@sigil-dev/types 0.3.0
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 +28 -0
- package/jsr.json +5 -0
- package/package.json +8 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Declare reactive state
|
|
5
|
+
*/
|
|
6
|
+
declare function $state<T>(initial: T): T;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Declare derived state
|
|
10
|
+
*/
|
|
11
|
+
declare function $derived<T>(expression: T): T;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Declare a side effect
|
|
15
|
+
*/
|
|
16
|
+
declare function $effect(fn: () => void | (() => void)): void;
|
|
17
|
+
|
|
18
|
+
type Component<P extends Record<string, unknown> = {}> = (
|
|
19
|
+
props: P & { children?: React.ReactNode },
|
|
20
|
+
) => globalThis.Element;
|
|
21
|
+
|
|
22
|
+
declare namespace JSX {
|
|
23
|
+
type Element = any;
|
|
24
|
+
interface ElementChildrenAttribute {
|
|
25
|
+
children: {};
|
|
26
|
+
}
|
|
27
|
+
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
|
|
28
|
+
}
|
package/jsr.json
ADDED