@qwik.dev/core 2.0.0-beta.4 → 2.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backpatch/index.d.ts +2 -0
- package/dist/backpatch/index.mjs +5 -0
- package/dist/backpatch/package.json +8 -0
- package/dist/backpatch-executor.debug.js +59 -0
- package/dist/backpatch-executor.js +1 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +12974 -0
- package/dist/core-internal.d.ts +1579 -818
- package/dist/core.min.mjs +9 -1
- package/dist/core.mjs +14777 -9194
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +10480 -5372
- package/dist/insights/index.qwik.mjs +82 -71
- package/dist/insights/vite/index.mjs +79 -81
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +78 -295
- package/dist/optimizer.mjs +2948 -4088
- package/dist/out-of-order-executor.debug.js +140 -0
- package/dist/out-of-order-executor.js +1 -0
- package/dist/preloader.mjs +172 -192
- package/dist/qwikloader.debug.js +403 -244
- package/dist/qwikloader.js +1 -1
- package/dist/server-modules.d.ts +1 -0
- package/dist/server.d.ts +54 -249
- package/dist/server.mjs +2332 -1407
- package/dist/server.prod.mjs +3844 -0
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/aws-lambda/package.json +3 -2
- package/dist/starters/adapters/aws-lambda/src/entry_aws-lambda.tsx +2 -6
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/azure-swa/package.json +3 -2
- package/dist/starters/adapters/azure-swa/src/entry.azure-swa.tsx +2 -3
- package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +4 -4
- package/dist/starters/adapters/bun/package.json +3 -2
- package/dist/starters/adapters/bun/src/entry.bun.ts +37 -10
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/cloud-run/package.json +3 -2
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +23 -7
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
- package/dist/starters/adapters/cloudflare-pages/src/entry.cloudflare-pages.tsx +2 -3
- package/dist/starters/adapters/cloudflare-workers/README.md +52 -0
- package/dist/starters/adapters/cloudflare-workers/adapters/cloudflare-workers/vite.config.ts +15 -0
- package/dist/starters/adapters/cloudflare-workers/gitignore +3 -0
- package/dist/starters/adapters/cloudflare-workers/package.json +31 -0
- package/dist/starters/adapters/cloudflare-workers/public/.assetsignore +4 -0
- package/dist/starters/adapters/cloudflare-workers/public/_headers +11 -0
- package/dist/starters/adapters/cloudflare-workers/public/_redirects +1 -0
- package/dist/starters/adapters/cloudflare-workers/src/entry.cloudflare-pages.tsx +22 -0
- package/dist/starters/adapters/cloudflare-workers/worker-configuration.d.ts +5 -0
- package/dist/starters/adapters/cloudflare-workers/wrangler.jsonc +41 -0
- package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/deno/package.json +3 -2
- package/dist/starters/adapters/deno/src/entry.deno.ts +43 -10
- package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/express/package.json +4 -3
- package/dist/starters/adapters/express/src/entry.express.tsx +22 -7
- package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/fastify/package.json +5 -4
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +21 -1
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +11 -4
- package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/firebase/package.json +3 -2
- package/dist/starters/adapters/firebase/src/entry-firebase.tsx +2 -3
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/netlify-edge/package.json +5 -4
- package/dist/starters/adapters/netlify-edge/src/entry.netlify-edge.tsx +2 -3
- package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/node-server/package.json +3 -2
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +22 -6
- package/dist/starters/adapters/{static/adapters/static/vite.config.mts → ssg/adapters/ssg/vite.config.ts} +4 -4
- package/dist/starters/adapters/ssg/package.json +20 -0
- package/dist/starters/adapters/vercel-edge/README.md +2 -2
- package/dist/starters/adapters/vercel-edge/adapters/vercel-edge/{vite.config.mts → vite.config.ts} +3 -3
- package/dist/starters/adapters/vercel-edge/package.json +3 -2
- package/dist/starters/adapters/vercel-edge/src/entry.vercel-edge.tsx +2 -3
- package/dist/starters/adapters/vercel-edge/vercel.json +1 -1
- package/dist/starters/features/auth/package.json +1 -1
- package/dist/starters/features/compiled-i18n/package.json +37 -0
- package/dist/starters/features/compiled-i18n/src/components/locale-selector/locale-selector.tsx +30 -0
- package/dist/starters/features/compiled-i18n/src/entry.ssr.tsx +31 -0
- package/dist/starters/features/compiled-i18n/src/routes/plugin@compiled-i18n.ts +28 -0
- package/dist/starters/features/csr/index.html +27 -0
- package/dist/starters/features/csr/package.json +29 -0
- package/dist/starters/features/csr/src/root.tsx +15 -0
- package/dist/starters/features/csr/vite.config.ts +13 -0
- package/dist/starters/features/cypress/src/actions/example.action.ts +5 -0
- package/dist/starters/features/cypress/src/components/example/example.cy.tsx +50 -8
- package/dist/starters/features/cypress/src/components/example/example.tsx +13 -3
- package/dist/starters/features/cypress/src/loaders/example.loader.ts +5 -0
- package/dist/starters/features/drizzle/package.json +1 -1
- package/dist/starters/features/pandacss/package.json +1 -1
- package/dist/starters/features/postcss/postcss.config.js +1 -1
- package/dist/starters/features/storybook/.storybook/tsconfig.json +0 -1
- package/dist/starters/features/styled-vanilla-extract/package.json +2 -1
- package/dist/starters/features/tailwind/package.json +2 -2
- package/dist/starters/features/tailwind/prettier.config.js +10 -0
- package/dist/starters/features/tailwind-v3/package.json +1 -1
- package/dist/starters/features/tailwind-v3/prettier.config.js +10 -0
- package/dist/starters/features/vitest/package.json +1 -1
- package/dist/testing/index.d.ts +1000 -7
- package/dist/testing/index.mjs +16487 -11656
- package/dist/testing/package.json +1 -1
- package/dist/worker/index.d.mts +21 -0
- package/dist/worker/index.mjs +251 -0
- package/dist/worker/package.json +9 -0
- package/dist/worker/worker.js +13 -0
- package/dist/worker/worker.node.js +15 -0
- package/dist/worker/worker.shared.js +63 -0
- package/handlers.mjs +21 -1
- package/package.json +40 -56
- package/public.d.ts +12 -2
- package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
- package/server.d.ts +2 -0
- package/worker.d.ts +2 -0
- package/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.wasm.cjs +0 -471
- package/bindings/qwik.wasm.mjs +0 -464
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- package/dist/build/index.cjs +0 -35
- package/dist/build/index.cjs.map +0 -7
- package/dist/build/index.dev.cjs +0 -37
- package/dist/build/index.dev.cjs.map +0 -7
- package/dist/build/index.prod.cjs +0 -37
- package/dist/build/index.prod.cjs.map +0 -7
- package/dist/cli.cjs +0 -5545
- package/dist/core.cjs +0 -11870
- package/dist/core.cjs.map +0 -1
- package/dist/core.prod.cjs +0 -5723
- package/dist/insights/index.qwik.cjs +0 -1
- package/dist/insights/vite/index.cjs +0 -1
- package/dist/loader/index.cjs +0 -4
- package/dist/optimizer.cjs +0 -4020
- package/dist/preloader.cjs +0 -269
- package/dist/server.cjs +0 -3040
- package/dist/starters/adapters/static/package.json +0 -19
- package/dist/starters/features/localize/package.json +0 -37
- package/dist/starters/features/localize/src/entry.ssr.tsx +0 -30
- package/dist/starters/features/localize/src/locales/message.en.json +0 -8
- package/dist/starters/features/localize/src/locales/message.it.json +0 -8
- package/dist/starters/features/localize/src/routes/[locale]/i18n-utils.ts +0 -94
- package/dist/starters/features/localize/src/routes/[locale]/index.tsx +0 -52
- package/dist/starters/features/localize/src/routes/[locale]/layout.tsx +0 -12
- package/dist/starters/features/playwright/playwright-report/index.html +0 -22026
- package/dist/starters/features/tailwind/.prettierrc.js +0 -3
- package/dist/testing/index.cjs +0 -33388
- /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
package/dist/core-internal.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as CSS_2 from 'csstype';
|
|
1
|
+
import type { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
+
import type * as CSS_2 from 'csstype';
|
|
3
3
|
import { isBrowser } from './build';
|
|
4
4
|
import { isDev } from './build';
|
|
5
5
|
import { isServer } from './build';
|
|
6
|
-
import {
|
|
7
|
-
import type {
|
|
8
|
-
import { ValueOrPromise as ValueOrPromise_2 } from '..';
|
|
6
|
+
import { ResolvedManifest } from './optimizer';
|
|
7
|
+
import type { ServerQwikManifest } from './optimizer';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Qwik Optimizer marker function.
|
|
@@ -83,23 +82,33 @@ import { ValueOrPromise as ValueOrPromise_2 } from '..';
|
|
|
83
82
|
*/
|
|
84
83
|
export declare const $: <T>(expression: T) => QRL<T>;
|
|
85
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Register an external projection on a parent component VNode.
|
|
87
|
+
*
|
|
88
|
+
* Creates a new VirtualVNode that will render the given component QRL with the given props. The
|
|
89
|
+
* VNode is stored as a projection on the parent, and a low-priority cursor is added so the cursor
|
|
90
|
+
* walker will process it.
|
|
91
|
+
*
|
|
92
|
+
* Use `_setProjectionTarget` to set the DOM target element before the cursor fires.
|
|
93
|
+
*
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
export declare function _addProjection(container: _Container, parentVNode: _VirtualVNode, componentQRL: QRL<any>, props: Record<string, unknown>, slotName: string): _VirtualVNode;
|
|
97
|
+
|
|
98
|
+
declare interface AddRootFn {
|
|
99
|
+
(obj: unknown, returnRef?: never): number;
|
|
100
|
+
(obj: unknown, returnRef: true): SeenRef;
|
|
101
|
+
}
|
|
102
|
+
|
|
86
103
|
declare type AllEventKeys = keyof AllEventsMap;
|
|
87
104
|
|
|
88
|
-
declare type AllEventMapRaw =
|
|
89
|
-
qidle: QwikIdleEvent;
|
|
90
|
-
qinit: QwikInitEvent;
|
|
91
|
-
qsymbol: QwikSymbolEvent;
|
|
92
|
-
qvisible: QwikVisibleEvent;
|
|
93
|
-
qviewtransition: QwikViewTransitionEvent;
|
|
94
|
-
};
|
|
105
|
+
declare type AllEventMapRaw = QwikHTMLElementEventMap & QwikDocumentEventMap & QwikWindowEventMap;
|
|
95
106
|
|
|
96
107
|
declare type AllEventsMap = Omit<AllEventMapRaw, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
97
108
|
|
|
98
109
|
declare type _AllowPlainQrl<Q> = QRLEventHandlerMulti<any, any> extends Q ? Q extends QRLEventHandlerMulti<infer EV, infer EL> ? Q | (EL extends Element ? EventHandler<EV, EL> : never) : Q : Q extends QRL<infer U> ? Q | U : NonNullable<Q> extends never ? Q : QRL<Q> | Q;
|
|
99
110
|
|
|
100
|
-
declare type
|
|
101
|
-
|
|
102
|
-
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | ComputedSignalFlags;
|
|
111
|
+
declare type AllSignalFlags = ComputedSignalFlags | SerializationSignalFlags | AsyncSignalFlags;
|
|
103
112
|
|
|
104
113
|
/**
|
|
105
114
|
* TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic`
|
|
@@ -357,53 +366,73 @@ declare interface AriaAttributes {
|
|
|
357
366
|
/** @public */
|
|
358
367
|
declare type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & {});
|
|
359
368
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
369
|
+
/**
|
|
370
|
+
* @deprecated Use `ComputedFn` instead.
|
|
371
|
+
* @public
|
|
372
|
+
*/
|
|
373
|
+
export declare type AsyncFn<T> = ComputedFn<T>;
|
|
364
374
|
|
|
365
|
-
/** @
|
|
366
|
-
|
|
375
|
+
/** @deprecated Use `ComputeQRL` instead. */
|
|
376
|
+
declare type AsyncQRL<T> = ComputeQRL<T>;
|
|
367
377
|
|
|
368
|
-
/**
|
|
369
|
-
|
|
378
|
+
/**
|
|
379
|
+
* An AsyncSignal holds the result of the given async function. If the function uses `track()` to
|
|
380
|
+
* track reactive state, and that state changes, the AsyncSignal is recalculated, and if the result
|
|
381
|
+
* changed, all tasks which are tracking the AsyncSignal will be re-run and all subscribers
|
|
382
|
+
* (components, tasks etc) that read the AsyncSignal will be updated.
|
|
383
|
+
*
|
|
384
|
+
* If the async function throws an error, the AsyncSignal will capture the error and set the `error`
|
|
385
|
+
* property. The error can be cleared by re-running the async function successfully.
|
|
386
|
+
*
|
|
387
|
+
* While the async function is running, the `.loading` property will be set to `true`. Once the
|
|
388
|
+
* function completes, `loading` will be set to `false`.
|
|
389
|
+
*
|
|
390
|
+
* If the value has not yet been resolved, reading the AsyncSignal will throw a Promise, which will
|
|
391
|
+
* retry the component or task once the value resolves.
|
|
392
|
+
*
|
|
393
|
+
* If the value has been resolved, but the async function is re-running, reading the AsyncSignal
|
|
394
|
+
* will subscribe to it and return the last resolved value until the new value is ready. As soon as
|
|
395
|
+
* the new value is ready, the subscribers will be updated.
|
|
396
|
+
*
|
|
397
|
+
* If the async function threw an error, reading the `.value` will throw that same error. Read from
|
|
398
|
+
* `.error` to check if there was an error.
|
|
399
|
+
*
|
|
400
|
+
* @deprecated Use `ComputedSignal` instead, it has async support now.
|
|
401
|
+
* @public
|
|
402
|
+
*/
|
|
403
|
+
export declare type AsyncSignal<T = unknown> = ComputedSignal<T>;
|
|
404
|
+
|
|
405
|
+
declare const enum AsyncSignalFlags {
|
|
406
|
+
EAGER_CLEANUP = 32,
|
|
407
|
+
CLIENT_ONLY = 64,
|
|
408
|
+
/** The compute fn is async: the async engine (jobs, loading, error) is active */
|
|
409
|
+
ASYNC_MODE = 512,
|
|
410
|
+
/** Invoke the compute fn AsyncSignal-style: pass the ComputeCtx argument, no auto-tracking */
|
|
411
|
+
CTX_ARG = 1024
|
|
370
412
|
}
|
|
371
413
|
|
|
372
|
-
/** @public */
|
|
373
|
-
export declare type AsyncComputedReturnType<T> = T extends Promise<infer T> ? AsyncComputedReadonlySignal<T> : AsyncComputedReadonlySignal<T>;
|
|
374
|
-
|
|
375
414
|
/**
|
|
376
415
|
* # ================================
|
|
377
416
|
*
|
|
378
|
-
*
|
|
417
|
+
* AsyncSignalImpl
|
|
379
418
|
*
|
|
380
419
|
* # ================================
|
|
420
|
+
*
|
|
421
|
+
* The async engine (jobs, loading, error) lives in ComputedSignalImpl; this subclass configures it
|
|
422
|
+
* from options and switches the compute invocation to CTX_ARG mode: the compute fn receives the
|
|
423
|
+
* ComputeCtx argument and tracks only via its explicit `track()` (no auto-tracking).
|
|
424
|
+
*
|
|
425
|
+
* @internal
|
|
381
426
|
*/
|
|
382
|
-
declare class
|
|
383
|
-
|
|
384
|
-
$untrackedError$: Error | null;
|
|
385
|
-
$loadingEffects$: null | Set<EffectSubscription>;
|
|
386
|
-
$errorEffects$: null | Set<EffectSubscription>;
|
|
387
|
-
$destroy$: NoSerialize<() => void> | null;
|
|
388
|
-
private $promiseValue$;
|
|
389
|
-
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
390
|
-
constructor(container: Container | null, fn: AsyncComputeQRL<T>, flags?: SignalFlags | ComputedSignalFlags);
|
|
391
|
-
/**
|
|
392
|
-
* Loading is true if the signal is still waiting for the promise to resolve, false if the promise
|
|
393
|
-
* has resolved or rejected.
|
|
394
|
-
*/
|
|
395
|
-
get loading(): boolean;
|
|
396
|
-
set untrackedLoading(value: boolean);
|
|
397
|
-
get untrackedLoading(): boolean;
|
|
398
|
-
/** The error that occurred when the signal was resolved. */
|
|
399
|
-
get error(): Error | null;
|
|
400
|
-
set untrackedError(value: Error | null);
|
|
401
|
-
get untrackedError(): Error | null;
|
|
402
|
-
invalidate(): void;
|
|
403
|
-
$computeIfNeeded$(): boolean;
|
|
427
|
+
export declare class _AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements AsyncSignal<T> {
|
|
428
|
+
constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: number, options?: AsyncSignalOptions<T>);
|
|
404
429
|
}
|
|
405
430
|
|
|
406
|
-
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated Use `ComputedOptions` instead.
|
|
433
|
+
* @public
|
|
434
|
+
*/
|
|
435
|
+
export declare type AsyncSignalOptions<T> = ComputedOptions<T>;
|
|
407
436
|
|
|
408
437
|
/**
|
|
409
438
|
* Replace given element's props with custom types and return all props specific to the element. Use
|
|
@@ -415,7 +444,7 @@ declare type Augmented<E, A = {}> = Prettify<Filtered<E, A> & A>;
|
|
|
415
444
|
|
|
416
445
|
/** Class for back reference to the EffectSubscription */
|
|
417
446
|
declare abstract class BackRef {
|
|
418
|
-
[_EFFECT_BACK_REF]: Map<
|
|
447
|
+
[_EFFECT_BACK_REF]: Map<any, any> | undefined;
|
|
419
448
|
}
|
|
420
449
|
|
|
421
450
|
declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
@@ -431,21 +460,39 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
|
431
460
|
/** @public */
|
|
432
461
|
declare type Booleanish = boolean | `${boolean}`;
|
|
433
462
|
|
|
434
|
-
declare
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
463
|
+
declare type Capture = {
|
|
464
|
+
[K in keyof HTMLElementEventMap as `capture:${K}`]?: boolean;
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The current captured scope during QRL invocation. This is used to provide the lexical scope for
|
|
469
|
+
* QRL functions. It is used one time per invocation, synchronously, so it is safe to store it in
|
|
470
|
+
* module scope.
|
|
471
|
+
*
|
|
472
|
+
* @internal
|
|
473
|
+
*/
|
|
474
|
+
export declare let _captures: Readonly<unknown[]> | null;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Handles events for bind:checked
|
|
478
|
+
*
|
|
479
|
+
* @internal
|
|
480
|
+
*/
|
|
481
|
+
export declare function _chk(this: string | undefined, _: any, element: HTMLInputElement): void | Promise<void>;
|
|
482
|
+
|
|
483
|
+
declare const enum ChoreBits {
|
|
484
|
+
NONE = 0,
|
|
485
|
+
TASKS = 1,
|
|
486
|
+
NODE_DIFF = 2,
|
|
487
|
+
COMPONENT = 4,
|
|
488
|
+
INLINE_COMPONENT = 8,
|
|
489
|
+
NODE_PROPS = 16,
|
|
490
|
+
COMPUTE = 32,
|
|
491
|
+
CHILDREN = 64,
|
|
492
|
+
CLEANUP = 128,
|
|
493
|
+
RECONCILE = 256,
|
|
494
|
+
ERROR_WRAP = 512,
|
|
495
|
+
DIRTY_MASK = 1023
|
|
449
496
|
}
|
|
450
497
|
|
|
451
498
|
/**
|
|
@@ -461,18 +508,17 @@ declare const enum ChoreType {
|
|
|
461
508
|
export declare type ClassList = string | undefined | null | false | Record<string, boolean | string | number | null | undefined> | ClassList[];
|
|
462
509
|
|
|
463
510
|
/** @internal */
|
|
464
|
-
export declare interface ClientContainer extends
|
|
511
|
+
export declare interface ClientContainer extends _Container {
|
|
465
512
|
document: _QDocument;
|
|
466
513
|
element: _ContainerElement;
|
|
467
514
|
qContainer: string;
|
|
468
515
|
$locale$: string;
|
|
469
516
|
qManifestHash: string;
|
|
470
517
|
rootVNode: _ElementVNode;
|
|
471
|
-
$
|
|
472
|
-
|
|
473
|
-
$forwardRefs$: Array<number> | null;
|
|
474
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
518
|
+
$forwardRefs$: Array<number | string> | null;
|
|
519
|
+
vNodeLocate(id: string | Element): _VNode;
|
|
475
520
|
parseQRL<T = unknown>(qrl: string): QRL<T>;
|
|
521
|
+
$getForwardRef$(id: number): number | string | undefined;
|
|
476
522
|
$setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
|
|
477
523
|
}
|
|
478
524
|
|
|
@@ -499,11 +545,11 @@ export declare interface ClientContainer extends Container {
|
|
|
499
545
|
* step?: number;
|
|
500
546
|
* }
|
|
501
547
|
* export const Counter = component$((props: CounterProps) => {
|
|
502
|
-
* const state =
|
|
548
|
+
* const state = useSignal(props.initialValue || 0);
|
|
503
549
|
* return (
|
|
504
550
|
* <div>
|
|
505
|
-
* <span>{state.
|
|
506
|
-
* <button onClick$={() => (state.
|
|
551
|
+
* <span>{state.value}</span>
|
|
552
|
+
* <button onClick$={() => (state.value += props.step || 1)}>+</button>
|
|
507
553
|
* </div>
|
|
508
554
|
* );
|
|
509
555
|
* });
|
|
@@ -558,26 +604,84 @@ declare type ComponentChildren<PROPS> = PROPS extends {
|
|
|
558
604
|
children?: JSXChildren;
|
|
559
605
|
};
|
|
560
606
|
|
|
561
|
-
/** @public */
|
|
562
|
-
declare interface ComponentEntryStrategy {
|
|
563
|
-
type: 'component';
|
|
564
|
-
manual?: Record<string, string>;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
607
|
/** @internal */
|
|
568
608
|
export declare const componentQrl: <PROPS extends Record<any, any>>(componentQrl: QRL<OnRenderFn<PROPS>>) => Component<PROPS>;
|
|
569
609
|
|
|
570
|
-
|
|
571
|
-
|
|
610
|
+
declare type ComputeCtx<T = unknown> = {
|
|
611
|
+
/**
|
|
612
|
+
* Track reactive reads so the computation re-runs when they change. Computed functions track
|
|
613
|
+
* synchronous reads automatically, but after the first `await` the tracking context is lost, so
|
|
614
|
+
* later reads must go through `track()`.
|
|
615
|
+
*/
|
|
616
|
+
readonly track: Tracker;
|
|
617
|
+
/**
|
|
618
|
+
* Register a cleanup callback to be called when the async computation is aborted or completed.
|
|
619
|
+
* The next invocation will await the previous cleanup. If you do not want this, do not return a
|
|
620
|
+
* Promise.
|
|
621
|
+
*/
|
|
622
|
+
cleanup: (callback: () => void | Promise<void>) => void;
|
|
623
|
+
/**
|
|
624
|
+
* A lazily created AbortSignal, for interrupting the async computation when needed, e.g. when the
|
|
625
|
+
* component is unmounted or the computation is invalidated. Pass it to `fetch` or other APIs that
|
|
626
|
+
* support it to ensure that unnecessary work is not performed.
|
|
627
|
+
*/
|
|
628
|
+
readonly abortSignal: AbortSignal;
|
|
629
|
+
/** The result of the previous computation, if any */
|
|
630
|
+
readonly previous: T | undefined;
|
|
631
|
+
/** Extra info passed to `invalidate(info)` for this computation, if any. */
|
|
632
|
+
readonly info?: unknown;
|
|
633
|
+
};
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* The compute function. The context provides `track()`, `previous` (the last computed value),
|
|
637
|
+
* `info` (the argument of the `invalidate(info)` call that triggered this computation), `cleanup()`
|
|
638
|
+
* and `abortSignal`. Synchronous reactive state reads are tracked automatically, use `untrack()` to
|
|
639
|
+
* read signals without tracking. Return a `Promise` (or use an `async` function) for async values.
|
|
640
|
+
* After the first `await`, reads are no longer tracked automatically and must use `track()`.
|
|
641
|
+
*
|
|
642
|
+
* @public
|
|
643
|
+
*/
|
|
644
|
+
export declare type ComputedFn<T> = (ctx: ComputeCtx) => ValueOrPromise<T>;
|
|
572
645
|
|
|
573
646
|
/** @public */
|
|
574
|
-
export declare interface ComputedOptions {
|
|
647
|
+
export declare interface ComputedOptions<T = unknown> {
|
|
575
648
|
serializationStrategy?: SerializationStrategy;
|
|
576
|
-
container?:
|
|
649
|
+
container?: _Container;
|
|
650
|
+
/** Like useSignal's `initial`; prevents the throw on first read when uninitialized */
|
|
651
|
+
initial?: Awaited<T> | (() => Awaited<T>);
|
|
652
|
+
/**
|
|
653
|
+
* Maximum number of concurrent computations. Use `0` for unlimited.
|
|
654
|
+
*
|
|
655
|
+
* Defaults to `1`.
|
|
656
|
+
*/
|
|
657
|
+
concurrency?: number;
|
|
658
|
+
/**
|
|
659
|
+
* When subscribers drop to 0, run cleanup in the next tick, instead of waiting for the function
|
|
660
|
+
* inputs to change.
|
|
661
|
+
*
|
|
662
|
+
* Defaults to `false`, meaning cleanup happens only when inputs change.
|
|
663
|
+
*/
|
|
664
|
+
eagerCleanup?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* When true, the async computation is postponed to the browser. On SSR, the signal remains
|
|
667
|
+
* INVALID and does not execute the function. On the client, it will compute on first read.
|
|
668
|
+
*
|
|
669
|
+
* Defaults to `false`.
|
|
670
|
+
*/
|
|
671
|
+
clientOnly?: boolean;
|
|
672
|
+
/**
|
|
673
|
+
* Maximum time in milliseconds to wait for the async computation to complete. If exceeded, the
|
|
674
|
+
* computation is aborted and an error is thrown.
|
|
675
|
+
*
|
|
676
|
+
* If `0`, no timeout is applied.
|
|
677
|
+
*
|
|
678
|
+
* Defaults to `0`.
|
|
679
|
+
*/
|
|
680
|
+
timeout?: number;
|
|
577
681
|
}
|
|
578
682
|
|
|
579
683
|
/** @public */
|
|
580
|
-
export declare type ComputedReturnType<T> =
|
|
684
|
+
export declare type ComputedReturnType<T> = ComputedSignal<Awaited<T>>;
|
|
581
685
|
|
|
582
686
|
/**
|
|
583
687
|
* A computed signal is a signal which is calculated from other signals. When the signals change,
|
|
@@ -586,54 +690,182 @@ export declare type ComputedReturnType<T> = T extends Promise<any> ? never : Com
|
|
|
586
690
|
*
|
|
587
691
|
* @public
|
|
588
692
|
*/
|
|
589
|
-
export declare interface ComputedSignal<T> extends
|
|
693
|
+
export declare interface ComputedSignal<T> extends Signal<T> {
|
|
694
|
+
/** @deprecated Use `trigger()` instead */
|
|
695
|
+
force(): void;
|
|
696
|
+
/** Use this to force recalculation. */
|
|
697
|
+
invalidate(): void;
|
|
590
698
|
/**
|
|
591
|
-
*
|
|
592
|
-
*
|
|
699
|
+
* Clear the value and recompute. Unlike `invalidate()`, readers see the loading state (reads
|
|
700
|
+
* throw the computation promise) instead of the stale value while the new value computes.
|
|
593
701
|
*/
|
|
594
|
-
|
|
702
|
+
clear(): void;
|
|
595
703
|
/**
|
|
596
|
-
*
|
|
597
|
-
*
|
|
704
|
+
* Whether the signal is currently loading. This will trigger lazy computation of the signal, so
|
|
705
|
+
* you can use it like this:
|
|
706
|
+
*
|
|
707
|
+
* ```tsx
|
|
708
|
+
* signal.pending ? <Loading /> : signal.error ? <Error /> : <Component
|
|
709
|
+
* value={signal.value} />
|
|
710
|
+
* ```
|
|
598
711
|
*/
|
|
599
|
-
|
|
712
|
+
pending: boolean;
|
|
713
|
+
/**
|
|
714
|
+
* Lets you read the pending state without subscribing to `.pending` updates. It also triggers
|
|
715
|
+
* lazy computation of the signal.
|
|
716
|
+
*
|
|
717
|
+
* Setting it will trigger listeners for `.pending`.
|
|
718
|
+
*/
|
|
719
|
+
untrackedPending: boolean;
|
|
720
|
+
/** @deprecated Use `pending` instead */
|
|
721
|
+
loading: boolean;
|
|
722
|
+
/** @deprecated Use `untrackedPending` instead */
|
|
723
|
+
untrackedLoading: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* The error that occurred while computing the signal, if any, including synchronous throws. This
|
|
726
|
+
* will be cleared when the signal is successfully computed. It also triggers lazy computation of
|
|
727
|
+
* the signal. While the error is set, reading `.value` throws it.
|
|
728
|
+
*/
|
|
729
|
+
error: Error | undefined;
|
|
730
|
+
/**
|
|
731
|
+
* Lets you read the error state without subscribing to `.error` updates. It also triggers lazy
|
|
732
|
+
* computation of the signal.
|
|
733
|
+
*
|
|
734
|
+
* Setting it will trigger listeners for `.error`.
|
|
735
|
+
*/
|
|
736
|
+
untrackedError: Error | undefined;
|
|
737
|
+
/** A promise that resolves when the value is computed or rejected. */
|
|
738
|
+
promise(): Promise<void>;
|
|
739
|
+
/** Abort the current computation and run cleanups if needed. */
|
|
740
|
+
abort(reason?: any): void;
|
|
741
|
+
/**
|
|
742
|
+
* Use this to force recalculation. If you pass `info`, it will be provided to the calculation
|
|
743
|
+
* function.
|
|
744
|
+
*/
|
|
745
|
+
invalidate(info?: unknown): void;
|
|
600
746
|
}
|
|
601
747
|
|
|
602
748
|
declare const enum ComputedSignalFlags {
|
|
603
|
-
|
|
604
|
-
|
|
749
|
+
INVALID = 1,
|
|
750
|
+
RUN_EFFECTS = 2,
|
|
751
|
+
PRESERVE_ON_SEQ_CLEANUP = 4
|
|
605
752
|
}
|
|
606
753
|
|
|
607
754
|
/**
|
|
608
755
|
* A signal which is computed from other signals.
|
|
609
756
|
*
|
|
610
|
-
*
|
|
757
|
+
* Sync compute functions resolve synchronously and every read they perform is auto-tracked. When
|
|
758
|
+
* the compute function turns out to be async (it returned a promise), the signal lazily switches on
|
|
759
|
+
* the async engine — jobs, `loading`, `error` — giving it the same API as an AsyncSignal.
|
|
760
|
+
* Auto-tracking only covers reads before the first await point (the invoke context is lost after
|
|
761
|
+
* it); later reads must use the ComputeCtx `track()`.
|
|
611
762
|
*/
|
|
612
|
-
declare class ComputedSignalImpl<T, S extends
|
|
763
|
+
declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> extends SignalImpl<T> implements BackRef {
|
|
613
764
|
/**
|
|
614
765
|
* The compute function is stored here.
|
|
615
766
|
*
|
|
616
|
-
*
|
|
617
|
-
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous).
|
|
767
|
+
* Sync computed functions must be executed synchronously (because of this we need to eagerly
|
|
768
|
+
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous).
|
|
618
769
|
*/
|
|
619
770
|
$computeQrl$: S;
|
|
620
|
-
$flags$:
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
771
|
+
$flags$: number;
|
|
772
|
+
[_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
|
|
773
|
+
$untrackedPending$: boolean | undefined;
|
|
774
|
+
$untrackedError$: Error | undefined;
|
|
775
|
+
$current$: Job<T> | null | undefined;
|
|
776
|
+
$jobs$: Job<T>[] | undefined;
|
|
777
|
+
$concurrency$: number | undefined;
|
|
778
|
+
$timeoutMs$: number | undefined;
|
|
779
|
+
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
780
|
+
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
781
|
+
$computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
782
|
+
$info$: unknown | undefined;
|
|
783
|
+
$infoVersion$: number | undefined;
|
|
784
|
+
constructor(container: _Container | null, fn: S, flags?: number, options?: ComputedOptions<T>);
|
|
785
|
+
/** Clear the value so readers see the loading state, then recompute. */
|
|
786
|
+
clear(): void;
|
|
787
|
+
invalidate(info?: unknown): void;
|
|
625
788
|
/**
|
|
626
|
-
*
|
|
627
|
-
*
|
|
789
|
+
* Read the value, subscribing if in a tracking context. Triggers computation if needed.
|
|
790
|
+
*
|
|
791
|
+
* Setting the value will mark the signal as not loading and clear any error, and prevent any
|
|
792
|
+
* pending computations from writing their results.
|
|
793
|
+
*
|
|
794
|
+
* If you want to set the value without affecting loading or error state, set `untrackedValue`
|
|
795
|
+
* instead and make sure to trigger effects manually if needed.
|
|
796
|
+
*
|
|
797
|
+
* If you want to abort pending computations when setting, you have to call `abort()` manually.
|
|
628
798
|
*/
|
|
629
|
-
|
|
799
|
+
get value(): T;
|
|
800
|
+
set value(value: T);
|
|
630
801
|
get untrackedValue(): T;
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
802
|
+
set untrackedValue(value: T);
|
|
803
|
+
/**
|
|
804
|
+
* Loading is true if the signal is still waiting for the promise to resolve, false if the promise
|
|
805
|
+
* has resolved or rejected (or the compute function is synchronous).
|
|
806
|
+
*
|
|
807
|
+
* Accessing `.pending` will trigger computation if needed, since it's often used like
|
|
808
|
+
*
|
|
809
|
+
* ```ts
|
|
810
|
+
* signal.pending ? <Loading /> : signal.value
|
|
811
|
+
* ```
|
|
812
|
+
*/
|
|
813
|
+
get pending(): boolean;
|
|
814
|
+
set untrackedPending(value: boolean);
|
|
815
|
+
get untrackedPending(): boolean;
|
|
816
|
+
/** @deprecated Use `pending` instead */
|
|
817
|
+
get loading(): boolean;
|
|
818
|
+
/** @deprecated Use `untrackedPending` instead */
|
|
819
|
+
get untrackedLoading(): boolean;
|
|
820
|
+
set untrackedLoading(value: boolean);
|
|
821
|
+
/**
|
|
822
|
+
* The error the compute function threw or rejected with.
|
|
823
|
+
*
|
|
824
|
+
* Accessing .error will trigger computation if needed, since it's often used like
|
|
825
|
+
*
|
|
826
|
+
* ```ts
|
|
827
|
+
* signal.error ? <Failed /> : signal.value
|
|
828
|
+
* ```
|
|
829
|
+
*/
|
|
830
|
+
get error(): Error | undefined;
|
|
831
|
+
set untrackedError(value: Error | undefined);
|
|
832
|
+
get untrackedError(): Error | undefined;
|
|
833
|
+
$setInvalid$(allowRecalc: boolean): void;
|
|
834
|
+
/** Abort the current computation and run cleanups if needed. */
|
|
835
|
+
abort(reason?: any): void;
|
|
836
|
+
/** Schedule eager cleanup on next macro task if no subscribers remain. */
|
|
837
|
+
$scheduleEagerCleanup$(): void;
|
|
838
|
+
/** Returns a promise resolves when the signal finished computing. */
|
|
839
|
+
promise(): Promise<void>;
|
|
840
|
+
/** Run the computation if needed */
|
|
841
|
+
$computeIfNeeded$(): void;
|
|
842
|
+
/**
|
|
843
|
+
* Invoke the compute fn with the ComputeCtx argument. CTX_ARG signals (createAsyncQrl,
|
|
844
|
+
* useResource$) only track via its explicit track(). Computeds auto-track every synchronous read
|
|
845
|
+
* instead; after the first await they must use the explicit track() too.
|
|
846
|
+
*/
|
|
847
|
+
$invokeComputeFn$(fn: Function, job: Job<T>): T | Promise<T>;
|
|
848
|
+
/** Start an async computation (the async engine; assumes the INVALID flag is set) */
|
|
849
|
+
$computeAsync$(): void;
|
|
850
|
+
$runComputation$(running: Job<T>): Promise<void>;
|
|
851
|
+
/** Await the computation and publish its result, error, and loading transitions. */
|
|
852
|
+
$settleComputation$(running: Job<T>, compute: () => ValueOrPromise<T>): Promise<void>;
|
|
853
|
+
/**
|
|
854
|
+
* Sets the error from the given job. We only accept errors from the current job and we ignore
|
|
855
|
+
* AbortErrors.
|
|
856
|
+
*/
|
|
857
|
+
$setError$(job: Job<T>, error: Error): void;
|
|
858
|
+
/** Called after SSR/unmount */
|
|
859
|
+
$destroy$(): Promise<void>;
|
|
860
|
+
private $hasSubscribers$;
|
|
861
|
+
$requestCleanups$(job: Job<T>, reason?: any): void;
|
|
862
|
+
/** Run a job's cleanup callbacks, returning a promise when any of them are async. */
|
|
863
|
+
$runCleanupCallbacks$(job: Job<T>): Promise<void> | undefined;
|
|
864
|
+
/** Clean up and trigger signal compute once complete */
|
|
865
|
+
$runCleanups$(job: Job<T>): Promise<void> | undefined;
|
|
634
866
|
}
|
|
635
867
|
|
|
636
|
-
declare type ComputeQRL<T> =
|
|
868
|
+
declare type ComputeQRL<T> = _QRLInternal<ComputedFn<T>>;
|
|
637
869
|
|
|
638
870
|
/** @internal */
|
|
639
871
|
export declare const _CONST_PROPS: unique symbol;
|
|
@@ -647,24 +879,31 @@ export declare const _CONST_PROPS: unique symbol;
|
|
|
647
879
|
* - `VNode` and `ISsrNode`: Either a component or `<Signal>`
|
|
648
880
|
* - `Signal2`: A derived signal which contains a computation function.
|
|
649
881
|
*/
|
|
650
|
-
declare type Consumer =
|
|
882
|
+
declare type Consumer = _Task | _VNode | SignalImpl | ISsrNode;
|
|
651
883
|
|
|
652
|
-
|
|
884
|
+
/** @internal */
|
|
885
|
+
export declare interface _Container {
|
|
653
886
|
readonly $version$: string;
|
|
654
|
-
readonly $scheduler$: Scheduler;
|
|
655
887
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
888
|
+
$rootContainer$: _Container | null;
|
|
889
|
+
$isOutOfOrderSegment$: boolean;
|
|
656
890
|
readonly $locale$: string;
|
|
657
891
|
readonly $getObjectById$: (id: number | string) => any;
|
|
658
892
|
readonly $serverData$: Record<string, any>;
|
|
893
|
+
readonly $instanceHash$: string | null;
|
|
659
894
|
$currentUniqueId$: number;
|
|
660
895
|
$buildBase$: string | null;
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
896
|
+
$renderPromise$: Promise<void> | null;
|
|
897
|
+
$resolveRenderPromise$: (() => void) | null;
|
|
898
|
+
$pendingCount$: number;
|
|
899
|
+
$checkPendingCount$(): void;
|
|
900
|
+
handleError(err: any, $host$: _HostElement | null): void;
|
|
901
|
+
getParentHost(host: _HostElement): _HostElement | null;
|
|
902
|
+
setContext<T>(host: _HostElement, context: ContextId<T>, value: T): void;
|
|
903
|
+
resolveContext<T>(host: _HostElement, contextId: ContextId<T>): T | undefined;
|
|
904
|
+
setHostProp<T>(host: _HostElement, name: string, value: T): void;
|
|
905
|
+
getHostProp<T>(host: _HostElement, name: string): T | null;
|
|
906
|
+
$appendStyle$(content: string, styleId: string, host: _HostElement, scoped: boolean): void;
|
|
668
907
|
/**
|
|
669
908
|
* When component is about to be executed, it may add/remove children. This can cause problems
|
|
670
909
|
* with the projection because deleting content will prevent the projection references from
|
|
@@ -673,7 +912,7 @@ declare interface Container {
|
|
|
673
912
|
*
|
|
674
913
|
* @param renderHost - Host element to ensure projection is resolved.
|
|
675
914
|
*/
|
|
676
|
-
ensureProjectionResolved(host:
|
|
915
|
+
ensureProjectionResolved(host: _HostElement): void;
|
|
677
916
|
serializationCtxFactory(NodeConstructor: {
|
|
678
917
|
new (...rest: any[]): {
|
|
679
918
|
__brand__: 'SsrNode';
|
|
@@ -685,6 +924,13 @@ declare interface Container {
|
|
|
685
924
|
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
|
|
686
925
|
}
|
|
687
926
|
|
|
927
|
+
declare const enum ContainerDataProcessState {
|
|
928
|
+
NotStarted = 0,
|
|
929
|
+
ProcessingVNode = 1,
|
|
930
|
+
ProcessingState = 2,
|
|
931
|
+
ProcessingStateDone = 3
|
|
932
|
+
}
|
|
933
|
+
|
|
688
934
|
/** @internal */
|
|
689
935
|
export declare interface _ContainerElement extends HTMLElement {
|
|
690
936
|
qContainer?: ClientContainer;
|
|
@@ -702,6 +948,9 @@ export declare interface _ContainerElement extends HTMLElement {
|
|
|
702
948
|
qVNodeRefs?: Map<number, Element | _ElementVNode>;
|
|
703
949
|
/** String from `<script type="qwik/vnode">` tag. */
|
|
704
950
|
qVnodeData?: string;
|
|
951
|
+
qDestroy?: () => void;
|
|
952
|
+
/** Segment-local strings from `<script type="qwik/vnode" q:r="...">` tags. */
|
|
953
|
+
qSegmentVnodeData?: Map<string, string>;
|
|
705
954
|
}
|
|
706
955
|
|
|
707
956
|
/**
|
|
@@ -802,19 +1051,13 @@ export declare interface CorePlatform {
|
|
|
802
1051
|
* @param symbol - The name of the symbol to import.
|
|
803
1052
|
* @returns A promise that resolves to the imported symbol.
|
|
804
1053
|
*/
|
|
805
|
-
importSymbol: (containerEl: Element | undefined, url: string | URL | undefined | null, symbol: string) => ValueOrPromise<
|
|
1054
|
+
importSymbol: (containerEl: Element | undefined, url: string | URL | undefined | null, symbol: string) => ValueOrPromise<unknown>;
|
|
806
1055
|
/**
|
|
807
1056
|
* Perform operation on next request-animation-frame.
|
|
808
1057
|
*
|
|
809
1058
|
* @param fn - The function to call when the next animation frame is ready.
|
|
810
1059
|
*/
|
|
811
1060
|
raf: (fn: () => any) => Promise<any>;
|
|
812
|
-
/**
|
|
813
|
-
* Perform operation on next tick.
|
|
814
|
-
*
|
|
815
|
-
* @param fn - The function to call when the tick is ready.
|
|
816
|
-
*/
|
|
817
|
-
nextTick: (fn: () => any) => Promise<any>;
|
|
818
1061
|
/**
|
|
819
1062
|
* Retrieve chunk name for the symbol.
|
|
820
1063
|
*
|
|
@@ -836,20 +1079,8 @@ export declare interface CorrectedToggleEvent extends Event {
|
|
|
836
1079
|
readonly prevState: 'open' | 'closed';
|
|
837
1080
|
}
|
|
838
1081
|
|
|
839
|
-
/**
|
|
840
|
-
* Create an async computed signal which is calculated from the given QRL. A computed signal is a
|
|
841
|
-
* signal which is calculated from other signals or async operation. When the signals change, the
|
|
842
|
-
* computed signal is recalculated.
|
|
843
|
-
*
|
|
844
|
-
* The QRL must be a function which returns the value of the signal. The function must not have side
|
|
845
|
-
* effects, and it can be async.
|
|
846
|
-
*
|
|
847
|
-
* @public
|
|
848
|
-
*/
|
|
849
|
-
export declare const createAsyncComputed$: <T>(qrl: () => Promise<T>, options?: ComputedOptions) => AsyncComputedReturnType<T>;
|
|
850
|
-
|
|
851
1082
|
/** @internal */
|
|
852
|
-
export declare const
|
|
1083
|
+
export declare const createAsyncQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: AsyncSignalOptions<T>) => _AsyncSignalImpl<T>;
|
|
853
1084
|
|
|
854
1085
|
/**
|
|
855
1086
|
* Create a computed signal which is calculated from the given QRL. A computed signal is a signal
|
|
@@ -857,16 +1088,17 @@ export declare const createAsyncComputedQrl: <T>(qrl: QRL<(ctx: AsyncComputedCtx
|
|
|
857
1088
|
* recalculated.
|
|
858
1089
|
*
|
|
859
1090
|
* The QRL must be a function which returns the value of the signal. The function must not have side
|
|
860
|
-
* effects
|
|
861
|
-
*
|
|
862
|
-
*
|
|
1091
|
+
* effects. Every synchronous signal or store read is tracked automatically; reads after the first
|
|
1092
|
+
* `await` must use the `track()` provided on the context argument. When the function is async, the
|
|
1093
|
+
* returned signal exposes the async API (`.pending`, `.error`, `.promise()`), and reading an
|
|
1094
|
+
* unresolved `.value` throws the computation promise.
|
|
863
1095
|
*
|
|
864
1096
|
* @public
|
|
865
1097
|
*/
|
|
866
|
-
export declare const createComputed$: <T>(qrl: () => T
|
|
1098
|
+
export declare const createComputed$: <T>(qrl: (ctx: ComputeCtx) => ValueOrPromise<T>, options?: ComputedOptions<T>) => ComputedReturnType<T>;
|
|
867
1099
|
|
|
868
1100
|
/** @internal */
|
|
869
|
-
export declare const createComputedQrl: <T>(qrl: QRL<
|
|
1101
|
+
export declare const createComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions<T>) => ComputedSignalImpl<T>;
|
|
870
1102
|
|
|
871
1103
|
/**
|
|
872
1104
|
* Create a context ID to be used in your application. The name should be written with no spaces.
|
|
@@ -920,18 +1152,23 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: Compute
|
|
|
920
1152
|
*/
|
|
921
1153
|
export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
|
|
922
1154
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1155
|
+
/** @internal */
|
|
1156
|
+
export declare function _createDeserializeContainer(stateData: unknown[]): DeserializeContainer;
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* Creates a QRL instance to represent a lazily loaded value. Normally this is a function, but it
|
|
1160
|
+
* can be any value.
|
|
1161
|
+
*
|
|
1162
|
+
* When the value is a function, calling the returned qrl will load the underlying code when
|
|
1163
|
+
* invoked, and call it with the captured scope. This always returns a promise since the code may
|
|
1164
|
+
* not be loaded yet.
|
|
1165
|
+
*
|
|
1166
|
+
* To get the underlying function without invoking it, await `qrl.resolve()` and then `qrl.resolved`
|
|
1167
|
+
* holds the loaded function, wrapped with the captured scope.
|
|
1168
|
+
*
|
|
1169
|
+
* @internal
|
|
1170
|
+
*/
|
|
1171
|
+
export declare const _createQRL: <TYPE>(chunk: string | null, symbol: string, symbolRef?: null | ValueOrPromise<TYPE>, symbolFn?: null | (() => Promise<Record<string, TYPE>>), captures?: QrlCaptures, container?: _Container) => _QRLInternal<TYPE>;
|
|
935
1172
|
|
|
936
1173
|
/**
|
|
937
1174
|
* Create a signal that holds a custom serializable value. See {@link useSerializer$} for more
|
|
@@ -959,6 +1196,9 @@ export declare const createSignal: {
|
|
|
959
1196
|
<T>(value: T): Signal<T>;
|
|
960
1197
|
};
|
|
961
1198
|
|
|
1199
|
+
/** @internal */
|
|
1200
|
+
export declare function _createStore<T extends object>(container: _Container | null | undefined, obj: T, flags: _StoreFlags): T;
|
|
1201
|
+
|
|
962
1202
|
/** @public */
|
|
963
1203
|
export declare interface CSSProperties extends CSS_2.Properties<string | number>, CSS_2.PropertiesHyphen<string | number> {
|
|
964
1204
|
/**
|
|
@@ -971,34 +1211,34 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
|
|
|
971
1211
|
[v: `--${string}`]: string | number | undefined;
|
|
972
1212
|
}
|
|
973
1213
|
|
|
974
|
-
/** @
|
|
975
|
-
declare
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
$state$: B | undefined;
|
|
981
|
-
$destroy$: NoSerialize<() => void> | null;
|
|
1214
|
+
/** @internal */
|
|
1215
|
+
export declare const _delay: (timeout: number) => Promise<unknown>;
|
|
1216
|
+
|
|
1217
|
+
declare class DeleteOperation {
|
|
1218
|
+
target: Element | Text;
|
|
1219
|
+
constructor(target: Element | Text);
|
|
982
1220
|
}
|
|
983
1221
|
|
|
984
1222
|
/**
|
|
985
|
-
* Deserialize data from string
|
|
1223
|
+
* Deserialize data from string.
|
|
986
1224
|
*
|
|
987
1225
|
* @param rawStateData - Data to deserialize
|
|
988
|
-
* @param element - Container element
|
|
989
1226
|
* @internal
|
|
990
1227
|
*/
|
|
991
|
-
export declare function _deserialize(rawStateData: string
|
|
1228
|
+
export declare function _deserialize<T>(rawStateData: string): Promise<T>;
|
|
992
1229
|
|
|
993
1230
|
declare interface DeserializeContainer {
|
|
994
1231
|
$getObjectById$: (id: number | string) => unknown;
|
|
1232
|
+
$getForwardRef$: (id: number) => number | string | undefined;
|
|
1233
|
+
$pendingStoreTargets$?: Map<object, {
|
|
1234
|
+
t: number;
|
|
1235
|
+
v: unknown;
|
|
1236
|
+
}>;
|
|
995
1237
|
element: HTMLElement | null;
|
|
996
1238
|
getSyncFn: (id: number) => (...args: unknown[]) => unknown;
|
|
997
1239
|
$state$?: unknown[];
|
|
998
1240
|
$storeProxyMap$: ObjToProxyMap;
|
|
999
|
-
$forwardRefs$: Array<number> | null;
|
|
1000
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
1001
|
-
readonly $scheduler$: Scheduler | null;
|
|
1241
|
+
$forwardRefs$: Array<number | string> | null;
|
|
1002
1242
|
}
|
|
1003
1243
|
|
|
1004
1244
|
/** @public */
|
|
@@ -1014,7 +1254,7 @@ export declare interface DOMAttributes<EL extends Element> extends DOMAttributes
|
|
|
1014
1254
|
class?: ClassList | Signal<ClassList> | undefined;
|
|
1015
1255
|
}
|
|
1016
1256
|
|
|
1017
|
-
declare interface DOMAttributesBase<EL extends Element> extends QwikIntrinsicAttributes, PreventDefault, StopPropagation, RefAttr<EL> {
|
|
1257
|
+
declare interface DOMAttributesBase<EL extends Element> extends QwikIntrinsicAttributes, PreventDefault, StopPropagation, Capture, Passive, RefAttr<EL> {
|
|
1018
1258
|
dangerouslySetInnerHTML?: string | undefined;
|
|
1019
1259
|
}
|
|
1020
1260
|
|
|
@@ -1025,68 +1265,81 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1025
1265
|
qManifestHash: string;
|
|
1026
1266
|
rootVNode: _ElementVNode;
|
|
1027
1267
|
document: _QDocument;
|
|
1028
|
-
$journal$: VNodeJournal;
|
|
1029
|
-
renderDone: Promise<void> | null;
|
|
1030
|
-
$rawStateData$: unknown[];
|
|
1031
1268
|
$storeProxyMap$: ObjToProxyMap;
|
|
1032
1269
|
$qFuncs$: Array<(...args: unknown[]) => unknown>;
|
|
1033
1270
|
$instanceHash$: string;
|
|
1034
|
-
$forwardRefs$: Array<number> | null;
|
|
1035
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
1271
|
+
$forwardRefs$: Array<number | string> | null;
|
|
1036
1272
|
vNodeLocate: (id: string | Element) => _VNode;
|
|
1273
|
+
$containerDataProcessState$: ContainerDataProcessState;
|
|
1274
|
+
$containerStateReadyCallbacks$: Array<() => void> | undefined;
|
|
1275
|
+
$containerStateDataState$: unknown;
|
|
1276
|
+
private $rawStateData$;
|
|
1037
1277
|
private $stateData$;
|
|
1278
|
+
private $rootForwardRefs$;
|
|
1038
1279
|
private $styleIds$;
|
|
1039
|
-
private $renderCount$;
|
|
1040
1280
|
constructor(element: _ContainerElement);
|
|
1041
|
-
$
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1281
|
+
$processContainerData$(): Generator<void, void, void>;
|
|
1282
|
+
/** Tear down this container so stale references fail gracefully. */
|
|
1283
|
+
$destroy$(): void;
|
|
1284
|
+
/**
|
|
1285
|
+
* The first time we render we need to hoist the styles. (Meaning we need to move all styles from
|
|
1286
|
+
* component inline to <head>)
|
|
1287
|
+
*
|
|
1288
|
+
* We bulk move all of the styles, because the expensive part is for the browser to recompute the
|
|
1289
|
+
* styles, (not the actual DOM manipulation.) By moving all of them at once we can minimize the
|
|
1290
|
+
* reflow.
|
|
1291
|
+
*/
|
|
1292
|
+
$hoistStyles$(): void;
|
|
1293
|
+
$setRawState$(id: number, vParent: _VNode): void;
|
|
1294
|
+
parseQRL<T = unknown>(qrlStr: string): QRL<T>;
|
|
1295
|
+
handleError(err: any, host: _VNode | null): void;
|
|
1296
|
+
setContext<T>(host: _VNode, context: ContextId<T>, value: T): void;
|
|
1297
|
+
resolveContext<T>(host: _VNode, contextId: ContextId<T>): T | undefined;
|
|
1298
|
+
getParentHost(host: _VNode): _VNode | null;
|
|
1299
|
+
setHostProp<T>(host: _HostElement, name: string, value: T): void;
|
|
1300
|
+
getHostProp<T>(host: _HostElement, name: string): T | null;
|
|
1051
1301
|
ensureProjectionResolved(vNode: _VirtualVNode): void;
|
|
1052
1302
|
$getObjectById$: (id: number | string) => unknown;
|
|
1303
|
+
$getForwardRef$(id: number): number | string | undefined;
|
|
1053
1304
|
getSyncFn(id: number): (...args: unknown[]) => unknown;
|
|
1054
1305
|
$appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
|
|
1055
1306
|
/** Set the server data for the Qwik Router. */
|
|
1056
1307
|
private $setServerData$;
|
|
1057
|
-
/**
|
|
1058
|
-
* Schedule the initial QRLs to be resolved.
|
|
1059
|
-
*
|
|
1060
|
-
* Schedules the QRLs that are defined in the state data as `PreloadQRL`.
|
|
1061
|
-
*
|
|
1062
|
-
* This is done because when computed and custom serializer QRLs are called they need QRL to work.
|
|
1063
|
-
* If the QRL is not resolved at this point, it will be resolved by throwing a promise and
|
|
1064
|
-
* rerunning the whole wrapping function again. We want to avoid that, because it means that the
|
|
1065
|
-
* function can execute twice.
|
|
1066
|
-
*
|
|
1067
|
-
* ```ts
|
|
1068
|
-
* useVisibleTask$(() => {
|
|
1069
|
-
* runHeavyLogic(); // This will be called again if the QRL of `computedOrCustomSerializer` is not resolved.
|
|
1070
|
-
* console.log(computedOrCustomSerializer.value); // Throw a promise if QRL not resolved and execute visible task again.
|
|
1071
|
-
* });
|
|
1072
|
-
* ```
|
|
1073
|
-
*/
|
|
1074
|
-
private $scheduleInitialQRLs$;
|
|
1075
1308
|
}
|
|
1076
1309
|
export { DomContainer }
|
|
1077
1310
|
export { DomContainer as _DomContainer }
|
|
1078
1311
|
|
|
1079
1312
|
declare type DomRef = {
|
|
1080
|
-
$ssrNode$:
|
|
1313
|
+
$ssrNode$: ISsrNode;
|
|
1081
1314
|
};
|
|
1082
1315
|
|
|
1083
1316
|
/** @internal */
|
|
1084
1317
|
export declare const _dumpState: (state: unknown[], color?: boolean, prefix?: string, limit?: number | null) => string;
|
|
1085
1318
|
|
|
1319
|
+
/** @internal */
|
|
1320
|
+
export declare const _eaC: (props: EachProps<any>) => JSXNode<unknown>;
|
|
1321
|
+
|
|
1322
|
+
/** @public @experimental */
|
|
1323
|
+
export declare const Each: EachComponent;
|
|
1324
|
+
|
|
1325
|
+
declare type EachComponent = <T, ITEM extends JSXOutput = JSXOutput>(props: PublicProps<EachProps<T, ITEM>>, key: string | null, flags: number, dev?: DevJSX) => JSXOutput;
|
|
1326
|
+
|
|
1327
|
+
declare interface EachProps<T, ITEM extends JSXOutput = JSXOutput> {
|
|
1328
|
+
items: readonly T[];
|
|
1329
|
+
item$: QRL<(item: T, index: number) => ITEM>;
|
|
1330
|
+
key$: QRL<(item: T, index: number) => string>;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
/** @internal */
|
|
1334
|
+
export declare const _eaT: ({ track }: TaskCtx) => Promise<void>;
|
|
1335
|
+
|
|
1086
1336
|
/** @internal */
|
|
1087
1337
|
export declare const _EFFECT_BACK_REF: unique symbol;
|
|
1088
1338
|
|
|
1089
|
-
declare
|
|
1339
|
+
declare type EffectBackRef = SignalImpl | StoreTarget | PropsProxy;
|
|
1340
|
+
|
|
1341
|
+
/** @internal */
|
|
1342
|
+
export declare const enum _EffectProperty {
|
|
1090
1343
|
COMPONENT = ":",
|
|
1091
1344
|
VNODE = "."
|
|
1092
1345
|
}
|
|
@@ -1127,42 +1380,29 @@ declare const enum EffectProperty {
|
|
|
1127
1380
|
* - `EffectProperty.COMPONENT` if component
|
|
1128
1381
|
* - `EffectProperty.VNODE` if VNode
|
|
1129
1382
|
*/
|
|
1130
|
-
declare
|
|
1131
|
-
Consumer
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
Set<
|
|
1136
|
-
|
|
1137
|
-
_SubscriptionData | null
|
|
1138
|
-
];
|
|
1383
|
+
declare class EffectSubscription {
|
|
1384
|
+
consumer: Consumer;
|
|
1385
|
+
property: _EffectProperty | string;
|
|
1386
|
+
backRef: Set<EffectBackRef> | null;
|
|
1387
|
+
data: _SubscriptionData | null;
|
|
1388
|
+
constructor(consumer: Consumer, property: _EffectProperty | string, backRef?: Set<EffectBackRef> | null, data?: _SubscriptionData | null);
|
|
1389
|
+
}
|
|
1139
1390
|
|
|
1140
1391
|
/** @internal */
|
|
1141
|
-
export declare
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
/////////////// 3 - Next sibling
|
|
1150
|
-
_VNode | null | undefined,
|
|
1151
|
-
/// 4 - First child - undefined if children need to be materialize
|
|
1152
|
-
_VNode | null | undefined,
|
|
1153
|
-
Element,
|
|
1154
|
-
//////////////////// 6 - Element
|
|
1155
|
-
string | undefined,
|
|
1156
|
-
(string | null)[]
|
|
1157
|
-
] & {
|
|
1158
|
-
__brand__: 'ElementVNode';
|
|
1159
|
-
};
|
|
1392
|
+
export declare const _ELEMENT_SEQ = "q:seq";
|
|
1393
|
+
|
|
1394
|
+
/** @internal */
|
|
1395
|
+
export declare class _ElementVNode extends _VirtualVNode {
|
|
1396
|
+
node: Element;
|
|
1397
|
+
elementName: string | undefined;
|
|
1398
|
+
constructor(key: string | null, flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined, node: Element, elementName: string | undefined);
|
|
1399
|
+
}
|
|
1160
1400
|
|
|
1161
1401
|
/** @internal */
|
|
1162
1402
|
export declare const _EMPTY_ARRAY: any[];
|
|
1163
1403
|
|
|
1164
|
-
/** @
|
|
1165
|
-
declare
|
|
1404
|
+
/** @internal */
|
|
1405
|
+
export declare const _EMPTY_OBJ: Record<string, any>;
|
|
1166
1406
|
|
|
1167
1407
|
/** @public */
|
|
1168
1408
|
export declare interface ErrorBoundaryStore {
|
|
@@ -1170,15 +1410,14 @@ export declare interface ErrorBoundaryStore {
|
|
|
1170
1410
|
}
|
|
1171
1411
|
|
|
1172
1412
|
/** @public */
|
|
1173
|
-
export declare const event$: <T>(qrl: T) =>
|
|
1413
|
+
export declare const event$: <T>(qrl: T) => QRL<T>;
|
|
1174
1414
|
|
|
1175
1415
|
declare type EventCorrectionMap = {
|
|
1176
1416
|
auxclick: PointerEvent;
|
|
1177
|
-
beforetoggle: CorrectedToggleEvent;
|
|
1178
1417
|
click: PointerEvent;
|
|
1179
1418
|
dblclick: PointerEvent;
|
|
1180
1419
|
input: InputEvent;
|
|
1181
|
-
|
|
1420
|
+
qvisible: QwikVisibleEvent;
|
|
1182
1421
|
};
|
|
1183
1422
|
|
|
1184
1423
|
declare type EventFromName<T extends string> = LcEvent<T>;
|
|
@@ -1197,6 +1436,9 @@ declare type EventQRL<T extends string = AllEventKeys> = QRL<EventHandler<EventF
|
|
|
1197
1436
|
/** @internal */
|
|
1198
1437
|
export declare const eventQrl: <T>(qrl: QRL<T>) => QRL<T>;
|
|
1199
1438
|
|
|
1439
|
+
/** @internal */
|
|
1440
|
+
export declare function _executeSsrChores(container: SSRContainer, ssrNode: ISsrNode): ValueOrPromise<void>;
|
|
1441
|
+
|
|
1200
1442
|
declare type FilterBase<T> = {
|
|
1201
1443
|
[K in keyof T as K extends string ? K extends Uppercase<K> ? never : any extends T[K] ? never : false extends IsAcceptableDOMValue<T[K]> ? never : IsReadOnlyKey<T, K> extends true ? never : K extends UnwantedKeys ? never : K : never]?: T[K];
|
|
1202
1444
|
};
|
|
@@ -1209,6 +1451,13 @@ declare type Filtered<T, A = {}> = {
|
|
|
1209
1451
|
/** @internal */
|
|
1210
1452
|
export declare const _fnSignal: <T extends (...args: any) => any>(fn: T, args: Parameters<T>, fnStr?: string) => WrappedSignalImpl<any>;
|
|
1211
1453
|
|
|
1454
|
+
/**
|
|
1455
|
+
* Force a store to recompute and schedule effects.
|
|
1456
|
+
*
|
|
1457
|
+
* @public
|
|
1458
|
+
*/
|
|
1459
|
+
export declare const forceStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => void;
|
|
1460
|
+
|
|
1212
1461
|
/** @public */
|
|
1213
1462
|
export declare const Fragment: FunctionComponent<{
|
|
1214
1463
|
children?: any;
|
|
@@ -1227,16 +1476,30 @@ export declare type FunctionComponent<P = unknown> = {
|
|
|
1227
1476
|
}['renderFn'];
|
|
1228
1477
|
|
|
1229
1478
|
/** @internal */
|
|
1230
|
-
export declare const
|
|
1479
|
+
export declare const _getAsyncLocalStorage: () => (new <T>() => AsyncLocalStorage<T>) | undefined;
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Returns the client build manifest, which includes the mappings from symbols to bundles, the
|
|
1483
|
+
* bundlegraph etc.
|
|
1484
|
+
*
|
|
1485
|
+
* @public
|
|
1486
|
+
*/
|
|
1487
|
+
export declare const getClientManifest: () => ServerQwikManifest | undefined;
|
|
1488
|
+
|
|
1489
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1490
|
+
export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1231
1491
|
|
|
1232
1492
|
/** @internal */
|
|
1233
|
-
export declare const
|
|
1493
|
+
export declare const _getContextContainer: () => _Container | undefined;
|
|
1234
1494
|
|
|
1235
1495
|
/** @internal */
|
|
1236
1496
|
export declare const _getContextEvent: () => unknown;
|
|
1237
1497
|
|
|
1498
|
+
/** @internal */
|
|
1499
|
+
export declare const _getContextHostElement: () => _HostElement | undefined;
|
|
1500
|
+
|
|
1238
1501
|
/** @public */
|
|
1239
|
-
declare function getDomContainer(element: Element
|
|
1502
|
+
declare function getDomContainer(element: Element): ClientContainer;
|
|
1240
1503
|
export { getDomContainer as _getDomContainer }
|
|
1241
1504
|
export { getDomContainer }
|
|
1242
1505
|
|
|
@@ -1265,22 +1528,17 @@ export declare function getLocale(defaultLocale?: string): string;
|
|
|
1265
1528
|
export declare const getPlatform: () => CorePlatform;
|
|
1266
1529
|
|
|
1267
1530
|
/** @internal */
|
|
1268
|
-
export declare function _getQContainerElement(element: Element
|
|
1531
|
+
export declare function _getQContainerElement(element: Element): Element | null;
|
|
1269
1532
|
|
|
1270
|
-
/** @
|
|
1271
|
-
declare
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
};
|
|
1276
|
-
location: 'head' | 'body';
|
|
1277
|
-
}
|
|
1533
|
+
/** @internal */
|
|
1534
|
+
export declare function _getSubscriber(effect: Consumer, prop: _EffectProperty | string, data?: _SubscriptionData): EffectSubscription;
|
|
1535
|
+
|
|
1536
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1537
|
+
export declare const _getVarProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1278
1538
|
|
|
1279
1539
|
/**
|
|
1280
|
-
* The legacy transform, used
|
|
1281
|
-
*
|
|
1282
|
-
*
|
|
1283
|
-
* Also note that this disables optimizations.
|
|
1540
|
+
* The legacy transform, used by some JSX transpilers. The optimizer normally replaces this with
|
|
1541
|
+
* optimized calls, with the same caveat as `jsx()`.
|
|
1284
1542
|
*
|
|
1285
1543
|
* @public
|
|
1286
1544
|
*/
|
|
@@ -1288,18 +1546,28 @@ declare function h<TYPE extends string | FunctionComponent<PROPS>, PROPS extends
|
|
|
1288
1546
|
export { h as createElement }
|
|
1289
1547
|
export { h }
|
|
1290
1548
|
|
|
1291
|
-
/**
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1549
|
+
/**
|
|
1550
|
+
* @returns True if the store has effects for the given prop
|
|
1551
|
+
* @internal
|
|
1552
|
+
*/
|
|
1553
|
+
export declare const _hasStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => boolean;
|
|
1295
1554
|
|
|
1296
|
-
/**
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1555
|
+
/**
|
|
1556
|
+
* HMR event handler. The host VNode is captured at registration time via QRL captures.
|
|
1557
|
+
*
|
|
1558
|
+
* When called by the qwikloader or the test dispatch, `this` is the serialized captures string
|
|
1559
|
+
* which we deserialize to get the host VNode. When called through `_qDispatch` (client-rendered),
|
|
1560
|
+
* `_captures` is already set by `ensureQrlCaptures` in the QRL call chain.
|
|
1561
|
+
*
|
|
1562
|
+
* @internal
|
|
1563
|
+
*/
|
|
1564
|
+
export declare const _hmr: (this: string | undefined, event: CustomEvent<{
|
|
1565
|
+
files: string[];
|
|
1566
|
+
t: number;
|
|
1567
|
+
}>, element: Element) => void | Promise<void>;
|
|
1301
1568
|
|
|
1302
|
-
|
|
1569
|
+
/** @internal */
|
|
1570
|
+
export declare type _HostElement = _VNode | ISsrNode;
|
|
1303
1571
|
|
|
1304
1572
|
/** @public */
|
|
1305
1573
|
declare type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {});
|
|
@@ -1358,7 +1626,7 @@ declare interface HTMLAttributesBase extends AriaAttributes {
|
|
|
1358
1626
|
declare type HTMLCrossOriginAttribute = 'anonymous' | 'use-credentials' | '' | undefined;
|
|
1359
1627
|
|
|
1360
1628
|
/** @public */
|
|
1361
|
-
declare interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> {
|
|
1629
|
+
export declare interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> {
|
|
1362
1630
|
}
|
|
1363
1631
|
|
|
1364
1632
|
/** @public */
|
|
@@ -1410,17 +1678,47 @@ export declare const _IMMUTABLE: unique symbol;
|
|
|
1410
1678
|
*/
|
|
1411
1679
|
export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
|
|
1412
1680
|
|
|
1413
|
-
/**
|
|
1414
|
-
|
|
1681
|
+
/**
|
|
1682
|
+
* Inject a pre-loaded value into a signal while preserving subscriptions. Calls `invalidate({__v})`
|
|
1683
|
+
* so the compute function reads the value from `info`, then triggers an immediate synchronous
|
|
1684
|
+
* compute via the private `$computeIfNeeded$()` method (which is mangled in core builds, so callers
|
|
1685
|
+
* from other packages must go through this helper).
|
|
1686
|
+
*
|
|
1687
|
+
* @internal
|
|
1688
|
+
*/
|
|
1689
|
+
export declare const _injectAsyncSignalValue: (signal: ComputedSignal<unknown>, value: unknown) => void;
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* Create an inlined QRL. This is mostly useful on the server side for serialization.
|
|
1693
|
+
*
|
|
1694
|
+
* @param symbol - The object/function to register, or `null` to retrieve a previously registered
|
|
1695
|
+
* one by hash
|
|
1696
|
+
* @param symbolName - The name of the symbol.
|
|
1697
|
+
* @param lexicalScopeCapture - A set of lexically scoped variables to capture.
|
|
1698
|
+
* @public
|
|
1699
|
+
*/
|
|
1700
|
+
export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1415
1701
|
|
|
1416
1702
|
/** @internal */
|
|
1417
|
-
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?:
|
|
1703
|
+
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1418
1704
|
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1705
|
+
declare class InsertOrMoveOperation {
|
|
1706
|
+
target: Element | Text;
|
|
1707
|
+
parent: Element;
|
|
1708
|
+
beforeTarget: Element | Text | null;
|
|
1709
|
+
constructor(target: Element | Text, parent: Element, beforeTarget: Element | Text | null);
|
|
1422
1710
|
}
|
|
1423
1711
|
|
|
1712
|
+
/** @internal */
|
|
1713
|
+
declare type InternalServerComponent<PROPS = unknown> = FunctionComponent<PROPS> & {
|
|
1714
|
+
[InternalServerComponentSymbol]: InternalServerComponentHandler;
|
|
1715
|
+
};
|
|
1716
|
+
|
|
1717
|
+
/** @internal */
|
|
1718
|
+
declare type InternalServerComponentHandler = (ssr: SSRContainer, jsx: JSXNodeInternal, options: SSRRenderJSXOptions, enqueue: (value: StackValue) => void) => ValueOrPromise<void>;
|
|
1719
|
+
|
|
1720
|
+
declare const InternalServerComponentSymbol: unique symbol;
|
|
1721
|
+
|
|
1424
1722
|
/**
|
|
1425
1723
|
* These are the HTML tags with handlers allowing plain callbacks, to be used for the JSX interface
|
|
1426
1724
|
*
|
|
@@ -1444,26 +1742,24 @@ declare type IntrinsicSVGElements = {
|
|
|
1444
1742
|
[K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: LenientSVGProps<SVGElementTagNameMap[K]>;
|
|
1445
1743
|
};
|
|
1446
1744
|
|
|
1745
|
+
/**
|
|
1746
|
+
* Call a function with the given InvokeContext and given arguments.
|
|
1747
|
+
*
|
|
1748
|
+
* @internal
|
|
1749
|
+
*/
|
|
1750
|
+
export declare function _invoke<FN extends (...args: any[]) => any>(this: unknown, context: InvokeContext | undefined, fn: FN, ...args: Parameters<FN>): ReturnType<FN>;
|
|
1751
|
+
|
|
1447
1752
|
/** The shared state during an invoke() call */
|
|
1448
1753
|
declare interface InvokeContext {
|
|
1449
|
-
$url$: URL | undefined;
|
|
1450
|
-
/** The next available index for the sequentialScope array */
|
|
1451
|
-
$i$: number;
|
|
1452
1754
|
/** The Virtual parent component for the current component code */
|
|
1453
|
-
$hostElement$:
|
|
1454
|
-
/** The current DOM element */
|
|
1455
|
-
$element$: Element | undefined;
|
|
1755
|
+
$hostElement$: _HostElement | undefined;
|
|
1456
1756
|
/** The event we're currently handling */
|
|
1457
1757
|
$event$: PossibleEvents | undefined;
|
|
1458
|
-
/** The QRL function we're currently executing */
|
|
1459
|
-
$qrl$: QRL | undefined;
|
|
1460
1758
|
$effectSubscriber$: EffectSubscription | undefined;
|
|
1461
1759
|
$locale$: string | undefined;
|
|
1462
|
-
$container$:
|
|
1760
|
+
$container$: _Container | undefined;
|
|
1463
1761
|
}
|
|
1464
1762
|
|
|
1465
|
-
declare type InvokeTuple = [Element, Event, URL?];
|
|
1466
|
-
|
|
1467
1763
|
declare type IsAcceptableDOMValue<T> = T extends boolean | number | string | null | undefined ? ((...args: any[]) => any) extends T ? false : true : false;
|
|
1468
1764
|
|
|
1469
1765
|
declare type IsAny<T> = 0 extends T & 1 ? true : false;
|
|
@@ -1489,11 +1785,11 @@ export declare const isSignal: (value: any) => value is Signal<unknown>;
|
|
|
1489
1785
|
/** @internal */
|
|
1490
1786
|
export declare interface ISsrComponentFrame {
|
|
1491
1787
|
componentNode: ISsrNode;
|
|
1788
|
+
slots: (string | JSXChildren)[];
|
|
1492
1789
|
scopedStyleIds: Set<string>;
|
|
1493
1790
|
projectionScopedStyle: string | null;
|
|
1494
1791
|
projectionComponentFrame: ISsrComponentFrame | null;
|
|
1495
1792
|
projectionDepth: number;
|
|
1496
|
-
releaseUnclaimedProjections(unclaimedProjections: (ISsrComponentFrame | JSXChildren | string)[]): void;
|
|
1497
1793
|
consumeChildrenForSlot(projectionNode: ISsrNode, slotName: string): JSXChildren | null;
|
|
1498
1794
|
distributeChildrenIntoSlots(children: JSXChildren, parentScopedStyle: string | null, parentComponentFrame: ISsrComponentFrame | null): void;
|
|
1499
1795
|
hasSlot(slotName: string): boolean;
|
|
@@ -1501,27 +1797,76 @@ export declare interface ISsrComponentFrame {
|
|
|
1501
1797
|
|
|
1502
1798
|
declare interface ISsrNode {
|
|
1503
1799
|
id: string;
|
|
1504
|
-
|
|
1505
|
-
|
|
1800
|
+
flags: SsrNodeFlags;
|
|
1801
|
+
dirty: ChoreBits;
|
|
1802
|
+
parentComponent: ISsrNode | null;
|
|
1803
|
+
children: ISsrNode[] | null;
|
|
1804
|
+
vnodeData: VNodeData;
|
|
1805
|
+
currentFile: string | null;
|
|
1806
|
+
readonly [_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | null;
|
|
1506
1807
|
setProp(name: string, value: any): void;
|
|
1507
1808
|
getProp(name: string): any;
|
|
1508
1809
|
removeProp(name: string): void;
|
|
1509
1810
|
addChild(child: ISsrNode): void;
|
|
1811
|
+
setTreeNonUpdatable(): void;
|
|
1510
1812
|
}
|
|
1511
1813
|
|
|
1814
|
+
/** @internal */
|
|
1815
|
+
export declare const _isStore: (value: object) => boolean;
|
|
1816
|
+
|
|
1512
1817
|
/** @internal */
|
|
1513
1818
|
export declare function _isStringifiable(value: unknown): value is _Stringifiable;
|
|
1514
1819
|
|
|
1820
|
+
/** @internal */
|
|
1821
|
+
export declare const _isTask: (value: any) => value is _Task;
|
|
1822
|
+
|
|
1823
|
+
/** @internal */
|
|
1824
|
+
declare interface IStreamHandler {
|
|
1825
|
+
flush(): ValueOrPromise<void>;
|
|
1826
|
+
waitForPendingFlush(): ValueOrPromise<void>;
|
|
1827
|
+
streamBlockStart(): void;
|
|
1828
|
+
streamBlockEnd(): ValueOrPromise<void>;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
/** Retains job metadata and also serves as the argument for CTX_ARG compute functions */
|
|
1832
|
+
declare class Job<T> implements ComputeCtx<T> {
|
|
1833
|
+
readonly $signal$: ComputedSignalImpl<T, any>;
|
|
1834
|
+
/** First holds the compute promise and then the cleanup promise */
|
|
1835
|
+
$promise$: Promise<void> | null | void;
|
|
1836
|
+
$cleanupRequested$: boolean;
|
|
1837
|
+
$canWrite$: boolean;
|
|
1838
|
+
$track$: Tracker | undefined;
|
|
1839
|
+
$cleanups$: Parameters<ComputeCtx<T>['cleanup']>[0][] | undefined;
|
|
1840
|
+
$abortController$: AbortController | undefined;
|
|
1841
|
+
info: unknown;
|
|
1842
|
+
$infoVersion$: number | undefined;
|
|
1843
|
+
constructor($signal$: ComputedSignalImpl<T, any>, info: unknown, $infoVersion$: number | undefined);
|
|
1844
|
+
get track(): Tracker;
|
|
1845
|
+
get abortSignal(): AbortSignal;
|
|
1846
|
+
/** Backward compatible cache method for resource */
|
|
1847
|
+
cache(): void;
|
|
1848
|
+
get previous(): T | undefined;
|
|
1849
|
+
cleanup(callback: () => void): void;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1515
1852
|
/**
|
|
1853
|
+
* Used by the JSX transpilers to create a JSXNode. Note that the optimizer will normally not use
|
|
1854
|
+
* this, instead using _jsxSplit and _jsxSorted directly.
|
|
1855
|
+
*
|
|
1856
|
+
* The optimizer will also replace all `jsx()` calls with the more optimized versions.
|
|
1857
|
+
*
|
|
1858
|
+
* The exception is when the props are not a literal object, which can only happen when the `jsx`
|
|
1859
|
+
* call is written directly.
|
|
1860
|
+
*
|
|
1516
1861
|
* @public
|
|
1517
|
-
* Used by the JSX transpilers to create a JSXNode.
|
|
1518
|
-
* Note that the optimizer will not use this, instead using _jsxSplit and _jsxSorted directly.
|
|
1519
1862
|
*/
|
|
1520
|
-
declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null) => JSXNode<T>;
|
|
1521
|
-
export { jsx }
|
|
1522
|
-
export { jsx as jsxs }
|
|
1863
|
+
export declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
|
|
1523
1864
|
|
|
1524
|
-
/**
|
|
1865
|
+
/**
|
|
1866
|
+
* @deprecated
|
|
1867
|
+
* @internal
|
|
1868
|
+
* No longer used since v2
|
|
1869
|
+
*/
|
|
1525
1870
|
export declare const _jsxBranch: <T>(input?: T) => T | undefined;
|
|
1526
1871
|
|
|
1527
1872
|
/** @internal @deprecated v1 compat */
|
|
@@ -1530,8 +1875,12 @@ export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) =>
|
|
|
1530
1875
|
/** @public */
|
|
1531
1876
|
export declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
1532
1877
|
|
|
1533
|
-
/**
|
|
1534
|
-
|
|
1878
|
+
/**
|
|
1879
|
+
* Alias of `jsx` for development purposes.
|
|
1880
|
+
*
|
|
1881
|
+
* @public
|
|
1882
|
+
*/
|
|
1883
|
+
export declare const jsxDEV: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
|
|
1535
1884
|
|
|
1536
1885
|
declare interface JsxDevOpts {
|
|
1537
1886
|
fileName: string;
|
|
@@ -1539,6 +1888,14 @@ declare interface JsxDevOpts {
|
|
|
1539
1888
|
columnNumber: number;
|
|
1540
1889
|
}
|
|
1541
1890
|
|
|
1891
|
+
declare type JSXDocumentEvents = {
|
|
1892
|
+
[K in keyof QwikDocumentEventMap as `document:on${PascalCaseName<K>}$`]: QwikDocumentEventMap[K];
|
|
1893
|
+
};
|
|
1894
|
+
|
|
1895
|
+
declare type JSXElementEvents = {
|
|
1896
|
+
[K in keyof QwikHTMLElementEventMap as `on${PascalCaseName<K>}$`]: QwikHTMLElementEventMap[K];
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1542
1899
|
/**
|
|
1543
1900
|
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
1544
1901
|
*
|
|
@@ -1552,15 +1909,68 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
|
|
|
1552
1909
|
dev?: DevJSX;
|
|
1553
1910
|
}
|
|
1554
1911
|
|
|
1912
|
+
declare const enum JSXNodeFlags {
|
|
1913
|
+
None = 0,
|
|
1914
|
+
StaticSubtree = 2,
|
|
1915
|
+
HasCapturedProps = 4
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
declare class JSXNodeImpl<T = unknown> implements JSXNodeInternal<T> {
|
|
1919
|
+
type: T;
|
|
1920
|
+
children: JSXChildren;
|
|
1921
|
+
flags: JSXNodeFlags;
|
|
1922
|
+
toSort: boolean;
|
|
1923
|
+
key: string | null;
|
|
1924
|
+
varProps: Props;
|
|
1925
|
+
constProps: Props | null;
|
|
1926
|
+
dev?: DevJSX & {
|
|
1927
|
+
stack: string | undefined;
|
|
1928
|
+
};
|
|
1929
|
+
_proxy: Props | null;
|
|
1930
|
+
constructor(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren, flags: JSXNodeFlags, key: string | number | null | undefined, toSort?: boolean, dev?: DevJSX);
|
|
1931
|
+
get props(): T extends FunctionComponent<infer PROPS> ? PROPS : Props;
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1555
1934
|
/**
|
|
1556
1935
|
* The internal representation of a JSX Node.
|
|
1557
1936
|
*
|
|
1558
1937
|
* @internal
|
|
1559
1938
|
*/
|
|
1560
1939
|
export declare interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1940
|
+
/** The type of node */
|
|
1941
|
+
type: T;
|
|
1942
|
+
/** Do the varProps need sorting */
|
|
1943
|
+
toSort: boolean;
|
|
1944
|
+
/** The key property */
|
|
1945
|
+
key: string | null;
|
|
1946
|
+
/** Flags */
|
|
1947
|
+
flags: JSXNodeFlags;
|
|
1948
|
+
/**
|
|
1949
|
+
* Props that are not guaranteed shallow equal across runs.
|
|
1950
|
+
*
|
|
1951
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1952
|
+
*
|
|
1953
|
+
* Does not contain `children` or `key`.
|
|
1954
|
+
*
|
|
1955
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
1956
|
+
*/
|
|
1957
|
+
varProps: Props;
|
|
1958
|
+
/**
|
|
1959
|
+
* Props that will be shallow equal across runs. Does not contain any props that are in varProps.
|
|
1960
|
+
*
|
|
1961
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1962
|
+
*
|
|
1963
|
+
* Does not contain `children` or `key`.
|
|
1964
|
+
*
|
|
1965
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
1966
|
+
*/
|
|
1967
|
+
constProps: Props | null;
|
|
1968
|
+
/** The children of the node */
|
|
1969
|
+
children: JSXChildren;
|
|
1970
|
+
/** Filename etc for debugging */
|
|
1971
|
+
dev?: DevJSX & {
|
|
1972
|
+
stack: string | undefined;
|
|
1973
|
+
};
|
|
1564
1974
|
}
|
|
1565
1975
|
|
|
1566
1976
|
/**
|
|
@@ -1576,6 +1986,13 @@ export declare const _jsxQ: (type: any, mutable: any, immutable: any, children:
|
|
|
1576
1986
|
/** @internal @deprecated v1 compat */
|
|
1577
1987
|
export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) => JSXNode<any>;
|
|
1578
1988
|
|
|
1989
|
+
/**
|
|
1990
|
+
* Alias of `jsx` to support JSX syntax.
|
|
1991
|
+
*
|
|
1992
|
+
* @public
|
|
1993
|
+
*/
|
|
1994
|
+
export declare const jsxs: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null, _isStatic?: boolean, dev?: JsxDevOpts) => JSXNode<T>;
|
|
1995
|
+
|
|
1579
1996
|
/**
|
|
1580
1997
|
* Create a JSXNode with the properties fully split into variable and constant parts, and children
|
|
1581
1998
|
* separated out. Furthermore, the varProps must be a sorted object, that is, the keys must be
|
|
@@ -1586,7 +2003,7 @@ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: an
|
|
|
1586
2003
|
* still update the attribute on the vnode.
|
|
1587
2004
|
*
|
|
1588
2005
|
* @param type - The JSX type
|
|
1589
|
-
* @param varProps - The properties of the tag, sorted, excluding children,
|
|
2006
|
+
* @param varProps - The properties of the tag, sorted, excluding children, key and any constProps
|
|
1590
2007
|
* @param constProps - The properties of the tag that are known to be constant references and don't
|
|
1591
2008
|
* need checking for changes on re-render
|
|
1592
2009
|
* @param children - JSX children. Any `children` in the props objects are ignored.
|
|
@@ -1596,13 +2013,13 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1596
2013
|
|
|
1597
2014
|
/**
|
|
1598
2015
|
* Create a JSXNode, with the properties split into variable and constant parts, but the variable
|
|
1599
|
-
* parts could include keys from constProps
|
|
2016
|
+
* parts could include keys from `constProps`, as well as `key` and `children`.
|
|
1600
2017
|
*
|
|
1601
|
-
* The constant parts are expected to be the same
|
|
1602
|
-
*
|
|
1603
|
-
* still update the attribute on the vnode.
|
|
2018
|
+
* `constProps` cannot include `key` or `children`. The constant parts are expected to be the same
|
|
2019
|
+
* on every render, and are not checked for changes. This means that they are constant scalars or
|
|
2020
|
+
* refs. When the ref is a signal or a store, it can still update the attribute on the vnode.
|
|
1604
2021
|
*
|
|
1605
|
-
* If `children`
|
|
2022
|
+
* If `children` or `key` are defined, any `children`/`key` in the props will be ignored.
|
|
1606
2023
|
*
|
|
1607
2024
|
* @param type - The tag type
|
|
1608
2025
|
* @param varProps - The properties of the tag that could change, including children
|
|
@@ -1610,11 +2027,15 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1610
2027
|
* for changes on re-render
|
|
1611
2028
|
* @internal
|
|
1612
2029
|
*/
|
|
1613
|
-
export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key
|
|
2030
|
+
export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key?: string | number | null, dev?: DevJSX) => JSXNodeInternal<T>;
|
|
1614
2031
|
|
|
1615
2032
|
/** @public */
|
|
1616
2033
|
export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
|
|
1617
2034
|
|
|
2035
|
+
declare type JSXWindowEvents = {
|
|
2036
|
+
[K in keyof QwikWindowEventMap as `window:on${PascalCaseName<K>}$`]: QwikWindowEventMap[K];
|
|
2037
|
+
};
|
|
2038
|
+
|
|
1618
2039
|
/**
|
|
1619
2040
|
* The names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are
|
|
1620
2041
|
* PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`)
|
|
@@ -1623,6 +2044,27 @@ export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyo
|
|
|
1623
2044
|
*/
|
|
1624
2045
|
export declare type KnownEventNames = LiteralUnion<AllEventKeys, string>;
|
|
1625
2046
|
|
|
2047
|
+
/**
|
|
2048
|
+
* Shared lazy-loading reference that holds module loading metadata. Multiple QRLs pointing to the
|
|
2049
|
+
* same chunk+symbol can share a single LazyRef, differing only in their captured scope.
|
|
2050
|
+
*/
|
|
2051
|
+
declare class LazyRef<TYPE = unknown> {
|
|
2052
|
+
readonly $chunk$: string | null;
|
|
2053
|
+
readonly $symbol$: string;
|
|
2054
|
+
readonly $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>);
|
|
2055
|
+
$ref$?: (null | ValueOrPromise<TYPE>) | undefined;
|
|
2056
|
+
$container$: _Container | undefined;
|
|
2057
|
+
$hasMovedCaptures$?: boolean;
|
|
2058
|
+
dev?: QRLDev | null | undefined;
|
|
2059
|
+
qrls?: Set<any>;
|
|
2060
|
+
constructor($chunk$: string | null, $symbol$: string, $symbolFn$: undefined | null | (() => Promise<Record<string, TYPE>>), $ref$?: (null | ValueOrPromise<TYPE>) | undefined, container?: _Container | null);
|
|
2061
|
+
/** We don't read hash very often so let's not allocate a string for every QRL */
|
|
2062
|
+
get $hash$(): string;
|
|
2063
|
+
$setRef$(ref: ValueOrPromise<TYPE>): void;
|
|
2064
|
+
/** Load the raw module export without capture binding. */
|
|
2065
|
+
$load$(): ValueOrPromise<TYPE>;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
1626
2068
|
declare type LcEvent<T extends string, C extends string = Lowercase<T>> = C extends keyof AllEventsMap ? AllEventsMap[C] : Event;
|
|
1627
2069
|
|
|
1628
2070
|
declare type LcEventNameMap = {
|
|
@@ -1666,6 +2108,28 @@ declare interface LenientSVGProps<T extends Element> extends SVGAttributes, DOMA
|
|
|
1666
2108
|
*/
|
|
1667
2109
|
declare type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1668
2110
|
|
|
2111
|
+
/** @internal */
|
|
2112
|
+
export declare const _mapApp_findIndx: <T>(array: (T | null)[], key: string, start: number) => number;
|
|
2113
|
+
|
|
2114
|
+
/** @internal */
|
|
2115
|
+
export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start: number) => T | null;
|
|
2116
|
+
|
|
2117
|
+
/** @internal */
|
|
2118
|
+
export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Mark this signal as owned outside of the component that read it.
|
|
2122
|
+
*
|
|
2123
|
+
* Externally owned signals are preserved when found in a component's sequential scope during
|
|
2124
|
+
* component cleanup.
|
|
2125
|
+
*
|
|
2126
|
+
* @internal
|
|
2127
|
+
*/
|
|
2128
|
+
export declare const _markSignalAsExternallyOwned: (signal: ComputedSignal<unknown>) => void;
|
|
2129
|
+
|
|
2130
|
+
declare class MaybeAsyncSignal {
|
|
2131
|
+
}
|
|
2132
|
+
|
|
1669
2133
|
declare type MediaSpecialAttrs = {
|
|
1670
2134
|
crossOrigin?: HTMLCrossOriginAttribute;
|
|
1671
2135
|
};
|
|
@@ -1706,16 +2170,19 @@ export declare type NativeUIEvent = UIEvent;
|
|
|
1706
2170
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
1707
2171
|
export declare type NativeWheelEvent = WheelEvent;
|
|
1708
2172
|
|
|
2173
|
+
/** @internal */
|
|
2174
|
+
export declare function _newInvokeContext(locale?: string, hostElement?: _HostElement, event?: Exclude<PossibleEvents, typeof RenderEvent>): InvokeContext;
|
|
2175
|
+
|
|
1709
2176
|
declare interface NodePropData {
|
|
1710
2177
|
$scopedStyleIdPrefix$: string | null;
|
|
1711
2178
|
$isConst$: boolean;
|
|
1712
2179
|
}
|
|
1713
2180
|
|
|
1714
2181
|
/** @internal */
|
|
1715
|
-
export declare const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?:
|
|
2182
|
+
export declare const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1716
2183
|
|
|
1717
2184
|
/** @internal */
|
|
1718
|
-
export declare const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalScopeCapture?:
|
|
2185
|
+
export declare const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1719
2186
|
|
|
1720
2187
|
/**
|
|
1721
2188
|
* Returned type of the `noSerialize()` function. It will be TYPE or undefined.
|
|
@@ -1782,6 +2249,31 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1782
2249
|
strategy?: VisibleTaskStrategy;
|
|
1783
2250
|
}
|
|
1784
2251
|
|
|
2252
|
+
/** @internal */
|
|
2253
|
+
declare type OutOfOrderRevealBoundary = {
|
|
2254
|
+
attrs: string;
|
|
2255
|
+
showFallback: boolean;
|
|
2256
|
+
resolve: () => void;
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
/** @internal */
|
|
2260
|
+
declare class OutOfOrderRevealCoordinator<ITEM extends RevealItemLike = RevealItemLike> {
|
|
2261
|
+
private id;
|
|
2262
|
+
private collapsed;
|
|
2263
|
+
private count;
|
|
2264
|
+
private pendingItems;
|
|
2265
|
+
private orderCode;
|
|
2266
|
+
constructor(id: number, order: RevealOrder, collapsed: boolean);
|
|
2267
|
+
register(registration: RevealRegistrationLike<ITEM>): OutOfOrderRevealBoundary;
|
|
2268
|
+
canReveal(registration: RevealRegistrationLike<ITEM>): boolean;
|
|
2269
|
+
script(): string;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
/** @internal */
|
|
2273
|
+
declare const _OWNER: unique symbol;
|
|
2274
|
+
|
|
2275
|
+
declare type PascalCaseName<T extends string> = T extends keyof LcEventNameMap ? LcEventNameMap[T] : Capitalize<T>;
|
|
2276
|
+
|
|
1785
2277
|
/**
|
|
1786
2278
|
* Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,
|
|
1787
2279
|
* instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization
|
|
@@ -1789,19 +2281,15 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1789
2281
|
*
|
|
1790
2282
|
* Add any multi-word event names to this list. Single word events are automatically converted.
|
|
1791
2283
|
*/
|
|
1792
|
-
declare type PascalCaseNames = 'AnimationEnd' | 'AnimationIteration' | 'AnimationStart' | 'AuxClick' | 'BeforeToggle' | 'CanPlay' | 'CanPlayThrough' | 'CompositionEnd' | 'CompositionStart' | 'CompositionUpdate' | 'ContextMenu' | 'DblClick' | 'DragEnd' | 'DragEnter' | 'DragExit' | 'DragLeave' | 'DragOver' | 'DragStart' | 'DurationChange' | 'FocusIn' | 'FocusOut' | 'FullscreenChange' | 'FullscreenError' | 'GotPointerCapture' | 'KeyDown' | 'KeyPress' | 'KeyUp' | 'LoadedData' | 'LoadedMetadata' | 'LoadEnd' | 'LoadStart' | 'LostPointerCapture' | 'MouseDown' | 'MouseEnter' | 'MouseLeave' | 'MouseMove' | 'MouseOut' | 'MouseOver' | 'MouseUp' | 'PointerCancel' | 'PointerDown' | 'PointerEnter' | 'PointerLeave' | 'PointerMove' | 'PointerOut' | 'PointerOver' | 'PointerUp' | 'QIdle' | 'QInit' | 'QSymbol' | 'QVisible' | 'RateChange' | 'RateChange' | 'SecurityPolicyViolation' | 'SelectionChange' | 'SelectStart' | 'TimeUpdate' | 'TouchCancel' | 'TouchEnd' | 'TouchMove' | 'TouchStart' | 'TransitionCancel' | 'TransitionEnd' | 'TransitionRun' | 'TransitionStart' | 'VisibilityChange' | 'VolumeChange';
|
|
2284
|
+
declare type PascalCaseNames = 'AnimationEnd' | 'AnimationIteration' | 'AnimationStart' | 'AuxClick' | 'BeforeToggle' | 'CanPlay' | 'CanPlayThrough' | 'CompositionEnd' | 'CompositionStart' | 'CompositionUpdate' | 'ContextMenu' | 'DblClick' | 'DragEnd' | 'DragEnter' | 'DragExit' | 'DragLeave' | 'DragOver' | 'DragStart' | 'DurationChange' | 'FocusIn' | 'FocusOut' | 'FullscreenChange' | 'FullscreenError' | 'GotPointerCapture' | 'KeyDown' | 'KeyPress' | 'KeyUp' | 'LoadedData' | 'LoadedMetadata' | 'LoadEnd' | 'LoadStart' | 'LostPointerCapture' | 'MouseDown' | 'MouseEnter' | 'MouseLeave' | 'MouseMove' | 'MouseOut' | 'MouseOver' | 'MouseUp' | 'PointerCancel' | 'PointerDown' | 'PointerEnter' | 'PointerLeave' | 'PointerMove' | 'PointerOut' | 'PointerOver' | 'PointerUp' | 'QIdle' | 'QInit' | 'QResume' | 'QSymbol' | 'QVisible' | 'QViewTransition' | 'RateChange' | 'RateChange' | 'SecurityPolicyViolation' | 'SelectionChange' | 'SelectStart' | 'TimeUpdate' | 'TouchCancel' | 'TouchEnd' | 'TouchMove' | 'TouchStart' | 'TransitionCancel' | 'TransitionEnd' | 'TransitionRun' | 'TransitionStart' | 'VisibilityChange' | 'VolumeChange';
|
|
1793
2285
|
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
* so this will capitalize them, and use the `LcEventNameMap` for multi-word events names.
|
|
1797
|
-
*/
|
|
1798
|
-
declare type PascalMap<M> = {
|
|
1799
|
-
[K in Extract<keyof M, string> as K extends keyof LcEventNameMap ? LcEventNameMap[K] : Capitalize<K>]: M[K];
|
|
2286
|
+
declare type Passive = {
|
|
2287
|
+
[K in keyof HTMLElementEventMap as `passive:${K}`]?: boolean;
|
|
1800
2288
|
};
|
|
1801
2289
|
|
|
1802
2290
|
declare type PopoverTargetAction = 'hide' | 'show' | 'toggle';
|
|
1803
2291
|
|
|
1804
|
-
declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent
|
|
2292
|
+
declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof TaskEvent | typeof RenderEvent;
|
|
1805
2293
|
|
|
1806
2294
|
/**
|
|
1807
2295
|
* @deprecated This is no longer needed as the preloading happens automatically in qrl-class. You
|
|
@@ -1877,7 +2365,7 @@ export declare const PrefetchServiceWorker: (opts: {
|
|
|
1877
2365
|
* @returns The preprocessed state data
|
|
1878
2366
|
* @internal
|
|
1879
2367
|
*/
|
|
1880
|
-
export declare function _preprocessState(data: unknown[], container: DeserializeContainer): void;
|
|
2368
|
+
export declare function _preprocessState(data: unknown[], container: DeserializeContainer, segmentId?: string, startIndex?: number): void;
|
|
1881
2369
|
|
|
1882
2370
|
declare type Prettify<T> = {} & {
|
|
1883
2371
|
[K in keyof T]: T[K];
|
|
@@ -1899,6 +2387,9 @@ export declare type PropFunction<T> = QRL<T>;
|
|
|
1899
2387
|
|
|
1900
2388
|
declare type Props = Record<string, unknown>;
|
|
1901
2389
|
|
|
2390
|
+
/** @internal */
|
|
2391
|
+
declare const _PROPS_HANDLER: unique symbol;
|
|
2392
|
+
|
|
1902
2393
|
/**
|
|
1903
2394
|
* Infers `Props` from the component or tag.
|
|
1904
2395
|
*
|
|
@@ -1921,7 +2412,24 @@ export declare type PropsOf<COMP> = COMP extends string ? COMP extends keyof Qwi
|
|
|
1921
2412
|
declare type PropsProxy = {
|
|
1922
2413
|
[_VAR_PROPS]: Props;
|
|
1923
2414
|
[_CONST_PROPS]: Props | null;
|
|
1924
|
-
|
|
2415
|
+
[_OWNER]: JSXNodeInternal;
|
|
2416
|
+
[_PROPS_HANDLER]: PropsProxyHandler;
|
|
2417
|
+
} & Record<string | symbol, unknown>;
|
|
2418
|
+
|
|
2419
|
+
declare class PropsProxyHandler implements ProxyHandler<any> {
|
|
2420
|
+
owner: JSXNodeImpl;
|
|
2421
|
+
$effects$: undefined | Map<string | symbol, Set<EffectSubscription>>;
|
|
2422
|
+
$container$: _Container | null;
|
|
2423
|
+
constructor(owner: JSXNodeImpl);
|
|
2424
|
+
get(_: any, prop: string | symbol): any;
|
|
2425
|
+
set(_: any, prop: string | symbol, value: any): boolean;
|
|
2426
|
+
deleteProperty(_: any, prop: string | symbol): boolean;
|
|
2427
|
+
has(_: any, prop: string | symbol): boolean;
|
|
2428
|
+
getOwnPropertyDescriptor(_: any, p: string | symbol): PropertyDescriptor | undefined;
|
|
2429
|
+
ownKeys(): string[];
|
|
2430
|
+
}
|
|
2431
|
+
|
|
2432
|
+
declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
|
|
1925
2433
|
|
|
1926
2434
|
/**
|
|
1927
2435
|
* Extends the defined component PROPS, adding the default ones (children and q:slot) and allowing
|
|
@@ -1934,6 +2442,20 @@ export declare type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<
|
|
|
1934
2442
|
/** @internal */
|
|
1935
2443
|
export declare interface _QDocument extends Document {
|
|
1936
2444
|
qVNodeData: WeakMap<Element, string>;
|
|
2445
|
+
/** True once root document VNode data has been scheduled at least once. */
|
|
2446
|
+
qVNodeDataStarted?: boolean;
|
|
2447
|
+
/** True when root, segment, and patch VNode data work is fully drained. */
|
|
2448
|
+
qVNodeDataReady?: boolean;
|
|
2449
|
+
/** Internal yielding state for queued VNode data jobs. */
|
|
2450
|
+
qVNodeDataState?: unknown;
|
|
2451
|
+
/** Callbacks waiting for root, segment, and patch VNode data work to drain. */
|
|
2452
|
+
qVNodeDataCallbacks?: Array<() => void>;
|
|
2453
|
+
/** True once the root document VNode data has been fully processed. */
|
|
2454
|
+
qVNodeDataProcessed?: boolean;
|
|
2455
|
+
/** Processes one vnode patch script. */
|
|
2456
|
+
qProcessVNodeDataPatch?: (script: Element | null) => void;
|
|
2457
|
+
/** Processes an out-of-order Suspense segment after its resolved HTML is swapped in. */
|
|
2458
|
+
qProcessOOOS?: (boundaryId: number, content: Element | null) => void;
|
|
1937
2459
|
}
|
|
1938
2460
|
|
|
1939
2461
|
/**
|
|
@@ -2037,7 +2559,7 @@ export declare interface _QDocument extends Document {
|
|
|
2037
2559
|
*
|
|
2038
2560
|
* ```
|
|
2039
2561
|
* <div q:base="/build/">
|
|
2040
|
-
* <button
|
|
2562
|
+
* <button q-e:click="./chunk-abc.js#onClick">...</button>
|
|
2041
2563
|
* </div>
|
|
2042
2564
|
* ```
|
|
2043
2565
|
*
|
|
@@ -2060,7 +2582,7 @@ export declare interface _QDocument extends Document {
|
|
|
2060
2582
|
*/
|
|
2061
2583
|
export declare type QRL<TYPE = unknown> = {
|
|
2062
2584
|
__qwik_serializable__?: any;
|
|
2063
|
-
__brand__QRL__
|
|
2585
|
+
__brand__QRL__?: TYPE;
|
|
2064
2586
|
/** Resolve the QRL and return the actual value. */
|
|
2065
2587
|
resolve(): Promise<TYPE>;
|
|
2066
2588
|
/** The resolved value, once `resolve()` returns. */
|
|
@@ -2068,7 +2590,7 @@ export declare type QRL<TYPE = unknown> = {
|
|
|
2068
2590
|
getCaptured(): unknown[] | null;
|
|
2069
2591
|
getSymbol(): string;
|
|
2070
2592
|
getHash(): string;
|
|
2071
|
-
dev
|
|
2593
|
+
dev?: QRLDev | null;
|
|
2072
2594
|
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
2073
2595
|
|
|
2074
2596
|
/**
|
|
@@ -2083,10 +2605,12 @@ export declare type QRL<TYPE = unknown> = {
|
|
|
2083
2605
|
* @public
|
|
2084
2606
|
* @see `QRL`, `$(...)`
|
|
2085
2607
|
*/
|
|
2086
|
-
export declare const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?:
|
|
2608
|
+
export declare const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?: Readonly<unknown[]> | null, stackOffset?: number) => QRL<T>;
|
|
2087
2609
|
|
|
2088
2610
|
declare type QrlArgs<T> = T extends (...args: infer ARGS) => any ? ARGS : unknown[];
|
|
2089
2611
|
|
|
2612
|
+
declare type QrlCaptures = Readonly<unknown[]> | string | null;
|
|
2613
|
+
|
|
2090
2614
|
/** @public */
|
|
2091
2615
|
declare interface QRLDev {
|
|
2092
2616
|
file: string;
|
|
@@ -2095,31 +2619,56 @@ declare interface QRLDev {
|
|
|
2095
2619
|
}
|
|
2096
2620
|
|
|
2097
2621
|
/** @internal */
|
|
2098
|
-
export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, opts: QRLDev, lexicalScopeCapture?:
|
|
2622
|
+
export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2099
2623
|
|
|
2100
2624
|
/**
|
|
2101
2625
|
* An event handler for Qwik events, can be a handler QRL or an array of handler QRLs.
|
|
2102
2626
|
*
|
|
2103
2627
|
* @public
|
|
2104
2628
|
*/
|
|
2105
|
-
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[]
|
|
2629
|
+
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[];
|
|
2106
2630
|
|
|
2107
|
-
|
|
2631
|
+
/** @internal */
|
|
2632
|
+
export declare type _QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
|
|
2108
2633
|
|
|
2109
2634
|
declare type QRLInternalMethods<TYPE> = {
|
|
2110
2635
|
readonly $chunk$: string | null;
|
|
2111
2636
|
readonly $symbol$: string;
|
|
2112
2637
|
readonly $hash$: string;
|
|
2113
|
-
|
|
2114
|
-
$
|
|
2115
|
-
|
|
2638
|
+
/** Captures are stored lazily after deserialization. */
|
|
2639
|
+
readonly $captures$?: QrlCaptures;
|
|
2640
|
+
readonly $hasMovedCaptures$?: boolean;
|
|
2641
|
+
dev?: QRLDev | null;
|
|
2642
|
+
resolve(container?: _Container): Promise<TYPE>;
|
|
2116
2643
|
resolved: undefined | TYPE;
|
|
2117
|
-
resolve(containerEl?: Element): Promise<TYPE>;
|
|
2118
2644
|
getSymbol(): string;
|
|
2119
2645
|
getHash(): string;
|
|
2120
2646
|
getCaptured(): unknown[] | null;
|
|
2121
|
-
getFn(currentCtx?: InvokeContext
|
|
2122
|
-
|
|
2647
|
+
getFn(currentCtx?: InvokeContext,
|
|
2648
|
+
/** If this returns false, the function execution will be skipped */
|
|
2649
|
+
beforeFn?: () => void | false): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE> | undefined> : unknown;
|
|
2650
|
+
$callFn$(withThis: unknown, ...args: QrlArgs<TYPE>): ValueOrPromise<QrlReturn<TYPE>>;
|
|
2651
|
+
$setDev$(dev: QRLDev | null): void;
|
|
2652
|
+
/**
|
|
2653
|
+
* "with captures" - Get a new QRL for these captures, reusing the lazy ref. It's an internal
|
|
2654
|
+
* method but we need to have a stable name because it gets called in user code by the optimizer,
|
|
2655
|
+
* after the $name$ props are mangled
|
|
2656
|
+
*/
|
|
2657
|
+
w(captures: QrlCaptures): _QRLInternal<TYPE>;
|
|
2658
|
+
/** Mark that the handler receives captures moved to its element. */
|
|
2659
|
+
m(): _QRLInternal<TYPE>;
|
|
2660
|
+
/**
|
|
2661
|
+
* "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
|
|
2662
|
+
* because it gets called in user code by the optimizer, after the $name$ props are mangled
|
|
2663
|
+
*/
|
|
2664
|
+
s(ref: ValueOrPromise<TYPE>): void;
|
|
2665
|
+
/**
|
|
2666
|
+
* Needed for deserialization and importing. We don't always have the container while creating
|
|
2667
|
+
* qrls in async sections of code
|
|
2668
|
+
*/
|
|
2669
|
+
readonly $container$?: _Container | null;
|
|
2670
|
+
/** The shared lazy-loading reference */
|
|
2671
|
+
readonly $lazy$: LazyRef<TYPE>;
|
|
2123
2672
|
};
|
|
2124
2673
|
|
|
2125
2674
|
declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
|
|
@@ -2136,50 +2685,26 @@ declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : u
|
|
|
2136
2685
|
*/
|
|
2137
2686
|
export declare const _qrlSync: <TYPE extends Function>(fn: TYPE, serializedFn?: string) => SyncQRL<TYPE>;
|
|
2138
2687
|
|
|
2688
|
+
/** @internal */
|
|
2689
|
+
export declare function _qrlToString(serializationContext: SerializationContext, qrl: _QRLInternal | SyncQRLInternal): string;
|
|
2690
|
+
|
|
2691
|
+
/** @internal */
|
|
2692
|
+
export declare function _qrlToString(serializationContext: SerializationContext, qrl: _QRLInternal | SyncQRLInternal, raw: true): [string, string, string | null];
|
|
2693
|
+
|
|
2694
|
+
/** @internal */
|
|
2695
|
+
export declare const _qrlWithChunk: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2696
|
+
|
|
2697
|
+
/** @internal */
|
|
2698
|
+
export declare const _qrlWithChunkDEV: <T = any>(chunk: string, importer: () => Promise<any>, symbol: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2699
|
+
|
|
2139
2700
|
/** @public @deprecated Use `AnimationEvent` and use the second argument to the handler function for the current event target */
|
|
2140
2701
|
export declare type QwikAnimationEvent<T = Element> = NativeAnimationEvent;
|
|
2141
2702
|
|
|
2142
|
-
/** @public */
|
|
2143
|
-
declare interface QwikAsset {
|
|
2144
|
-
/** Name of the asset */
|
|
2145
|
-
name: string | undefined;
|
|
2146
|
-
/** Size of the asset */
|
|
2147
|
-
size: number;
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2703
|
/** The Qwik DOM attributes without plain handlers, for use as function parameters @public */
|
|
2151
2704
|
export declare interface QwikAttributes<EL extends Element> extends DOMAttributesBase<EL>, QwikEvents<EL, false> {
|
|
2152
2705
|
class?: ClassList | undefined;
|
|
2153
2706
|
}
|
|
2154
2707
|
|
|
2155
|
-
/** @public */
|
|
2156
|
-
declare interface QwikBundle {
|
|
2157
|
-
/** Size of the bundle */
|
|
2158
|
-
size: number;
|
|
2159
|
-
/** Total size of this bundle's static import graph */
|
|
2160
|
-
total: number;
|
|
2161
|
-
/** Interactivity score of the bundle */
|
|
2162
|
-
interactivity?: number;
|
|
2163
|
-
/** Symbols in the bundle */
|
|
2164
|
-
symbols?: string[];
|
|
2165
|
-
/** Direct imports */
|
|
2166
|
-
imports?: string[];
|
|
2167
|
-
/** Dynamic imports */
|
|
2168
|
-
dynamicImports?: string[];
|
|
2169
|
-
/** Source files of the bundle */
|
|
2170
|
-
origins?: string[];
|
|
2171
|
-
}
|
|
2172
|
-
|
|
2173
|
-
/**
|
|
2174
|
-
* Bundle graph.
|
|
2175
|
-
*
|
|
2176
|
-
* Format: [ 'bundle-a.js', 3, 5 // Depends on 'bundle-b.js' and 'bundle-c.js' 'bundle-b.js', 5, //
|
|
2177
|
-
* Depends on 'bundle-c.js' 'bundle-c.js', ]
|
|
2178
|
-
*
|
|
2179
|
-
* @public
|
|
2180
|
-
*/
|
|
2181
|
-
declare type QwikBundleGraph = Array<string | number>;
|
|
2182
|
-
|
|
2183
2708
|
/** @public @deprecated Use `Event` and use the second argument to the handler function for the current event target. Also note that in Qwik, onInput$ with the InputEvent is the event that behaves like onChange in React. */
|
|
2184
2709
|
export declare type QwikChangeEvent<T = Element> = Event;
|
|
2185
2710
|
|
|
@@ -2189,13 +2714,19 @@ export declare type QwikClipboardEvent<T = Element> = NativeClipboardEvent;
|
|
|
2189
2714
|
/** @public @deprecated Use `CompositionEvent` and use the second argument to the handler function for the current event target */
|
|
2190
2715
|
export declare type QwikCompositionEvent<T = Element> = NativeCompositionEvent;
|
|
2191
2716
|
|
|
2192
|
-
declare type QwikCustomEvents<EL> = {};
|
|
2193
|
-
|
|
2194
2717
|
declare type QwikCustomEventsPlain<EL> = {
|
|
2195
2718
|
/** The handler */
|
|
2196
2719
|
[key: `${'document:' | 'window:' | ''}on${string}$`]: QRLEventHandlerMulti<Event, EL> | EventHandler<Event, EL>;
|
|
2197
2720
|
};
|
|
2198
2721
|
|
|
2722
|
+
declare type QwikDocumentEventMap = Omit<DocumentEventMap, keyof QwikHTMLElementEventMap> & Omit<QwikHTMLElementEventMap, 'qvisible' | 'focus' | 'blur'> & {
|
|
2723
|
+
qidle: QwikIdleEvent;
|
|
2724
|
+
qinit: QwikInitEvent;
|
|
2725
|
+
qsymbol: QwikSymbolEvent;
|
|
2726
|
+
qresume: QwikResumeEvent;
|
|
2727
|
+
qviewtransition: QwikViewTransitionEvent;
|
|
2728
|
+
};
|
|
2729
|
+
|
|
2199
2730
|
/** @public */
|
|
2200
2731
|
export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
2201
2732
|
}
|
|
@@ -2204,11 +2735,13 @@ export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
|
2204
2735
|
export declare type QwikDragEvent<T = Element> = NativeDragEvent;
|
|
2205
2736
|
|
|
2206
2737
|
/** @public */
|
|
2207
|
-
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL
|
|
2738
|
+
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL>;
|
|
2208
2739
|
|
|
2209
2740
|
/** @public @deprecated Use `FocusEvent` and use the second argument to the handler function for the current event target */
|
|
2210
2741
|
export declare type QwikFocusEvent<T = Element> = NativeFocusEvent;
|
|
2211
2742
|
|
|
2743
|
+
declare type QwikHTMLElementEventMap = Omit<HTMLElementEventMap, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
2744
|
+
|
|
2212
2745
|
/**
|
|
2213
2746
|
* The DOM props without plain handlers, for use inside functions
|
|
2214
2747
|
*
|
|
@@ -2279,78 +2812,31 @@ declare namespace QwikJSX {
|
|
|
2279
2812
|
export { QwikJSX as JSX }
|
|
2280
2813
|
export { QwikJSX }
|
|
2281
2814
|
|
|
2815
|
+
declare type QwikJSXEvents = JSXElementEvents & JSXDocumentEvents & JSXWindowEvents;
|
|
2816
|
+
|
|
2282
2817
|
/** @public @deprecated Use `KeyboardEvent` and use the second argument to the handler function for the current event target */
|
|
2283
2818
|
export declare type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;
|
|
2284
2819
|
|
|
2285
2820
|
declare type QwikKnownEvents<EL> = {
|
|
2286
|
-
[K in keyof
|
|
2821
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL>;
|
|
2287
2822
|
};
|
|
2288
2823
|
|
|
2289
2824
|
declare type QwikKnownEventsPlain<EL> = {
|
|
2290
|
-
[K in keyof
|
|
2825
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL> | EventHandler<QwikJSXEvents[K], EL>;
|
|
2291
2826
|
};
|
|
2292
2827
|
|
|
2293
|
-
/**
|
|
2294
|
-
* The metadata of the build. One of its uses is storing where QRL symbols are located.
|
|
2295
|
-
*
|
|
2296
|
-
* @public
|
|
2297
|
-
*/
|
|
2298
|
-
declare interface QwikManifest {
|
|
2299
|
-
/** Content hash of the manifest, if this changes, the code changed */
|
|
2300
|
-
manifestHash: string;
|
|
2301
|
-
/** QRL symbols */
|
|
2302
|
-
symbols: {
|
|
2303
|
-
[symbolName: string]: QwikSymbol;
|
|
2304
|
-
};
|
|
2305
|
-
/** Where QRLs are located. The key is the symbol name, the value is the bundle fileName */
|
|
2306
|
-
mapping: {
|
|
2307
|
-
[symbolName: string]: string;
|
|
2308
|
-
};
|
|
2309
|
-
/**
|
|
2310
|
-
* All code bundles, used to know the import graph. The key is the bundle fileName relative to
|
|
2311
|
-
* "build/"
|
|
2312
|
-
*/
|
|
2313
|
-
bundles: {
|
|
2314
|
-
[fileName: string]: QwikBundle;
|
|
2315
|
-
};
|
|
2316
|
-
/** All assets. The key is the fileName relative to the rootDir */
|
|
2317
|
-
assets?: {
|
|
2318
|
-
[fileName: string]: QwikAsset;
|
|
2319
|
-
};
|
|
2320
|
-
/** All bundles in a compact graph format with probabilities */
|
|
2321
|
-
bundleGraph?: QwikBundleGraph;
|
|
2322
|
-
/** The bundle graph fileName */
|
|
2323
|
-
bundleGraphAsset?: string;
|
|
2324
|
-
/** The preloader bundle fileName */
|
|
2325
|
-
preloader?: string;
|
|
2326
|
-
/** The Qwik core bundle fileName */
|
|
2327
|
-
core?: string;
|
|
2328
|
-
/** The Qwik loader bundle fileName */
|
|
2329
|
-
qwikLoader?: string;
|
|
2330
|
-
/** CSS etc to inject in the document head */
|
|
2331
|
-
injections?: GlobalInjections[];
|
|
2332
|
-
/** The version of the manifest */
|
|
2333
|
-
version: string;
|
|
2334
|
-
/** The options used to build the manifest */
|
|
2335
|
-
options?: {
|
|
2336
|
-
target?: string;
|
|
2337
|
-
buildMode?: string;
|
|
2338
|
-
entryStrategy?: {
|
|
2339
|
-
type: EntryStrategy['type'];
|
|
2340
|
-
};
|
|
2341
|
-
};
|
|
2342
|
-
/** The platform used to build the manifest */
|
|
2343
|
-
platform?: {
|
|
2344
|
-
[name: string]: string;
|
|
2345
|
-
};
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
2828
|
/** @public @deprecated Use `MouseEvent` and use the second argument to the handler function for the current event target */
|
|
2349
2829
|
export declare type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;
|
|
2350
2830
|
|
|
2351
2831
|
/** @public @deprecated Use `PointerEvent` and use the second argument to the handler function for the current event target */
|
|
2352
2832
|
export declare type QwikPointerEvent<T = Element> = NativePointerEvent;
|
|
2353
2833
|
|
|
2834
|
+
/**
|
|
2835
|
+
* Emitted by qwik-core on the container element when it resumes from a paused state. You cannot put
|
|
2836
|
+
* a Qwik event handler on the container so you must listen on the document instead. @public
|
|
2837
|
+
*/
|
|
2838
|
+
export declare type QwikResumeEvent = CustomEvent<{}>;
|
|
2839
|
+
|
|
2354
2840
|
/** @public @deprecated Use `SubmitEvent` and use the second argument to the handler function for the current event target */
|
|
2355
2841
|
export declare type QwikSubmitEvent<T = Element> = SubmitEvent;
|
|
2356
2842
|
|
|
@@ -2363,32 +2849,12 @@ export declare type QwikSVGElements = {
|
|
|
2363
2849
|
[K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<SVGElementTagNameMap[K]>;
|
|
2364
2850
|
};
|
|
2365
2851
|
|
|
2366
|
-
/** @public */
|
|
2367
|
-
declare interface QwikSymbol {
|
|
2368
|
-
origin: string;
|
|
2369
|
-
displayName: string;
|
|
2370
|
-
hash: string;
|
|
2371
|
-
canonicalFilename: string;
|
|
2372
|
-
ctxKind: 'function' | 'eventHandler';
|
|
2373
|
-
ctxName: string;
|
|
2374
|
-
/** Whether the symbol captures a variable */
|
|
2375
|
-
captures: boolean;
|
|
2376
|
-
parent: string | null;
|
|
2377
|
-
loc: [number, number];
|
|
2378
|
-
/** The parameter names if it's a function with parameters */
|
|
2379
|
-
paramNames?: string[];
|
|
2380
|
-
/** The transformed names of scoped variables, if any */
|
|
2381
|
-
captureNames?: string[];
|
|
2382
|
-
}
|
|
2383
|
-
|
|
2384
|
-
/** Emitted by qwik-loader when a module was lazily loaded @public */
|
|
2852
|
+
/** Emitted by qwik-loader on document when a module was lazily loaded @public */
|
|
2385
2853
|
export declare type QwikSymbolEvent = CustomEvent<{
|
|
2386
2854
|
symbol: string;
|
|
2387
2855
|
element: Element;
|
|
2388
2856
|
reqTime: number;
|
|
2389
2857
|
qBase?: string;
|
|
2390
|
-
qManifest?: string;
|
|
2391
|
-
qVersion?: string;
|
|
2392
2858
|
href?: string;
|
|
2393
2859
|
}>;
|
|
2394
2860
|
|
|
@@ -2402,19 +2868,33 @@ export declare type QwikTransitionEvent<T = Element> = NativeTransitionEvent;
|
|
|
2402
2868
|
export declare type QwikUIEvent<T = Element> = NativeUIEvent;
|
|
2403
2869
|
|
|
2404
2870
|
/** Emitted by qwik-core on document when the a view transition start @public */
|
|
2405
|
-
declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2871
|
+
export declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2406
2872
|
|
|
2407
|
-
/**
|
|
2873
|
+
/**
|
|
2874
|
+
* Handled by qwik-loader when an element becomes visible. Used by `useVisibleTask$`. Does not
|
|
2875
|
+
* bubble. @public
|
|
2876
|
+
*/
|
|
2408
2877
|
export declare type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;
|
|
2409
2878
|
|
|
2410
2879
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
2411
2880
|
export declare type QwikWheelEvent<T = Element> = NativeWheelEvent;
|
|
2412
2881
|
|
|
2413
|
-
|
|
2882
|
+
declare type QwikWindowEventMap = Omit<WindowEventHandlersEventMap, keyof QwikDocumentEventMap> & QwikDocumentEventMap;
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* @deprecated Use `Readonly<Signal<T>>` instead.
|
|
2886
|
+
* @public
|
|
2887
|
+
*/
|
|
2414
2888
|
export declare interface ReadonlySignal<T = unknown> {
|
|
2415
2889
|
readonly value: T;
|
|
2416
2890
|
}
|
|
2417
2891
|
|
|
2892
|
+
/** @internal */
|
|
2893
|
+
export declare const _reC: (props: RevealProps) => JSXNodeInternal<InternalServerComponent<SSRRevealSlotProps>> | JSXNodeInternal<FunctionComponent< {
|
|
2894
|
+
name?: string;
|
|
2895
|
+
children?: JSXChildren;
|
|
2896
|
+
}>>;
|
|
2897
|
+
|
|
2418
2898
|
/**
|
|
2419
2899
|
* A ref can be either a signal or a function. Note that the type of Signal is Element so that it
|
|
2420
2900
|
* can accept more specialized elements too
|
|
@@ -2431,9 +2911,26 @@ declare type RefFnInterface<EL> = {
|
|
|
2431
2911
|
(el: EL): void;
|
|
2432
2912
|
};
|
|
2433
2913
|
|
|
2434
|
-
/**
|
|
2914
|
+
/**
|
|
2915
|
+
* Register a QRL symbol globally for lookup by its hash. This is used by the optimizer to register
|
|
2916
|
+
* the names passed in `reg_ctx_name`.
|
|
2917
|
+
*
|
|
2918
|
+
* @internal
|
|
2919
|
+
*/
|
|
2435
2920
|
export declare const _regSymbol: (symbol: any, hash: string) => any;
|
|
2436
2921
|
|
|
2922
|
+
declare class RemoveAllChildrenOperation {
|
|
2923
|
+
target: Element;
|
|
2924
|
+
constructor(target: Element);
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
/**
|
|
2928
|
+
* Remove an external projection from its parent and clean up.
|
|
2929
|
+
*
|
|
2930
|
+
* @internal
|
|
2931
|
+
*/
|
|
2932
|
+
export declare function _removeProjection(container: _Container, parentVNode: _VirtualVNode, vnode: _VirtualVNode, slotName: string): void;
|
|
2933
|
+
|
|
2437
2934
|
/**
|
|
2438
2935
|
* Render JSX.
|
|
2439
2936
|
*
|
|
@@ -2451,19 +2948,14 @@ export declare const render: (parent: Element | Document, jsxNode: JSXOutput | F
|
|
|
2451
2948
|
|
|
2452
2949
|
declare const RenderEvent = "qRender";
|
|
2453
2950
|
|
|
2454
|
-
declare interface RenderInvokeContext extends InvokeContext {
|
|
2455
|
-
$hostElement$: HostElement;
|
|
2456
|
-
$event$: PossibleEvents;
|
|
2457
|
-
$waitOn$: Promise<unknown>[];
|
|
2458
|
-
$container$: Container;
|
|
2459
|
-
}
|
|
2460
|
-
|
|
2461
2951
|
/** @public */
|
|
2462
2952
|
export declare const RenderOnce: FunctionComponent<{
|
|
2463
2953
|
children?: unknown;
|
|
2464
2954
|
key?: string | number | null | undefined;
|
|
2465
2955
|
}>;
|
|
2466
2956
|
|
|
2957
|
+
/** @internal */
|
|
2958
|
+
/** @internal */
|
|
2467
2959
|
/** @public */
|
|
2468
2960
|
export declare interface RenderOptions {
|
|
2469
2961
|
serverData?: Record<string, any>;
|
|
@@ -2484,82 +2976,64 @@ export declare interface RenderSSROptions {
|
|
|
2484
2976
|
manifestHash: string;
|
|
2485
2977
|
}
|
|
2486
2978
|
|
|
2487
|
-
/** @
|
|
2488
|
-
declare
|
|
2489
|
-
mapper: SymbolMapper;
|
|
2490
|
-
manifest: ServerQwikManifest;
|
|
2491
|
-
injections?: GlobalInjections[];
|
|
2492
|
-
bundleGraph?: QwikBundleGraph;
|
|
2493
|
-
}
|
|
2979
|
+
/** @internal */
|
|
2980
|
+
export declare const _reR: () => boolean;
|
|
2494
2981
|
|
|
2495
2982
|
/**
|
|
2496
|
-
*
|
|
2497
|
-
*
|
|
2498
|
-
*
|
|
2499
|
-
* `useResource` however returns immediate a `ResourceReturn` object that contains the data and a
|
|
2500
|
-
* state that indicates if the data is available or not.
|
|
2501
|
-
*
|
|
2502
|
-
* The status can be one of the following:
|
|
2503
|
-
*
|
|
2504
|
-
* - `pending` - the data is not yet available.
|
|
2505
|
-
* - `resolved` - the data is available.
|
|
2506
|
-
* - `rejected` - the data is not available due to an error or timeout.
|
|
2507
|
-
*
|
|
2508
|
-
* Be careful when using a `try/catch` statement in `useResource$`. If you catch the error and don't
|
|
2509
|
-
* re-throw it (or a new Error), the resource status will never be `rejected`.
|
|
2510
|
-
*
|
|
2511
|
-
* ### Example
|
|
2512
|
-
*
|
|
2513
|
-
* Example showing how `useResource` to perform a fetch to request the weather, whenever the input
|
|
2514
|
-
* city name changes.
|
|
2983
|
+
* Resumes selected state (e.g. polling AsyncSignals) by deserializing captures. Used for
|
|
2984
|
+
* document:onQIdle to resume async signals with active polling.
|
|
2515
2985
|
*
|
|
2986
|
+
* @internal
|
|
2987
|
+
*/
|
|
2988
|
+
export declare function _res(this: string | undefined, _: any, element: Element): void | Promise<void>;
|
|
2989
|
+
|
|
2990
|
+
/** @internal */
|
|
2991
|
+
export declare const _resolveContextWithoutSequentialScope: <STATE>(context: ContextId<STATE>) => STATE | undefined;
|
|
2992
|
+
|
|
2993
|
+
/**
|
|
2516
2994
|
* ```tsx
|
|
2517
2995
|
* const Cmp = component$(() => {
|
|
2518
|
-
* const
|
|
2996
|
+
* const city = useSignal('');
|
|
2519
2997
|
*
|
|
2520
|
-
* const
|
|
2521
|
-
* const cityName = track(
|
|
2522
|
-
* const abortController = new AbortController();
|
|
2523
|
-
* cleanup(() => abortController.abort('cleanup'));
|
|
2998
|
+
* const weather = useComputed$(async ({ track, cleanup, abortSignal }) => {
|
|
2999
|
+
* const cityName = track(city);
|
|
2524
3000
|
* const res = await fetch(`http://weatherdata.com?city=${cityName}`, {
|
|
2525
|
-
* signal:
|
|
3001
|
+
* signal: abortSignal,
|
|
2526
3002
|
* });
|
|
2527
|
-
* const
|
|
2528
|
-
* return
|
|
3003
|
+
* const temp = (await res.json()) as { temp: number };
|
|
3004
|
+
* return temp;
|
|
2529
3005
|
* });
|
|
2530
3006
|
*
|
|
2531
3007
|
* return (
|
|
2532
3008
|
* <div>
|
|
2533
|
-
* <input name="city" bind:value={
|
|
2534
|
-
* <
|
|
2535
|
-
*
|
|
2536
|
-
*
|
|
2537
|
-
*
|
|
2538
|
-
*
|
|
2539
|
-
*
|
|
3009
|
+
* <input name="city" bind:value={city} />
|
|
3010
|
+
* <div>
|
|
3011
|
+
* Temperature:{' '}
|
|
3012
|
+
* {weather.pending
|
|
3013
|
+
* ? 'Loading...'
|
|
3014
|
+
* : weather.error
|
|
3015
|
+
* ? `Error: ${weather.error.message}`
|
|
3016
|
+
* : weather.value.temp}
|
|
3017
|
+
* </div>
|
|
2540
3018
|
* </div>
|
|
2541
3019
|
* );
|
|
2542
3020
|
* });
|
|
2543
3021
|
* ```
|
|
2544
3022
|
*
|
|
3023
|
+
* @deprecated Use `useComputed$` instead. Read the `pending` and `error` properties from the
|
|
3024
|
+
* returned signal to determine the status.
|
|
2545
3025
|
* @public
|
|
2546
|
-
* @see Resource
|
|
2547
|
-
* @see ResourceReturn
|
|
2548
3026
|
*/
|
|
2549
|
-
export declare const Resource: <T>(
|
|
3027
|
+
export declare const Resource: <T>({ value, onResolved, onPending, onRejected, }: ResourceProps<T>) => JSXOutput;
|
|
2550
3028
|
|
|
2551
3029
|
/** @public */
|
|
2552
|
-
export declare interface ResourceCtx<T> {
|
|
2553
|
-
|
|
2554
|
-
cleanup(callback: () => void): void;
|
|
3030
|
+
export declare interface ResourceCtx<T = unknown> extends ComputeCtx<T> {
|
|
3031
|
+
/** @deprecated Does not do anything */
|
|
2555
3032
|
cache(policyOrMilliseconds: number | 'immutable'): void;
|
|
2556
|
-
readonly previous: T | undefined;
|
|
2557
3033
|
}
|
|
2558
3034
|
|
|
2559
|
-
declare const ResourceEvent = "qResource";
|
|
2560
|
-
|
|
2561
3035
|
/** @public */
|
|
2562
|
-
export declare type ResourceFn<T> = (ctx: ResourceCtx
|
|
3036
|
+
export declare type ResourceFn<T> = (ctx: ResourceCtx) => ValueOrPromise<T>;
|
|
2563
3037
|
|
|
2564
3038
|
/**
|
|
2565
3039
|
* Options to pass to `useResource$()`
|
|
@@ -2576,71 +3050,108 @@ export declare interface ResourceOptions {
|
|
|
2576
3050
|
}
|
|
2577
3051
|
|
|
2578
3052
|
/** @public */
|
|
2579
|
-
export declare
|
|
2580
|
-
readonly value: Promise<T>;
|
|
2581
|
-
readonly loading: boolean;
|
|
2582
|
-
}
|
|
3053
|
+
export declare type ResourcePending<T> = ResourceReturn<T>;
|
|
2583
3054
|
|
|
2584
3055
|
/** @public */
|
|
2585
3056
|
export declare interface ResourceProps<T> {
|
|
2586
3057
|
readonly value: ResourceReturn<T> | Signal<Promise<T> | T> | Promise<T>;
|
|
2587
|
-
onResolved: (value: T) => JSXOutput
|
|
2588
|
-
onPending?: () => JSXOutput
|
|
2589
|
-
onRejected?: (reason: Error) => JSXOutput
|
|
3058
|
+
onResolved: (value: T) => JSXOutput | Promise<JSXOutput>;
|
|
3059
|
+
onPending?: () => JSXOutput | Promise<JSXOutput>;
|
|
3060
|
+
onRejected?: (reason: Error) => JSXOutput | Promise<JSXOutput>;
|
|
2590
3061
|
}
|
|
2591
3062
|
|
|
2592
3063
|
/** @public */
|
|
2593
|
-
export declare
|
|
2594
|
-
readonly value: Promise<T>;
|
|
2595
|
-
readonly loading: boolean;
|
|
2596
|
-
}
|
|
3064
|
+
export declare type ResourceRejected<T> = ResourceReturn<T>;
|
|
2597
3065
|
|
|
2598
3066
|
/** @public */
|
|
2599
|
-
export declare
|
|
2600
|
-
readonly value: Promise<T>;
|
|
2601
|
-
readonly loading: boolean;
|
|
2602
|
-
}
|
|
3067
|
+
export declare type ResourceResolved<T> = ResourceReturn<T>;
|
|
2603
3068
|
|
|
2604
3069
|
/** @public */
|
|
2605
|
-
export declare type ResourceReturn<T> =
|
|
3070
|
+
export declare type ResourceReturn<T> = {
|
|
3071
|
+
readonly value: Promise<T>;
|
|
3072
|
+
readonly loading: boolean;
|
|
3073
|
+
};
|
|
2606
3074
|
|
|
2607
3075
|
declare interface ResourceReturnInternal<T> {
|
|
2608
3076
|
__brand: 'resource';
|
|
2609
|
-
_state: 'pending' | 'resolved' | 'rejected';
|
|
2610
|
-
_resolved: T | undefined;
|
|
2611
|
-
_error: Error | undefined;
|
|
2612
|
-
_cache: number;
|
|
2613
|
-
_timeout: number;
|
|
2614
3077
|
value: Promise<T>;
|
|
2615
3078
|
loading: boolean;
|
|
3079
|
+
signal: AsyncSignal<{
|
|
3080
|
+
r: T;
|
|
3081
|
+
}>;
|
|
2616
3082
|
}
|
|
2617
3083
|
|
|
2618
3084
|
/** @internal */
|
|
2619
|
-
export declare const _restProps: (props:
|
|
3085
|
+
export declare const _restProps: (props: unknown, omit?: string[], target?: Props) => Props;
|
|
3086
|
+
|
|
3087
|
+
/** @internal */
|
|
3088
|
+
export declare const _reT: ({ cleanup }: TaskCtx) => void;
|
|
3089
|
+
|
|
3090
|
+
/**
|
|
3091
|
+
* Retries a function that throws a promise. If you pass `onError`, you're responsible for handling
|
|
3092
|
+
* errors.
|
|
3093
|
+
*
|
|
3094
|
+
* @internal
|
|
3095
|
+
*/
|
|
3096
|
+
export declare function _retryOnPromise<T>(fn: () => ValueOrPromise<T>, onError?: (e: any) => ValueOrPromise<T>): ValueOrPromise<T>;
|
|
3097
|
+
|
|
3098
|
+
/** @public @experimental */
|
|
3099
|
+
export declare const Reveal: typeof _reC;
|
|
3100
|
+
|
|
3101
|
+
declare interface RevealItemLike {
|
|
3102
|
+
boundary: {
|
|
3103
|
+
untrackedValue: number;
|
|
3104
|
+
};
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
/** @public @experimental */
|
|
3108
|
+
export declare type RevealOrder = 'parallel' | 'sequential' | 'reverse' | 'together';
|
|
3109
|
+
|
|
3110
|
+
/** @public @experimental */
|
|
3111
|
+
export declare type RevealProps = {
|
|
3112
|
+
order?: RevealOrder;
|
|
3113
|
+
collapsed?: boolean;
|
|
3114
|
+
};
|
|
3115
|
+
|
|
3116
|
+
declare interface RevealRegistrationLike<ITEM extends RevealItemLike = RevealItemLike> {
|
|
3117
|
+
reveal: {
|
|
3118
|
+
order: RevealOrder;
|
|
3119
|
+
items: ITEM[];
|
|
3120
|
+
};
|
|
3121
|
+
item: ITEM;
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
/**
|
|
3125
|
+
* The resource function wrapper
|
|
3126
|
+
*
|
|
3127
|
+
* @internal
|
|
3128
|
+
*/
|
|
3129
|
+
export declare const _rsc: <T>(arg: ResourceCtx<T>) => Promise<{
|
|
3130
|
+
r: T;
|
|
3131
|
+
}>;
|
|
2620
3132
|
|
|
2621
3133
|
/**
|
|
2622
|
-
* This is called by qwik-loader to
|
|
3134
|
+
* This is called by qwik-loader to run a QRL. It has to be synchronous when possible.
|
|
2623
3135
|
*
|
|
2624
3136
|
* @internal
|
|
2625
3137
|
*/
|
|
2626
|
-
export declare
|
|
2627
|
-
|
|
2628
|
-
declare type Scheduler = ReturnType<typeof createScheduler>;
|
|
3138
|
+
export declare function _run(this: string, event: Event, element: Element): ValueOrPromise<unknown>;
|
|
2629
3139
|
|
|
3140
|
+
/** Stores the location of an object. If no parent, it's a root. */
|
|
2630
3141
|
declare type SeenRef = {
|
|
2631
|
-
$parent$: unknown | null;
|
|
2632
3142
|
$index$: number;
|
|
2633
|
-
$
|
|
3143
|
+
$parent$?: SeenRef | null;
|
|
2634
3144
|
};
|
|
2635
3145
|
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
3146
|
+
declare interface SegmentRenderContext {
|
|
3147
|
+
container: SSRSegmentContainer;
|
|
3148
|
+
writer: SSRInternalStreamWriter;
|
|
3149
|
+
htmlChunks: SSRSegmentWriteChunk[];
|
|
2640
3150
|
}
|
|
2641
3151
|
|
|
2642
3152
|
declare interface SerializationContext {
|
|
2643
|
-
$serialize$: () => void
|
|
3153
|
+
$serialize$: () => ValueOrPromise<void>;
|
|
3154
|
+
$serializePatch$: (rootStart: number, rootIds: number[], extraRootId?: number | string | number[], streamedRootLimit?: number) => ValueOrPromise<void>;
|
|
2644
3155
|
$symbolToChunkResolver$: SymbolToChunkResolver;
|
|
2645
3156
|
/**
|
|
2646
3157
|
* Map from object to parent and index reference.
|
|
@@ -2652,60 +3163,76 @@ declare interface SerializationContext {
|
|
|
2652
3163
|
* - `{ parent, index }` - The parent object and the index within that parent.
|
|
2653
3164
|
* - `undefined` - Object has not been seen yet.
|
|
2654
3165
|
*/
|
|
2655
|
-
|
|
3166
|
+
getSeenRef: (obj: unknown) => SeenRef | undefined;
|
|
3167
|
+
/** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
|
|
2656
3168
|
$hasRootId$: (obj: unknown) => number | undefined;
|
|
2657
3169
|
/**
|
|
2658
3170
|
* Root objects which need to be serialized.
|
|
2659
3171
|
*
|
|
2660
3172
|
* Roots are entry points into the object graph. Typically the roots are held by the listeners.
|
|
2661
3173
|
*
|
|
2662
|
-
* Returns
|
|
2663
|
-
* Format: "3 2 0" where each number is the index within its parent, from root to leaf.
|
|
2664
|
-
*/
|
|
2665
|
-
$addRoot$: (obj: unknown, parent?: unknown) => number;
|
|
2666
|
-
/**
|
|
2667
|
-
* Get root path of the object without creating a new root.
|
|
2668
|
-
*
|
|
2669
|
-
* This is used during serialization, as new roots can't be created during serialization.
|
|
2670
|
-
*
|
|
2671
|
-
* The function throws if the root was not found.
|
|
3174
|
+
* Returns the index of the root object.
|
|
2672
3175
|
*/
|
|
2673
|
-
$
|
|
2674
|
-
$
|
|
3176
|
+
$addRoot$: AddRootFn;
|
|
3177
|
+
$addDuplicateRoot$: (obj: unknown) => SeenRef;
|
|
3178
|
+
$commitRoot$: (root: unknown, obj: unknown) => number;
|
|
3179
|
+
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
3180
|
+
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
2675
3181
|
$roots$: unknown[];
|
|
2676
|
-
$
|
|
3182
|
+
$rootObjs$: unknown[];
|
|
3183
|
+
$onAddRoot$?: (id: number, root: unknown, obj: unknown) => void;
|
|
3184
|
+
$forwardRefOffset$: number;
|
|
3185
|
+
$serializedRootCount$: number;
|
|
3186
|
+
$serializedForwardRefCount$: number;
|
|
3187
|
+
$rootStateRootCount$: number;
|
|
3188
|
+
$hasRootStateForwardRefs$: boolean;
|
|
3189
|
+
$promoteToRoot$: (ref: SeenRef, obj: unknown, index?: number) => void;
|
|
2677
3190
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
2678
|
-
$
|
|
3191
|
+
$setSyncFnOffset$(offset: number, existingFns?: string[]): void;
|
|
3192
|
+
$isSsrNode$: (obj: unknown) => obj is ISsrNode;
|
|
2679
3193
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
2680
|
-
$
|
|
3194
|
+
$markSsrNodeForSerialization$: (node: ISsrNode, flags: number) => void;
|
|
3195
|
+
$writer$: SSRInternalStreamWriter;
|
|
3196
|
+
$setWriter$(writer: SSRInternalStreamWriter): void;
|
|
2681
3197
|
$syncFns$: string[];
|
|
2682
3198
|
$eventQrls$: Set<QRL>;
|
|
2683
3199
|
$eventNames$: Set<string>;
|
|
2684
|
-
$resources$: Set<ResourceReturnInternal<unknown>>;
|
|
2685
3200
|
$renderSymbols$: Set<string>;
|
|
2686
3201
|
$storeProxyMap$: ObjToProxyMap;
|
|
2687
|
-
$
|
|
3202
|
+
$eagerResume$: Set<unknown>;
|
|
2688
3203
|
$setProp$: (obj: any, prop: string, value: any) => void;
|
|
2689
3204
|
}
|
|
2690
3205
|
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
$obj$: unknown;
|
|
2696
|
-
constructor($obj$: unknown);
|
|
3206
|
+
declare const enum SerializationSignalFlags {
|
|
3207
|
+
SERIALIZATION_STRATEGY_NEVER = 8,
|
|
3208
|
+
SERIALIZATION_STRATEGY_ALWAYS = 16,
|
|
3209
|
+
SERIALIZATION_ALL_STRATEGIES = 24
|
|
2697
3210
|
}
|
|
2698
3211
|
|
|
2699
|
-
/**
|
|
2700
|
-
|
|
3212
|
+
/**
|
|
3213
|
+
* Serialization strategy for computed and async signals. This determines whether to serialize their
|
|
3214
|
+
* value during SSR.
|
|
3215
|
+
*
|
|
3216
|
+
* - `never`: The value is never serialized. When the component is resumed, the value will be
|
|
3217
|
+
* recalculated when it is first read.
|
|
3218
|
+
* - `always`: The value is always serialized. This is the default.
|
|
3219
|
+
*
|
|
3220
|
+
* **IMPORTANT**: When you use `never`, your serialized HTML is smaller, but the recalculation will
|
|
3221
|
+
* trigger subscriptions, meaning that other signals using this signal will recalculate, even if
|
|
3222
|
+
* this signal didn't change.
|
|
3223
|
+
*
|
|
3224
|
+
* This is normally not a problem, but for async signals it may mean fetching something again.
|
|
3225
|
+
*
|
|
3226
|
+
* @public
|
|
3227
|
+
*/
|
|
3228
|
+
export declare type SerializationStrategy = 'never' | 'always';
|
|
2701
3229
|
|
|
2702
3230
|
/**
|
|
2703
3231
|
* Serialize data to string using SerializationContext.
|
|
2704
3232
|
*
|
|
2705
|
-
* @param data - Data to serialize
|
|
2706
3233
|
* @internal
|
|
2707
3234
|
*/
|
|
2708
|
-
export declare function _serialize(data:
|
|
3235
|
+
export declare function _serialize<T>(data: T): Promise<string>;
|
|
2709
3236
|
|
|
2710
3237
|
/**
|
|
2711
3238
|
* Serialize and deserialize custom objects.
|
|
@@ -2768,9 +3295,9 @@ declare interface SerializerSignal<T> extends ComputedSignal<T> {
|
|
|
2768
3295
|
* @public
|
|
2769
3296
|
*/
|
|
2770
3297
|
declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
|
|
2771
|
-
constructor(container:
|
|
3298
|
+
constructor(container: _Container | null, argQrl: _QRLInternal<SerializerArg<T, S>>);
|
|
2772
3299
|
$didInitialize$: boolean;
|
|
2773
|
-
$computeIfNeeded$():
|
|
3300
|
+
$computeIfNeeded$(): void;
|
|
2774
3301
|
}
|
|
2775
3302
|
|
|
2776
3303
|
/**
|
|
@@ -2791,12 +3318,17 @@ declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
|
|
|
2791
3318
|
*/
|
|
2792
3319
|
export declare const SerializerSymbol: unique symbol;
|
|
2793
3320
|
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
3321
|
+
declare class SetAttributeOperation {
|
|
3322
|
+
target: Element;
|
|
3323
|
+
attrName: string;
|
|
3324
|
+
attrValue: any;
|
|
3325
|
+
scopedStyleIdPrefix: string | null;
|
|
3326
|
+
isSvg: boolean;
|
|
3327
|
+
constructor(target: Element, attrName: string, attrValue: any, scopedStyleIdPrefix: string | null, isSvg: boolean);
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
/** @internal */
|
|
3331
|
+
export declare function _setEvent(serializationCtx: SerializationContext, key: string, rawValue: unknown, hasMovedCaptures: boolean): string | SSRWriteChunk[] | null;
|
|
2800
3332
|
|
|
2801
3333
|
/**
|
|
2802
3334
|
* Sets the `CorePlatform`.
|
|
@@ -2810,19 +3342,39 @@ declare type ServerQwikManifest = Pick<QwikManifest, 'manifestHash' | 'injection
|
|
|
2810
3342
|
*/
|
|
2811
3343
|
export declare const setPlatform: (plt: CorePlatform) => CorePlatform;
|
|
2812
3344
|
|
|
3345
|
+
/**
|
|
3346
|
+
* Set the DOM target element for an external projection VNode.
|
|
3347
|
+
*
|
|
3348
|
+
* When the cursor walker processes this VNode, DOM operations will target this element instead of
|
|
3349
|
+
* walking the parent chain.
|
|
3350
|
+
*
|
|
3351
|
+
* @internal
|
|
3352
|
+
*/
|
|
3353
|
+
export declare function _setProjectionTarget(vnode: _VirtualVNode, targetElement: Element): void;
|
|
3354
|
+
|
|
3355
|
+
declare class SetTextOperation {
|
|
3356
|
+
target: Text;
|
|
3357
|
+
text: string;
|
|
3358
|
+
constructor(target: Text, text: string);
|
|
3359
|
+
}
|
|
3360
|
+
|
|
2813
3361
|
/** @internal */
|
|
2814
|
-
export declare abstract class _SharedContainer implements
|
|
3362
|
+
export declare abstract class _SharedContainer implements _Container {
|
|
2815
3363
|
readonly $version$: string;
|
|
2816
|
-
readonly $scheduler$: Scheduler;
|
|
2817
3364
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
3365
|
+
$rootContainer$: _Container | null;
|
|
3366
|
+
$isOutOfOrderSegment$: boolean;
|
|
2818
3367
|
readonly $locale$: string;
|
|
2819
3368
|
readonly $getObjectById$: (id: number | string) => any;
|
|
2820
3369
|
$serverData$: Record<string, any>;
|
|
2821
3370
|
$currentUniqueId$: number;
|
|
2822
3371
|
$instanceHash$: string | null;
|
|
2823
3372
|
$buildBase$: string | null;
|
|
2824
|
-
|
|
2825
|
-
|
|
3373
|
+
$renderPromise$: Promise<void> | null;
|
|
3374
|
+
$resolveRenderPromise$: (() => void) | null;
|
|
3375
|
+
$pendingCount$: number;
|
|
3376
|
+
constructor(serverData: Record<string, any>, locale: string);
|
|
3377
|
+
trackSignalValue<T>(signal: Signal, subscriber: _HostElement, property: string, data: _SubscriptionData): T;
|
|
2826
3378
|
serializationCtxFactory(NodeConstructor: {
|
|
2827
3379
|
new (...rest: any[]): {
|
|
2828
3380
|
__brand__: 'SsrNode';
|
|
@@ -2832,16 +3384,36 @@ export declare abstract class _SharedContainer implements Container {
|
|
|
2832
3384
|
__brand__: 'DomRef';
|
|
2833
3385
|
};
|
|
2834
3386
|
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
|
|
2835
|
-
|
|
2836
|
-
abstract
|
|
2837
|
-
abstract
|
|
2838
|
-
abstract
|
|
2839
|
-
abstract
|
|
2840
|
-
abstract
|
|
2841
|
-
abstract
|
|
2842
|
-
abstract
|
|
3387
|
+
$checkPendingCount$(): void;
|
|
3388
|
+
abstract ensureProjectionResolved(host: _HostElement): void;
|
|
3389
|
+
abstract handleError(err: any, $host$: _HostElement | null): void;
|
|
3390
|
+
abstract getParentHost(host: _HostElement): _HostElement | null;
|
|
3391
|
+
abstract setContext<T>(host: _HostElement, context: ContextId<T>, value: T): void;
|
|
3392
|
+
abstract resolveContext<T>(host: _HostElement, contextId: ContextId<T>): T | undefined;
|
|
3393
|
+
abstract setHostProp<T>(host: _HostElement, name: string, value: T): void;
|
|
3394
|
+
abstract getHostProp<T>(host: _HostElement, name: string): T | null;
|
|
3395
|
+
abstract $appendStyle$(content: string, styleId: string, host: _HostElement, scoped: boolean): void;
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3398
|
+
/** @internal */
|
|
3399
|
+
export declare const _shC: (props: ShowProps<any>) => JSXNode<unknown>;
|
|
3400
|
+
|
|
3401
|
+
/** @public @experimental */
|
|
3402
|
+
export declare const Show: ShowComponent;
|
|
3403
|
+
|
|
3404
|
+
/** @public @experimental */
|
|
3405
|
+
export declare type ShowComponent = <WHEN = unknown, THEN extends JSXOutput = JSXOutput, ELSE extends JSXOutput = JSXOutput>(props: PublicProps<ShowProps<WHEN, THEN, ELSE>>, key: string | null, flags: number, dev?: DevJSX) => JSXOutput;
|
|
3406
|
+
|
|
3407
|
+
/** @public @experimental */
|
|
3408
|
+
export declare interface ShowProps<WHEN = unknown, THEN extends JSXOutput = JSXOutput, ELSE extends JSXOutput = JSXOutput> {
|
|
3409
|
+
when$: QRL<() => WHEN>;
|
|
3410
|
+
then$: QRL<(when: WHEN) => THEN>;
|
|
3411
|
+
else$?: QRL<(when: WHEN) => ELSE>;
|
|
2843
3412
|
}
|
|
2844
3413
|
|
|
3414
|
+
/** @internal */
|
|
3415
|
+
export declare const _shT: ({ track }: TaskCtx) => ValueOrPromise<void | undefined>;
|
|
3416
|
+
|
|
2845
3417
|
/**
|
|
2846
3418
|
* A signal is a reactive value which can be read and written. When the signal is written, all tasks
|
|
2847
3419
|
* which are tracking the signal will be re-run and all components that read the signal will be
|
|
@@ -2854,20 +3426,32 @@ export declare abstract class _SharedContainer implements Container {
|
|
|
2854
3426
|
*
|
|
2855
3427
|
* @public
|
|
2856
3428
|
*/
|
|
2857
|
-
export declare interface Signal<T = any>
|
|
3429
|
+
export declare interface Signal<T = any> {
|
|
3430
|
+
/** Reading from this subscribes to updates; writing to this triggers updates. */
|
|
2858
3431
|
value: T;
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
3432
|
+
/** Reading from this does not subscribe to updates; writing to this does not trigger updates. */
|
|
3433
|
+
untrackedValue: T;
|
|
3434
|
+
/**
|
|
3435
|
+
* Use this to trigger running subscribers, for example when the value mutated but remained the
|
|
3436
|
+
* same object.
|
|
3437
|
+
*/
|
|
3438
|
+
trigger(): void;
|
|
2863
3439
|
}
|
|
2864
3440
|
|
|
2865
3441
|
declare class SignalImpl<T = any> implements Signal<T> {
|
|
2866
3442
|
$untrackedValue$: T;
|
|
2867
3443
|
/** Store a list of effects which are dependent on this signal. */
|
|
2868
|
-
$effects$:
|
|
2869
|
-
$container$:
|
|
2870
|
-
|
|
3444
|
+
$effects$: undefined | Set<EffectSubscription>;
|
|
3445
|
+
$container$: _Container | null;
|
|
3446
|
+
$wrappedSignal$: WrappedSignalImpl<T> | null;
|
|
3447
|
+
constructor(container: _Container | null | undefined, value: T);
|
|
3448
|
+
/**
|
|
3449
|
+
* Use this to trigger running subscribers, for example when the calculated value has mutated but
|
|
3450
|
+
* remained the same object
|
|
3451
|
+
*/
|
|
3452
|
+
trigger(): void;
|
|
3453
|
+
/** @deprecated Use `trigger()` instead */
|
|
3454
|
+
force(): void;
|
|
2871
3455
|
get untrackedValue(): T;
|
|
2872
3456
|
set untrackedValue(value: T);
|
|
2873
3457
|
get value(): T;
|
|
@@ -2885,12 +3469,6 @@ declare interface SimplifiedServerRequestEvent<T = unknown> {
|
|
|
2885
3469
|
request: Request;
|
|
2886
3470
|
}
|
|
2887
3471
|
|
|
2888
|
-
/** @public */
|
|
2889
|
-
declare interface SingleEntryStrategy {
|
|
2890
|
-
type: 'single';
|
|
2891
|
-
manual?: Record<string, string>;
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
3472
|
/** @public */
|
|
2895
3473
|
declare type Size = number | string;
|
|
2896
3474
|
|
|
@@ -2908,12 +3486,6 @@ export declare const Slot: FunctionComponent<{
|
|
|
2908
3486
|
children?: JSXChildren;
|
|
2909
3487
|
}>;
|
|
2910
3488
|
|
|
2911
|
-
/** @public */
|
|
2912
|
-
declare interface SmartEntryStrategy {
|
|
2913
|
-
type: 'smart';
|
|
2914
|
-
manual?: Record<string, string>;
|
|
2915
|
-
}
|
|
2916
|
-
|
|
2917
3489
|
/** @public */
|
|
2918
3490
|
export declare interface SnapshotListener {
|
|
2919
3491
|
key: string;
|
|
@@ -3154,49 +3726,65 @@ declare type SpecialAttrs = {
|
|
|
3154
3726
|
[key: string]: {};
|
|
3155
3727
|
};
|
|
3156
3728
|
|
|
3157
|
-
declare type SsrAttrKey = string;
|
|
3158
|
-
|
|
3159
|
-
declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
|
|
3160
|
-
|
|
3161
|
-
declare type SsrAttrValue = string | Signal<any> | boolean | object | null;
|
|
3162
|
-
|
|
3163
3729
|
/** @public */
|
|
3164
3730
|
export declare const SSRComment: FunctionComponent<{
|
|
3165
3731
|
data: string;
|
|
3166
3732
|
}>;
|
|
3167
3733
|
|
|
3168
|
-
declare interface SSRContainer extends
|
|
3734
|
+
declare interface SSRContainer extends _Container {
|
|
3169
3735
|
readonly tag: string;
|
|
3170
3736
|
readonly isHtml: boolean;
|
|
3171
|
-
readonly
|
|
3737
|
+
readonly size: number;
|
|
3738
|
+
readonly writer: SSRInternalStreamWriter;
|
|
3739
|
+
readonly streamHandler: IStreamHandler;
|
|
3172
3740
|
readonly serializationCtx: SerializationContext;
|
|
3173
3741
|
readonly symbolToChunkResolver: SymbolToChunkResolver;
|
|
3174
3742
|
readonly resolvedManifest: ResolvedManifest;
|
|
3743
|
+
readonly outOfOrderStreaming: boolean;
|
|
3175
3744
|
additionalHeadNodes: Array<JSXNodeInternal>;
|
|
3176
3745
|
additionalBodyNodes: Array<JSXNodeInternal>;
|
|
3177
|
-
|
|
3746
|
+
$noScriptHere$: number;
|
|
3747
|
+
/**
|
|
3748
|
+
* Lets the container place a root-level `useOn` placeholder `<script>` itself when injecting it
|
|
3749
|
+
* inline would put it at an illegal position. Returns `true` if the container took the node, in
|
|
3750
|
+
* which case the caller must not inject it into the component's JSX.
|
|
3751
|
+
*/
|
|
3752
|
+
$deferRootPlaceholder$(scriptNode: JSXNodeInternal<string>): boolean;
|
|
3753
|
+
write(text: string): void;
|
|
3178
3754
|
openContainer(): void;
|
|
3179
3755
|
closeContainer(): ValueOrPromise<void>;
|
|
3180
|
-
openElement(elementName: string,
|
|
3756
|
+
openElement(elementName: string, key: string | null, varAttrs: Props, constAttrs: Props | null, styleScopedId: string | null, currentFile: string | null, hasMovedCaptures?: boolean): string | undefined;
|
|
3181
3757
|
closeElement(): ValueOrPromise<void>;
|
|
3182
|
-
openFragment(attrs:
|
|
3758
|
+
openFragment(attrs: Props): void;
|
|
3183
3759
|
closeFragment(): void;
|
|
3184
|
-
openProjection(attrs:
|
|
3760
|
+
openProjection(attrs: Props): void;
|
|
3185
3761
|
closeProjection(): void;
|
|
3186
|
-
openComponent(attrs:
|
|
3762
|
+
openComponent(attrs: Props): void;
|
|
3187
3763
|
getComponentFrame(projectionDepth: number): ISsrComponentFrame | null;
|
|
3188
3764
|
getParentComponentFrame(): ISsrComponentFrame | null;
|
|
3189
|
-
closeComponent(): void
|
|
3765
|
+
closeComponent(): Promise<void>;
|
|
3190
3766
|
textNode(text: string): void;
|
|
3191
3767
|
htmlNode(rawHtml: string): void;
|
|
3192
3768
|
commentNode(text: string): void;
|
|
3193
|
-
addRoot(obj: any): number | undefined;
|
|
3769
|
+
addRoot(obj: any): number | string | undefined;
|
|
3194
3770
|
getOrCreateLastNode(): ISsrNode;
|
|
3195
3771
|
addUnclaimedProjection(frame: ISsrComponentFrame, name: string, children: JSXChildren): void;
|
|
3196
3772
|
isStatic(): boolean;
|
|
3197
3773
|
render(jsx: JSXOutput): Promise<void>;
|
|
3774
|
+
renderJSX(jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
|
|
3775
|
+
$runQueuedRender$<T>(render: () => ValueOrPromise<T>): ValueOrPromise<T>;
|
|
3776
|
+
nextOutOfOrderId(): number;
|
|
3777
|
+
emitOutOfOrderSegmentScripts(scripts: string): void;
|
|
3778
|
+
segment(segmentId: string, jsx: JSXOutput, options: SSRRenderJSXOptions): Promise<SSROutOfOrderSegment>;
|
|
3779
|
+
queueOutOfOrderSegment(segment: Promise<void>): void;
|
|
3780
|
+
emitOutOfOrderExecutorIfNeeded(): void;
|
|
3781
|
+
emitInlineScript(script: string): void;
|
|
3782
|
+
writeScript(attrs: Props, body?: string): void;
|
|
3198
3783
|
emitPreloaderPre(): void;
|
|
3199
3784
|
emitQwikLoaderAtTopIfNeeded(): void;
|
|
3785
|
+
emitPatchDataIfNeeded(): void;
|
|
3786
|
+
emitBackpatchDataAndExecutorIfNeeded(): void;
|
|
3787
|
+
addBackpatchEntry(ssrNodeId: string, attrName: string, serializedValue: string | boolean | null): void;
|
|
3200
3788
|
}
|
|
3201
3789
|
|
|
3202
3790
|
/** @public */
|
|
@@ -3204,19 +3792,68 @@ export declare type SSRHintProps = {
|
|
|
3204
3792
|
dynamic?: boolean;
|
|
3205
3793
|
};
|
|
3206
3794
|
|
|
3207
|
-
/**
|
|
3208
|
-
declare
|
|
3209
|
-
id:
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
[
|
|
3213
|
-
}
|
|
3795
|
+
/** @internal */
|
|
3796
|
+
declare interface SSRInternalStreamWriter extends StreamWriter {
|
|
3797
|
+
writeRootRef(id: number): ValueOrPromise<void>;
|
|
3798
|
+
writeRootRefPath(path: number[]): ValueOrPromise<void>;
|
|
3799
|
+
writeRootRefDelta(id: number, base: number): ValueOrPromise<void>;
|
|
3800
|
+
toString(remap?: number[]): string;
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
declare const enum SsrNodeFlags {
|
|
3804
|
+
Updatable = 1,
|
|
3805
|
+
WarnedStreamedChore = 2
|
|
3806
|
+
}
|
|
3807
|
+
|
|
3808
|
+
declare type SSROutOfOrderSegment = SegmentRenderContext;
|
|
3214
3809
|
|
|
3215
3810
|
/** @public */
|
|
3216
3811
|
export declare const SSRRaw: FunctionComponent<{
|
|
3217
3812
|
data: string;
|
|
3218
3813
|
}>;
|
|
3219
3814
|
|
|
3815
|
+
declare interface SSRRenderJSXOptions {
|
|
3816
|
+
currentStyleScoped: string | null;
|
|
3817
|
+
parentComponentFrame: ISsrComponentFrame | null;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
declare type SSRRevealSlotProps = {
|
|
3821
|
+
coordinator: OutOfOrderRevealCoordinator;
|
|
3822
|
+
};
|
|
3823
|
+
|
|
3824
|
+
/** @internal */
|
|
3825
|
+
declare interface SSRRootRefDeltaChunk {
|
|
3826
|
+
readonly id: number;
|
|
3827
|
+
readonly base: number;
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
/** @internal */
|
|
3831
|
+
declare interface SSRRootRefPathChunk {
|
|
3832
|
+
readonly path: number[];
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
declare interface SSRSegmentContainer extends SSRContainer {
|
|
3836
|
+
$rootContainer$: SSRContainer;
|
|
3837
|
+
$recordExternalRootEffect$(producer: unknown, effect: EffectSubscription, prop: string | symbol | null, sourceEffects?: Map<string | symbol, Set<EffectSubscription>>): void;
|
|
3838
|
+
$finalizeOutOfOrderSegment$(segmentId: string, segment: SSROutOfOrderSegment): Promise<{
|
|
3839
|
+
html: string;
|
|
3840
|
+
scripts: string;
|
|
3841
|
+
}>;
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
/** @internal */
|
|
3845
|
+
declare type SSRSegmentWriteChunk = string | {
|
|
3846
|
+
readonly type: 'root-ref';
|
|
3847
|
+
readonly localId: number;
|
|
3848
|
+
} | {
|
|
3849
|
+
readonly type: 'root-ref-path';
|
|
3850
|
+
readonly localPath: number[];
|
|
3851
|
+
} | {
|
|
3852
|
+
readonly type: 'root-ref-delta';
|
|
3853
|
+
readonly localId: number;
|
|
3854
|
+
readonly localBaseId: number;
|
|
3855
|
+
};
|
|
3856
|
+
|
|
3220
3857
|
/** @public */
|
|
3221
3858
|
export declare const SSRStream: FunctionComponent<SSRStreamProps>;
|
|
3222
3859
|
|
|
@@ -3226,43 +3863,42 @@ export declare const SSRStreamBlock: FunctionComponent<{
|
|
|
3226
3863
|
}>;
|
|
3227
3864
|
|
|
3228
3865
|
/** @public */
|
|
3229
|
-
export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream:
|
|
3866
|
+
export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream: SSRStreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);
|
|
3230
3867
|
|
|
3231
3868
|
/** @public */
|
|
3232
3869
|
export declare type SSRStreamProps = {
|
|
3233
3870
|
children: SSRStreamChildren;
|
|
3234
3871
|
};
|
|
3235
3872
|
|
|
3873
|
+
/** @public */
|
|
3874
|
+
export declare interface SSRStreamWriter {
|
|
3875
|
+
write(chunk: JSXOutput): void;
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
/** @internal */
|
|
3879
|
+
declare type SSRWriteChunk = string | number | SSRRootRefPathChunk | SSRRootRefDeltaChunk;
|
|
3880
|
+
|
|
3881
|
+
declare type StackFn = () => ValueOrPromise<void>;
|
|
3882
|
+
|
|
3883
|
+
declare type StackValue = ValueOrPromise<JSXOutput | StackFn | Promise<JSXOutput> | typeof Promise | AsyncGenerator | typeof MaybeAsyncSignal>;
|
|
3884
|
+
|
|
3236
3885
|
declare type StopPropagation = {
|
|
3237
3886
|
[K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
|
|
3238
3887
|
};
|
|
3239
3888
|
|
|
3240
|
-
|
|
3889
|
+
/** @internal */
|
|
3890
|
+
export declare const enum _StoreFlags {
|
|
3241
3891
|
NONE = 0,
|
|
3242
3892
|
RECURSIVE = 1,
|
|
3243
3893
|
IMMUTABLE = 2
|
|
3244
3894
|
}
|
|
3245
3895
|
|
|
3246
|
-
declare class StoreHandler implements ProxyHandler<StoreTarget> {
|
|
3247
|
-
$flags$: StoreFlags;
|
|
3248
|
-
$container$: Container | null;
|
|
3249
|
-
$effects$: null | Map<string | symbol, Set<EffectSubscription>>;
|
|
3250
|
-
constructor($flags$: StoreFlags, $container$: Container | null);
|
|
3251
|
-
toString(): string;
|
|
3252
|
-
get(target: StoreTarget, prop: string | symbol): any;
|
|
3253
|
-
/** In the case of oldValue and value are the same, the effects are not triggered. */
|
|
3254
|
-
set(target: StoreTarget, prop: string | symbol, value: any): boolean;
|
|
3255
|
-
deleteProperty(target: StoreTarget, prop: string | symbol): boolean;
|
|
3256
|
-
has(target: StoreTarget, prop: string | symbol): boolean;
|
|
3257
|
-
ownKeys(target: StoreTarget): ArrayLike<string | symbol>;
|
|
3258
|
-
getOwnPropertyDescriptor(target: StoreTarget, prop: string | symbol): PropertyDescriptor | undefined;
|
|
3259
|
-
}
|
|
3260
|
-
|
|
3261
3896
|
declare type StoreTarget = Record<string | symbol, any>;
|
|
3262
3897
|
|
|
3263
3898
|
/** @internal */
|
|
3264
3899
|
export declare interface StreamWriter {
|
|
3265
|
-
write(chunk: string): void
|
|
3900
|
+
write(chunk: string): ValueOrPromise<void>;
|
|
3901
|
+
waitForDrain?(): ValueOrPromise<void>;
|
|
3266
3902
|
}
|
|
3267
3903
|
|
|
3268
3904
|
/** @file Shared types */
|
|
@@ -3275,6 +3911,28 @@ export declare class _SubscriptionData {
|
|
|
3275
3911
|
constructor(data: NodePropData);
|
|
3276
3912
|
}
|
|
3277
3913
|
|
|
3914
|
+
/** @internal */
|
|
3915
|
+
export declare class _SubscriptionPatch {
|
|
3916
|
+
rootId: number;
|
|
3917
|
+
subscriptions: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>;
|
|
3918
|
+
constructor(rootId?: number, subscriptions?: Set<EffectSubscription> | Map<string | symbol, Set<EffectSubscription>>);
|
|
3919
|
+
}
|
|
3920
|
+
|
|
3921
|
+
/** @internal */
|
|
3922
|
+
export declare const _suC: (props: SuspenseProps) => JSXNodeInternal<string>[];
|
|
3923
|
+
|
|
3924
|
+
/** @public @experimental */
|
|
3925
|
+
export declare const Suspense: typeof _suC;
|
|
3926
|
+
|
|
3927
|
+
/** @public @experimental */
|
|
3928
|
+
export declare type SuspenseProps = {
|
|
3929
|
+
fallback?: JSXOutput;
|
|
3930
|
+
delay?: number;
|
|
3931
|
+
};
|
|
3932
|
+
|
|
3933
|
+
/** @internal */
|
|
3934
|
+
export declare const _suT: ({ track, cleanup }: TaskCtx) => void;
|
|
3935
|
+
|
|
3278
3936
|
/**
|
|
3279
3937
|
* The TS types don't include the SVG attributes so we have to define them ourselves
|
|
3280
3938
|
*
|
|
@@ -3544,12 +4202,9 @@ export declare interface SVGAttributes<T extends Element = Element> extends Aria
|
|
|
3544
4202
|
}
|
|
3545
4203
|
|
|
3546
4204
|
/** @public */
|
|
3547
|
-
declare interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> {
|
|
4205
|
+
export declare interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> {
|
|
3548
4206
|
}
|
|
3549
4207
|
|
|
3550
|
-
/** @public */
|
|
3551
|
-
declare type SymbolMapper = Record<string, readonly [symbol: string, chunk: string]>;
|
|
3552
|
-
|
|
3553
4208
|
declare type SymbolToChunkResolver = (symbol: string) => string;
|
|
3554
4209
|
|
|
3555
4210
|
/**
|
|
@@ -3563,18 +4218,19 @@ declare type SymbolToChunkResolver = (symbol: string) => string;
|
|
|
3563
4218
|
*/
|
|
3564
4219
|
export declare const sync$: <T extends Function>(fn: T) => SyncQRL<T>;
|
|
3565
4220
|
|
|
4221
|
+
declare const SYNC_QRL = "<sync>";
|
|
4222
|
+
|
|
3566
4223
|
/** @public */
|
|
3567
|
-
export declare
|
|
4224
|
+
export declare type SyncQRL<TYPE extends Function> = QRL<TYPE> & {
|
|
3568
4225
|
__brand__SyncQRL__: TYPE;
|
|
3569
|
-
/**
|
|
3570
|
-
* Resolve the QRL of closure and invoke it.
|
|
3571
|
-
*
|
|
3572
|
-
* @param args - Closure arguments.
|
|
3573
|
-
* @returns A return value of the closure.
|
|
3574
|
-
*/
|
|
3575
|
-
(...args: TYPE extends (...args: infer ARGS) => any ? ARGS : never): TYPE extends (...args: any[]) => infer RETURN ? RETURN : never;
|
|
3576
4226
|
resolved: TYPE;
|
|
3577
|
-
dev
|
|
4227
|
+
dev?: QRLDev | null;
|
|
4228
|
+
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
4229
|
+
|
|
4230
|
+
declare type SyncQRLInternal = _QRLInternal & SyncQRLSymbol;
|
|
4231
|
+
|
|
4232
|
+
declare interface SyncQRLSymbol {
|
|
4233
|
+
$symbol$: typeof SYNC_QRL;
|
|
3578
4234
|
}
|
|
3579
4235
|
|
|
3580
4236
|
declare type TableCellSpecialAttrs = {
|
|
@@ -3584,49 +4240,59 @@ declare type TableCellSpecialAttrs = {
|
|
|
3584
4240
|
valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined;
|
|
3585
4241
|
};
|
|
3586
4242
|
|
|
3587
|
-
|
|
3588
|
-
|
|
4243
|
+
/** @internal */
|
|
4244
|
+
export declare class _Task<T = unknown, B = T> extends BackRef {
|
|
4245
|
+
$flags$: TaskFlags;
|
|
3589
4246
|
$index$: number;
|
|
3590
|
-
$el$:
|
|
3591
|
-
$qrl$:
|
|
3592
|
-
$
|
|
3593
|
-
$
|
|
3594
|
-
|
|
4247
|
+
$el$: _HostElement;
|
|
4248
|
+
$qrl$: _QRLInternal<T>;
|
|
4249
|
+
$destroy$: (() => void) | null;
|
|
4250
|
+
$destroyPromise$: Promise<void> | undefined;
|
|
4251
|
+
$taskPromise$: Promise<void> | null;
|
|
4252
|
+
constructor($flags$: TaskFlags, $index$: number, $el$: _HostElement, $qrl$: _QRLInternal<T>, $destroy$: (() => void) | null);
|
|
3595
4253
|
}
|
|
3596
4254
|
|
|
3597
4255
|
/**
|
|
3598
|
-
* Used internally as a
|
|
4256
|
+
* Used internally as a qwikloader event handler to schedule a task. The `this` context is the
|
|
4257
|
+
* captures part of the QRL, provided by qwikloader.
|
|
3599
4258
|
*
|
|
3600
4259
|
* @internal
|
|
3601
4260
|
*/
|
|
3602
|
-
export declare
|
|
4261
|
+
export declare function _task(this: string, _event: Event, element: Element): void | Promise<void>;
|
|
3603
4262
|
|
|
3604
4263
|
/** @public */
|
|
3605
4264
|
export declare interface TaskCtx {
|
|
3606
4265
|
track: Tracker;
|
|
3607
|
-
cleanup: (callback: () => void) => void;
|
|
4266
|
+
cleanup: (callback: () => ValueOrPromise<void>) => void;
|
|
3608
4267
|
}
|
|
3609
4268
|
|
|
3610
4269
|
declare const TaskEvent = "qTask";
|
|
3611
4270
|
|
|
4271
|
+
/** @internal */
|
|
4272
|
+
declare const enum TaskFlags {
|
|
4273
|
+
VISIBLE_TASK = 1,
|
|
4274
|
+
TASK = 2,
|
|
4275
|
+
DIRTY = 4,
|
|
4276
|
+
RENDER_BLOCKING = 8,
|
|
4277
|
+
NEEDS_CLEANUP = 16,
|
|
4278
|
+
EVENTS_REGISTERED = 32
|
|
4279
|
+
}
|
|
4280
|
+
|
|
4281
|
+
/** @public */
|
|
4282
|
+
export declare type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => ValueOrPromise<void>)>;
|
|
4283
|
+
|
|
3612
4284
|
/** @public */
|
|
3613
|
-
export declare
|
|
4285
|
+
export declare interface TaskOptions {
|
|
4286
|
+
/** Block the rendering of the component until the task completes. Default is `true` */
|
|
4287
|
+
deferUpdates?: boolean;
|
|
4288
|
+
}
|
|
3614
4289
|
|
|
3615
4290
|
/** @internal */
|
|
3616
|
-
export declare
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
_VNode | null,
|
|
3620
|
-
|
|
3621
|
-
_VNode | null,
|
|
3622
|
-
///////////////// 2 - Previous sibling
|
|
3623
|
-
_VNode | null,
|
|
3624
|
-
///////////////// 3 - Next sibling
|
|
3625
|
-
Text | null | undefined,
|
|
3626
|
-
string
|
|
3627
|
-
] & {
|
|
3628
|
-
__brand__: 'TextVNode';
|
|
3629
|
-
};
|
|
4291
|
+
export declare class _TextVNode extends _VNode {
|
|
4292
|
+
node: Text | null;
|
|
4293
|
+
text: string | undefined;
|
|
4294
|
+
constructor(flags: _VNodeFlags, parent: _VNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null, node: Text | null, text: string | undefined);
|
|
4295
|
+
}
|
|
3630
4296
|
|
|
3631
4297
|
/**
|
|
3632
4298
|
* Used to signal to Qwik which state should be watched for changes.
|
|
@@ -3647,6 +4313,8 @@ string
|
|
|
3647
4313
|
* useTask$(({ track }) => {
|
|
3648
4314
|
* // Any signals or stores accessed inside the task will be tracked
|
|
3649
4315
|
* const count = track(() => store.count);
|
|
4316
|
+
* // For stores you can also pass the store and specify the property
|
|
4317
|
+
* track(store, 'count');
|
|
3650
4318
|
* // You can also pass a signal to track() directly
|
|
3651
4319
|
* const signalCount = track(signal);
|
|
3652
4320
|
* store.doubleCount = count + signalCount;
|
|
@@ -3717,11 +4385,18 @@ export declare interface Tracker {
|
|
|
3717
4385
|
export declare const _UNINITIALIZED: unique symbol;
|
|
3718
4386
|
|
|
3719
4387
|
/**
|
|
3720
|
-
*
|
|
4388
|
+
* Get the value of the expression without tracking listeners. A function will be invoked, signals
|
|
4389
|
+
* will return their value, and stores will be unwrapped (they return the backing object).
|
|
4390
|
+
*
|
|
4391
|
+
* When you pass a function, you can also pass additional arguments that the function will receive.
|
|
3721
4392
|
*
|
|
4393
|
+
* Note that stores are not unwrapped recursively.
|
|
4394
|
+
*
|
|
4395
|
+
* @param expr - The function or object to evaluate without tracking.
|
|
4396
|
+
* @param args - Additional arguments to pass when `expr` is a function.
|
|
3722
4397
|
* @public
|
|
3723
4398
|
*/
|
|
3724
|
-
export declare const untrack: <T>(
|
|
4399
|
+
export declare const untrack: <T, A extends any[]>(expr: ((...args: A) => T) | Signal<T> | T, ...args: A) => T;
|
|
3725
4400
|
|
|
3726
4401
|
declare type UnwantedKeys = keyof HTMLAttributesBase | keyof DOMAttributes<any> | keyof ARIAMixin | keyof GlobalEventHandlers | 'enterKeyHint' | 'innerText' | 'innerHTML' | 'outerHTML' | 'inputMode' | 'outerText' | 'nodeValue' | 'textContent';
|
|
3727
4402
|
|
|
@@ -3734,19 +4409,11 @@ declare type UnwantedKeys = keyof HTMLAttributesBase | keyof DOMAttributes<any>
|
|
|
3734
4409
|
export declare const unwrapStore: <T>(value: T) => T;
|
|
3735
4410
|
|
|
3736
4411
|
/**
|
|
3737
|
-
*
|
|
3738
|
-
* signal which is calculated from other signals. When the signals change, the computed signal is
|
|
3739
|
-
* recalculated, and if the result changed, all tasks which are tracking the signal will be re-run
|
|
3740
|
-
* and all components that read the signal will be re-rendered.
|
|
3741
|
-
*
|
|
3742
|
-
* The function must be synchronous and must not have any side effects.
|
|
4412
|
+
* Update the props on an external projection VNode and trigger re-rendering.
|
|
3743
4413
|
*
|
|
3744
|
-
* @
|
|
4414
|
+
* @internal
|
|
3745
4415
|
*/
|
|
3746
|
-
export declare
|
|
3747
|
-
|
|
3748
|
-
/** @internal */
|
|
3749
|
-
export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>, options?: ComputedOptions) => AsyncComputedReturnType<T>;
|
|
4416
|
+
export declare function _updateProjectionProps(container: _Container, vnode: _VirtualVNode, newProps: Record<string, unknown>): void;
|
|
3750
4417
|
|
|
3751
4418
|
/**
|
|
3752
4419
|
* Creates a computed signal which is calculated from the given function. A computed signal is a
|
|
@@ -3754,24 +4421,42 @@ export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>, opti
|
|
|
3754
4421
|
* recalculated, and if the result changed, all tasks which are tracking the signal will be re-run
|
|
3755
4422
|
* and all components that read the signal will be re-rendered.
|
|
3756
4423
|
*
|
|
3757
|
-
*
|
|
4424
|
+
* Every synchronous signal or store read is tracked automatically. Reads after an `await` are not:
|
|
4425
|
+
* the tracking context is lost, so track them explicitly with the `track()` provided on the context
|
|
4426
|
+
* argument. When the function is async, the returned signal exposes the async API: reading an
|
|
4427
|
+
* unresolved `.value` throws the computation promise, and `.pending` and `.error` expose the
|
|
4428
|
+
* computation state.
|
|
4429
|
+
*
|
|
4430
|
+
* The function must not have any side effects.
|
|
3758
4431
|
*
|
|
3759
4432
|
* @public
|
|
3760
4433
|
*/
|
|
3761
|
-
export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions | undefined) => ComputedReturnType<T>;
|
|
4434
|
+
export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions<T> | undefined) => ComputedReturnType<T>;
|
|
3762
4435
|
|
|
3763
4436
|
/** @internal */
|
|
3764
|
-
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions) => ComputedReturnType<T>;
|
|
4437
|
+
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions<T>) => ComputedReturnType<T>;
|
|
3765
4438
|
|
|
3766
4439
|
/**
|
|
3767
4440
|
* Stores a value which is retained for the lifetime of the component. Subsequent calls to
|
|
3768
4441
|
* `useConstant` will always return the first value given.
|
|
3769
4442
|
*
|
|
3770
|
-
* If the value is a function, the function is invoked once to calculate the actual value.
|
|
4443
|
+
* If the value is a function, the function is invoked once to calculate the actual value. You can
|
|
4444
|
+
* then also pass arguments to call the function with, so that you don't need to create a new
|
|
4445
|
+
* function on every render.
|
|
4446
|
+
*
|
|
4447
|
+
* @example
|
|
4448
|
+
*
|
|
4449
|
+
* ```tsx
|
|
4450
|
+
* const fixedRandomValue = useConstant(() => Math.random);
|
|
4451
|
+
* const otherFixedRandomValue = useConstant(Math.random);
|
|
4452
|
+
*
|
|
4453
|
+
* const getConfig = (env: string) => { ... }
|
|
4454
|
+
* const config = useConstant(getConfig, environment);
|
|
4455
|
+
* ```
|
|
3771
4456
|
*
|
|
3772
4457
|
* @public
|
|
3773
4458
|
*/
|
|
3774
|
-
export declare const useConstant: <T>(value: (() => T) | T) => T;
|
|
4459
|
+
export declare const useConstant: <T, A extends any[]>(value: ((...args: A) => T) | T, ...args: A) => T;
|
|
3775
4460
|
|
|
3776
4461
|
declare interface UseContext {
|
|
3777
4462
|
<STATE, T>(context: ContextId<STATE>, transformer: (value: STATE) => T): T;
|
|
@@ -3883,12 +4568,17 @@ export declare const useContextProvider: <STATE>(context: ContextId<STATE>, newV
|
|
|
3883
4568
|
/** @public */
|
|
3884
4569
|
export declare const useErrorBoundary: () => ErrorBoundaryStore;
|
|
3885
4570
|
|
|
4571
|
+
/**
|
|
4572
|
+
* Injected by the optimizer into component$ bodies in HMR mode. Registers a document event listener
|
|
4573
|
+
* that triggers component re-render on HMR updates.
|
|
4574
|
+
*
|
|
4575
|
+
* @internal
|
|
4576
|
+
*/
|
|
4577
|
+
export declare function _useHmr(devPath: string): void;
|
|
4578
|
+
|
|
3886
4579
|
/** @public */
|
|
3887
4580
|
export declare const useId: () => string;
|
|
3888
4581
|
|
|
3889
|
-
/** @internal */
|
|
3890
|
-
export declare const _useInvokeContext: () => RenderInvokeContext;
|
|
3891
|
-
|
|
3892
4582
|
/**
|
|
3893
4583
|
* Used by the Qwik Optimizer to restore the lexically scoped variables.
|
|
3894
4584
|
*
|
|
@@ -3897,6 +4587,7 @@ export declare const _useInvokeContext: () => RenderInvokeContext;
|
|
|
3897
4587
|
* NOTE: `useLexicalScope` method can only be used in the synchronous portion of the callback
|
|
3898
4588
|
* (before any `await` statements.)
|
|
3899
4589
|
*
|
|
4590
|
+
* @deprecated Use `_captures` instead.
|
|
3900
4591
|
* @internal
|
|
3901
4592
|
*/
|
|
3902
4593
|
export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
@@ -3907,10 +4598,12 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
|
3907
4598
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3908
4599
|
* have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.
|
|
3909
4600
|
*
|
|
4601
|
+
* Events are case sensitive.
|
|
4602
|
+
*
|
|
3910
4603
|
* @public
|
|
3911
4604
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3912
4605
|
*/
|
|
3913
|
-
export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4606
|
+
export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
3914
4607
|
|
|
3915
4608
|
/**
|
|
3916
4609
|
* Register a listener on `document`.
|
|
@@ -3918,6 +4611,8 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
|
|
|
3918
4611
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3919
4612
|
* have access to the JSX.
|
|
3920
4613
|
*
|
|
4614
|
+
* Events are case sensitive.
|
|
4615
|
+
*
|
|
3921
4616
|
* @public
|
|
3922
4617
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3923
4618
|
*
|
|
@@ -3937,7 +4632,21 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
|
|
|
3937
4632
|
* });
|
|
3938
4633
|
* ```
|
|
3939
4634
|
*/
|
|
3940
|
-
export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4635
|
+
export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
4636
|
+
|
|
4637
|
+
/** @public */
|
|
4638
|
+
export declare type UseOnOptions = UseOnOptionsBase & ({
|
|
4639
|
+
passive?: boolean;
|
|
4640
|
+
preventdefault?: never;
|
|
4641
|
+
} | {
|
|
4642
|
+
passive?: never;
|
|
4643
|
+
preventdefault?: boolean;
|
|
4644
|
+
});
|
|
4645
|
+
|
|
4646
|
+
declare interface UseOnOptionsBase {
|
|
4647
|
+
capture?: boolean;
|
|
4648
|
+
stoppropagation?: boolean;
|
|
4649
|
+
}
|
|
3941
4650
|
|
|
3942
4651
|
/**
|
|
3943
4652
|
* Register a listener on `window`.
|
|
@@ -3945,6 +4654,8 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
|
|
|
3945
4654
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3946
4655
|
* have access to the JSX.
|
|
3947
4656
|
*
|
|
4657
|
+
* Events are case sensitive.
|
|
4658
|
+
*
|
|
3948
4659
|
* @public
|
|
3949
4660
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3950
4661
|
*
|
|
@@ -3965,7 +4676,7 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
|
|
|
3965
4676
|
* });
|
|
3966
4677
|
* ```
|
|
3967
4678
|
*/
|
|
3968
|
-
export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T
|
|
4679
|
+
export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], eventQrl: EventQRL<T>, options?: UseOnOptions) => void;
|
|
3969
4680
|
|
|
3970
4681
|
/**
|
|
3971
4682
|
* This method works like an async memoized function that runs whenever some tracked value changes
|
|
@@ -3983,45 +4694,15 @@ export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], ev
|
|
|
3983
4694
|
* Be careful when using a `try/catch` statement in `useResource$`. If you catch the error and don't
|
|
3984
4695
|
* re-throw it (or a new Error), the resource status will never be `rejected`.
|
|
3985
4696
|
*
|
|
3986
|
-
*
|
|
3987
|
-
*
|
|
3988
|
-
*
|
|
3989
|
-
* city name changes.
|
|
3990
|
-
*
|
|
3991
|
-
* ```tsx
|
|
3992
|
-
* const Cmp = component$(() => {
|
|
3993
|
-
* const cityS = useSignal('');
|
|
3994
|
-
*
|
|
3995
|
-
* const weatherResource = useResource$(async ({ track, cleanup }) => {
|
|
3996
|
-
* const cityName = track(cityS);
|
|
3997
|
-
* const abortController = new AbortController();
|
|
3998
|
-
* cleanup(() => abortController.abort('cleanup'));
|
|
3999
|
-
* const res = await fetch(`http://weatherdata.com?city=${cityName}`, {
|
|
4000
|
-
* signal: abortController.signal,
|
|
4001
|
-
* });
|
|
4002
|
-
* const data = await res.json();
|
|
4003
|
-
* return data as { temp: number };
|
|
4004
|
-
* });
|
|
4005
|
-
*
|
|
4006
|
-
* return (
|
|
4007
|
-
* <div>
|
|
4008
|
-
* <input name="city" bind:value={cityS} />
|
|
4009
|
-
* <Resource
|
|
4010
|
-
* value={weatherResource}
|
|
4011
|
-
* onResolved={(weather) => {
|
|
4012
|
-
* return <div>Temperature: {weather.temp}</div>;
|
|
4013
|
-
* }}
|
|
4014
|
-
* />
|
|
4015
|
-
* </div>
|
|
4016
|
-
* );
|
|
4017
|
-
* });
|
|
4018
|
-
* ```
|
|
4019
|
-
*
|
|
4697
|
+
* @deprecated Use `useComputed$` instead, which is more powerful and flexible. `useResource$` is
|
|
4698
|
+
* still available for backward compatibility but it is recommended to migrate to `useComputed$`
|
|
4699
|
+
* for new code and when updating existing code.
|
|
4020
4700
|
* @public
|
|
4701
|
+
* @see useComputed$
|
|
4021
4702
|
* @see Resource
|
|
4022
4703
|
* @see ResourceReturn
|
|
4023
4704
|
*/
|
|
4024
|
-
export declare const useResource$: <T>(
|
|
4705
|
+
export declare const useResource$: <T>(qrl: ResourceFn<T>, opts?: ResourceOptions | undefined) => ResourceReturn<T>;
|
|
4025
4706
|
|
|
4026
4707
|
/** @internal */
|
|
4027
4708
|
export declare const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: ResourceOptions) => ResourceReturn<T>;
|
|
@@ -4090,7 +4771,7 @@ export declare const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: Resourc
|
|
|
4090
4771
|
export declare const useSerializer$: typeof createSerializer$;
|
|
4091
4772
|
|
|
4092
4773
|
/** @internal */
|
|
4093
|
-
export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) =>
|
|
4774
|
+
export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) => SerializerSignalImpl<T, S>;
|
|
4094
4775
|
|
|
4095
4776
|
/** @public */
|
|
4096
4777
|
export declare function useServerData<T>(key: string): T | undefined;
|
|
@@ -4104,14 +4785,61 @@ export declare interface UseSignal {
|
|
|
4104
4785
|
<T>(value: T | (() => T)): Signal<T>;
|
|
4105
4786
|
}
|
|
4106
4787
|
|
|
4107
|
-
/**
|
|
4788
|
+
/**
|
|
4789
|
+
* Creates an object with a single reactive `.value` property, that Qwik can track across
|
|
4790
|
+
* serializations.
|
|
4791
|
+
*
|
|
4792
|
+
* Use it to create state for your application. The object has a getter and setter to track reads
|
|
4793
|
+
* and writes of the `.value` property. When the value changes, any functions that read from it will
|
|
4794
|
+
* re-run.
|
|
4795
|
+
*
|
|
4796
|
+
* Prefer `useSignal` over `useStore` when possible, as it is more efficient.
|
|
4797
|
+
*
|
|
4798
|
+
* ### Example
|
|
4799
|
+
*
|
|
4800
|
+
* ```tsx
|
|
4801
|
+
* const Signals = component$(() => {
|
|
4802
|
+
* const counter = useSignal(1);
|
|
4803
|
+
* const text = useSignal('changeme');
|
|
4804
|
+
* const toggle = useSignal(false);
|
|
4805
|
+
*
|
|
4806
|
+
* // useSignal() can also accept a function to calculate the initial value
|
|
4807
|
+
* const state = useSignal(() => {
|
|
4808
|
+
* return expensiveInitialValue();
|
|
4809
|
+
* });
|
|
4810
|
+
*
|
|
4811
|
+
* return (
|
|
4812
|
+
* <div>
|
|
4813
|
+
* <button onClick$={() => counter.value++}>Counter: {counter.value}</button>
|
|
4814
|
+
* {
|
|
4815
|
+
* // pass signal values as the value, the optimizer will make it pass the signal
|
|
4816
|
+
* }
|
|
4817
|
+
* <Child state={state.value} />
|
|
4818
|
+
* {
|
|
4819
|
+
* // signals can be bound to inputs. A property named `bind:x` implies that the property
|
|
4820
|
+
* is a signal
|
|
4821
|
+
* }
|
|
4822
|
+
* <input type="text" bind:value={text} />
|
|
4823
|
+
* <input type="checkbox" bind:checked={toggle} />
|
|
4824
|
+
* </div>
|
|
4825
|
+
* );
|
|
4826
|
+
* });
|
|
4827
|
+
* ```
|
|
4828
|
+
*
|
|
4829
|
+
* @public
|
|
4830
|
+
*/
|
|
4108
4831
|
export declare const useSignal: UseSignal;
|
|
4109
4832
|
|
|
4110
4833
|
/**
|
|
4111
|
-
* Creates
|
|
4834
|
+
* Creates a reactive object that Qwik can track across serialization.
|
|
4835
|
+
*
|
|
4836
|
+
* Use it to create state for your application. The returned object is a Proxy that tracks reads and
|
|
4837
|
+
* writes. When any of the properties change, the functions that read those properties will re-run.
|
|
4112
4838
|
*
|
|
4113
|
-
*
|
|
4114
|
-
*
|
|
4839
|
+
* `Store`s are deep by default, meaning that any objects assigned to properties will also become
|
|
4840
|
+
* `Store`s. This includes arrays.
|
|
4841
|
+
*
|
|
4842
|
+
* Prefer `useSignal` over `useStore` when possible, as it is more efficient.
|
|
4115
4843
|
*
|
|
4116
4844
|
* ### Example
|
|
4117
4845
|
*
|
|
@@ -4291,10 +5019,10 @@ export declare const useStylesScopedQrl: (styles: QRL<string>) => UseStylesScope
|
|
|
4291
5019
|
* @public
|
|
4292
5020
|
* @see `Tracker`
|
|
4293
5021
|
*/
|
|
4294
|
-
export declare const useTask$: (fn: TaskFn) => void;
|
|
5022
|
+
export declare const useTask$: (fn: TaskFn, opts?: TaskOptions) => void;
|
|
4295
5023
|
|
|
4296
5024
|
/** @internal */
|
|
4297
|
-
export declare const useTaskQrl: (qrl: QRL<TaskFn
|
|
5025
|
+
export declare const useTaskQrl: (qrl: QRL<TaskFn>, opts?: TaskOptions) => void;
|
|
4298
5026
|
|
|
4299
5027
|
/**
|
|
4300
5028
|
* ```tsx
|
|
@@ -4324,6 +5052,13 @@ export declare const useVisibleTask$: (fn: TaskFn, opts?: OnVisibleTaskOptions)
|
|
|
4324
5052
|
/** @internal */
|
|
4325
5053
|
export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;
|
|
4326
5054
|
|
|
5055
|
+
/**
|
|
5056
|
+
* Handles events for bind:value
|
|
5057
|
+
*
|
|
5058
|
+
* @internal
|
|
5059
|
+
*/
|
|
5060
|
+
export declare function _val(this: string | undefined, _: any, element: HTMLInputElement): void | Promise<void>;
|
|
5061
|
+
|
|
4327
5062
|
/**
|
|
4328
5063
|
* Type representing a value which is either resolve or a promise.
|
|
4329
5064
|
*
|
|
@@ -4338,38 +5073,83 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4338
5073
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4339
5074
|
|
|
4340
5075
|
/**
|
|
4341
|
-
* 2.0.0-beta.
|
|
5076
|
+
* 2.0.0-beta.41-dev+4d04076
|
|
4342
5077
|
*
|
|
4343
5078
|
* @public
|
|
4344
5079
|
*/
|
|
4345
5080
|
export declare const version: string;
|
|
4346
5081
|
|
|
4347
5082
|
/** @internal */
|
|
4348
|
-
export declare
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
_VNode | null
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
/////////////// 2 - Previous sibling
|
|
4355
|
-
_VNode | null,
|
|
4356
|
-
/////////////// 3 - Next sibling
|
|
4357
|
-
_VNode | null,
|
|
4358
|
-
/////////////// 4 - First child
|
|
4359
|
-
_VNode | null,
|
|
4360
|
-
(string | null | boolean)[]
|
|
4361
|
-
] & {
|
|
4362
|
-
__brand__: 'FragmentNode' & 'HostElement';
|
|
4363
|
-
};
|
|
5083
|
+
export declare class _VirtualVNode extends _VNode {
|
|
5084
|
+
key: string | null;
|
|
5085
|
+
firstChild: _VNode | null | undefined;
|
|
5086
|
+
lastChild: _VNode | null | undefined;
|
|
5087
|
+
constructor(key: string | null, flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined);
|
|
5088
|
+
}
|
|
4364
5089
|
|
|
4365
5090
|
/** @public */
|
|
4366
5091
|
export declare type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';
|
|
4367
5092
|
|
|
4368
5093
|
/** @internal */
|
|
4369
|
-
export declare
|
|
5094
|
+
export declare abstract class _VNode implements BackRef {
|
|
5095
|
+
flags: _VNodeFlags;
|
|
5096
|
+
parent: _VNode | null;
|
|
5097
|
+
previousSibling: _VNode | null | undefined;
|
|
5098
|
+
nextSibling: _VNode | null | undefined;
|
|
5099
|
+
props: Props | null;
|
|
5100
|
+
[_EFFECT_BACK_REF]: Map<any, any> | undefined;
|
|
5101
|
+
slotParent: _VNode | null;
|
|
5102
|
+
dirty: ChoreBits;
|
|
5103
|
+
dirtyChildren: _VNode[] | null;
|
|
5104
|
+
nextDirtyChildIndex: number;
|
|
5105
|
+
constructor(flags: _VNodeFlags, parent: _VNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null);
|
|
5106
|
+
toString(): string;
|
|
5107
|
+
}
|
|
5108
|
+
|
|
5109
|
+
/** @internal */
|
|
5110
|
+
export declare const _vnode_ensureElementInflated: (container: _Container, vnode: _VNode) => void;
|
|
5111
|
+
|
|
5112
|
+
/** @internal */
|
|
5113
|
+
export declare const _vnode_getAttrKeys: (container: _Container, vnode: _ElementVNode | _VirtualVNode) => string[];
|
|
5114
|
+
|
|
5115
|
+
/** @internal */
|
|
5116
|
+
export declare const _vnode_getElementName: (vnode: _ElementVNode) => string;
|
|
5117
|
+
|
|
5118
|
+
/** @internal */
|
|
5119
|
+
export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
|
|
5120
|
+
|
|
5121
|
+
/** @internal */
|
|
5122
|
+
export declare const _vnode_getProp: <T = unknown>(vNode: _VNode, key: string, getObject: ((id: string) => unknown) | null) => T | null;
|
|
5123
|
+
|
|
5124
|
+
/** @internal */
|
|
5125
|
+
export declare const _vnode_getVNodeForChildNode: (vNode: _ElementVNode, childElement: Element) => _ElementVNode;
|
|
5126
|
+
|
|
5127
|
+
/** @internal */
|
|
5128
|
+
export declare const _vnode_insertBefore: (journal: _VNodeJournal, parent: _ElementVNode | _VirtualVNode, newChild: _VNode, insertBefore: _VNode | null) => void;
|
|
5129
|
+
|
|
5130
|
+
/** @internal */
|
|
5131
|
+
export declare const _vnode_isElementVNode: (vNode: _VNode) => vNode is _ElementVNode;
|
|
5132
|
+
|
|
5133
|
+
/** @internal */
|
|
5134
|
+
export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
|
|
5135
|
+
|
|
5136
|
+
/** @internal */
|
|
5137
|
+
export declare const _vnode_isTextVNode: (vNode: _VNode) => vNode is _TextVNode;
|
|
5138
|
+
|
|
5139
|
+
/** @internal */
|
|
5140
|
+
export declare const _vnode_isVirtualVNode: (vNode: _VNode) => vNode is _VirtualVNode;
|
|
5141
|
+
|
|
5142
|
+
/** @internal */
|
|
5143
|
+
export declare const _vnode_newVirtual: () => _VirtualVNode;
|
|
5144
|
+
|
|
5145
|
+
/** @internal */
|
|
5146
|
+
export declare const _vnode_remove: (journal: _VNodeJournal, vParent: _ElementVNode | _VirtualVNode, vToRemove: _VNode, removeDOM: boolean) => void;
|
|
5147
|
+
|
|
5148
|
+
/** @internal */
|
|
5149
|
+
export declare const _vnode_setProp: (vNode: _VNode, key: string, value: unknown) => void;
|
|
4370
5150
|
|
|
4371
5151
|
/** @internal */
|
|
4372
|
-
export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean): string;
|
|
5152
|
+
export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean, container?: _Container | null): string;
|
|
4373
5153
|
|
|
4374
5154
|
/**
|
|
4375
5155
|
* Array of numbers which describes virtual nodes in the tree.
|
|
@@ -4398,7 +5178,7 @@ export declare function _vnode_toString(this: _VNode | null, depth?: number, off
|
|
|
4398
5178
|
* this data needs to be serialized into a string and stored in the DOM as a script tag which has
|
|
4399
5179
|
* deferent serialization format.
|
|
4400
5180
|
*/
|
|
4401
|
-
declare type VNodeData = [VNodeDataFlag, ...(
|
|
5181
|
+
declare type VNodeData = [VNodeDataFlag, ...(Props | number)[]];
|
|
4402
5182
|
|
|
4403
5183
|
/**
|
|
4404
5184
|
* Flags for VNodeData (Flags con be bitwise combined)
|
|
@@ -4437,46 +5217,34 @@ export declare const enum _VNodeFlags {
|
|
|
4437
5217
|
Element = 1,
|
|
4438
5218
|
Virtual = 2,
|
|
4439
5219
|
ELEMENT_OR_VIRTUAL_MASK = 3,
|
|
5220
|
+
Text = 4,
|
|
4440
5221
|
ELEMENT_OR_TEXT_MASK = 5,
|
|
4441
5222
|
TYPE_MASK = 7,
|
|
4442
5223
|
INFLATED_TYPE_MASK = 15,
|
|
4443
|
-
Text = 4,
|
|
4444
5224
|
Inflated = 8,
|
|
4445
5225
|
Resolved = 16,
|
|
4446
5226
|
Deleted = 32,
|
|
4447
|
-
|
|
4448
|
-
|
|
5227
|
+
HasIterationItems = 64,
|
|
5228
|
+
InflatedIterationItems = 128,
|
|
5229
|
+
Cursor = 256,
|
|
5230
|
+
NAMESPACE_MASK = 1536,
|
|
5231
|
+
NEGATED_NAMESPACE_MASK = -1537,
|
|
4449
5232
|
NS_html = 0,// http://www.w3.org/1999/xhtml
|
|
4450
|
-
NS_svg =
|
|
4451
|
-
NS_math =
|
|
5233
|
+
NS_svg = 512,// http://www.w3.org/2000/svg
|
|
5234
|
+
NS_math = 1024,// http://www.w3.org/1998/Math/MathML
|
|
5235
|
+
HasTargetElement = 2048
|
|
4452
5236
|
}
|
|
4453
5237
|
|
|
4454
|
-
|
|
5238
|
+
/** @internal */
|
|
5239
|
+
export declare type _VNodeJournal = Array<VNodeOperation>;
|
|
4455
5240
|
|
|
4456
|
-
|
|
4457
|
-
* Fundamental DOM operations are:
|
|
4458
|
-
*
|
|
4459
|
-
* - Insert new DOM element/text
|
|
4460
|
-
* - Remove DOM element/text
|
|
4461
|
-
* - Set DOM element attributes
|
|
4462
|
-
* - Set text node value
|
|
4463
|
-
*/
|
|
4464
|
-
declare const enum VNodeJournalOpCode {
|
|
4465
|
-
SetText = 1,// ------ [SetAttribute, target, text]
|
|
4466
|
-
SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
|
|
4467
|
-
HoistStyles = 3,// -- [HoistStyles, document]
|
|
4468
|
-
Remove = 4,// ------- [Insert, target(parent), ...nodes]
|
|
4469
|
-
Insert = 5
|
|
4470
|
-
}
|
|
5241
|
+
declare type VNodeOperation = DeleteOperation | RemoveAllChildrenOperation | SetTextOperation | InsertOrMoveOperation | SetAttributeOperation;
|
|
4471
5242
|
|
|
4472
5243
|
/** @internal */
|
|
4473
|
-
export declare const _waitUntilRendered: (
|
|
5244
|
+
export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
|
|
4474
5245
|
|
|
4475
5246
|
/** @internal */
|
|
4476
|
-
export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options:
|
|
4477
|
-
currentStyleScoped: string | null;
|
|
4478
|
-
parentComponentFrame: ISsrComponentFrame | null;
|
|
4479
|
-
}): Promise<void>;
|
|
5247
|
+
export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: SSRRenderJSXOptions): Promise<void>;
|
|
4480
5248
|
|
|
4481
5249
|
/**
|
|
4482
5250
|
* Override the `getLocale` with `lang` within the `fn` execution.
|
|
@@ -4485,27 +5253,20 @@ export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
|
|
|
4485
5253
|
*/
|
|
4486
5254
|
export declare function withLocale<T>(locale: string, fn: () => T): T;
|
|
4487
5255
|
|
|
4488
|
-
declare
|
|
4489
|
-
UNWRAP = 2
|
|
4490
|
-
}
|
|
5256
|
+
declare type WrappedProp<T extends object, P extends keyof T> = T extends Signal ? WrappedSignalImpl<PropType<T, P>> : PropType<T, P>;
|
|
4491
5257
|
|
|
4492
|
-
declare class WrappedSignalImpl<T> extends SignalImpl<T>
|
|
5258
|
+
declare class WrappedSignalImpl<T> extends SignalImpl<T> {
|
|
4493
5259
|
$args$: any[];
|
|
4494
5260
|
$func$: (...args: any[]) => T;
|
|
4495
5261
|
$funcStr$: string | null;
|
|
4496
5262
|
$flags$: AllSignalFlags;
|
|
4497
|
-
$hostElement$:
|
|
4498
|
-
|
|
4499
|
-
[
|
|
4500
|
-
constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
|
|
5263
|
+
$hostElement$: _HostElement | undefined;
|
|
5264
|
+
[_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
|
|
5265
|
+
constructor(container: _Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: AllSignalFlags);
|
|
4501
5266
|
invalidate(): void;
|
|
4502
|
-
/**
|
|
4503
|
-
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
4504
|
-
* remained the same object.
|
|
4505
|
-
*/
|
|
4506
|
-
force(): void;
|
|
4507
5267
|
get untrackedValue(): T;
|
|
4508
|
-
$computeIfNeeded$():
|
|
5268
|
+
$computeIfNeeded$(): void;
|
|
5269
|
+
$unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
|
|
4509
5270
|
set value(_: any);
|
|
4510
5271
|
get value(): any;
|
|
4511
5272
|
}
|
|
@@ -4521,9 +5282,9 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
|
4521
5282
|
*
|
|
4522
5283
|
* @internal
|
|
4523
5284
|
*/
|
|
4524
|
-
export declare const _wrapProp: <T extends
|
|
5285
|
+
export declare const _wrapProp: <T extends object, P extends keyof T>(...args: [T, P?]) => WrappedProp<T, P>;
|
|
4525
5286
|
|
|
4526
5287
|
/** @internal @deprecated v1 compat */
|
|
4527
|
-
export declare const _wrapSignal: <T extends
|
|
5288
|
+
export declare const _wrapSignal: <T extends object, P extends keyof T>(obj: T, prop: P) => T[P] | WrappedProp<T, P>;
|
|
4528
5289
|
|
|
4529
5290
|
export { }
|