solid-js 1.9.3 → 2.0.0-experimental.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 (76) hide show
  1. package/dist/dev.cjs +213 -1603
  2. package/dist/dev.js +159 -1749
  3. package/dist/server.cjs +88 -11
  4. package/dist/server.js +91 -11
  5. package/dist/solid.cjs +196 -1558
  6. package/dist/solid.js +139 -1682
  7. package/package.json +8 -154
  8. package/types/{render → client}/component.d.ts +0 -61
  9. package/types/client/core.d.ts +75 -0
  10. package/types/client/flow.d.ts +114 -0
  11. package/types/{render → client}/hydration.d.ts +0 -2
  12. package/types/{reactive → client}/observable.d.ts +1 -1
  13. package/types/index.d.ts +44 -55
  14. package/types/jsx.d.ts +1944 -174
  15. package/types/server/index.d.ts +1 -1
  16. package/types/server/reactive.d.ts +6 -1
  17. package/types/server/store.d.ts +6 -0
  18. package/h/dist/h.cjs +0 -115
  19. package/h/dist/h.js +0 -144
  20. package/h/jsx-dev-runtime/package.json +0 -8
  21. package/h/jsx-runtime/dist/jsx.cjs +0 -15
  22. package/h/jsx-runtime/dist/jsx.js +0 -10
  23. package/h/jsx-runtime/package.json +0 -8
  24. package/h/jsx-runtime/types/index.d.ts +0 -14
  25. package/h/jsx-runtime/types/jsx.d.ts +0 -2276
  26. package/h/package.json +0 -8
  27. package/h/types/hyperscript.d.ts +0 -20
  28. package/h/types/index.d.ts +0 -3
  29. package/html/dist/html.cjs +0 -583
  30. package/html/dist/html.js +0 -706
  31. package/html/package.json +0 -8
  32. package/html/types/index.d.ts +0 -3
  33. package/html/types/lit.d.ts +0 -60
  34. package/store/dist/dev.cjs +0 -454
  35. package/store/dist/dev.js +0 -525
  36. package/store/dist/server.cjs +0 -126
  37. package/store/dist/server.js +0 -126
  38. package/store/dist/store.cjs +0 -434
  39. package/store/dist/store.js +0 -499
  40. package/store/package.json +0 -46
  41. package/store/types/index.d.ts +0 -26
  42. package/store/types/modifiers.d.ts +0 -9
  43. package/store/types/mutable.d.ts +0 -8
  44. package/store/types/server.d.ts +0 -37
  45. package/store/types/store.d.ts +0 -263
  46. package/types/reactive/array.d.ts +0 -52
  47. package/types/reactive/scheduler.d.ts +0 -13
  48. package/types/reactive/signal.d.ts +0 -664
  49. package/types/render/Suspense.d.ts +0 -26
  50. package/types/render/flow.d.ts +0 -130
  51. package/types/render/index.d.ts +0 -4
  52. package/universal/dist/dev.cjs +0 -243
  53. package/universal/dist/dev.js +0 -257
  54. package/universal/dist/universal.cjs +0 -243
  55. package/universal/dist/universal.js +0 -257
  56. package/universal/package.json +0 -20
  57. package/universal/types/index.d.ts +0 -4
  58. package/universal/types/universal.d.ts +0 -29
  59. package/web/dist/dev.cjs +0 -804
  60. package/web/dist/dev.js +0 -1241
  61. package/web/dist/server.cjs +0 -793
  62. package/web/dist/server.js +0 -1214
  63. package/web/dist/web.cjs +0 -793
  64. package/web/dist/web.js +0 -1220
  65. package/web/package.json +0 -46
  66. package/web/storage/dist/storage.cjs +0 -12
  67. package/web/storage/dist/storage.js +0 -10
  68. package/web/storage/package.json +0 -15
  69. package/web/storage/types/index.d.ts +0 -2
  70. package/web/storage/types/index.js +0 -13
  71. package/web/types/client.d.ts +0 -79
  72. package/web/types/core.d.ts +0 -10
  73. package/web/types/index.d.ts +0 -54
  74. package/web/types/jsx.d.ts +0 -1
  75. package/web/types/server-mock.d.ts +0 -80
  76. package/web/types/server.d.ts +0 -177
