@qwik.dev/core 2.0.0-beta.3 → 2.0.0-beta.31

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 (139) hide show
  1. package/dist/backpatch/index.d.ts +2 -0
  2. package/dist/backpatch/index.mjs +5 -0
  3. package/dist/backpatch/package.json +8 -0
  4. package/dist/backpatch-executor.debug.js +39 -0
  5. package/dist/backpatch-executor.js +1 -0
  6. package/dist/build/package.json +1 -1
  7. package/dist/cli.mjs +12961 -0
  8. package/dist/core-internal.d.ts +1117 -707
  9. package/dist/core.min.mjs +2 -1
  10. package/dist/core.mjs +12216 -8953
  11. package/dist/core.mjs.map +1 -1
  12. package/dist/core.prod.mjs +8677 -5376
  13. package/dist/insights/index.qwik.mjs +80 -57
  14. package/dist/insights/vite/index.mjs +36 -33
  15. package/dist/loader/index.mjs +2 -2
  16. package/dist/loader/package.json +1 -1
  17. package/dist/optimizer.d.ts +47 -278
  18. package/dist/optimizer.mjs +2427 -3791
  19. package/dist/preloader.mjs +212 -117
  20. package/dist/qwikloader.debug.js +173 -135
  21. package/dist/qwikloader.js +1 -1
  22. package/dist/server.d.ts +51 -203
  23. package/dist/server.mjs +1661 -1157
  24. package/dist/server.prod.mjs +3452 -0
  25. package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +2 -2
  26. package/dist/starters/adapters/aws-lambda/package.json +3 -2
  27. package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
  28. package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +2 -2
  29. package/dist/starters/adapters/azure-swa/package.json +3 -2
  30. package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
  31. package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +3 -3
  32. package/dist/starters/adapters/bun/package.json +3 -2
  33. package/dist/starters/adapters/bun/src/entry.bun.ts +0 -2
  34. package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +2 -2
  35. package/dist/starters/adapters/cloud-run/package.json +3 -2
  36. package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
  37. package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +2 -2
  38. package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
  39. package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
  40. package/dist/starters/adapters/cloudflare-workers/README.md +52 -0
  41. package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +15 -0
  42. package/dist/starters/adapters/cloudflare-workers/gitignore +3 -0
  43. package/dist/starters/adapters/cloudflare-workers/package.json +31 -0
  44. package/dist/starters/adapters/cloudflare-workers/public/.assetsignore +4 -0
  45. package/dist/starters/adapters/cloudflare-workers/public/_headers +11 -0
  46. package/dist/starters/adapters/cloudflare-workers/public/_redirects +1 -0
  47. package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +23 -0
  48. package/dist/starters/adapters/cloudflare-workers/worker-configuration.d.ts +5 -0
  49. package/dist/starters/adapters/cloudflare-workers/wrangler.jsonc +41 -0
  50. package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +2 -2
  51. package/dist/starters/adapters/deno/package.json +3 -2
  52. package/dist/starters/adapters/deno/src/entry.deno.ts +0 -2
  53. package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +2 -2
  54. package/dist/starters/adapters/express/package.json +4 -3
  55. package/dist/starters/adapters/express/src/entry.express.tsx +1 -3
  56. package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +2 -2
  57. package/dist/starters/adapters/fastify/package.json +4 -3
  58. package/dist/starters/adapters/fastify/src/entry.fastify.tsx +1 -1
  59. package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
  60. package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +2 -2
  61. package/dist/starters/adapters/firebase/package.json +3 -2
  62. package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
  63. package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +2 -2
  64. package/dist/starters/adapters/netlify-edge/package.json +5 -4
  65. package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
  66. package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +2 -2
  67. package/dist/starters/adapters/node-server/package.json +3 -2
  68. package/dist/starters/adapters/node-server/src/entry.node-server.tsx +0 -2
  69. package/dist/starters/adapters/{static/adapters/static/vite.config.mts → ssg/adapters/ssg/vite.config.ts} +3 -3
  70. package/dist/starters/adapters/ssg/package.json +20 -0
  71. package/dist/starters/adapters/vercel-edge/README.md +2 -2
  72. package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +2 -2
  73. package/dist/starters/adapters/vercel-edge/package.json +3 -2
  74. package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
  75. package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
  76. package/dist/starters/features/auth/package.json +1 -1
  77. package/dist/starters/features/compiled-i18n/package.json +37 -0
  78. package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +30 -0
  79. package/dist/starters/features/compiled-i18n/src/entry.ssr.tsx +31 -0
  80. package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +28 -0
  81. package/dist/starters/features/csr/index.html +27 -0
  82. package/dist/starters/features/csr/package.json +29 -0
  83. package/dist/starters/features/csr/src/root.tsx +15 -0
  84. package/dist/starters/features/csr/vite.config.ts +13 -0
  85. package/dist/starters/features/cypress/src/actions/example.action.ts +5 -0
  86. package/dist/starters/features/cypress/src/components/example/example.cy.tsx +50 -8
  87. package/dist/starters/features/cypress/src/components/example/example.tsx +13 -3
  88. package/dist/starters/features/cypress/src/loaders/example.loader.ts +5 -0
  89. package/dist/starters/features/pandacss/package.json +1 -1
  90. package/dist/starters/features/postcss/postcss.config.js +1 -1
  91. package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
  92. package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
  93. package/dist/starters/features/tailwind/package.json +2 -2
  94. package/dist/starters/features/tailwind/prettier.config.js +10 -0
  95. package/dist/starters/features/tailwind-v3/package.json +1 -1
  96. package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
  97. package/dist/testing/index.d.ts +928 -6
  98. package/dist/testing/index.mjs +16212 -11578
  99. package/dist/testing/package.json +1 -1
  100. package/handlers.mjs +1 -1
  101. package/package.json +34 -56
  102. package/public.d.ts +5 -1
  103. package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
  104. package/server.d.ts +2 -0
  105. package/bindings/qwik.darwin-arm64.node +0 -0
  106. package/bindings/qwik.darwin-x64.node +0 -0
  107. package/bindings/qwik.linux-x64-gnu.node +0 -0
  108. package/bindings/qwik.wasm.cjs +0 -471
  109. package/bindings/qwik.wasm.mjs +0 -464
  110. package/bindings/qwik.win32-x64-msvc.node +0 -0
  111. package/bindings/qwik_wasm_bg.wasm +0 -0
  112. package/dist/build/index.cjs +0 -35
  113. package/dist/build/index.cjs.map +0 -7
  114. package/dist/build/index.dev.cjs +0 -37
  115. package/dist/build/index.dev.cjs.map +0 -7
  116. package/dist/build/index.prod.cjs +0 -37
  117. package/dist/build/index.prod.cjs.map +0 -7
  118. package/dist/cli.cjs +0 -5545
  119. package/dist/core.cjs +0 -11800
  120. package/dist/core.cjs.map +0 -1
  121. package/dist/core.prod.cjs +0 -5661
  122. package/dist/insights/index.qwik.cjs +0 -1
  123. package/dist/insights/vite/index.cjs +0 -1
  124. package/dist/loader/index.cjs +0 -4
  125. package/dist/optimizer.cjs +0 -4020
  126. package/dist/preloader.cjs +0 -269
  127. package/dist/server.cjs +0 -3037
  128. package/dist/starters/adapters/static/package.json +0 -19
  129. package/dist/starters/features/localize/package.json +0 -37
  130. package/dist/starters/features/localize/src/entry.ssr.tsx +0 -30
  131. package/dist/starters/features/localize/src/locales/message.en.json +0 -8
  132. package/dist/starters/features/localize/src/locales/message.it.json +0 -8
  133. package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +0 -94
  134. package/dist/starters/features/localize/src/routes/[locale]/index.tsx +0 -52
  135. package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +0 -12
  136. package/dist/starters/features/playwright/playwright-report/index.html +0 -22026
  137. package/dist/starters/features/tailwind/.prettierrc.js +0 -3
  138. package/dist/testing/index.cjs +0 -33331
  139. /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
