@sigil-dev/types 0.8.0 → 0.8.3
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 +88 -88
- package/package.json +1 -1
- package/sigil-node.d.ts +8 -0
package/index.d.ts
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
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: () =>
|
|
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: () =>
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Dev-only reactive inspect
|
|
42
|
-
*/
|
|
43
|
-
declare function $inspect(...vals: unknown[]): void;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference path="sigil-node.d.ts" />
|
|
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: () => undefined | (() => 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: () => undefined | (() => void)): void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Dev-only reactive inspect
|
|
42
|
+
*/
|
|
43
|
+
declare function $inspect(...vals: unknown[]): void;
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
interface SigilBaseProps {
|
|
47
|
+
class?: string;
|
|
48
|
+
style?: React.CSSProperties | string;
|
|
49
|
+
children?: SigilNode;
|
|
50
|
+
bindThis?: unknown;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface SigilBindProps {
|
|
54
|
+
bindValue?: string | number;
|
|
55
|
+
bindChecked?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type LowercaseHandlers<T> = {
|
|
59
|
+
[K in keyof T as K extends `on${string}`
|
|
60
|
+
? Lowercase<K & string>
|
|
61
|
+
: never]?: T[K];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
type SigilIntrinsicElements = {
|
|
65
|
+
[K in keyof React.JSX.IntrinsicElements]: Omit<
|
|
66
|
+
React.JSX.IntrinsicElements[K],
|
|
67
|
+
"style" | "children"
|
|
68
|
+
> &
|
|
69
|
+
SigilBaseProps &
|
|
70
|
+
LowercaseHandlers<React.JSX.IntrinsicElements[K]>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
declare namespace JSX {
|
|
74
|
+
type Element = React.JSX.Element;
|
|
75
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
|
76
|
+
interface ElementAttributesProperty
|
|
77
|
+
extends React.JSX.ElementAttributesProperty {}
|
|
78
|
+
interface ElementChildrenAttribute {
|
|
79
|
+
children: {};
|
|
80
|
+
}
|
|
81
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
|
82
|
+
|
|
83
|
+
interface IntrinsicElements extends SigilIntrinsicElements {
|
|
84
|
+
input: SigilIntrinsicElements["input"] & SigilBindProps;
|
|
85
|
+
textarea: SigilIntrinsicElements["textarea"] & SigilBindProps;
|
|
86
|
+
select: SigilIntrinsicElements["select"] & SigilBindProps;
|
|
87
|
+
}
|
|
88
|
+
}
|
package/package.json
CHANGED