@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.
Files changed (3) hide show
  1. package/index.d.ts +28 -0
  2. package/jsr.json +5 -0
  3. 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
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@sigil-dev/types",
3
+ "version": "0.2.0",
4
+ "exports": "./index.d.ts"
5
+ }
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@sigil-dev/types",
3
+ "version": "0.3.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": "./index.d.ts"
7
+ }
8
+ }