mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 18:43:21 +08:00
[Drop] Fix issue where createContext did not return constructable type
This commit is contained in:
@@ -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
6
drop/drop.d.ts
vendored
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user