@sigil-dev/types 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +55 -28
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,28 +1,55 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Declare reactive state
|
|
5
|
-
*/
|
|
6
|
-
declare function $state<T>(initial: T): T;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
declare
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Declare reactive state
|
|
5
|
+
*/
|
|
6
|
+
declare function $state<T>(initial: T): T;
|
|
7
|
+
|
|
8
|
+
declare namespace $state {
|
|
9
|
+
/**
|
|
10
|
+
* Create state without Proxy wrapping for objects/arrays
|
|
11
|
+
*/
|
|
12
|
+
export function raw<T>(initial: T): T;
|
|
13
|
+
/**
|
|
14
|
+
* Un-proxy a signal value to get a plain snapshot
|
|
15
|
+
*/
|
|
16
|
+
export function snapshot<T>(value: T): T;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Declare derived state
|
|
21
|
+
*/
|
|
22
|
+
declare function $derived<T>(expression: T): T;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Declare a side effect
|
|
26
|
+
*/
|
|
27
|
+
declare function $effect(fn: () => void | (() => void)): void;
|
|
28
|
+
|
|
29
|
+
declare namespace $effect {
|
|
30
|
+
/**
|
|
31
|
+
* Check if inside a reactive tracking context
|
|
32
|
+
*/
|
|
33
|
+
export function tracking(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Effect that flushes before DOM update
|
|
36
|
+
*/
|
|
37
|
+
export function pre(fn: () => void | (() => void)): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Dev-only reactive inspect
|
|
42
|
+
*/
|
|
43
|
+
declare function $inspect(...vals: unknown[]): void;
|
|
44
|
+
|
|
45
|
+
type Component<P extends Record<string, unknown> = {}> = (
|
|
46
|
+
props: P & { children?: React.ReactNode },
|
|
47
|
+
) => globalThis.Element;
|
|
48
|
+
|
|
49
|
+
declare namespace JSX {
|
|
50
|
+
type Element = any;
|
|
51
|
+
interface ElementChildrenAttribute {
|
|
52
|
+
children: {};
|
|
53
|
+
}
|
|
54
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
55
|
+
}
|