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

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