@@ -1,4 +1,5 @@
1
- import { ClientContainer } from '../internal';
1
+ import { ClientContainer } from '..';
2
+ import type { ClientContainer as ClientContainer_2 } from '../internal';
2
3
  import type { CorePlatform } from '..';
3
4
  import type { _DomContainer } from '../internal';
4
5
  import type { _ElementVNode } from '../internal';
@@ -10,6 +11,157 @@ import type { _Stringifiable } from '../internal';
10
11
  import type { _VirtualVNode } from '../internal';
11
12
  import type { _VNode } from '../internal';
12
13
 
14
+ declare interface AddRootFn {
15
+ (obj: unknown, returnRef?: never): number;
16
+ (obj: unknown, returnRef: true): SeenRef;
17
+ }
18
+
19
+ declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags | AsyncSignalFlags;
20
+
21
+ declare const enum AsyncSignalFlags {
22
+ EAGER_CLEANUP = 32,
23
+ CLIENT_ONLY = 64
24
+ }
25
+
26
+ /** Class for back reference to the EffectSubscription */
27
+ declare abstract class BackRef {
28
+ [_EFFECT_BACK_REF]: Map<any, any> | undefined;
29
+ }
30
+
31
+ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
32
+ /**
33
+ * Resolve the QRL of closure and invoke it.
34
+ *
35
+ * @param args - Closure arguments.
36
+ * @returns A promise of the return value of the closure.
37
+ */
38
+ bivarianceHack(...args: ARGS): Promise<RETURN>;
39
+ }['bivarianceHack'];
40
+
41
+ declare const enum ChoreBits {
42
+ NONE = 0,
43
+ TASKS = 1,
44
+ NODE_DIFF = 2,
45
+ COMPONENT = 4,
46
+ NODE_PROPS = 8,
47
+ COMPUTE = 16,
48
+ CHILDREN = 32,
49
+ CLEANUP = 64,
50
+ RECONCILE = 128,
51
+ ERROR_WRAP = 256,
52
+ DIRTY_MASK = 511
53
+ }
54
+
55
+ /** @internal */
56
+ declare const _CONST_PROPS: unique symbol;
57
+
58
+ /**
59
+ * Effect is something which needs to happen (side-effect) due to signal value change.
60
+ *
61
+ * There are three types of effects:
62
+ *
63
+ * - `Task`: `useTask`, `useVisibleTask`, `useResource`
64
+ * - `VNode` and `ISsrNode`: Either a component or `<Signal>`
65
+ * - `Signal2`: A derived signal which contains a computation function.
66
+ */
67
+ declare type Consumer = Task | VNode | SignalImpl | ISsrNode;
68
+
69
+ /** @internal */
70
+ declare interface Container {
71
+ readonly $version$: string;
72
+ readonly $storeProxyMap$: ObjToProxyMap;
73
+ readonly $locale$: string;
74
+ readonly $getObjectById$: (id: number | string) => any;
75
+ readonly $serverData$: Record<string, any>;
76
+ $currentUniqueId$: number;
77
+ $buildBase$: string | null;
78
+ $renderPromise$: Promise<void> | null;
79
+ $resolveRenderPromise$: (() => void) | null;
80
+ $pendingCount$: number;
81
+ $checkPendingCount$(): void;
82
+ handleError(err: any, $host$: HostElement | null): void;
83
+ getParentHost(host: HostElement): HostElement | null;
84
+ setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
85
+ resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
86
+ setHostProp<T>(host: HostElement, name: string, value: T): void;
87
+ getHostProp<T>(host: HostElement, name: string): T | null;
88
+ $appendStyle$(content: string, styleId: string, host: HostElement, scoped: boolean): void;
89
+ /**
90
+ * When component is about to be executed, it may add/remove children. This can cause problems
91
+ * with the projection because deleting content will prevent the projection references from
92
+ * looking up vnodes. Therefore before we execute the component we need to ensure that all of its
93
+ * references to vnode are resolved.
94
+ *
95
+ * @param renderHost - Host element to ensure projection is resolved.
96
+ */
97
+ ensureProjectionResolved(host: HostElement): void;
98
+ serializationCtxFactory(NodeConstructor: {
99
+ new (...rest: any[]): {
100
+ __brand__: 'SsrNode';
101
+ };
102
+ } | null, DomRefConstructor: {
103
+ new (...rest: any[]): {
104
+ __brand__: 'DomRef';
105
+ };
106
+ } | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
107
+ }
108
+
109
+ /**
110
+ * ContextId is a typesafe ID for your context.
111
+ *
112
+ * Context is a way to pass stores to the child components without prop-drilling.
113
+ *
114
+ * Use `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier
115
+ * for the context. It is not the context value itself. See `useContextProvider()` and
116
+ * `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can
117
+ * track context providers and consumers in a way that survives resumability.
118
+ *
119
+ * ### Example
120
+ *
121
+ * ```tsx
122
+ * // Declare the Context type.
123
+ * interface TodosStore {
124
+ * items: string[];
125
+ * }
126
+ * // Create a Context ID (no data is saved here.)
127
+ * // You will use this ID to both create and retrieve the Context.
128
+ * export const TodosContext = createContextId<TodosStore>('Todos');
129
+ *
130
+ * // Example of providing context to child components.
131
+ * export const App = component$(() => {
132
+ * useContextProvider(
133
+ * TodosContext,
134
+ * useStore<TodosStore>({
135
+ * items: ['Learn Qwik', 'Build Qwik app', 'Profit'],
136
+ * })
137
+ * );
138
+ *
139
+ * return <Items />;
140
+ * });
141
+ *
142
+ * // Example of retrieving the context provided by a parent component.
143
+ * export const Items = component$(() => {
144
+ * const todos = useContext(TodosContext);
145
+ * return (
146
+ * <ul>
147
+ * {todos.items.map((item) => (
148
+ * <li>{item}</li>
149
+ * ))}
150
+ * </ul>
151
+ * );
152
+ * });
153
+ *
154
+ * ```
155
+ *
156
+ * @public
157
+ */
158
+ declare interface ContextId<STATE> {
159
+ /** Design-time property to store type information for the context. */
160
+ readonly __brand_context_type__: STATE;
161
+ /** A unique ID for the context. */
162
+ readonly id: string;
163
+ }
164
+
13
165
  /**
14
166
  * Create emulated `Document` for server environment. Does not implement the full browser `document`
15
167
  * and `window` API. This api may be removed in the future.
@@ -31,6 +183,27 @@ export declare const createDOM: ({ html }?: {
31
183
  userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;
32
184
  }>;
33
185
 
186
+ declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
187
+ $flags$: number;
188
+ $index$: number;
189
+ $el$: HostElement;
190
+ $qrl$: QRLInternal<T>;
191
+ $state$: B | undefined;
192
+ $destroy$: (() => void) | null;
193
+ }
194
+
195
+ /** @public */
196
+ declare interface DevJSX {
197
+ fileName: string;
198
+ lineNumber: number;
199
+ columnNumber: number;
200
+ stack?: string;
201
+ }
202
+
203
+ declare type DomRef = {
204
+ $ssrNode$: SsrNode;
205
+ };
206
+
34
207
  /** @public */
35
208
  export declare function domRender(jsx: JSXOutput, opts?: {
36
209
  debug?: boolean;
@@ -41,6 +214,60 @@ export declare function domRender(jsx: JSXOutput, opts?: {
41
214
  getStyles: () => Record<string, string | string[]>;
42
215
  }>;
43
216
 
217
+ /** @internal */
218
+ declare const _EFFECT_BACK_REF: unique symbol;
219
+
220
+ declare type EffectBackRef = SignalImpl | StoreTarget | PropsProxy;
221
+
222
+ declare const enum EffectProperty {
223
+ COMPONENT = ":",
224
+ VNODE = "."
225
+ }
226
+
227
+ /**
228
+ * An effect consumer plus type of effect, back references to producers and additional data
229
+ *
230
+ * An effect can be trigger by one or more of signal inputs. The first step of re-running an effect
231
+ * is to clear its subscriptions so that the effect can re add new set of subscriptions. In order to
232
+ * clear the subscriptions we need to store them here.
233
+ *
234
+ * Imagine you have effect such as:
235
+ *
236
+ * ```
237
+ * function effect1() {
238
+ * console.log(signalA.value ? signalB.value : 'default');
239
+ * }
240
+ * ```
241
+ *
242
+ * In the above case the `signalB` needs to be unsubscribed when `signalA` is falsy. We do this by
243
+ * always clearing all of the subscriptions
244
+ *
245
+ * The `EffectSubscription` stores
246
+ *
247
+ * ```
248
+ * subscription1 = [effectConsumer1, EffectProperty.COMPONENT, Set[(signalA, signalB)]];
249
+ * ```
250
+ *
251
+ * The `signal1` and `signal2` back references are needed to "clear" existing subscriptions.
252
+ *
253
+ * Both `signalA` as well as `signalB` will have a reference to `subscription` to the so that the
254
+ * effect can be scheduled if either `signalA` or `signalB` triggers. The `subscription1` is shared
255
+ * between the signals.
256
+ *
257
+ * The second position `EffectProperty|string` store the property name of the effect.
258
+ *
259
+ * - Property name of the VNode
260
+ * - `EffectProperty.COMPONENT` if component
261
+ * - `EffectProperty.VNODE` if VNode
262
+ */
263
+ declare class EffectSubscription {
264
+ consumer: Consumer;
265
+ property: EffectProperty | string;
266
+ backRef: Set<EffectBackRef> | null;
267
+ data: SubscriptionData | null;
268
+ constructor(consumer: Consumer, property: EffectProperty | string, backRef?: Set<EffectBackRef> | null, data?: SubscriptionData | null);
269
+ }
270
+
44
271
  /**
45
272
  * Creates a simple DOM structure for testing components.
46
273
  *
@@ -76,9 +303,154 @@ export declare function emulateExecutionOfQwikFuncs(document: Document): void;
76
303
  /** @public */
77
304
  export declare function expectDOM(actual: Element, expected: string): Promise<void>;
78
305
 
306
+ /**
307
+ * Any function taking a props object that returns JSXOutput.
308
+ *
309
+ * The `key`, `flags` and `dev` parameters are for internal use.
310
+ *
311
+ * @public
312
+ */
313
+ declare type FunctionComponent<P = unknown> = {
314
+ renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput_2;
315
+ }['renderFn'];
316
+
79
317
  /** @public */
80
318
  export declare function getTestPlatform(): TestPlatform;
81
319
 
320
+ declare type HostElement = VNode | ISsrNode;
321
+
322
+ /** The shared state during an invoke() call */
323
+ declare interface InvokeContext {
324
+ /** The Virtual parent component for the current component code */
325
+ $hostElement$: HostElement | undefined;
326
+ /** The event we're currently handling */
327
+ $event$: PossibleEvents | undefined;
328
+ $effectSubscriber$: EffectSubscription | undefined;
329
+ $locale$: string | undefined;
330
+ $container$: Container | undefined;
331
+ }
332
+
333
+ declare interface ISsrNode {
334
+ id: string;
335
+ flags: SsrNodeFlags;
336
+ dirty: ChoreBits;
337
+ parentComponent: ISsrNode | null;
338
+ vnodeData: VNodeData;
339
+ currentFile: string | null;
340
+ setProp(name: string, value: any): void;
341
+ getProp(name: string): any;
342
+ removeProp(name: string): void;
343
+ addChild(child: ISsrNode): void;
344
+ setTreeNonUpdatable(): void;
345
+ }
346
+
347
+ /** @public */
348
+ declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
349
+
350
+ /**
351
+ * A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
352
+ *
353
+ * @public
354
+ */
355
+ declare interface JSXNode<T extends string | FunctionComponent | unknown = unknown> {
356
+ type: T;
357
+ props: T extends FunctionComponent<infer P> ? P : Record<any, unknown>;
358
+ children: JSXChildren | null;
359
+ key: string | null;
360
+ dev?: DevJSX;
361
+ }
362
+
363
+ declare const enum JSXNodeFlags {
364
+ None = 0,
365
+ StaticSubtree = 2,
366
+ HasCapturedProps = 4
367
+ }
368
+
369
+ declare class JSXNodeImpl<T = unknown> implements JSXNodeInternal_2<T> {
370
+ type: T;
371
+ children: JSXChildren;
372
+ flags: JSXNodeFlags;
373
+ toSort: boolean;
374
+ key: string | null;
375
+ varProps: Props;
376
+ constProps: Props | null;
377
+ dev?: DevJSX & {
378
+ stack: string | undefined;
379
+ };
380
+ _proxy: Props | null;
381
+ constructor(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren, flags: JSXNodeFlags, key: string | number | null | undefined, toSort?: boolean, dev?: DevJSX);
382
+ get props(): T extends FunctionComponent<infer PROPS> ? PROPS : Props;
383
+ }
384
+
385
+ /**
386
+ * The internal representation of a JSX Node.
387
+ *
388
+ * @internal
389
+ */
390
+ declare interface JSXNodeInternal_2<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
391
+ /** The type of node */
392
+ type: T;
393
+ /** Do the varProps need sorting */
394
+ toSort: boolean;
395
+ /** The key property */
396
+ key: string | null;
397
+ /** Flags */
398
+ flags: JSXNodeFlags;
399
+ /**
400
+ * Props that are not guaranteed shallow equal across runs.
401
+ *
402
+ * Any prop that is in `constProps` takes precedence over `varProps`.
403
+ *
404
+ * Does not contain `children` or `key`.
405
+ *
406
+ * `onEvent$` props are normalized to the html `q-x:event` version
407
+ */
408
+ varProps: Props;
409
+ /**
410
+ * Props that will be shallow equal across runs. Does not contain any props that are in varProps.
411
+ *
412
+ * Any prop that is in `constProps` takes precedence over `varProps`.
413
+ *
414
+ * Does not contain `children` or `key`.
415
+ *
416
+ * `onEvent$` props are normalized to the html `q-x:event` version
417
+ */
418
+ constProps: Props | null;
419
+ /** The children of the node */
420
+ children: JSXChildren;
421
+ /** Filename etc for debugging */
422
+ dev?: DevJSX & {
423
+ stack: string | undefined;
424
+ };
425
+ }
426
+
427
+ /**
428
+ * Any valid output for a component
429
+ *
430
+ * @public
431
+ */
432
+ declare type JSXOutput_2 = JSXNode | string | number | boolean | null | undefined | JSXOutput_2[];
433
+
434
+ /**
435
+ * Shared lazy-loading reference that holds module loading metadata. Multiple QRLs pointing to the
436
+ * same chunk+symbol can share a single LazyRef, differing only in their captured scope.
437
+ */
438
+ declare class LazyRef<TYPE = unknown> {
439
+ readonly $chunk$: string | null;
440
+ readonly $symbol$: string;
441
+ readonly $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>);
442
+ $ref$?: (null | ValueOrPromise<TYPE>) | undefined;
443
+ $container$: Container | undefined;
444
+ dev?: QRLDev | null | undefined;
445
+ qrls?: Set<any>;
446
+ constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: Container | null);
447
+ /** We don't read hash very often so let's not allocate a string for every QRL */
448
+ get $hash$(): string;
449
+ $setRef$(ref: ValueOrPromise<TYPE>): void;
450
+ /** Load the raw module export without capture binding. */
451
+ $load$(): ValueOrPromise<TYPE>;
452
+ }
453
+
82
454
  /** @public */
83
455
  declare interface MockDocument extends Document {
84
456
  }
@@ -98,39 +470,569 @@ declare interface MockWindow extends Window {
98
470
  document: MockDocument;
99
471
  }
100
472
 
473
+ declare interface NodePropData {
474
+ $scopedStyleIdPrefix$: string | null;
475
+ $isConst$: boolean;
476
+ }
477
+
478
+ declare type ObjToProxyMap = WeakMap<any, any>;
479
+
480
+ /** @internal */
481
+ declare const _OWNER: unique symbol;
482
+
483
+ declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent;
484
+
485
+ declare type Props = Record<string, unknown>;
486
+
487
+ /** @internal */
488
+ declare const _PROPS_HANDLER: unique symbol;
489
+
490
+ declare type PropsProxy = {
491
+ [_VAR_PROPS]: Props;
492
+ [_CONST_PROPS]: Props | null;
493
+ [_OWNER]: JSXNodeInternal_2;
494
+ [_PROPS_HANDLER]: PropsProxyHandler;
495
+ } & Record<string | symbol, unknown>;
496
+
497
+ declare class PropsProxyHandler implements ProxyHandler<any> {
498
+ owner: JSXNodeImpl;
499
+ $effects$: undefined | Map<string | symbol, Set<EffectSubscription>>;
500
+ $container$: Container | null;
501
+ constructor(owner: JSXNodeImpl);
502
+ get(_: any, prop: string | symbol): any;
503
+ set(_: any, prop: string | symbol, value: any): boolean;
504
+ deleteProperty(_: any, prop: string | symbol): boolean;
505
+ has(_: any, prop: string | symbol): boolean;
506
+ getOwnPropertyDescriptor(_: any, p: string | symbol): PropertyDescriptor | undefined;
507
+ ownKeys(): string[];
508
+ }
509
+
510
+ /**
511
+ * The `QRL` type represents a lazy-loadable AND serializable resource.
512
+ *
513
+ * QRL stands for Qwik URL.
514
+ *
515
+ * Use `QRL` when you want to refer to a lazy-loaded resource. `QRL`s are most often used for code
516
+ * (functions) but can also be used for other resources such as `string`s in the case of styles.
517
+ *
518
+ * `QRL` is an opaque token that is generated by the Qwik Optimizer. (Do not rely on any properties
519
+ * in `QRL` as it may change between versions.)
520
+ *
521
+ * ## Creating `QRL` references
522
+ *
523
+ * Creating `QRL` is done using `$(...)` function. `$(...)` is a special marker for the Qwik
524
+ * Optimizer that marks that the code should be extracted into a lazy-loaded symbol.
525
+ *
526
+ * ```tsx
527
+ * useOnDocument(
528
+ * 'mousemove',
529
+ * $((event) => console.log('mousemove', event))
530
+ * );
531
+ * ```
532
+ *
533
+ * In the above code, the Qwik Optimizer detects `$(...)` and transforms the code as shown below:
534
+ *
535
+ * ```tsx
536
+ * // FILE: <current file>
537
+ * useOnDocument('mousemove', qrl('./chunk-abc.js', 'onMousemove'));
538
+ *
539
+ * // FILE: chunk-abc.js
540
+ * export const onMousemove = () => console.log('mousemove');
541
+ * ```
542
+ *
543
+ * NOTE: `qrl(...)` is a result of Qwik Optimizer transformation. You should never have to invoke
544
+ * this function directly in your application. The `qrl(...)` function should be invoked only after
545
+ * the Qwik Optimizer transformation.
546
+ *
547
+ * ## Using `QRL`s
548
+ *
549
+ * Use `QRL` type in your application when you want to get a lazy-loadable reference to a resource
550
+ * (most likely a function).
551
+ *
552
+ * ```tsx
553
+ * // Example of declaring a custom functions which takes callback as QRL.
554
+ * export function useMyFunction(callback: QRL<() => void>) {
555
+ * doExtraStuff();
556
+ * // The callback passed to `onDocument` requires `QRL`.
557
+ * useOnDocument('mousemove', callback);
558
+ * }
559
+ * ```
560
+ *
561
+ * In the above example, the way to think about the code is that you are not asking for a callback
562
+ * function but rather a reference to a lazy-loadable callback function. Specifically, the function
563
+ * loading should be delayed until it is actually needed. In the above example, the function would
564
+ * not load until after a `mousemove` event on `document` fires.
565
+ *
566
+ * ## Resolving `QRL` references
567
+ *
568
+ * At times it may be necessary to resolve a `QRL` reference to the actual value. This can be
569
+ * performed using `QRL.resolve(..)` function.
570
+ *
571
+ * ```tsx
572
+ * // Assume you have QRL reference to a greet function
573
+ * const lazyGreet: QRL<() => void> = $(() => console.log('Hello World!'));
574
+ *
575
+ * // Use `qrlImport` to load / resolve the reference.
576
+ * const greet: () => void = await lazyGreet.resolve();
577
+ *
578
+ * // Invoke it
579
+ * greet();
580
+ * ```
581
+ *
582
+ * NOTE: `element` is needed because `QRL`s are relative and need a base location to resolve
583
+ * against. The base location is encoded in the HTML in the form of `<div q:base="/url">`.
584
+ *
585
+ * ## `QRL.resolved`
586
+ *
587
+ * Once `QRL.resolve()` returns, the value is stored under `QRL.resolved`. This allows the value to
588
+ * be used without having to await `QRL.resolve()` again.
589
+ *
590
+ * ## Question: Why not just use `import()`?
591
+ *
592
+ * At first glance, `QRL` serves the same purpose as `import()`. However, there are three subtle
593
+ * differences that need to be taken into account.
594
+ *
595
+ * 1. `QRL`s must be serializable into HTML.
596
+ * 2. `QRL`s must be resolved by framework relative to `q:base`.
597
+ * 3. `QRL`s must be able to capture lexically scoped variables.
598
+ * 4. `QRL`s encapsulate the difference between running with and without Qwik Optimizer.
599
+ * 5. `QRL`s allow expressing lazy-loaded boundaries without thinking about chunk and symbol names.
600
+ *
601
+ * Let's assume that you intend to write code such as this:
602
+ *
603
+ * ```tsx
604
+ * return <button onClick={() => (await import('./chunk-abc.js')).onClick}>
605
+ * ```
606
+ *
607
+ * The above code needs to be serialized into DOM such as:
608
+ *
609
+ * ```
610
+ * <div q:base="/build/">
611
+ * <button q-e:click="./chunk-abc.js#onClick">...</button>
612
+ * </div>
613
+ * ```
614
+ *
615
+ * 1. Notice there is no easy way to extract chunk (`./chunk-abc.js`) and symbol (`onClick`) into HTML.
616
+ * 2. Notice that even if you could extract it, the `import('./chunk-abc.js')` would become relative to
617
+ * where the `import()` file is declared. Because it is our framework doing the load, the
618
+ * `./chunk-abc.js` would become relative to the framework file. This is not correct, as it
619
+ * should be relative to the original file generated by the bundler.
620
+ * 3. Next, the framework needs to resolve the `./chunk-abc.js` and needs a base location that is
621
+ * encoded in the HTML.
622
+ * 4. The QRL needs to be able to capture lexically scoped variables. (`import()` only allows loading
623
+ * top-level symbols which don't capture variables.)
624
+ * 5. As a developer, you don't want to think about `import` and naming the chunks and symbols. You
625
+ * just want to say: "this should be lazy."
626
+ *
627
+ * These are the main reasons why Qwik introduces its own concept of `QRL`.
628
+ *
629
+ * @public
630
+ * @see `$`
631
+ */
632
+ declare type QRL<TYPE = unknown> = {
633
+ __qwik_serializable__?: any;
634
+ __brand__QRL__?: TYPE;
635
+ /** Resolve the QRL and return the actual value. */
636
+ resolve(): Promise<TYPE>;
637
+ /** The resolved value, once `resolve()` returns. */
638
+ resolved: undefined | TYPE;
639
+ getCaptured(): unknown[] | null;
640
+ getSymbol(): string;
641
+ getHash(): string;
642
+ dev?: QRLDev | null;
643
+ } & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
644
+
645
+ declare type QrlArgs<T> = T extends (...args: infer ARGS) => any ? ARGS : unknown[];
646
+
647
+ /** @public */
648
+ declare interface QRLDev {
649
+ file: string;
650
+ lo: number;
651
+ hi: number;
652
+ }
653
+
654
+ /** @internal */
655
+ declare type QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
656
+
657
+ declare type QRLInternalMethods<TYPE> = {
658
+ readonly $chunk$: string | null;
659
+ readonly $symbol$: string;
660
+ readonly $hash$: string;
661
+ /** If it's a string it's serialized */
662
+ readonly $captures$?: Readonly<unknown[]> | string | null;
663
+ dev?: QRLDev | null;
664
+ resolve(container?: Container): Promise<TYPE>;
665
+ resolved: undefined | TYPE;
666
+ getSymbol(): string;
667
+ getHash(): string;
668
+ getCaptured(): unknown[] | null;
669
+ getFn(currentCtx?: InvokeContext,
670
+ /** If this returns false, the function execution will be skipped */
671
+ beforeFn?: () => void | false): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE> | undefined> : unknown;
672
+ $callFn$(withThis: unknown, ...args: QrlArgs<TYPE>): ValueOrPromise<QrlReturn<TYPE>>;
673
+ $setDev$(dev: QRLDev | null): void;
674
+ /**
675
+ * "with captures" - Get a new QRL for these captures, reusing the lazy ref. It's an internal
676
+ * method but we need to have a stable name because it gets called in user code by the optimizer,
677
+ * after the $name$ props are mangled
678
+ */
679
+ w(captures: Readonly<unknown[]> | string | null): QRLInternal<TYPE>;
680
+ /**
681
+ * "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
682
+ * because it gets called in user code by the optimizer, after the $name$ props are mangled
683
+ */
684
+ s(ref: ValueOrPromise<TYPE>): void;
685
+ /**
686
+ * Needed for deserialization and importing. We don't always have the container while creating
687
+ * qrls in async sections of code
688
+ */
689
+ readonly $container$?: Container | null;
690
+ /** The shared lazy-loading reference */
691
+ readonly $lazy$: LazyRef<TYPE>;
692
+ };
693
+
694
+ declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
695
+
696
+ declare const RenderEvent = "qRender";
697
+
698
+ /** Stores the location of an object. If no parent, it's a root. */
699
+ declare type SeenRef = {
700
+ $index$: number;
701
+ $parent$?: SeenRef | null;
702
+ };
703
+
704
+ declare interface SerializationContext {
705
+ $serialize$: () => ValueOrPromise<void>;
706
+ $symbolToChunkResolver$: SymbolToChunkResolver;
707
+ /**
708
+ * Map from object to parent and index reference.
709
+ *
710
+ * If object is found in `objMap` will return the parent reference and index path.
711
+ *
712
+ * `objMap` return:
713
+ *
714
+ * - `{ parent, index }` - The parent object and the index within that parent.
715
+ * - `undefined` - Object has not been seen yet.
716
+ */
717
+ getSeenRef: (obj: unknown) => SeenRef | undefined;
718
+ /** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
719
+ $hasRootId$: (obj: unknown) => number | undefined;
720
+ /**
721
+ * Root objects which need to be serialized.
722
+ *
723
+ * Roots are entry points into the object graph. Typically the roots are held by the listeners.
724
+ *
725
+ * Returns the index of the root object.
726
+ */
727
+ $addRoot$: AddRootFn;
728
+ /** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
729
+ $markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
730
+ $roots$: unknown[];
731
+ $promoteToRoot$: (ref: SeenRef, index?: number) => void;
732
+ $addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
733
+ $isSsrNode$: (obj: unknown) => obj is SsrNode;
734
+ $isDomRef$: (obj: unknown) => obj is DomRef;
735
+ $writer$: StreamWriter;
736
+ $syncFns$: string[];
737
+ $eventQrls$: Set<QRL>;
738
+ $eventNames$: Set<string>;
739
+ $renderSymbols$: Set<string>;
740
+ $storeProxyMap$: ObjToProxyMap;
741
+ $eagerResume$: Set<unknown>;
742
+ $setProp$: (obj: any, prop: string, value: any) => void;
743
+ }
744
+
745
+ declare const enum SerializationSignalFlags {
746
+ SERIALIZATION_STRATEGY_NEVER = 8,
747
+ SERIALIZATION_STRATEGY_ALWAYS = 16,
748
+ SERIALIZATION_ALL_STRATEGIES = 24
749
+ }
750
+
751
+ /**
752
+ * A signal is a reactive value which can be read and written. When the signal is written, all tasks
753
+ * which are tracking the signal will be re-run and all components that read the signal will be
754
+ * re-rendered.
755
+ *
756
+ * Furthermore, when a signal value is passed as a prop to a component, the optimizer will
757
+ * automatically forward the signal. This means that `return <div title={signal.value}>hi</div>`
758
+ * will update the `title` attribute when the signal changes without having to re-render the
759
+ * component.
760
+ *
761
+ * @public
762
+ */
763
+ declare interface Signal<T = any> {
764
+ /** Reading from this subscribes to updates; writing to this triggers updates. */
765
+ value: T;
766
+ /** Reading from this does not subscribe to updates; writing to this does not trigger updates. */
767
+ untrackedValue: T;
768
+ /**
769
+ * Use this to trigger running subscribers, for example when the value mutated but remained the
770
+ * same object.
771
+ */
772
+ trigger(): void;
773
+ }
774
+
775
+ declare const enum SignalFlags {
776
+ INVALID = 1,
777
+ RUN_EFFECTS = 2
778
+ }
779
+
780
+ declare class SignalImpl<T = any> implements Signal<T> {
781
+ $untrackedValue$: T;
782
+ /** Store a list of effects which are dependent on this signal. */
783
+ $effects$: undefined | Set<EffectSubscription>;
784
+ $container$: Container | null;
785
+ $wrappedSignal$: WrappedSignalImpl<T> | null;
786
+ constructor(container: Container | null | undefined, value: T);
787
+ /**
788
+ * Use this to trigger running subscribers, for example when the calculated value has mutated but
789
+ * remained the same object
790
+ */
791
+ trigger(): void;
792
+ /** @deprecated Use `trigger()` instead */
793
+ force(): void;
794
+ get untrackedValue(): T;
795
+ set untrackedValue(value: T);
796
+ get value(): T;
797
+ set value(value: T);
798
+ valueOf(): void;
799
+ toString(): string;
800
+ toJSON(): {
801
+ value: T;
802
+ };
803
+ }
804
+
805
+ declare interface SimplifiedServerRequestEvent<T = unknown> {
806
+ url: URL;
807
+ locale: string | undefined;
808
+ request: Request;
809
+ }
810
+
811
+ /** A selection of attributes of the real thing */
812
+ declare type SsrNode = {
813
+ id: string;
814
+ children: ISsrNode[] | null;
815
+ vnodeData: VNodeData;
816
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
817
+ };
818
+
819
+ declare const enum SsrNodeFlags {
820
+ Updatable = 1
821
+ }
822
+
101
823
  /** @public */
102
824
  export declare function ssrRenderToDom(jsx: JSXOutput, opts?: {
825
+ /** Print debug information to console. */
103
826
  debug?: boolean;
827
+ /** Treat JSX as raw, (don't wrap in in head/body) */
104
828
  raw?: boolean;
829
+ /** Include QwikLoader */
830
+ qwikLoader?: boolean;
831
+ /** Inject nodes into the document before test runs (for testing purposes) */
832
+ onBeforeResume?: (document: Document) => void;
105
833
  }): Promise<{
106
834
  container: _DomContainer;
107
835
  document: Document;
108
- vNode: _VirtualVNode | null;
836
+ vNode: _VNode | null;
109
837
  getStyles: () => Record<string, string | string[]>;
110
838
  }>;
111
839
 
840
+ declare type StoreTarget = Record<string | symbol, any>;
841
+
842
+ /** @internal */
843
+ declare interface StreamWriter {
844
+ write(chunk: string): void;
845
+ }
846
+
847
+ /** @internal */
848
+ declare class SubscriptionData {
849
+ data: NodePropData;
850
+ constructor(data: NodePropData);
851
+ }
852
+
853
+ declare type SymbolToChunkResolver = (symbol: string) => string;
854
+
855
+ declare class Task<T = unknown, B = T> extends BackRef implements DescriptorBase<unknown, Signal<B>> {
856
+ $flags$: number;
857
+ $index$: number;
858
+ $el$: HostElement;
859
+ $qrl$: QRLInternal<T>;
860
+ $state$: Signal<B> | undefined;
861
+ $destroy$: (() => void) | null;
862
+ $destroyPromise$: Promise<void> | undefined;
863
+ $taskPromise$: Promise<void> | null;
864
+ constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$: QRLInternal<T>, $state$: Signal<B> | undefined, $destroy$: (() => void) | null);
865
+ }
866
+
867
+ declare const TaskEvent = "qTask";
868
+
112
869
  /** @public */
113
870
  declare interface TestPlatform extends CorePlatform {
871
+ /**
872
+ * @deprecated No longer used, please use {@link waitForDrain} instead.
873
+ * @example With `ssrRenderToDom`
874
+ *
875
+ * ```ts
876
+ * import { waitForDrain } from '@qwik.dev/testing';
877
+ *
878
+ * const { container } = ssrRenderToDom(...);
879
+ * await waitForDrain(container);
880
+ * ```
881
+ *
882
+ * @example With `domRender`
883
+ *
884
+ * ```ts
885
+ * import { waitForDrain } from '@qwik.dev/testing';
886
+ *
887
+ * const { container } = domRender(...);
888
+ * await waitForDrain(container);
889
+ * ```
890
+ */
114
891
  flush: () => Promise<void>;
115
892
  }
116
893
 
117
894
  /**
118
- * Trigger an event in unit tests on an element.
895
+ * Trigger an event in unit tests on an element. Needs to be kept in sync with the Qwik Loader event
896
+ * dispatching.
897
+ *
898
+ * Events can be either case sensitive element-scoped events or scoped kebab-case.
119
899
  *
120
900
  * Future deprecation candidate.
121
901
  *
122
902
  * @public
123
903
  */
124
- export declare function trigger(root: Element, queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventName: string, eventPayload?: any): Promise<void>;
904
+ export declare function trigger(root: Element, queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventName: string, eventPayload?: any, options?: {
905
+ waitForIdle?: boolean;
906
+ }): Promise<void>;
907
+
908
+ /**
909
+ * Type representing a value which is either resolve or a promise.
910
+ *
911
+ * @public
912
+ */
913
+ declare type ValueOrPromise<T> = T | Promise<T>;
914
+
915
+ /** @internal */
916
+ declare const _VAR_PROPS: unique symbol;
917
+
918
+ /** @internal */
919
+ declare abstract class VNode implements BackRef {
920
+ flags: VNodeFlags;
921
+ parent: VNode | null;
922
+ previousSibling: VNode | null | undefined;
923
+ nextSibling: VNode | null | undefined;
924
+ props: Props | null;
925
+ [_EFFECT_BACK_REF]: Map<any, any> | undefined;
926
+ slotParent: VNode | null;
927
+ dirty: ChoreBits;
928
+ dirtyChildren: VNode[] | null;
929
+ nextDirtyChildIndex: number;
930
+ constructor(flags: VNodeFlags, parent: VNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined, props: Props | null);
931
+ toString(): string;
932
+ }
125
933
 
126
934
  /** @public */
127
935
  export declare function vnode_fromJSX(jsx: JSXOutput): {
128
- vParent: _ElementVNode;
936
+ vParent: _VirtualVNode | _ElementVNode;
129
937
  vNode: _VNode | null;
130
938
  document: _QDocument;
131
- container: ClientContainer;
939
+ container: ClientContainer_2;
132
940
  };
133
941
 
942
+ /**
943
+ * Array of numbers which describes virtual nodes in the tree.
944
+ *
945
+ * HTML can't account for:
946
+ *
947
+ * - Multiple text nodes in a row. (it treats it as a single text node)
948
+ * - Empty text nodes. (it ignores them)
949
+ * - And virtual nodes such as `<Fragment/>` or `<MyComponent/>`
950
+ *
951
+ * So we need to encode all of that information into the VNodeData.
952
+ *
953
+ * Encoding:
954
+ *
955
+ * - First position is special and encodes state information and stores VNodeDataFlag.
956
+ * - Positive numbers are text node lengths. (0 is a special case for empty text node)
957
+ * - Negative numbers are element counts.
958
+ * - `OPEN_FRAGMENT` is start of virtual node.
959
+ *
960
+ * - If `OPEN_FRAGMENT` than the previous node is an `Array` which contains the props (see
961
+ * `SsrAttrs`). NOTE: The array is never going to be the last item in the VNodeData, so we can
962
+ * always assume that the last item in `vNodeData` is a number.
963
+ * - `CLOSE_FRAGMENT` is end of virtual node.
964
+ *
965
+ * NOTE: This is how we store the information during the SSR streaming, once the SSR is complete
966
+ * this data needs to be serialized into a string and stored in the DOM as a script tag which has
967
+ * deferent serialization format.
968
+ */
969
+ declare type VNodeData = [VNodeDataFlag, ...(Props | number)[]];
970
+
971
+ /**
972
+ * Flags for VNodeData (Flags con be bitwise combined)
973
+ *
974
+ * @internal
975
+ */
976
+ declare const enum VNodeDataFlag {
977
+ NONE = 0,
978
+ TEXT_DATA = 1,
979
+ VIRTUAL_NODE = 2,
980
+ ELEMENT_NODE = 4,
981
+ REFERENCE = 8,
982
+ SERIALIZE = 16
983
+ }
984
+
985
+ /**
986
+ * Flags for VNode.
987
+ *
988
+ * # Materialize vs Inflation
989
+ *
990
+ * - Materialized: The node has all of its children. Specifically `firstChild`/`lastChild` are NOT
991
+ * `undefined`. Materialization creates lazy instantiation of the children. NOTE: Only
992
+ * ElementVNode need to be materialized.
993
+ * - Inflation:
994
+ *
995
+ * - If Text: It means that it is safe to write to the node. When Text nodes are first Deserialized
996
+ * multiple text nodes can share the same DOM node. On write the sibling text nodes need to be
997
+ * converted into separate text nodes.
998
+ * - If Element: It means that the element tag attributes have not yet been read from the DOM.
999
+ *
1000
+ * Inflation and materialization are not the same, they are two independent things.
1001
+ *
1002
+ * @internal
1003
+ */
1004
+ declare const enum VNodeFlags {
1005
+ Element = 1,
1006
+ Virtual = 2,
1007
+ ELEMENT_OR_VIRTUAL_MASK = 3,
1008
+ Text = 4,
1009
+ ELEMENT_OR_TEXT_MASK = 5,
1010
+ TYPE_MASK = 7,
1011
+ INFLATED_TYPE_MASK = 15,
1012
+ Inflated = 8,
1013
+ Resolved = 16,
1014
+ Deleted = 32,
1015
+ HasIterationItems = 64,
1016
+ InflatedIterationItems = 128,
1017
+ Cursor = 256,
1018
+ NAMESPACE_MASK = 1536,
1019
+ NEGATED_NAMESPACE_MASK = -1537,
1020
+ NS_html = 0,// http://www.w3.org/1999/xhtml
1021
+ NS_svg = 512,// http://www.w3.org/2000/svg
1022
+ NS_math = 1024,// http://www.w3.org/1998/Math/MathML
1023
+ HasTargetElement = 2048
1024
+ }
1025
+
1026
+ /**
1027
+ * Wait for the scheduler to drain.
1028
+ *
1029
+ * This is useful when testing async code.
1030
+ *
1031
+ * @param container - The application container.
1032
+ * @public
1033
+ */
1034
+ export declare function waitForDrain(container: Container): Promise<void>;
1035
+
134
1036
  /** @public */
135
1037
  export declare function walkJSX(jsx: JSXOutput, apply: {
136
1038
  enter: (jsx: JSXNodeInternal) => void;
@@ -138,4 +1040,24 @@ export declare function walkJSX(jsx: JSXOutput, apply: {
138
1040
  text: (text: _Stringifiable) => void;
139
1041
  }): void;
140
1042
 
1043
+ declare const enum WrappedSignalFlags {
1044
+ UNWRAP = 4
1045
+ }
1046
+
1047
+ declare class WrappedSignalImpl<T> extends SignalImpl<T> {
1048
+ $args$: any[];
1049
+ $func$: (...args: any[]) => T;
1050
+ $funcStr$: string | null;
1051
+ $flags$: AllSignalFlags;
1052
+ $hostElement$: HostElement | undefined;
1053
+ [_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
1054
+ constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
1055
+ invalidate(): void;
1056
+ get untrackedValue(): T;
1057
+ $computeIfNeeded$(): void;
1058
+ $unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
1059
+ set value(_: any);
1060
+ get value(): any;
1061
+ }
1062
+
141
1063
  export { }