-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.d.ts
62 lines (62 loc) · 1.51 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @typedef {{
* (...args: any[]): Hole;
* for: (entry: IEntry, id?: string) => (...args: any[]) => any
* }} IRenderer
*/
/**
* @type {IRenderer}
*/
export function html(...args: any[]): Hole;
export namespace html { }
/**
* @type {IRenderer}
*/
export function svg(...args: any[]): Hole;
export namespace svg { }
export function Component<Args>(fn: (...args: Args[]) => unknown): (...args: Args[]) => Hook;
export function render(where: Node, what: any): Node;
export type IRenderer = {
(...args: any[]): Hole;
for: (entry: IEntry, id?: string) => (...args: any[]) => any;
};
export type ITagFunction = <K>(template: TemplateStringsArray, ...values: any[]) => K;
/**
* An interface describing hooks counter
*/
export type ICounter = {
a: number;
aLength: number;
i: number;
iLength: number;
};
/**
* An interface describing hooks info
*/
export type IInfo = {
sub?: IInfo[];
stack: IEntry[];
};
export type IEntry = {
hook: any;
fn: any;
};
export type CacheFn = <T>(wm: any, key: any, value: T) => T;
import { Hole } from "lighterhtml";
/**
* @class
* @param {Function} fn
* @param {any[]} args
*/
declare function Hook(fn: Function, args: any[]): void;
declare class Hook {
/**
* @class
* @param {Function} fn
* @param {any[]} args
*/
constructor(fn: Function, args: any[]);
fn: Function;
args: any[];
}
export { useState, useEffect, useContext, createContext, useRef, useReducer, useCallback, useMemo, useLayoutEffect } from "dom-augmentor";