diff --git a/drop/drop-tests.ts b/drop/drop-tests.ts index cc19621fbd..0da04e9445 100644 --- a/drop/drop-tests.ts +++ b/drop/drop-tests.ts @@ -36,3 +36,11 @@ var e = new Drop({ content: () => greenBox }); +var Tooltip = Drop.createContext({ + classPrefix: 'tooltip' +}); + +var t = new Tooltip({ + target: yellowBox, + content: () => greenBox +}); diff --git a/drop/drop.d.ts b/drop/drop.d.ts index 63f9c8621e..51b05b8c1a 100644 --- a/drop/drop.d.ts +++ b/drop/drop.d.ts @@ -27,7 +27,7 @@ declare class Drop { public once(event: string, handler: Function, context?: any): void; public off(event: string, handler?: Function): void; - public static createContext(options: Drop.IDropContextOptions): Drop; + public static createContext(options: Drop.IDropContextOptions): Drop.IDropConstructor; } declare namespace Drop { @@ -54,6 +54,10 @@ declare namespace Drop { hoverCloseDelay?: number; tetherOptions?: Tether.ITetherOptions; } + + interface IDropConstructor { + new (options: Drop.IDropOptions): Drop; + } } declare module "drop" {