@sigil-dev/types 0.9.1 → 0.9.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 CHANGED
@@ -1,87 +1,87 @@
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
- interface SigilBaseProps {
46
- class?: string;
47
- style?: React.CSSProperties | string;
48
- children?: SigilNode;
49
- bindThis?: unknown;
50
- }
51
-
52
- interface SigilBindProps {
53
- bindValue?: string | number;
54
- bindChecked?: boolean;
55
- }
56
-
57
- type LowercaseHandlers<T> = {
58
- [K in keyof T as K extends `on${string}`
59
- ? Lowercase<K & string>
60
- : never]?: T[K];
61
- };
62
-
63
- type SigilIntrinsicElements = {
64
- [K in keyof React.JSX.IntrinsicElements]: Omit<
65
- React.JSX.IntrinsicElements[K],
66
- "style" | "children"
67
- > &
68
- SigilBaseProps &
69
- LowercaseHandlers<React.JSX.IntrinsicElements[K]>;
70
- };
71
-
72
- declare namespace JSX {
73
- type Element = React.JSX.Element;
74
- interface ElementClass extends React.JSX.ElementClass {}
75
- interface ElementAttributesProperty
76
- extends React.JSX.ElementAttributesProperty {}
77
- interface ElementChildrenAttribute {
78
- children: {};
79
- }
80
- interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
81
-
82
- interface IntrinsicElements extends SigilIntrinsicElements {
83
- input: SigilIntrinsicElements["input"] & SigilBindProps;
84
- textarea: SigilIntrinsicElements["textarea"] & SigilBindProps;
85
- select: SigilIntrinsicElements["select"] & SigilBindProps;
86
- }
87
- }
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
+ interface SigilBaseProps {
46
+ class?: string;
47
+ style?: React.CSSProperties | string;
48
+ children?: SigilNode;
49
+ bindThis?: unknown;
50
+ }
51
+
52
+ interface SigilBindProps {
53
+ bindValue?: string | number;
54
+ bindChecked?: boolean;
55
+ }
56
+
57
+ type LowercaseHandlers<T> = {
58
+ [K in keyof T as K extends `on${string}`
59
+ ? Lowercase<K & string>
60
+ : never]?: T[K];
61
+ };
62
+
63
+ type SigilIntrinsicElements = {
64
+ [K in keyof React.JSX.IntrinsicElements]: Omit<
65
+ React.JSX.IntrinsicElements[K],
66
+ "style" | "children"
67
+ > &
68
+ SigilBaseProps &
69
+ LowercaseHandlers<React.JSX.IntrinsicElements[K]>;
70
+ };
71
+
72
+ declare namespace JSX {
73
+ type Element = React.JSX.Element;
74
+ interface ElementClass extends React.JSX.ElementClass {}
75
+ interface ElementAttributesProperty
76
+ extends React.JSX.ElementAttributesProperty {}
77
+ interface ElementChildrenAttribute {
78
+ children: {};
79
+ }
80
+ interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
81
+
82
+ interface IntrinsicElements extends SigilIntrinsicElements {
83
+ input: SigilIntrinsicElements["input"] & SigilBindProps;
84
+ textarea: SigilIntrinsicElements["textarea"] & SigilBindProps;
85
+ select: SigilIntrinsicElements["select"] & SigilBindProps;
86
+ }
87
+ }
package/jsr.json CHANGED
@@ -1,5 +1,5 @@
1
- {
2
- "name": "@sigil-dev/types",
3
- "version": "0.6.0",
4
- "exports": "./index.d.ts"
5
- }
1
+ {
2
+ "name": "@sigil-dev/types",
3
+ "version": "0.6.0",
4
+ "exports": "./index.d.ts"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@sigil-dev/types",
3
- "version": "0.9.1",
3
+ "description": "JSX/runtime sigil types",
4
+ "version": "0.9.3",
4
5
  "type": "module",
5
6
  "exports": {
6
7
  ".": "./index.d.ts"
package/sigil-node.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- // packages/types/src/sigil-node.d.ts
2
- type SigilNode =
3
- | string
4
- | number
5
- | boolean
6
- | null
7
- | undefined
8
- | SigilNode[]
9
- | JSX.Element;
10
-
11
- export type { SigilNode };
1
+ // packages/types/src/sigil-node.d.ts
2
+ type SigilNode =
3
+ | string
4
+ | number
5
+ | boolean
6
+ | null
7
+ | undefined
8
+ | SigilNode[]
9
+ | JSX.Element;
10
+
11
+ export type { SigilNode };