This repository was archived by the owner on Feb 11, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeclarations.d.ts
40 lines (40 loc) · 1.7 KB
/
declarations.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
import { IsotopeNode } from "./node";
import { Properties } from "csstype";
interface CustomDOM {
createElement(qualifiedName: string, namespaceURI?: string): CustomElement;
createEvent(type: string, eventInitDict?: EventInit | undefined): CustomEvent;
}
interface CustomElement {
children: {
[index: number]: CustomElement;
};
classList: {
add(...tokens: string[]): void;
contains(token: string): boolean;
remove(...tokens: string[]): void;
};
parentElement: CustomElement | null;
style?: Properties<string>;
tagName: string;
textContent: string | null;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
appendChild(newChild: CustomElement): CustomElement;
dispatchEvent(event: CustomEvent): boolean;
getAttribute(qualifiedName: string): string | null;
insertBefore(newChild: CustomElement, refChild: CustomElement | null): CustomElement;
removeAttribute(qualifiedName: string): void;
removeChild(oldChild: CustomElement): CustomElement;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
setAttribute(qualifiedName: string, value: string): void;
}
interface CustomEvent {
type: string;
}
interface Indexable<T = any> {
[key: string]: T;
}
declare type ConfigFunction<S extends Indexable, C extends Indexable, V> = (node: IsotopeNode<S, C>) => V;
declare type StyleProperties = {
[P in keyof Properties]: Properties<number | string>[P] | string;
};
export { ConfigFunction, CustomDOM, CustomElement, CustomEvent, Indexable, StyleProperties };