[Drop] Fix issue where createContext did not return constructable type

This commit is contained in:
Péter Kovács Q
2016-08-05 17:04:49 +02:00
parent e659470271
commit a1a716dca3
2 changed files with 13 additions and 1 deletions

View File

@@ -36,3 +36,11 @@ var e = new Drop({
content: () => greenBox
});
var Tooltip = Drop.createContext({
classPrefix: 'tooltip'
});
var t = new Tooltip({
target: yellowBox,
content: () => greenBox
});

6
drop/drop.d.ts vendored
View File

@@ -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" {