forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
drop.d.ts
56 lines (47 loc) · 1.55 KB
/
drop.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Type definitions for Drop v1.4
// Project: http://github.hubspot.com/drop/
// Definitions by: Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../tether/tether.d.ts" />
// global Drop constructor
declare class Drop {
constructor(options: Drop.IDropOptions);
public content: HTMLElement;
public element: HTMLElement;
public tether: Tether;
public open(): void;
public close(): void;
public remove(): void;
public toggle(): void;
public isOpened(): boolean;
public position(): void;
public destroy(): void;
/*
* Drop instances fire "open" and "close" events.
*/
public on(event: string, handler: Function, context?: any): void;
public once(event: string, handler: Function, context?: any): void;
public off(event: string, handler?: Function): void;
public static createContext(options: Drop.IDropContextOptions): Drop;
}
declare namespace Drop {
interface IDropContextOptions {
classPrefix?: string;
defaults?: IDropOptions;
}
interface IDropOptions {
target?: Element;
content?: Element | string | ((drop?: Drop) => string) | ((drop?: Drop) => Element);
position?: string;
openOn?: string;
classes?: string;
constrainToWindow?: boolean;
constrainToScrollParent?: boolean;
remove?: boolean;
beforeClose?: () => boolean;
tetherOptions?: Tether.ITetherOptions;
}
}
declare module "drop" {
export = Drop;
}