Skip to content

Commit

Permalink
fix: Add missing typings
Browse files Browse the repository at this point in the history
Add missing typings
  • Loading branch information
Eduard Kyvenko committed Jul 10, 2017
1 parent 970f1d2 commit 429e6a7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Top-level api', () => {
.addVariation({ name: 'Variation B' })
.setup();

skift.ui.show([skift.getTest(testName)]);
skift.ui.show();

const div = <HTMLElement>document.querySelector('div');
const root = <ShadowRoot>div.shadowRoot;
Expand Down
11 changes: 9 additions & 2 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { tests, config, getUserAgentInfo, getTest, create, getCurrentTestVariation, setCurrentTestVariation, reset, ui, SplitTest, UserConfig } from './main';
import { tests, config, getUserAgentInfo, getTest, create, getCurrentTestVariation, setCurrentTestVariation, reset, SplitTest, UserConfig } from './main';
import { UserAgentInfo } from './useragentinfo';
declare const ui: {
show: () => void;
hide: () => void;
};
export { tests, config, getUserAgentInfo, getTest, create, getCurrentTestVariation, setCurrentTestVariation, reset, ui, SplitTest };
declare const _default: {
tests: SplitTest[];
Expand All @@ -10,7 +14,10 @@ declare const _default: {
getCurrentTestVariation: (testName: string) => string;
setCurrentTestVariation: (testName: string, variation: string) => void;
reset: () => void;
ui: typeof ui;
ui: {
show: () => void;
hide: () => void;
};
SplitTest: typeof SplitTest;
initialize: () => void;
};
Expand Down
5 changes: 1 addition & 4 deletions types/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,4 @@ export declare function create(name: string): SplitTest;
export declare function getCurrentTestVariation(testName: string): string;
export declare function setCurrentTestVariation(testName: string, variation: string): void;
export declare function reset(): void;
export declare namespace ui {
function show(testsList: SplitTest[]): void;
function hide(): void;
}
export declare function shouldShowUI(): boolean;
6 changes: 6 additions & 0 deletions types/ui.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { SplitTest } from './splittest';
import { UserAgentInfo } from './useragentinfo';
export declare const uiFactory: (tests: SplitTest[], reset: () => void, getCurrentTestVariation: (testName: string) => string, getUserAgentInfo: () => UserAgentInfo) => {
show: () => void;
hide: () => void;
};

0 comments on commit 429e6a7

Please sign in to comment.