@@ -1,263 +0,0 @@
1
- export declare const $RAW: unique symbol,
2
- $NODE: unique symbol,
3
- $HAS: unique symbol,
4
- $SELF: unique symbol;
5
- export declare const DevHooks: {
6
- onStoreNodeUpdate: OnStoreNodeUpdate | null;
7
- };
8
- type DataNode = {
9
- (): any;
10
- $(value?: any): void;
11
- };
12
- export type DataNodes = Record<PropertyKey, DataNode | undefined>;
13
- export type OnStoreNodeUpdate = (
14
- state: StoreNode,
15
- property: PropertyKey,
16
- value: StoreNode | NotWrappable,
17
- prev: StoreNode | NotWrappable
18
- ) => void;
19
- export interface StoreNode {
20
- [$NODE]?: DataNodes;
21
- [key: PropertyKey]: any;
22
- }
23
- export declare namespace SolidStore {
24
- interface Unwrappable {}
25
- }
26
- export type NotWrappable =
27
- | string
28
- | number
29
- | bigint
30
- | symbol
31
- | boolean
32
- | Function
33
- | null
34
- | undefined
35
- | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
36
- export type Store<T> = T;
37
- export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
38
- /**
39
- * Returns the underlying data in the store without a proxy.
40
- * @param item store proxy object
41
- * @example
42
- * ```js
43
- * const initial = {z...};
44
- * const [state, setState] = createStore(initial);
45
- * initial === state; // => false
46
- * initial === unwrap(state); // => true
47
- * ```
48
- */
49
- export declare function unwrap<T>(item: T, set?: Set<unknown>): T;
50
- export declare function getNodes(target: StoreNode, symbol: typeof $NODE | typeof $HAS): DataNodes;
51
- export declare function getNode(nodes: DataNodes, property: PropertyKey, value?: any): DataNode;
52
- export declare function proxyDescriptor(
53
- target: StoreNode,
54
- property: PropertyKey
55
- ): TypedPropertyDescriptor<any> | undefined;
56
- export declare function trackSelf(target: StoreNode): void;
57
- export declare function ownKeys(target: StoreNode): (string | symbol)[];
58
- export declare function setProperty(
59
- state: StoreNode,
60
- property: PropertyKey,
61
- value: any,
62
- deleting?: boolean
63
- ): void;
64
- export declare function updatePath(
65
- current: StoreNode,
66
- path: any[],
67
- traversed?: PropertyKey[]
68
- ): void;
69
- /** @deprecated */
70
- export type DeepReadonly<T> = 0 extends 1 & T
71
- ? T
72
- : T extends NotWrappable
73
- ? T
74
- : {
75
- readonly [K in keyof T]: DeepReadonly<T[K]>;
76
- };
77
- /** @deprecated */
78
- export type DeepMutable<T> = 0 extends 1 & T
79
- ? T
80
- : T extends NotWrappable
81
- ? T
82
- : {
83
- -readonly [K in keyof T]: DeepMutable<T[K]>;
84
- };
85
- export type CustomPartial<T> = T extends readonly unknown[]
86
- ? "0" extends keyof T
87
- ? {
88
- [K in Extract<keyof T, `${number}`>]?: T[K];
89
- }
90
- : {
91
- [x: number]: T[number];
92
- }
93
- : Partial<T>;
94
- export type PickMutable<T> = {
95
- [K in keyof T as (<U>() => U extends {
96
- [V in K]: T[V];
97
- }
98
- ? 1
99
- : 2) extends <U>() => U extends {
100
- -readonly [V in K]: T[V];
101
- }
102
- ? 1
103
- : 2
104
- ? K
105
- : never]: T[K];
106
- };
107
- export type StorePathRange = {
108
- from?: number;
109
- to?: number;
110
- by?: number;
111
- };
112
- export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
113
- export type StoreSetter<T, U extends PropertyKey[] = []> =
114
- | T
115
- | CustomPartial<T>
116
- | ((prevState: T, traversed: U) => T | CustomPartial<T>);
117
- export type Part<T, K extends KeyOf<T> = KeyOf<T>> =
118
- | K
119
- | ([K] extends [never] ? never : readonly K[])
120
- | ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
121
- type W<T> = Exclude<T, NotWrappable>;
122
- type KeyOf<T> = number extends keyof T
123
- ? 0 extends 1 & T
124
- ? keyof T
125
- : [T] extends [never]
126
- ? never
127
- : [T] extends [readonly unknown[]]
128
- ? number
129
- : keyof T
130
- : keyof T;
131
- type MutableKeyOf<T> = KeyOf<T> & keyof PickMutable<T>;
132
- type Rest<T, U extends PropertyKey[], K extends KeyOf<T> = KeyOf<T>> = [T] extends [never]
133
- ? never
134
- : K extends MutableKeyOf<T>
135
- ? [Part<T, K>, ...RestSetterOrContinue<T[K], [K, ...U]>]
136
- : K extends KeyOf<T>
137
- ? [Part<T, K>, ...RestContinue<T[K], [K, ...U]>]
138
- : never;
139
- type RestContinue<T, U extends PropertyKey[]> = 0 extends 1 & T
140
- ? [...Part<any>[], StoreSetter<any, PropertyKey[]>]
141
- : Rest<W<T>, U>;
142
- type RestSetterOrContinue<T, U extends PropertyKey[]> = [StoreSetter<T, U>] | RestContinue<T, U>;
143
- export interface SetStoreFunction<T> {
144
- <
145
- K1 extends KeyOf<W<T>>,
146
- K2 extends KeyOf<W<W<T>[K1]>>,
147
- K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
148
- K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
149
- K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
150
- K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
151
- K7 extends MutableKeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>
152
- >(
153
- k1: Part<W<T>, K1>,
154
- k2: Part<W<W<T>[K1]>, K2>,
155
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
156
- k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
157
- k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
158
- k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
159
- k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
160
- setter: StoreSetter<
161
- W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7],
162
- [K7, K6, K5, K4, K3, K2, K1]
163
- >
164
- ): void;
165
- <
166
- K1 extends KeyOf<W<T>>,
167
- K2 extends KeyOf<W<W<T>[K1]>>,
168
- K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
169
- K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
170
- K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
171
- K6 extends MutableKeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>
172
- >(
173
- k1: Part<W<T>, K1>,
174
- k2: Part<W<W<T>[K1]>, K2>,
175
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
176
- k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
177
- k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
178
- k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
179
- setter: StoreSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6], [K6, K5, K4, K3, K2, K1]>
180
- ): void;
181
- <
182
- K1 extends KeyOf<W<T>>,
183
- K2 extends KeyOf<W<W<T>[K1]>>,
184
- K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
185
- K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
186
- K5 extends MutableKeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>
187
- >(
188
- k1: Part<W<T>, K1>,
189
- k2: Part<W<W<T>[K1]>, K2>,
190
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
191
- k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
192
- k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
193
- setter: StoreSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5], [K5, K4, K3, K2, K1]>
194
- ): void;
195
- <
196
- K1 extends KeyOf<W<T>>,
197
- K2 extends KeyOf<W<W<T>[K1]>>,
198
- K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
199
- K4 extends MutableKeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>
200
- >(
201
- k1: Part<W<T>, K1>,
202
- k2: Part<W<W<T>[K1]>, K2>,
203
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
204
- k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
205
- setter: StoreSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4], [K4, K3, K2, K1]>
206
- ): void;
207
- <
208
- K1 extends KeyOf<W<T>>,
209
- K2 extends KeyOf<W<W<T>[K1]>>,
210
- K3 extends MutableKeyOf<W<W<W<T>[K1]>[K2]>>
211
- >(
212
- k1: Part<W<T>, K1>,
213
- k2: Part<W<W<T>[K1]>, K2>,
214
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
215
- setter: StoreSetter<W<W<W<T>[K1]>[K2]>[K3], [K3, K2, K1]>
216
- ): void;
217
- <K1 extends KeyOf<W<T>>, K2 extends MutableKeyOf<W<W<T>[K1]>>>(
218
- k1: Part<W<T>, K1>,
219
- k2: Part<W<W<T>[K1]>, K2>,
220
- setter: StoreSetter<W<W<T>[K1]>[K2], [K2, K1]>
221
- ): void;
222
- <K1 extends MutableKeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: StoreSetter<W<T>[K1], [K1]>): void;
223
- (setter: StoreSetter<T, []>): void;
224
- <
225
- K1 extends KeyOf<W<T>>,
226
- K2 extends KeyOf<W<W<T>[K1]>>,
227
- K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>,
228
- K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>,
229
- K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>,
230
- K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>,
231
- K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>
232
- >(
233
- k1: Part<W<T>, K1>,
234
- k2: Part<W<W<T>[K1]>, K2>,
235
- k3: Part<W<W<W<T>[K1]>[K2]>, K3>,
236
- k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>,
237
- k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>,
238
- k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>,
239
- k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>,
240
- ...rest: Rest<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7], [K7, K6, K5, K4, K3, K2, K1]>
241
- ): void;
242
- }
243
- /**
244
- * Creates a reactive store that can be read through a proxy object and written with a setter function
245
- *
246
- * @description https://docs.solidjs.com/reference/store-utilities/create-store
247
- */
248
- export declare function createStore<T extends object = {}>(
249
- ...[store, options]: {} extends T
250
- ? [
251
- store?: T | Store<T>,
252
- options?: {
253
- name?: string;
254
- }
255
- ]
256
- : [
257
- store: T | Store<T>,
258
- options?: {
259
- name?: string;
260
- }
261
- ]
262
- ): [get: Store<T>, set: SetStoreFunction<T>];
263
- export {};
@@ -1,52 +0,0 @@
1
- import { Accessor } from "./signal.js";
2
- /**
3
- The MIT License (MIT)
4
-
5
- Copyright (c) 2017 Adam Haile
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy
8
- of this software and associated documentation files (the "Software"), to deal
9
- in the Software without restriction, including without limitation the rights
10
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- copies of the Software, and to permit persons to whom the Software is
12
- furnished to do so, subject to the following conditions:
13
-
14
- The above copyright notice and this permission notice shall be included in all
15
- copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- SOFTWARE.
24
- */
25
- /**
26
- * Reactively transforms an array with a callback function - underlying helper for the `<For>` control flow
27
- *
28
- * similar to `Array.prototype.map`, but gets the index as accessor, transforms only values that changed and returns an accessor and reactively tracks changes to the list.
29
- *
30
- * @description https://docs.solidjs.com/reference/reactive-utilities/map-array
31
- */
32
- export declare function mapArray<T, U>(
33
- list: Accessor<readonly T[] | undefined | null | false>,
34
- mapFn: (v: T, i: Accessor<number>) => U,
35
- options?: {
36
- fallback?: Accessor<any>;
37
- }
38
- ): () => U[];
39
- /**
40
- * Reactively maps arrays by index instead of value - underlying helper for the `<Index>` control flow
41
- *
42
- * similar to `Array.prototype.map`, but gets the value as an accessor, transforms only changed items of the original arrays anew and returns an accessor.
43
- *
44
- * @description https://docs.solidjs.com/reference/reactive-utilities/index-array
45
- */
46
- export declare function indexArray<T, U>(
47
- list: Accessor<readonly T[] | undefined | null | false>,
48
- mapFn: (v: Accessor<T>, i: number) => U,
49
- options?: {
50
- fallback?: Accessor<any>;
51
- }
52
- ): () => U[];
@@ -1,13 +0,0 @@
1
- export interface Task {
2
- id: number;
3
- fn: ((didTimeout: boolean) => void) | null;
4
- startTime: number;
5
- expirationTime: number;
6
- }
7
- export declare function requestCallback(
8
- fn: () => void,
9
- options?: {
10
- timeout: number;
11
- }
12
- ): Task;
13
- export declare function cancelCallback(task: Task): void;