-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
31 lines (28 loc) · 989 Bytes
/
index.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
declare module 'selectricity' {
interface SelectObject extends HTMLElement {
execute: () => void;
listen: (
eventName: string,
callback: (data: CallbackData) => void,
dynamic?: boolean
) => void;
modifyClass: (method: string, className: string) => void;
addClass: (className: string) => void;
removeClass: (className: string) => void;
toggleClass: (className: string) => void;
hasClass: (className: string) => boolean;
addAttr: (attribute: string, value?: string | number | boolean) => void;
removeAttr: (attribute: string) => void;
toggleAttr: (attribute: string, value?: string | number | boolean) => void;
}
interface CallbackData {
$node: SelectObject;
index: number;
e: Event;
}
interface SelectObjectArray extends Array<SelectObject>, SelectObject {}
export default function select(
selector: string | HTMLElement,
parent?: string | HTMLElement
): SelectObject | SelectObjectArray;
}