@qwik.dev/core 2.0.0-beta.2 → 2.0.0-beta.21
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/bindings/qwik.darwin-arm64.node +0 -0
- package/bindings/qwik.linux-x64-gnu.node +0 -0
- package/bindings/qwik.win32-x64-msvc.node +0 -0
- package/bindings/qwik_wasm_bg.wasm +0 -0
- 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 +39 -0
- package/dist/backpatch-executor.js +1 -0
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +5633 -0
- package/dist/core-internal.d.ts +673 -396
- package/dist/core.min.mjs +2 -1
- package/dist/core.mjs +10168 -8294
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +5745 -4592
- package/dist/insights/vite/index.mjs +10 -10
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +16 -38
- package/dist/optimizer.mjs +2608 -3719
- package/dist/preloader.mjs +8 -11
- package/dist/qwikloader.debug.js +152 -132
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +38 -15
- package/dist/server.mjs +1209 -927
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +2 -2
- 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} +2 -2
- 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} +3 -3
- package/dist/starters/adapters/bun/package.json +3 -2
- package/dist/starters/adapters/bun/src/entry.bun.ts +0 -2
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +2 -2
- package/dist/starters/adapters/cloud-run/package.json +3 -2
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +1 -3
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +2 -2
- 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 +23 -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} +2 -2
- package/dist/starters/adapters/deno/package.json +3 -2
- package/dist/starters/adapters/deno/src/entry.deno.ts +0 -2
- package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +2 -2
- package/dist/starters/adapters/express/package.json +4 -3
- package/dist/starters/adapters/express/src/entry.express.tsx +1 -3
- package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +2 -2
- package/dist/starters/adapters/fastify/package.json +3 -2
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +1 -1
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +1 -2
- package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +2 -2
- 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} +2 -2
- package/dist/starters/adapters/netlify-edge/package.json +3 -2
- 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} +2 -2
- package/dist/starters/adapters/node-server/package.json +3 -2
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +0 -2
- package/dist/starters/adapters/{static/adapters/static/vite.config.mts → ssg/adapters/ssg/vite.config.ts} +3 -3
- 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} +2 -2
- 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 +23 -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/pandacss/package.json +1 -1
- package/dist/starters/features/playwright/playwright-report/index.html +953 -930
- 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/testing/index.d.ts +775 -6
- package/dist/testing/index.mjs +14298 -10837
- package/dist/testing/package.json +1 -1
- package/handlers.mjs +1 -1
- package/package.json +30 -55
- package/public.d.ts +3 -1
- package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
- package/server.d.ts +2 -0
- package/bindings/qwik.darwin-x64.node +0 -0
- package/bindings/qwik.wasm.cjs +0 -471
- 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 -11754
- package/dist/core.cjs.map +0 -1
- package/dist/core.prod.cjs +0 -5647
- 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 -3027
- 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/tailwind/.prettierrc.js +0 -3
- package/dist/testing/index.cjs +0 -33287
- /package/dist/starters/adapters/{static → ssg}/README.md +0 -0
package/dist/core-internal.d.ts
CHANGED
|
@@ -2,10 +2,6 @@ import * as CSS_2 from 'csstype';
|
|
|
2
2
|
import { isBrowser } from './build';
|
|
3
3
|
import { isDev } from './build';
|
|
4
4
|
import { isServer } from './build';
|
|
5
|
-
import { QRL as QRL_2 } from './qrl.public';
|
|
6
|
-
import { ReadonlySignal as ReadonlySignal_2 } from '..';
|
|
7
|
-
import type { StreamWriter as StreamWriter_2 } from '.';
|
|
8
|
-
import { ValueOrPromise as ValueOrPromise_2 } from '..';
|
|
9
5
|
|
|
10
6
|
/**
|
|
11
7
|
* Qwik Optimizer marker function.
|
|
@@ -83,23 +79,20 @@ import { ValueOrPromise as ValueOrPromise_2 } from '..';
|
|
|
83
79
|
*/
|
|
84
80
|
export declare const $: <T>(expression: T) => QRL<T>;
|
|
85
81
|
|
|
82
|
+
declare interface AddRootFn {
|
|
83
|
+
(obj: unknown, returnRef?: never): number;
|
|
84
|
+
(obj: unknown, returnRef: true): SeenRef;
|
|
85
|
+
}
|
|
86
|
+
|
|
86
87
|
declare type AllEventKeys = keyof AllEventsMap;
|
|
87
88
|
|
|
88
|
-
declare type AllEventMapRaw =
|
|
89
|
-
qidle: QwikIdleEvent;
|
|
90
|
-
qinit: QwikInitEvent;
|
|
91
|
-
qsymbol: QwikSymbolEvent;
|
|
92
|
-
qvisible: QwikVisibleEvent;
|
|
93
|
-
qviewtransition: QwikViewTransitionEvent;
|
|
94
|
-
};
|
|
89
|
+
declare type AllEventMapRaw = QwikHTMLElementEventMap & QwikDocumentEventMap & QwikWindowEventMap;
|
|
95
90
|
|
|
96
91
|
declare type AllEventsMap = Omit<AllEventMapRaw, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
97
92
|
|
|
98
93
|
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
94
|
|
|
100
|
-
declare type
|
|
101
|
-
|
|
102
|
-
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags;
|
|
95
|
+
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags;
|
|
103
96
|
|
|
104
97
|
/**
|
|
105
98
|
* TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic`
|
|
@@ -357,22 +350,60 @@ declare interface AriaAttributes {
|
|
|
357
350
|
/** @public */
|
|
358
351
|
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
352
|
|
|
360
|
-
declare type
|
|
353
|
+
declare type AsyncCtx = {
|
|
361
354
|
track: Tracker;
|
|
362
355
|
cleanup: (callback: () => void) => void;
|
|
363
356
|
};
|
|
364
357
|
|
|
365
358
|
/** @public */
|
|
366
|
-
export declare type
|
|
359
|
+
export declare type AsyncFn<T> = (ctx: AsyncCtx) => Promise<T>;
|
|
367
360
|
|
|
368
|
-
|
|
369
|
-
export declare interface AsyncComputedReadonlySignal<T = unknown> extends ReadonlySignal<T> {
|
|
370
|
-
}
|
|
361
|
+
declare type AsyncQRL<T> = _QRLInternal<AsyncFn<T>>;
|
|
371
362
|
|
|
372
363
|
/** @public */
|
|
373
|
-
export declare
|
|
364
|
+
export declare interface AsyncSignal<T = unknown> extends ComputedSignal<T> {
|
|
365
|
+
/** Whether the signal is currently loading. */
|
|
366
|
+
loading: boolean;
|
|
367
|
+
/** The error that occurred while computing the signal. */
|
|
368
|
+
error: Error | undefined;
|
|
369
|
+
/** A promise that resolves when the value is computed. */
|
|
370
|
+
promise(): Promise<T>;
|
|
371
|
+
}
|
|
374
372
|
|
|
375
|
-
|
|
373
|
+
/**
|
|
374
|
+
* # ================================
|
|
375
|
+
*
|
|
376
|
+
* AsyncSignalImpl
|
|
377
|
+
*
|
|
378
|
+
* # ================================
|
|
379
|
+
*/
|
|
380
|
+
declare class AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements BackRef {
|
|
381
|
+
$untrackedLoading$: boolean;
|
|
382
|
+
$untrackedError$: Error | undefined;
|
|
383
|
+
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
384
|
+
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
385
|
+
$destroy$: NoSerialize<() => void> | null;
|
|
386
|
+
$promiseValue$: T | typeof NEEDS_COMPUTATION;
|
|
387
|
+
private $promise$;
|
|
388
|
+
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
|
|
389
|
+
constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: SignalFlags | SerializationSignalFlags);
|
|
390
|
+
/**
|
|
391
|
+
* Loading is true if the signal is still waiting for the promise to resolve, false if the promise
|
|
392
|
+
* has resolved or rejected.
|
|
393
|
+
*/
|
|
394
|
+
get loading(): boolean;
|
|
395
|
+
set untrackedLoading(value: boolean);
|
|
396
|
+
get untrackedLoading(): boolean;
|
|
397
|
+
/** The error that occurred when the signal was resolved. */
|
|
398
|
+
get error(): Error | undefined;
|
|
399
|
+
set untrackedError(value: Error | undefined);
|
|
400
|
+
get untrackedError(): Error | undefined;
|
|
401
|
+
invalidate(): void;
|
|
402
|
+
promise(): Promise<T>;
|
|
403
|
+
$computeIfNeeded$(): Promise<void> | undefined;
|
|
404
|
+
private $promiseComputation$;
|
|
405
|
+
private setValue;
|
|
406
|
+
}
|
|
376
407
|
|
|
377
408
|
/**
|
|
378
409
|
* Replace given element's props with custom types and return all props specific to the element. Use
|
|
@@ -384,7 +415,7 @@ declare type Augmented<E, A = {}> = Prettify<Filtered<E, A> & A>;
|
|
|
384
415
|
|
|
385
416
|
/** Class for back reference to the EffectSubscription */
|
|
386
417
|
declare abstract class BackRef {
|
|
387
|
-
[_EFFECT_BACK_REF]: Map<
|
|
418
|
+
[_EFFECT_BACK_REF]: Map<any, any> | undefined;
|
|
388
419
|
}
|
|
389
420
|
|
|
390
421
|
declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
@@ -400,21 +431,32 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
|
400
431
|
/** @public */
|
|
401
432
|
declare type Booleanish = boolean | `${boolean}`;
|
|
402
433
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
434
|
+
/**
|
|
435
|
+
* The current captured scope during QRL invocation. This is used to provide the lexical scope for
|
|
436
|
+
* QRL functions. It is used one time per invocation, synchronously, so it is safe to store it in
|
|
437
|
+
* module scope.
|
|
438
|
+
*
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
441
|
+
export declare let _captures: Readonly<unknown[]> | null;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Handles events for bind:checked
|
|
445
|
+
*
|
|
446
|
+
* @internal
|
|
447
|
+
*/
|
|
448
|
+
export declare function _chk(this: string | undefined, _: any, element: HTMLInputElement): void;
|
|
449
|
+
|
|
450
|
+
declare const enum ChoreBits {
|
|
451
|
+
NONE = 0,
|
|
452
|
+
TASKS = 1,
|
|
453
|
+
NODE_DIFF = 2,
|
|
454
|
+
COMPONENT = 4,
|
|
455
|
+
NODE_PROPS = 8,
|
|
456
|
+
COMPUTE = 16,
|
|
457
|
+
CHILDREN = 32,
|
|
458
|
+
CLEANUP = 64,
|
|
459
|
+
DIRTY_MASK = 127
|
|
418
460
|
}
|
|
419
461
|
|
|
420
462
|
/**
|
|
@@ -430,17 +472,14 @@ declare const enum ChoreType {
|
|
|
430
472
|
export declare type ClassList = string | undefined | null | false | Record<string, boolean | string | number | null | undefined> | ClassList[];
|
|
431
473
|
|
|
432
474
|
/** @internal */
|
|
433
|
-
export declare interface ClientContainer extends
|
|
475
|
+
export declare interface ClientContainer extends _Container {
|
|
434
476
|
document: _QDocument;
|
|
435
477
|
element: _ContainerElement;
|
|
436
478
|
qContainer: string;
|
|
437
479
|
$locale$: string;
|
|
438
480
|
qManifestHash: string;
|
|
439
481
|
rootVNode: _ElementVNode;
|
|
440
|
-
$journal$: VNodeJournal;
|
|
441
|
-
renderDone: Promise<void> | null;
|
|
442
482
|
$forwardRefs$: Array<number> | null;
|
|
443
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
444
483
|
parseQRL<T = unknown>(qrl: string): QRL<T>;
|
|
445
484
|
$setRawState$(id: number, vParent: _ElementVNode | _VirtualVNode): void;
|
|
446
485
|
}
|
|
@@ -468,11 +507,11 @@ export declare interface ClientContainer extends Container {
|
|
|
468
507
|
* step?: number;
|
|
469
508
|
* }
|
|
470
509
|
* export const Counter = component$((props: CounterProps) => {
|
|
471
|
-
* const state =
|
|
510
|
+
* const state = useSignal(props.initialValue || 0);
|
|
472
511
|
* return (
|
|
473
512
|
* <div>
|
|
474
|
-
* <span>{state.
|
|
475
|
-
* <button onClick$={() => (state.
|
|
513
|
+
* <span>{state.value}</span>
|
|
514
|
+
* <button onClick$={() => (state.value += props.step || 1)}>+</button>
|
|
476
515
|
* </div>
|
|
477
516
|
* );
|
|
478
517
|
* });
|
|
@@ -540,7 +579,13 @@ export declare const componentQrl: <PROPS extends Record<any, any>>(componentQrl
|
|
|
540
579
|
export declare type ComputedFn<T> = () => T;
|
|
541
580
|
|
|
542
581
|
/** @public */
|
|
543
|
-
export declare
|
|
582
|
+
export declare interface ComputedOptions {
|
|
583
|
+
serializationStrategy?: SerializationStrategy;
|
|
584
|
+
container?: _Container;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** @public */
|
|
588
|
+
export declare type ComputedReturnType<T> = T extends Promise<any> ? never : ComputedSignal<T>;
|
|
544
589
|
|
|
545
590
|
/**
|
|
546
591
|
* A computed signal is a signal which is calculated from other signals. When the signals change,
|
|
@@ -551,10 +596,15 @@ export declare type ComputedReturnType<T> = T extends Promise<any> ? never : Rea
|
|
|
551
596
|
*/
|
|
552
597
|
export declare interface ComputedSignal<T> extends ReadonlySignal<T> {
|
|
553
598
|
/**
|
|
554
|
-
* Use this to force
|
|
555
|
-
*
|
|
599
|
+
* Use this to force running subscribers, for example when the calculated value mutates but
|
|
600
|
+
* remains the same object.
|
|
556
601
|
*/
|
|
557
602
|
force(): void;
|
|
603
|
+
/**
|
|
604
|
+
* Use this to force recalculation and running subscribers, for example when the calculated value
|
|
605
|
+
* mutates but remains the same object.
|
|
606
|
+
*/
|
|
607
|
+
invalidate(): void;
|
|
558
608
|
}
|
|
559
609
|
|
|
560
610
|
/**
|
|
@@ -562,7 +612,7 @@ export declare interface ComputedSignal<T> extends ReadonlySignal<T> {
|
|
|
562
612
|
*
|
|
563
613
|
* The value is available synchronously, but the computation is done lazily.
|
|
564
614
|
*/
|
|
565
|
-
declare class ComputedSignalImpl<T, S extends
|
|
615
|
+
declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> extends SignalImpl<T> implements BackRef {
|
|
566
616
|
/**
|
|
567
617
|
* The compute function is stored here.
|
|
568
618
|
*
|
|
@@ -570,23 +620,20 @@ declare class ComputedSignalImpl<T, S extends QRLInternal = ComputeQRL<T>> exten
|
|
|
570
620
|
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous). )
|
|
571
621
|
*/
|
|
572
622
|
$computeQrl$: S;
|
|
573
|
-
$flags$: SignalFlags;
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
$invalidate$(): void;
|
|
623
|
+
$flags$: SignalFlags | SerializationSignalFlags;
|
|
624
|
+
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
|
|
625
|
+
constructor(container: _Container | null, fn: S, flags?: SignalFlags | SerializationSignalFlags);
|
|
626
|
+
invalidate(): void;
|
|
578
627
|
/**
|
|
579
628
|
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
580
629
|
* remained the same object
|
|
581
630
|
*/
|
|
582
631
|
force(): void;
|
|
583
632
|
get untrackedValue(): T;
|
|
584
|
-
$computeIfNeeded$():
|
|
585
|
-
set value(_: any);
|
|
586
|
-
get value(): any;
|
|
633
|
+
$computeIfNeeded$(): void;
|
|
587
634
|
}
|
|
588
635
|
|
|
589
|
-
declare type ComputeQRL<T> =
|
|
636
|
+
declare type ComputeQRL<T> = _QRLInternal<ComputedFn<T>>;
|
|
590
637
|
|
|
591
638
|
/** @internal */
|
|
592
639
|
export declare const _CONST_PROPS: unique symbol;
|
|
@@ -600,18 +647,22 @@ export declare const _CONST_PROPS: unique symbol;
|
|
|
600
647
|
* - `VNode` and `ISsrNode`: Either a component or `<Signal>`
|
|
601
648
|
* - `Signal2`: A derived signal which contains a computation function.
|
|
602
649
|
*/
|
|
603
|
-
declare type Consumer = Task | _VNode |
|
|
650
|
+
declare type Consumer = Task | _VNode | SignalImpl | ISsrNode;
|
|
604
651
|
|
|
605
|
-
|
|
652
|
+
/** @internal */
|
|
653
|
+
export declare interface _Container {
|
|
606
654
|
readonly $version$: string;
|
|
607
|
-
readonly $scheduler$: Scheduler;
|
|
608
655
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
609
656
|
readonly $locale$: string;
|
|
610
657
|
readonly $getObjectById$: (id: number | string) => any;
|
|
611
658
|
readonly $serverData$: Record<string, any>;
|
|
612
659
|
$currentUniqueId$: number;
|
|
613
660
|
$buildBase$: string | null;
|
|
614
|
-
|
|
661
|
+
$renderPromise$: Promise<void> | null;
|
|
662
|
+
$resolveRenderPromise$: (() => void) | null;
|
|
663
|
+
$cursorCount$: number;
|
|
664
|
+
$pausedCursorCount$: number;
|
|
665
|
+
handleError(err: any, $host$: HostElement | null): void;
|
|
615
666
|
getParentHost(host: HostElement): HostElement | null;
|
|
616
667
|
setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
|
|
617
668
|
resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
|
|
@@ -755,19 +806,13 @@ export declare interface CorePlatform {
|
|
|
755
806
|
* @param symbol - The name of the symbol to import.
|
|
756
807
|
* @returns A promise that resolves to the imported symbol.
|
|
757
808
|
*/
|
|
758
|
-
importSymbol: (containerEl: Element | undefined, url: string | URL | undefined | null, symbol: string) => ValueOrPromise<
|
|
809
|
+
importSymbol: (containerEl: Element | undefined, url: string | URL | undefined | null, symbol: string) => ValueOrPromise<unknown>;
|
|
759
810
|
/**
|
|
760
811
|
* Perform operation on next request-animation-frame.
|
|
761
812
|
*
|
|
762
813
|
* @param fn - The function to call when the next animation frame is ready.
|
|
763
814
|
*/
|
|
764
815
|
raf: (fn: () => any) => Promise<any>;
|
|
765
|
-
/**
|
|
766
|
-
* Perform operation on next tick.
|
|
767
|
-
*
|
|
768
|
-
* @param fn - The function to call when the tick is ready.
|
|
769
|
-
*/
|
|
770
|
-
nextTick: (fn: () => any) => Promise<any>;
|
|
771
816
|
/**
|
|
772
817
|
* Retrieve chunk name for the symbol.
|
|
773
818
|
*
|
|
@@ -789,6 +834,21 @@ export declare interface CorrectedToggleEvent extends Event {
|
|
|
789
834
|
readonly prevState: 'open' | 'closed';
|
|
790
835
|
}
|
|
791
836
|
|
|
837
|
+
/**
|
|
838
|
+
* Create an async computed signal which is calculated from the given QRL. A computed signal is a
|
|
839
|
+
* signal which is calculated from other signals or async operation. When the signals change, the
|
|
840
|
+
* computed signal is recalculated.
|
|
841
|
+
*
|
|
842
|
+
* The QRL must be a function which returns the value of the signal. The function must not have side
|
|
843
|
+
* effects, and it can be async.
|
|
844
|
+
*
|
|
845
|
+
* @public
|
|
846
|
+
*/
|
|
847
|
+
export declare const createAsync$: <T>(qrl: () => Promise<T>, options?: ComputedOptions) => AsyncSignal<T>;
|
|
848
|
+
|
|
849
|
+
/** @internal */
|
|
850
|
+
export declare const createAsyncQrl: <T>(qrl: QRL<(ctx: AsyncCtx) => Promise<T>>, options?: ComputedOptions) => AsyncSignalImpl<T>;
|
|
851
|
+
|
|
792
852
|
/**
|
|
793
853
|
* Create a computed signal which is calculated from the given QRL. A computed signal is a signal
|
|
794
854
|
* which is calculated from other signals. When the signals change, the computed signal is
|
|
@@ -797,14 +857,14 @@ export declare interface CorrectedToggleEvent extends Event {
|
|
|
797
857
|
* The QRL must be a function which returns the value of the signal. The function must not have side
|
|
798
858
|
* effects, and it must be synchronous.
|
|
799
859
|
*
|
|
800
|
-
* If you need the function to be async, use `
|
|
860
|
+
* If you need the function to be async, use `useAsync$` instead.
|
|
801
861
|
*
|
|
802
862
|
* @public
|
|
803
863
|
*/
|
|
804
|
-
export declare const createComputed$: <T>(qrl: () => T) =>
|
|
864
|
+
export declare const createComputed$: <T>(qrl: () => T, options?: ComputedOptions) => ComputedReturnType<T>;
|
|
805
865
|
|
|
806
866
|
/** @internal */
|
|
807
|
-
export declare const createComputedQrl: <T>(qrl: QRL<() => T
|
|
867
|
+
export declare const createComputedQrl: <T>(qrl: QRL<() => T>, options?: ComputedOptions) => ComputedSignalImpl<T>;
|
|
808
868
|
|
|
809
869
|
/**
|
|
810
870
|
* Create a context ID to be used in your application. The name should be written with no spaces.
|
|
@@ -858,19 +918,6 @@ export declare const createComputedQrl: <T>(qrl: QRL<() => T>) => ComputedSignal
|
|
|
858
918
|
*/
|
|
859
919
|
export declare const createContextId: <STATE = unknown>(name: string) => ContextId<STATE>;
|
|
860
920
|
|
|
861
|
-
declare const createScheduler: (container: Container, scheduleDrain: () => void, journalFlush: () => void) => {
|
|
862
|
-
(type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): ValueOrPromise<void>;
|
|
863
|
-
(type: ChoreType.JOURNAL_FLUSH): ValueOrPromise<void>;
|
|
864
|
-
(type: ChoreType.WAIT_FOR_ALL): ValueOrPromise<void>;
|
|
865
|
-
(type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal | StoreHandler, effects: Set<EffectSubscription> | null): ValueOrPromise<void>;
|
|
866
|
-
(type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): ValueOrPromise<void>;
|
|
867
|
-
(type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): ValueOrPromise<void>;
|
|
868
|
-
(type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): ValueOrPromise<JSXOutput>;
|
|
869
|
-
(type: ChoreType.NODE_DIFF, host: HostElement, target: HostElement, value: JSXOutput | Signal): ValueOrPromise<void>;
|
|
870
|
-
(type: ChoreType.NODE_PROP, host: HostElement, prop: string, value: any): ValueOrPromise<void>;
|
|
871
|
-
(type: ChoreType.CLEANUP_VISIBLE, task: Task): ValueOrPromise<JSXOutput>;
|
|
872
|
-
};
|
|
873
|
-
|
|
874
921
|
/**
|
|
875
922
|
* Create a signal that holds a custom serializable value. See {@link useSerializer$} for more
|
|
876
923
|
* details.
|
|
@@ -909,12 +956,11 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
|
|
|
909
956
|
[v: `--${string}`]: string | number | undefined;
|
|
910
957
|
}
|
|
911
958
|
|
|
912
|
-
/** @public */
|
|
913
959
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
914
960
|
$flags$: number;
|
|
915
961
|
$index$: number;
|
|
916
962
|
$el$: HostElement;
|
|
917
|
-
$qrl$:
|
|
963
|
+
$qrl$: _QRLInternal<T>;
|
|
918
964
|
$state$: B | undefined;
|
|
919
965
|
$destroy$: NoSerialize<() => void> | null;
|
|
920
966
|
}
|
|
@@ -923,10 +969,9 @@ declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
|
923
969
|
* Deserialize data from string to an array of objects.
|
|
924
970
|
*
|
|
925
971
|
* @param rawStateData - Data to deserialize
|
|
926
|
-
* @param element - Container element
|
|
927
972
|
* @internal
|
|
928
973
|
*/
|
|
929
|
-
export declare function _deserialize(rawStateData: string | null
|
|
974
|
+
export declare function _deserialize(rawStateData: string | null): unknown[];
|
|
930
975
|
|
|
931
976
|
declare interface DeserializeContainer {
|
|
932
977
|
$getObjectById$: (id: number | string) => unknown;
|
|
@@ -935,8 +980,6 @@ declare interface DeserializeContainer {
|
|
|
935
980
|
$state$?: unknown[];
|
|
936
981
|
$storeProxyMap$: ObjToProxyMap;
|
|
937
982
|
$forwardRefs$: Array<number> | null;
|
|
938
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
939
|
-
readonly $scheduler$: Scheduler | null;
|
|
940
983
|
}
|
|
941
984
|
|
|
942
985
|
/** @public */
|
|
@@ -963,53 +1006,38 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
963
1006
|
qManifestHash: string;
|
|
964
1007
|
rootVNode: _ElementVNode;
|
|
965
1008
|
document: _QDocument;
|
|
966
|
-
$journal$: VNodeJournal;
|
|
967
|
-
renderDone: Promise<void> | null;
|
|
968
1009
|
$rawStateData$: unknown[];
|
|
969
1010
|
$storeProxyMap$: ObjToProxyMap;
|
|
970
1011
|
$qFuncs$: Array<(...args: unknown[]) => unknown>;
|
|
971
1012
|
$instanceHash$: string;
|
|
972
1013
|
$forwardRefs$: Array<number> | null;
|
|
973
|
-
$initialQRLsIndexes$: Array<number> | null;
|
|
974
1014
|
vNodeLocate: (id: string | Element) => _VNode;
|
|
975
1015
|
private $stateData$;
|
|
976
1016
|
private $styleIds$;
|
|
977
|
-
private $renderCount$;
|
|
978
1017
|
constructor(element: _ContainerElement);
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1018
|
+
/**
|
|
1019
|
+
* The first time we render we need to hoist the styles. (Meaning we need to move all styles from
|
|
1020
|
+
* component inline to <head>)
|
|
1021
|
+
*
|
|
1022
|
+
* We bulk move all of the styles, because the expensive part is for the browser to recompute the
|
|
1023
|
+
* styles, (not the actual DOM manipulation.) By moving all of them at once we can minimize the
|
|
1024
|
+
* reflow.
|
|
1025
|
+
*/
|
|
1026
|
+
$hoistStyles$(): void;
|
|
1027
|
+
$setRawState$(id: number, vParent: _VNode): void;
|
|
1028
|
+
parseQRL<T = unknown>(qrlStr: string): QRL<T>;
|
|
1029
|
+
handleError(err: any, host: _VNode | null): void;
|
|
1030
|
+
setContext<T>(host: _VNode, context: ContextId<T>, value: T): void;
|
|
1031
|
+
resolveContext<T>(host: _VNode, contextId: ContextId<T>): T | undefined;
|
|
1032
|
+
getParentHost(host: _VNode): _VNode | null;
|
|
985
1033
|
setHostProp<T>(host: HostElement, name: string, value: T): void;
|
|
986
1034
|
getHostProp<T>(host: HostElement, name: string): T | null;
|
|
987
|
-
scheduleRender(): Promise<void>;
|
|
988
|
-
private processChores;
|
|
989
1035
|
ensureProjectionResolved(vNode: _VirtualVNode): void;
|
|
990
1036
|
$getObjectById$: (id: number | string) => unknown;
|
|
991
1037
|
getSyncFn(id: number): (...args: unknown[]) => unknown;
|
|
992
1038
|
$appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
|
|
993
1039
|
/** Set the server data for the Qwik Router. */
|
|
994
1040
|
private $setServerData$;
|
|
995
|
-
/**
|
|
996
|
-
* Schedule the initial QRLs to be resolved.
|
|
997
|
-
*
|
|
998
|
-
* Schedules the QRLs that are defined in the state data as `PreloadQRL`.
|
|
999
|
-
*
|
|
1000
|
-
* This is done because when computed and custom serializer QRLs are called they need QRL to work.
|
|
1001
|
-
* If the QRL is not resolved at this point, it will be resolved by throwing a promise and
|
|
1002
|
-
* rerunning the whole wrapping function again. We want to avoid that, because it means that the
|
|
1003
|
-
* function can execute twice.
|
|
1004
|
-
*
|
|
1005
|
-
* ```ts
|
|
1006
|
-
* useVisibleTask$(() => {
|
|
1007
|
-
* runHeavyLogic(); // This will be called again if the QRL of `computedOrCustomSerializer` is not resolved.
|
|
1008
|
-
* console.log(computedOrCustomSerializer.value); // Throw a promise if QRL not resolved and execute visible task again.
|
|
1009
|
-
* });
|
|
1010
|
-
* ```
|
|
1011
|
-
*/
|
|
1012
|
-
private $scheduleInitialQRLs$;
|
|
1013
1041
|
}
|
|
1014
1042
|
export { DomContainer }
|
|
1015
1043
|
export { DomContainer as _DomContainer }
|
|
@@ -1065,36 +1093,20 @@ declare const enum EffectProperty {
|
|
|
1065
1093
|
* - `EffectProperty.COMPONENT` if component
|
|
1066
1094
|
* - `EffectProperty.VNODE` if VNode
|
|
1067
1095
|
*/
|
|
1068
|
-
declare
|
|
1069
|
-
Consumer
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
Set<SignalImpl | StoreTarget> | null,
|
|
1074
|
-
|
|
1075
|
-
_SubscriptionData | null
|
|
1076
|
-
];
|
|
1096
|
+
declare class EffectSubscription {
|
|
1097
|
+
consumer: Consumer;
|
|
1098
|
+
property: EffectProperty | string;
|
|
1099
|
+
backRef: Set<SignalImpl | StoreTarget> | null;
|
|
1100
|
+
data: _SubscriptionData | null;
|
|
1101
|
+
constructor(consumer: Consumer, property: EffectProperty | string, backRef?: Set<SignalImpl | StoreTarget> | null, data?: _SubscriptionData | null);
|
|
1102
|
+
}
|
|
1077
1103
|
|
|
1078
1104
|
/** @internal */
|
|
1079
|
-
export declare
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
_VNode | null,
|
|
1083
|
-
|
|
1084
|
-
_VNode | null,
|
|
1085
|
-
/////////////// 2 - Previous sibling
|
|
1086
|
-
_VNode | null,
|
|
1087
|
-
/////////////// 3 - Next sibling
|
|
1088
|
-
_VNode | null | undefined,
|
|
1089
|
-
/// 4 - First child - undefined if children need to be materialize
|
|
1090
|
-
_VNode | null | undefined,
|
|
1091
|
-
Element,
|
|
1092
|
-
//////////////////// 6 - Element
|
|
1093
|
-
string | undefined,
|
|
1094
|
-
(string | null)[]
|
|
1095
|
-
] & {
|
|
1096
|
-
__brand__: 'ElementVNode';
|
|
1097
|
-
};
|
|
1105
|
+
export declare class _ElementVNode extends _VirtualVNode {
|
|
1106
|
+
node: Element;
|
|
1107
|
+
elementName: string | undefined;
|
|
1108
|
+
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);
|
|
1109
|
+
}
|
|
1098
1110
|
|
|
1099
1111
|
/** @internal */
|
|
1100
1112
|
export declare const _EMPTY_ARRAY: any[];
|
|
@@ -1108,15 +1120,14 @@ export declare interface ErrorBoundaryStore {
|
|
|
1108
1120
|
}
|
|
1109
1121
|
|
|
1110
1122
|
/** @public */
|
|
1111
|
-
export declare const event$: <T>(qrl: T) =>
|
|
1123
|
+
export declare const event$: <T>(qrl: T) => QRL<T>;
|
|
1112
1124
|
|
|
1113
1125
|
declare type EventCorrectionMap = {
|
|
1114
1126
|
auxclick: PointerEvent;
|
|
1115
|
-
beforetoggle: CorrectedToggleEvent;
|
|
1116
1127
|
click: PointerEvent;
|
|
1117
1128
|
dblclick: PointerEvent;
|
|
1118
1129
|
input: InputEvent;
|
|
1119
|
-
|
|
1130
|
+
qvisible: QwikVisibleEvent;
|
|
1120
1131
|
};
|
|
1121
1132
|
|
|
1122
1133
|
declare type EventFromName<T extends string> = LcEvent<T>;
|
|
@@ -1135,6 +1146,9 @@ declare type EventQRL<T extends string = AllEventKeys> = QRL<EventHandler<EventF
|
|
|
1135
1146
|
/** @internal */
|
|
1136
1147
|
export declare const eventQrl: <T>(qrl: QRL<T>) => QRL<T>;
|
|
1137
1148
|
|
|
1149
|
+
/** @internal */
|
|
1150
|
+
export declare function _executeSsrChores(container: SSRContainer, ssrNode: ISsrNode): ValueOrPromise<void>;
|
|
1151
|
+
|
|
1138
1152
|
declare type FilterBase<T> = {
|
|
1139
1153
|
[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];
|
|
1140
1154
|
};
|
|
@@ -1147,6 +1161,13 @@ declare type Filtered<T, A = {}> = {
|
|
|
1147
1161
|
/** @internal */
|
|
1148
1162
|
export declare const _fnSignal: <T extends (...args: any) => any>(fn: T, args: Parameters<T>, fnStr?: string) => WrappedSignalImpl<any>;
|
|
1149
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* Force a store to recompute and schedule effects.
|
|
1166
|
+
*
|
|
1167
|
+
* @public
|
|
1168
|
+
*/
|
|
1169
|
+
export declare const forceStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => void;
|
|
1170
|
+
|
|
1150
1171
|
/** @public */
|
|
1151
1172
|
export declare const Fragment: FunctionComponent<{
|
|
1152
1173
|
children?: any;
|
|
@@ -1164,14 +1185,20 @@ export declare type FunctionComponent<P = unknown> = {
|
|
|
1164
1185
|
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
|
|
1165
1186
|
}['renderFn'];
|
|
1166
1187
|
|
|
1188
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1189
|
+
export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1190
|
+
|
|
1167
1191
|
/** @internal */
|
|
1168
|
-
export declare const
|
|
1192
|
+
export declare const _getContextContainer: () => _Container | undefined;
|
|
1169
1193
|
|
|
1170
1194
|
/** @internal */
|
|
1171
1195
|
export declare const _getContextEvent: () => unknown;
|
|
1172
1196
|
|
|
1197
|
+
/** @internal */
|
|
1198
|
+
export declare const _getContextHostElement: () => HostElement | undefined;
|
|
1199
|
+
|
|
1173
1200
|
/** @public */
|
|
1174
|
-
declare function getDomContainer(element: Element
|
|
1201
|
+
declare function getDomContainer(element: Element): ClientContainer;
|
|
1175
1202
|
export { getDomContainer as _getDomContainer }
|
|
1176
1203
|
export { getDomContainer }
|
|
1177
1204
|
|
|
@@ -1200,7 +1227,10 @@ export declare function getLocale(defaultLocale?: string): string;
|
|
|
1200
1227
|
export declare const getPlatform: () => CorePlatform;
|
|
1201
1228
|
|
|
1202
1229
|
/** @internal */
|
|
1203
|
-
export declare function _getQContainerElement(element: Element
|
|
1230
|
+
export declare function _getQContainerElement(element: Element): Element | null;
|
|
1231
|
+
|
|
1232
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1233
|
+
export declare const _getVarProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1204
1234
|
|
|
1205
1235
|
/** @public */
|
|
1206
1236
|
declare interface GlobalInjections {
|
|
@@ -1212,10 +1242,8 @@ declare interface GlobalInjections {
|
|
|
1212
1242
|
}
|
|
1213
1243
|
|
|
1214
1244
|
/**
|
|
1215
|
-
* The legacy transform, used
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
* Also note that this disables optimizations.
|
|
1245
|
+
* The legacy transform, used by some JSX transpilers. The optimizer normally replaces this with
|
|
1246
|
+
* optimized calls, with the same caveat as `jsx()`.
|
|
1219
1247
|
*
|
|
1220
1248
|
* @public
|
|
1221
1249
|
*/
|
|
@@ -1223,6 +1251,12 @@ declare function h<TYPE extends string | FunctionComponent<PROPS>, PROPS extends
|
|
|
1223
1251
|
export { h as createElement }
|
|
1224
1252
|
export { h }
|
|
1225
1253
|
|
|
1254
|
+
/**
|
|
1255
|
+
* @returns True if the store has effects for the given prop
|
|
1256
|
+
* @internal
|
|
1257
|
+
*/
|
|
1258
|
+
export declare const _hasStoreEffects: (value: StoreTarget, prop: keyof StoreTarget) => boolean;
|
|
1259
|
+
|
|
1226
1260
|
/** @public */
|
|
1227
1261
|
declare interface HoistEntryStrategy {
|
|
1228
1262
|
type: 'hoist';
|
|
@@ -1345,11 +1379,19 @@ export declare const _IMMUTABLE: unique symbol;
|
|
|
1345
1379
|
*/
|
|
1346
1380
|
export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
|
|
1347
1381
|
|
|
1348
|
-
/**
|
|
1349
|
-
|
|
1382
|
+
/**
|
|
1383
|
+
* Create an inlined QRL. This is mostly useful on the server side for serialization.
|
|
1384
|
+
*
|
|
1385
|
+
* @param symbol - The object/function to register, or `null` to retrieve a previously registered
|
|
1386
|
+
* one by hash
|
|
1387
|
+
* @param symbolName - The name of the symbol.
|
|
1388
|
+
* @param lexicalScopeCapture - A set of lexically scoped variables to capture.
|
|
1389
|
+
* @public
|
|
1390
|
+
*/
|
|
1391
|
+
export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1350
1392
|
|
|
1351
1393
|
/** @internal */
|
|
1352
|
-
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?:
|
|
1394
|
+
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1353
1395
|
|
|
1354
1396
|
/** @public */
|
|
1355
1397
|
declare interface InlineEntryStrategy {
|
|
@@ -1381,24 +1423,15 @@ declare type IntrinsicSVGElements = {
|
|
|
1381
1423
|
|
|
1382
1424
|
/** The shared state during an invoke() call */
|
|
1383
1425
|
declare interface InvokeContext {
|
|
1384
|
-
$url$: URL | undefined;
|
|
1385
|
-
/** The next available index for the sequentialScope array */
|
|
1386
|
-
$i$: number;
|
|
1387
1426
|
/** The Virtual parent component for the current component code */
|
|
1388
1427
|
$hostElement$: HostElement | undefined;
|
|
1389
|
-
/** The current DOM element */
|
|
1390
|
-
$element$: Element | undefined;
|
|
1391
1428
|
/** The event we're currently handling */
|
|
1392
1429
|
$event$: PossibleEvents | undefined;
|
|
1393
|
-
/** The QRL function we're currently executing */
|
|
1394
|
-
$qrl$: QRL | undefined;
|
|
1395
1430
|
$effectSubscriber$: EffectSubscription | undefined;
|
|
1396
1431
|
$locale$: string | undefined;
|
|
1397
|
-
$container$:
|
|
1432
|
+
$container$: _Container | undefined;
|
|
1398
1433
|
}
|
|
1399
1434
|
|
|
1400
|
-
declare type InvokeTuple = [Element, Event, URL?];
|
|
1401
|
-
|
|
1402
1435
|
declare type IsAcceptableDOMValue<T> = T extends boolean | number | string | null | undefined ? ((...args: any[]) => any) extends T ? false : true : false;
|
|
1403
1436
|
|
|
1404
1437
|
declare type IsAny<T> = 0 extends T & 1 ? true : false;
|
|
@@ -1424,11 +1457,11 @@ export declare const isSignal: (value: any) => value is Signal<unknown>;
|
|
|
1424
1457
|
/** @internal */
|
|
1425
1458
|
export declare interface ISsrComponentFrame {
|
|
1426
1459
|
componentNode: ISsrNode;
|
|
1460
|
+
slots: (string | JSXChildren)[];
|
|
1427
1461
|
scopedStyleIds: Set<string>;
|
|
1428
1462
|
projectionScopedStyle: string | null;
|
|
1429
1463
|
projectionComponentFrame: ISsrComponentFrame | null;
|
|
1430
1464
|
projectionDepth: number;
|
|
1431
|
-
releaseUnclaimedProjections(unclaimedProjections: (ISsrComponentFrame | JSXChildren | string)[]): void;
|
|
1432
1465
|
consumeChildrenForSlot(projectionNode: ISsrNode, slotName: string): JSXChildren | null;
|
|
1433
1466
|
distributeChildrenIntoSlots(children: JSXChildren, parentScopedStyle: string | null, parentComponentFrame: ISsrComponentFrame | null): void;
|
|
1434
1467
|
hasSlot(slotName: string): boolean;
|
|
@@ -1436,27 +1469,45 @@ export declare interface ISsrComponentFrame {
|
|
|
1436
1469
|
|
|
1437
1470
|
declare interface ISsrNode {
|
|
1438
1471
|
id: string;
|
|
1439
|
-
|
|
1440
|
-
|
|
1472
|
+
flags: SsrNodeFlags;
|
|
1473
|
+
dirty: ChoreBits;
|
|
1474
|
+
parentComponent: ISsrNode | null;
|
|
1475
|
+
vnodeData: VNodeData;
|
|
1476
|
+
currentFile: string | null;
|
|
1441
1477
|
setProp(name: string, value: any): void;
|
|
1442
1478
|
getProp(name: string): any;
|
|
1443
1479
|
removeProp(name: string): void;
|
|
1444
1480
|
addChild(child: ISsrNode): void;
|
|
1481
|
+
setTreeNonUpdatable(): void;
|
|
1445
1482
|
}
|
|
1446
1483
|
|
|
1484
|
+
/** @internal */
|
|
1485
|
+
export declare const _isStore: (value: StoreTarget) => boolean;
|
|
1486
|
+
|
|
1447
1487
|
/** @internal */
|
|
1448
1488
|
export declare function _isStringifiable(value: unknown): value is _Stringifiable;
|
|
1449
1489
|
|
|
1490
|
+
/** @internal */
|
|
1491
|
+
export declare const _isTask: (value: any) => value is Task;
|
|
1492
|
+
|
|
1450
1493
|
/**
|
|
1494
|
+
* Used by the JSX transpilers to create a JSXNode. Note that the optimizer will normally not use
|
|
1495
|
+
* this, instead using _jsxSplit and _jsxSorted directly.
|
|
1496
|
+
*
|
|
1497
|
+
* The optimizer will also replace all `jsx()` calls with the more optimized versions.
|
|
1498
|
+
*
|
|
1499
|
+
* The exception is when the props are not a literal object, which can only happen when the `jsx`
|
|
1500
|
+
* call is written directly.
|
|
1501
|
+
*
|
|
1451
1502
|
* @public
|
|
1452
|
-
* Used by the JSX transpilers to create a JSXNode.
|
|
1453
|
-
* Note that the optimizer will not use this, instead using _jsxSplit and _jsxSorted directly.
|
|
1454
1503
|
*/
|
|
1455
|
-
declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null) => JSXNode<T>;
|
|
1456
|
-
export { jsx }
|
|
1457
|
-
export { jsx as jsxs }
|
|
1504
|
+
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>;
|
|
1458
1505
|
|
|
1459
|
-
/**
|
|
1506
|
+
/**
|
|
1507
|
+
* @deprecated
|
|
1508
|
+
* @internal
|
|
1509
|
+
* No longer used since v2
|
|
1510
|
+
*/
|
|
1460
1511
|
export declare const _jsxBranch: <T>(input?: T) => T | undefined;
|
|
1461
1512
|
|
|
1462
1513
|
/** @internal @deprecated v1 compat */
|
|
@@ -1465,8 +1516,12 @@ export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) =>
|
|
|
1465
1516
|
/** @public */
|
|
1466
1517
|
export declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
1467
1518
|
|
|
1468
|
-
/**
|
|
1469
|
-
|
|
1519
|
+
/**
|
|
1520
|
+
* Alias of `jsx` for development purposes.
|
|
1521
|
+
*
|
|
1522
|
+
* @public
|
|
1523
|
+
*/
|
|
1524
|
+
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>;
|
|
1470
1525
|
|
|
1471
1526
|
declare interface JsxDevOpts {
|
|
1472
1527
|
fileName: string;
|
|
@@ -1474,6 +1529,14 @@ declare interface JsxDevOpts {
|
|
|
1474
1529
|
columnNumber: number;
|
|
1475
1530
|
}
|
|
1476
1531
|
|
|
1532
|
+
declare type JSXDocumentEvents = {
|
|
1533
|
+
[K in keyof QwikDocumentEventMap as `document:on${PascalCaseName<K>}$`]: QwikDocumentEventMap[K];
|
|
1534
|
+
};
|
|
1535
|
+
|
|
1536
|
+
declare type JSXElementEvents = {
|
|
1537
|
+
[K in keyof QwikHTMLElementEventMap as `on${PascalCaseName<K>}$`]: QwikHTMLElementEventMap[K];
|
|
1538
|
+
};
|
|
1539
|
+
|
|
1477
1540
|
/**
|
|
1478
1541
|
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
1479
1542
|
*
|
|
@@ -1487,15 +1550,59 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
|
|
|
1487
1550
|
dev?: DevJSX;
|
|
1488
1551
|
}
|
|
1489
1552
|
|
|
1553
|
+
declare class JSXNodeImpl<T = unknown> implements JSXNodeInternal<T> {
|
|
1554
|
+
type: T;
|
|
1555
|
+
children: JSXChildren;
|
|
1556
|
+
toSort: boolean;
|
|
1557
|
+
key: string | null;
|
|
1558
|
+
varProps: Props;
|
|
1559
|
+
constProps: Props | null;
|
|
1560
|
+
dev?: DevJSX & {
|
|
1561
|
+
stack: string | undefined;
|
|
1562
|
+
};
|
|
1563
|
+
_proxy: Props | null;
|
|
1564
|
+
constructor(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren, key: string | number | null | undefined, toSort?: boolean, dev?: DevJSX);
|
|
1565
|
+
get props(): T extends FunctionComponent<infer PROPS> ? PROPS : Props;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1490
1568
|
/**
|
|
1491
1569
|
* The internal representation of a JSX Node.
|
|
1492
1570
|
*
|
|
1493
1571
|
* @internal
|
|
1494
1572
|
*/
|
|
1495
1573
|
export declare interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1574
|
+
/** The type of node */
|
|
1575
|
+
type: T;
|
|
1576
|
+
/** Do the varProps need sorting */
|
|
1577
|
+
toSort: boolean;
|
|
1578
|
+
/** The key property */
|
|
1579
|
+
key: string | null;
|
|
1580
|
+
/**
|
|
1581
|
+
* Props that are not guaranteed shallow equal across runs.
|
|
1582
|
+
*
|
|
1583
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1584
|
+
*
|
|
1585
|
+
* Does not contain `children` or `key`.
|
|
1586
|
+
*
|
|
1587
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
1588
|
+
*/
|
|
1589
|
+
varProps: Props;
|
|
1590
|
+
/**
|
|
1591
|
+
* Props that will be shallow equal across runs. Does not contain any props that are in varProps.
|
|
1592
|
+
*
|
|
1593
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1594
|
+
*
|
|
1595
|
+
* Does not contain `children` or `key`.
|
|
1596
|
+
*
|
|
1597
|
+
* `onEvent$` props are normalized to the html `q-x:event` version
|
|
1598
|
+
*/
|
|
1599
|
+
constProps: Props | null;
|
|
1600
|
+
/** The children of the node */
|
|
1601
|
+
children: JSXChildren;
|
|
1602
|
+
/** Filename etc for debugging */
|
|
1603
|
+
dev?: DevJSX & {
|
|
1604
|
+
stack: string | undefined;
|
|
1605
|
+
};
|
|
1499
1606
|
}
|
|
1500
1607
|
|
|
1501
1608
|
/**
|
|
@@ -1511,6 +1618,13 @@ export declare const _jsxQ: (type: any, mutable: any, immutable: any, children:
|
|
|
1511
1618
|
/** @internal @deprecated v1 compat */
|
|
1512
1619
|
export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) => JSXNode<any>;
|
|
1513
1620
|
|
|
1621
|
+
/**
|
|
1622
|
+
* Alias of `jsx` to support JSX syntax.
|
|
1623
|
+
*
|
|
1624
|
+
* @public
|
|
1625
|
+
*/
|
|
1626
|
+
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>;
|
|
1627
|
+
|
|
1514
1628
|
/**
|
|
1515
1629
|
* Create a JSXNode with the properties fully split into variable and constant parts, and children
|
|
1516
1630
|
* separated out. Furthermore, the varProps must be a sorted object, that is, the keys must be
|
|
@@ -1521,7 +1635,7 @@ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: an
|
|
|
1521
1635
|
* still update the attribute on the vnode.
|
|
1522
1636
|
*
|
|
1523
1637
|
* @param type - The JSX type
|
|
1524
|
-
* @param varProps - The properties of the tag, sorted, excluding children,
|
|
1638
|
+
* @param varProps - The properties of the tag, sorted, excluding children, key and any constProps
|
|
1525
1639
|
* @param constProps - The properties of the tag that are known to be constant references and don't
|
|
1526
1640
|
* need checking for changes on re-render
|
|
1527
1641
|
* @param children - JSX children. Any `children` in the props objects are ignored.
|
|
@@ -1531,13 +1645,13 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1531
1645
|
|
|
1532
1646
|
/**
|
|
1533
1647
|
* Create a JSXNode, with the properties split into variable and constant parts, but the variable
|
|
1534
|
-
* parts could include keys from constProps
|
|
1648
|
+
* parts could include keys from `constProps`, as well as `key` and `children`.
|
|
1535
1649
|
*
|
|
1536
|
-
* The constant parts are expected to be the same
|
|
1537
|
-
*
|
|
1538
|
-
* still update the attribute on the vnode.
|
|
1650
|
+
* `constProps` cannot include `key` or `children`. The constant parts are expected to be the same
|
|
1651
|
+
* on every render, and are not checked for changes. This means that they are constant scalars or
|
|
1652
|
+
* refs. When the ref is a signal or a store, it can still update the attribute on the vnode.
|
|
1539
1653
|
*
|
|
1540
|
-
* If `children`
|
|
1654
|
+
* If `children` or `key` are defined, any `children`/`key` in the props will be ignored.
|
|
1541
1655
|
*
|
|
1542
1656
|
* @param type - The tag type
|
|
1543
1657
|
* @param varProps - The properties of the tag that could change, including children
|
|
@@ -1545,11 +1659,15 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1545
1659
|
* for changes on re-render
|
|
1546
1660
|
* @internal
|
|
1547
1661
|
*/
|
|
1548
|
-
export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key
|
|
1662
|
+
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>;
|
|
1549
1663
|
|
|
1550
1664
|
/** @public */
|
|
1551
1665
|
export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
|
|
1552
1666
|
|
|
1667
|
+
declare type JSXWindowEvents = {
|
|
1668
|
+
[K in keyof QwikWindowEventMap as `window:on${PascalCaseName<K>}$`]: QwikWindowEventMap[K];
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1553
1671
|
/**
|
|
1554
1672
|
* The names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are
|
|
1555
1673
|
* PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`)
|
|
@@ -1601,6 +1719,15 @@ declare interface LenientSVGProps<T extends Element> extends SVGAttributes, DOMA
|
|
|
1601
1719
|
*/
|
|
1602
1720
|
declare type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
|
|
1603
1721
|
|
|
1722
|
+
/** @internal */
|
|
1723
|
+
export declare const _mapApp_findIndx: <T>(array: (T | null)[], key: string, start: number) => number;
|
|
1724
|
+
|
|
1725
|
+
/** @internal */
|
|
1726
|
+
export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start: number) => T | null;
|
|
1727
|
+
|
|
1728
|
+
/** @internal */
|
|
1729
|
+
export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
|
|
1730
|
+
|
|
1604
1731
|
declare type MediaSpecialAttrs = {
|
|
1605
1732
|
crossOrigin?: HTMLCrossOriginAttribute;
|
|
1606
1733
|
};
|
|
@@ -1641,16 +1768,22 @@ export declare type NativeUIEvent = UIEvent;
|
|
|
1641
1768
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
1642
1769
|
export declare type NativeWheelEvent = WheelEvent;
|
|
1643
1770
|
|
|
1771
|
+
/**
|
|
1772
|
+
* Special value used to mark that a given signal needs to be computed. This is essentially a
|
|
1773
|
+
* "marked as dirty" flag.
|
|
1774
|
+
*/
|
|
1775
|
+
declare const NEEDS_COMPUTATION: any;
|
|
1776
|
+
|
|
1644
1777
|
declare interface NodePropData {
|
|
1645
1778
|
$scopedStyleIdPrefix$: string | null;
|
|
1646
1779
|
$isConst$: boolean;
|
|
1647
1780
|
}
|
|
1648
1781
|
|
|
1649
1782
|
/** @internal */
|
|
1650
|
-
export declare const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?:
|
|
1783
|
+
export declare const _noopQrl: <T>(symbolName: string, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1651
1784
|
|
|
1652
1785
|
/** @internal */
|
|
1653
|
-
export declare const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalScopeCapture?:
|
|
1786
|
+
export declare const _noopQrlDEV: <T>(symbolName: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
1654
1787
|
|
|
1655
1788
|
/**
|
|
1656
1789
|
* Returned type of the `noSerialize()` function. It will be TYPE or undefined.
|
|
@@ -1717,6 +1850,11 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1717
1850
|
strategy?: VisibleTaskStrategy;
|
|
1718
1851
|
}
|
|
1719
1852
|
|
|
1853
|
+
/** @internal */
|
|
1854
|
+
declare const _OWNER: unique symbol;
|
|
1855
|
+
|
|
1856
|
+
declare type PascalCaseName<T extends string> = T extends keyof LcEventNameMap ? LcEventNameMap[T] : Capitalize<T>;
|
|
1857
|
+
|
|
1720
1858
|
/**
|
|
1721
1859
|
* Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,
|
|
1722
1860
|
* instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization
|
|
@@ -1724,15 +1862,7 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1724
1862
|
*
|
|
1725
1863
|
* Add any multi-word event names to this list. Single word events are automatically converted.
|
|
1726
1864
|
*/
|
|
1727
|
-
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';
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Convert an event map to PascalCase. For example, `HTMLElementEventMap` contains lowercase keys,
|
|
1731
|
-
* so this will capitalize them, and use the `LcEventNameMap` for multi-word events names.
|
|
1732
|
-
*/
|
|
1733
|
-
declare type PascalMap<M> = {
|
|
1734
|
-
[K in Extract<keyof M, string> as K extends keyof LcEventNameMap ? LcEventNameMap[K] : Capitalize<K>]: M[K];
|
|
1735
|
-
};
|
|
1865
|
+
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';
|
|
1736
1866
|
|
|
1737
1867
|
declare type PopoverTargetAction = 'hide' | 'show' | 'toggle';
|
|
1738
1868
|
|
|
@@ -1834,6 +1964,9 @@ export declare type PropFunction<T> = QRL<T>;
|
|
|
1834
1964
|
|
|
1835
1965
|
declare type Props = Record<string, unknown>;
|
|
1836
1966
|
|
|
1967
|
+
/** @internal */
|
|
1968
|
+
declare const _PROPS_HANDLER: unique symbol;
|
|
1969
|
+
|
|
1837
1970
|
/**
|
|
1838
1971
|
* Infers `Props` from the component or tag.
|
|
1839
1972
|
*
|
|
@@ -1856,7 +1989,24 @@ export declare type PropsOf<COMP> = COMP extends string ? COMP extends keyof Qwi
|
|
|
1856
1989
|
declare type PropsProxy = {
|
|
1857
1990
|
[_VAR_PROPS]: Props;
|
|
1858
1991
|
[_CONST_PROPS]: Props | null;
|
|
1859
|
-
|
|
1992
|
+
[_OWNER]: JSXNodeInternal;
|
|
1993
|
+
[_PROPS_HANDLER]: PropsProxyHandler;
|
|
1994
|
+
} & Record<string | symbol, unknown>;
|
|
1995
|
+
|
|
1996
|
+
declare class PropsProxyHandler implements ProxyHandler<any> {
|
|
1997
|
+
owner: JSXNodeImpl;
|
|
1998
|
+
$effects$: undefined | Map<string | symbol, Set<EffectSubscription>>;
|
|
1999
|
+
$container$: _Container | null;
|
|
2000
|
+
constructor(owner: JSXNodeImpl);
|
|
2001
|
+
get(_: any, prop: string | symbol): any;
|
|
2002
|
+
set(_: any, prop: string | symbol, value: any): boolean;
|
|
2003
|
+
deleteProperty(_: any, prop: string | symbol): boolean;
|
|
2004
|
+
has(_: any, prop: string | symbol): boolean;
|
|
2005
|
+
getOwnPropertyDescriptor(_: any, p: string | symbol): PropertyDescriptor | undefined;
|
|
2006
|
+
ownKeys(): string[];
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
|
|
1860
2010
|
|
|
1861
2011
|
/**
|
|
1862
2012
|
* Extends the defined component PROPS, adding the default ones (children and q:slot) and allowing
|
|
@@ -1972,7 +2122,7 @@ export declare interface _QDocument extends Document {
|
|
|
1972
2122
|
*
|
|
1973
2123
|
* ```
|
|
1974
2124
|
* <div q:base="/build/">
|
|
1975
|
-
* <button
|
|
2125
|
+
* <button q-e:click="./chunk-abc.js#onClick">...</button>
|
|
1976
2126
|
* </div>
|
|
1977
2127
|
* ```
|
|
1978
2128
|
*
|
|
@@ -1995,7 +2145,7 @@ export declare interface _QDocument extends Document {
|
|
|
1995
2145
|
*/
|
|
1996
2146
|
export declare type QRL<TYPE = unknown> = {
|
|
1997
2147
|
__qwik_serializable__?: any;
|
|
1998
|
-
__brand__QRL__
|
|
2148
|
+
__brand__QRL__?: TYPE;
|
|
1999
2149
|
/** Resolve the QRL and return the actual value. */
|
|
2000
2150
|
resolve(): Promise<TYPE>;
|
|
2001
2151
|
/** The resolved value, once `resolve()` returns. */
|
|
@@ -2003,7 +2153,7 @@ export declare type QRL<TYPE = unknown> = {
|
|
|
2003
2153
|
getCaptured(): unknown[] | null;
|
|
2004
2154
|
getSymbol(): string;
|
|
2005
2155
|
getHash(): string;
|
|
2006
|
-
dev
|
|
2156
|
+
dev?: QRLDev | null;
|
|
2007
2157
|
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
2008
2158
|
|
|
2009
2159
|
/**
|
|
@@ -2018,7 +2168,7 @@ export declare type QRL<TYPE = unknown> = {
|
|
|
2018
2168
|
* @public
|
|
2019
2169
|
* @see `QRL`, `$(...)`
|
|
2020
2170
|
*/
|
|
2021
|
-
export declare const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?:
|
|
2171
|
+
export declare const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, lexicalScopeCapture?: Readonly<unknown[]> | null, stackOffset?: number) => QRL<T>;
|
|
2022
2172
|
|
|
2023
2173
|
declare type QrlArgs<T> = T extends (...args: infer ARGS) => any ? ARGS : unknown[];
|
|
2024
2174
|
|
|
@@ -2030,32 +2180,38 @@ declare interface QRLDev {
|
|
|
2030
2180
|
}
|
|
2031
2181
|
|
|
2032
2182
|
/** @internal */
|
|
2033
|
-
export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, opts: QRLDev, lexicalScopeCapture?:
|
|
2183
|
+
export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>), symbol: string, opts: QRLDev, lexicalScopeCapture?: Readonly<unknown[]>) => QRL<T>;
|
|
2034
2184
|
|
|
2035
2185
|
/**
|
|
2036
2186
|
* An event handler for Qwik events, can be a handler QRL or an array of handler QRLs.
|
|
2037
2187
|
*
|
|
2038
2188
|
* @public
|
|
2039
2189
|
*/
|
|
2040
|
-
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[]
|
|
2190
|
+
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[];
|
|
2041
2191
|
|
|
2042
|
-
|
|
2192
|
+
/** @internal */
|
|
2193
|
+
export declare type _QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
|
|
2043
2194
|
|
|
2044
2195
|
declare type QRLInternalMethods<TYPE> = {
|
|
2045
2196
|
readonly $chunk$: string | null;
|
|
2046
2197
|
readonly $symbol$: string;
|
|
2047
2198
|
readonly $hash$: string;
|
|
2048
|
-
|
|
2049
|
-
$
|
|
2199
|
+
/** If it's a string it's serialized */
|
|
2200
|
+
$captures$: Readonly<unknown[]> | string | null;
|
|
2050
2201
|
dev: QRLDev | null;
|
|
2202
|
+
resolve(container?: _Container): Promise<TYPE>;
|
|
2051
2203
|
resolved: undefined | TYPE;
|
|
2052
|
-
resolve(): Promise<TYPE>;
|
|
2053
2204
|
getSymbol(): string;
|
|
2054
2205
|
getHash(): string;
|
|
2055
2206
|
getCaptured(): unknown[] | null;
|
|
2056
|
-
getFn(currentCtx?: InvokeContext
|
|
2057
|
-
|
|
2058
|
-
|
|
2207
|
+
getFn(currentCtx?: InvokeContext, beforeFn?: () => void): TYPE extends (...args: any) => any ? (...args: Parameters<TYPE>) => ValueOrPromise<ReturnType<TYPE>> : unknown;
|
|
2208
|
+
/**
|
|
2209
|
+
* Needed for deserialization and importing. We don't always have the container while creating
|
|
2210
|
+
* qrls in async sections of code
|
|
2211
|
+
*/
|
|
2212
|
+
$container$: _Container | null;
|
|
2213
|
+
/** Only in dev mode */
|
|
2214
|
+
$symbolRef$?: null | ValueOrPromise<TYPE>;
|
|
2059
2215
|
};
|
|
2060
2216
|
|
|
2061
2217
|
declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
|
|
@@ -2125,13 +2281,19 @@ export declare type QwikClipboardEvent<T = Element> = NativeClipboardEvent;
|
|
|
2125
2281
|
/** @public @deprecated Use `CompositionEvent` and use the second argument to the handler function for the current event target */
|
|
2126
2282
|
export declare type QwikCompositionEvent<T = Element> = NativeCompositionEvent;
|
|
2127
2283
|
|
|
2128
|
-
declare type QwikCustomEvents<EL> = {};
|
|
2129
|
-
|
|
2130
2284
|
declare type QwikCustomEventsPlain<EL> = {
|
|
2131
2285
|
/** The handler */
|
|
2132
2286
|
[key: `${'document:' | 'window:' | ''}on${string}$`]: QRLEventHandlerMulti<Event, EL> | EventHandler<Event, EL>;
|
|
2133
2287
|
};
|
|
2134
2288
|
|
|
2289
|
+
declare type QwikDocumentEventMap = Omit<DocumentEventMap, keyof QwikHTMLElementEventMap> & Omit<QwikHTMLElementEventMap, 'qvisible' | 'focus' | 'blur'> & {
|
|
2290
|
+
qidle: QwikIdleEvent;
|
|
2291
|
+
qinit: QwikInitEvent;
|
|
2292
|
+
qsymbol: QwikSymbolEvent;
|
|
2293
|
+
qresume: QwikResumeEvent;
|
|
2294
|
+
qviewtransition: QwikViewTransitionEvent;
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2135
2297
|
/** @public */
|
|
2136
2298
|
export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
2137
2299
|
}
|
|
@@ -2140,11 +2302,13 @@ export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
|
2140
2302
|
export declare type QwikDragEvent<T = Element> = NativeDragEvent;
|
|
2141
2303
|
|
|
2142
2304
|
/** @public */
|
|
2143
|
-
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL
|
|
2305
|
+
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL>;
|
|
2144
2306
|
|
|
2145
2307
|
/** @public @deprecated Use `FocusEvent` and use the second argument to the handler function for the current event target */
|
|
2146
2308
|
export declare type QwikFocusEvent<T = Element> = NativeFocusEvent;
|
|
2147
2309
|
|
|
2310
|
+
declare type QwikHTMLElementEventMap = Omit<HTMLElementEventMap, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
2311
|
+
|
|
2148
2312
|
/**
|
|
2149
2313
|
* The DOM props without plain handlers, for use inside functions
|
|
2150
2314
|
*
|
|
@@ -2215,15 +2379,17 @@ declare namespace QwikJSX {
|
|
|
2215
2379
|
export { QwikJSX as JSX }
|
|
2216
2380
|
export { QwikJSX }
|
|
2217
2381
|
|
|
2382
|
+
declare type QwikJSXEvents = JSXElementEvents & JSXDocumentEvents & JSXWindowEvents;
|
|
2383
|
+
|
|
2218
2384
|
/** @public @deprecated Use `KeyboardEvent` and use the second argument to the handler function for the current event target */
|
|
2219
2385
|
export declare type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;
|
|
2220
2386
|
|
|
2221
2387
|
declare type QwikKnownEvents<EL> = {
|
|
2222
|
-
[K in keyof
|
|
2388
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL>;
|
|
2223
2389
|
};
|
|
2224
2390
|
|
|
2225
2391
|
declare type QwikKnownEventsPlain<EL> = {
|
|
2226
|
-
[K in keyof
|
|
2392
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL> | EventHandler<QwikJSXEvents[K], EL>;
|
|
2227
2393
|
};
|
|
2228
2394
|
|
|
2229
2395
|
/**
|
|
@@ -2287,6 +2453,12 @@ export declare type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;
|
|
|
2287
2453
|
/** @public @deprecated Use `PointerEvent` and use the second argument to the handler function for the current event target */
|
|
2288
2454
|
export declare type QwikPointerEvent<T = Element> = NativePointerEvent;
|
|
2289
2455
|
|
|
2456
|
+
/**
|
|
2457
|
+
* Emitted by qwik-core on the container element when it resumes from a paused state. You cannot put
|
|
2458
|
+
* a Qwik event handler on the container so you must listen on the document instead. @public
|
|
2459
|
+
*/
|
|
2460
|
+
export declare type QwikResumeEvent = CustomEvent<{}>;
|
|
2461
|
+
|
|
2290
2462
|
/** @public @deprecated Use `SubmitEvent` and use the second argument to the handler function for the current event target */
|
|
2291
2463
|
export declare type QwikSubmitEvent<T = Element> = SubmitEvent;
|
|
2292
2464
|
|
|
@@ -2317,14 +2489,12 @@ declare interface QwikSymbol {
|
|
|
2317
2489
|
captureNames?: string[];
|
|
2318
2490
|
}
|
|
2319
2491
|
|
|
2320
|
-
/** Emitted by qwik-loader when a module was lazily loaded @public */
|
|
2492
|
+
/** Emitted by qwik-loader on document when a module was lazily loaded @public */
|
|
2321
2493
|
export declare type QwikSymbolEvent = CustomEvent<{
|
|
2322
2494
|
symbol: string;
|
|
2323
2495
|
element: Element;
|
|
2324
2496
|
reqTime: number;
|
|
2325
2497
|
qBase?: string;
|
|
2326
|
-
qManifest?: string;
|
|
2327
|
-
qVersion?: string;
|
|
2328
2498
|
href?: string;
|
|
2329
2499
|
}>;
|
|
2330
2500
|
|
|
@@ -2338,14 +2508,19 @@ export declare type QwikTransitionEvent<T = Element> = NativeTransitionEvent;
|
|
|
2338
2508
|
export declare type QwikUIEvent<T = Element> = NativeUIEvent;
|
|
2339
2509
|
|
|
2340
2510
|
/** Emitted by qwik-core on document when the a view transition start @public */
|
|
2341
|
-
declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2511
|
+
export declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2342
2512
|
|
|
2343
|
-
/**
|
|
2513
|
+
/**
|
|
2514
|
+
* Handled by qwik-loader when an element becomes visible. Used by `useVisibleTask$`. Does not
|
|
2515
|
+
* bubble. @public
|
|
2516
|
+
*/
|
|
2344
2517
|
export declare type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;
|
|
2345
2518
|
|
|
2346
2519
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
2347
2520
|
export declare type QwikWheelEvent<T = Element> = NativeWheelEvent;
|
|
2348
2521
|
|
|
2522
|
+
declare type QwikWindowEventMap = Omit<WindowEventHandlersEventMap, keyof QwikDocumentEventMap> & QwikDocumentEventMap;
|
|
2523
|
+
|
|
2349
2524
|
/** @public */
|
|
2350
2525
|
export declare interface ReadonlySignal<T = unknown> {
|
|
2351
2526
|
readonly value: T;
|
|
@@ -2367,7 +2542,12 @@ declare type RefFnInterface<EL> = {
|
|
|
2367
2542
|
(el: EL): void;
|
|
2368
2543
|
};
|
|
2369
2544
|
|
|
2370
|
-
/**
|
|
2545
|
+
/**
|
|
2546
|
+
* Register a QRL symbol globally for lookup by its hash. This is used by the optimizer to register
|
|
2547
|
+
* the names passed in `reg_ctx_name`.
|
|
2548
|
+
*
|
|
2549
|
+
* @internal
|
|
2550
|
+
*/
|
|
2371
2551
|
export declare const _regSymbol: (symbol: any, hash: string) => any;
|
|
2372
2552
|
|
|
2373
2553
|
/**
|
|
@@ -2393,6 +2573,8 @@ export declare const RenderOnce: FunctionComponent<{
|
|
|
2393
2573
|
key?: string | number | null | undefined;
|
|
2394
2574
|
}>;
|
|
2395
2575
|
|
|
2576
|
+
/** @internal */
|
|
2577
|
+
/** @internal */
|
|
2396
2578
|
/** @public */
|
|
2397
2579
|
export declare interface RenderOptions {
|
|
2398
2580
|
serverData?: Record<string, any>;
|
|
@@ -2413,6 +2595,9 @@ export declare interface RenderSSROptions {
|
|
|
2413
2595
|
manifestHash: string;
|
|
2414
2596
|
}
|
|
2415
2597
|
|
|
2598
|
+
/** @internal */
|
|
2599
|
+
export declare const _resolveContextWithoutSequentialScope: <STATE>(context: ContextId<STATE>) => STATE | undefined;
|
|
2600
|
+
|
|
2416
2601
|
/** @public */
|
|
2417
2602
|
declare interface ResolvedManifest {
|
|
2418
2603
|
mapper: SymbolMapper;
|
|
@@ -2513,9 +2698,9 @@ export declare interface ResourcePending<T> {
|
|
|
2513
2698
|
/** @public */
|
|
2514
2699
|
export declare interface ResourceProps<T> {
|
|
2515
2700
|
readonly value: ResourceReturn<T> | Signal<Promise<T> | T> | Promise<T>;
|
|
2516
|
-
onResolved: (value: T) => JSXOutput
|
|
2517
|
-
onPending?: () => JSXOutput
|
|
2518
|
-
onRejected?: (reason: Error) => JSXOutput
|
|
2701
|
+
onResolved: (value: T) => JSXOutput | Promise<JSXOutput>;
|
|
2702
|
+
onPending?: () => JSXOutput | Promise<JSXOutput>;
|
|
2703
|
+
onRejected?: (reason: Error) => JSXOutput | Promise<JSXOutput>;
|
|
2519
2704
|
}
|
|
2520
2705
|
|
|
2521
2706
|
/** @public */
|
|
@@ -2540,26 +2725,25 @@ declare interface ResourceReturnInternal<T> {
|
|
|
2540
2725
|
_error: Error | undefined;
|
|
2541
2726
|
_cache: number;
|
|
2542
2727
|
_timeout: number;
|
|
2728
|
+
_generation: number;
|
|
2543
2729
|
value: Promise<T>;
|
|
2544
2730
|
loading: boolean;
|
|
2545
2731
|
}
|
|
2546
2732
|
|
|
2547
2733
|
/** @internal */
|
|
2548
|
-
export declare const _restProps: (props: PropsProxy, omit
|
|
2734
|
+
export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
|
|
2549
2735
|
|
|
2550
2736
|
/**
|
|
2551
|
-
* This is called by qwik-loader to
|
|
2737
|
+
* This is called by qwik-loader to run a QRL. It has to be synchronous when possible.
|
|
2552
2738
|
*
|
|
2553
2739
|
* @internal
|
|
2554
2740
|
*/
|
|
2555
|
-
export declare
|
|
2556
|
-
|
|
2557
|
-
declare type Scheduler = ReturnType<typeof createScheduler>;
|
|
2741
|
+
export declare function _run(this: string, event: Event, element: Element): ValueOrPromise<unknown>;
|
|
2558
2742
|
|
|
2743
|
+
/** Stores the location of an object. If no parent, it's a root. */
|
|
2559
2744
|
declare type SeenRef = {
|
|
2560
|
-
$parent$: unknown | null;
|
|
2561
2745
|
$index$: number;
|
|
2562
|
-
$
|
|
2746
|
+
$parent$?: SeenRef | null;
|
|
2563
2747
|
};
|
|
2564
2748
|
|
|
2565
2749
|
/** @public */
|
|
@@ -2581,32 +2765,25 @@ declare interface SerializationContext {
|
|
|
2581
2765
|
* - `{ parent, index }` - The parent object and the index within that parent.
|
|
2582
2766
|
* - `undefined` - Object has not been seen yet.
|
|
2583
2767
|
*/
|
|
2584
|
-
|
|
2768
|
+
getSeenRef: (obj: unknown) => SeenRef | undefined;
|
|
2769
|
+
/** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
|
|
2585
2770
|
$hasRootId$: (obj: unknown) => number | undefined;
|
|
2586
2771
|
/**
|
|
2587
2772
|
* Root objects which need to be serialized.
|
|
2588
2773
|
*
|
|
2589
2774
|
* Roots are entry points into the object graph. Typically the roots are held by the listeners.
|
|
2590
2775
|
*
|
|
2591
|
-
* Returns
|
|
2592
|
-
* Format: "3 2 0" where each number is the index within its parent, from root to leaf.
|
|
2776
|
+
* Returns the index of the root object.
|
|
2593
2777
|
*/
|
|
2594
|
-
$addRoot$:
|
|
2595
|
-
/**
|
|
2596
|
-
|
|
2597
|
-
*
|
|
2598
|
-
* This is used during serialization, as new roots can't be created during serialization.
|
|
2599
|
-
*
|
|
2600
|
-
* The function throws if the root was not found.
|
|
2601
|
-
*/
|
|
2602
|
-
$addRootPath$: (obj: any) => string | number;
|
|
2603
|
-
$seen$: (obj: unknown, parent: unknown | null, index: number) => void;
|
|
2778
|
+
$addRoot$: AddRootFn;
|
|
2779
|
+
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
2780
|
+
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
2604
2781
|
$roots$: unknown[];
|
|
2605
|
-
$
|
|
2782
|
+
$promoteToRoot$: (ref: SeenRef, index?: number) => void;
|
|
2606
2783
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
2607
2784
|
$isSsrNode$: (obj: unknown) => obj is SsrNode;
|
|
2608
2785
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
2609
|
-
$writer$:
|
|
2786
|
+
$writer$: StreamWriter;
|
|
2610
2787
|
$syncFns$: string[];
|
|
2611
2788
|
$eventQrls$: Set<QRL>;
|
|
2612
2789
|
$eventNames$: Set<string>;
|
|
@@ -2617,6 +2794,14 @@ declare interface SerializationContext {
|
|
|
2617
2794
|
$setProp$: (obj: any, prop: string, value: any) => void;
|
|
2618
2795
|
}
|
|
2619
2796
|
|
|
2797
|
+
declare const enum SerializationSignalFlags {
|
|
2798
|
+
SERIALIZATION_STRATEGY_NEVER = 8,
|
|
2799
|
+
SERIALIZATION_STRATEGY_ALWAYS = 16
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
/** @public */
|
|
2803
|
+
export declare type SerializationStrategy = 'never' | 'always';
|
|
2804
|
+
|
|
2620
2805
|
/**
|
|
2621
2806
|
* Serialize data to string using SerializationContext.
|
|
2622
2807
|
*
|
|
@@ -2686,9 +2871,9 @@ declare interface SerializerSignal<T> extends ComputedSignal<T> {
|
|
|
2686
2871
|
* @public
|
|
2687
2872
|
*/
|
|
2688
2873
|
declare class SerializerSignalImpl<T, S> extends ComputedSignalImpl<T> {
|
|
2689
|
-
constructor(container:
|
|
2874
|
+
constructor(container: _Container | null, argQrl: _QRLInternal<SerializerArg<T, S>>);
|
|
2690
2875
|
$didInitialize$: boolean;
|
|
2691
|
-
$computeIfNeeded$():
|
|
2876
|
+
$computeIfNeeded$(): void;
|
|
2692
2877
|
}
|
|
2693
2878
|
|
|
2694
2879
|
/**
|
|
@@ -2729,9 +2914,8 @@ declare type ServerQwikManifest = Pick<QwikManifest, 'manifestHash' | 'injection
|
|
|
2729
2914
|
export declare const setPlatform: (plt: CorePlatform) => CorePlatform;
|
|
2730
2915
|
|
|
2731
2916
|
/** @internal */
|
|
2732
|
-
export declare abstract class _SharedContainer implements
|
|
2917
|
+
export declare abstract class _SharedContainer implements _Container {
|
|
2733
2918
|
readonly $version$: string;
|
|
2734
|
-
readonly $scheduler$: Scheduler;
|
|
2735
2919
|
readonly $storeProxyMap$: ObjToProxyMap;
|
|
2736
2920
|
readonly $locale$: string;
|
|
2737
2921
|
readonly $getObjectById$: (id: number | string) => any;
|
|
@@ -2739,7 +2923,11 @@ export declare abstract class _SharedContainer implements Container {
|
|
|
2739
2923
|
$currentUniqueId$: number;
|
|
2740
2924
|
$instanceHash$: string | null;
|
|
2741
2925
|
$buildBase$: string | null;
|
|
2742
|
-
|
|
2926
|
+
$renderPromise$: Promise<void> | null;
|
|
2927
|
+
$resolveRenderPromise$: (() => void) | null;
|
|
2928
|
+
$cursorCount$: number;
|
|
2929
|
+
$pausedCursorCount$: number;
|
|
2930
|
+
constructor(serverData: Record<string, any>, locale: string);
|
|
2743
2931
|
trackSignalValue<T>(signal: Signal, subscriber: HostElement, property: string, data: _SubscriptionData): T;
|
|
2744
2932
|
serializationCtxFactory(NodeConstructor: {
|
|
2745
2933
|
new (...rest: any[]): {
|
|
@@ -2751,7 +2939,7 @@ export declare abstract class _SharedContainer implements Container {
|
|
|
2751
2939
|
};
|
|
2752
2940
|
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
|
|
2753
2941
|
abstract ensureProjectionResolved(host: HostElement): void;
|
|
2754
|
-
abstract handleError(err: any, $host$: HostElement): void;
|
|
2942
|
+
abstract handleError(err: any, $host$: HostElement | null): void;
|
|
2755
2943
|
abstract getParentHost(host: HostElement): HostElement | null;
|
|
2756
2944
|
abstract setContext<T>(host: HostElement, context: ContextId<T>, value: T): void;
|
|
2757
2945
|
abstract resolveContext<T>(host: HostElement, contextId: ContextId<T>): T | undefined;
|
|
@@ -2777,15 +2965,22 @@ export declare interface Signal<T = any> extends ReadonlySignal<T> {
|
|
|
2777
2965
|
}
|
|
2778
2966
|
|
|
2779
2967
|
declare const enum SignalFlags {
|
|
2780
|
-
INVALID = 1
|
|
2968
|
+
INVALID = 1,
|
|
2969
|
+
RUN_EFFECTS = 2
|
|
2781
2970
|
}
|
|
2782
2971
|
|
|
2783
2972
|
declare class SignalImpl<T = any> implements Signal<T> {
|
|
2784
2973
|
$untrackedValue$: T;
|
|
2785
2974
|
/** Store a list of effects which are dependent on this signal. */
|
|
2786
|
-
$effects$:
|
|
2787
|
-
$container$:
|
|
2788
|
-
|
|
2975
|
+
$effects$: undefined | Set<EffectSubscription>;
|
|
2976
|
+
$container$: _Container | null;
|
|
2977
|
+
$wrappedSignal$: WrappedSignalImpl<T> | null;
|
|
2978
|
+
constructor(container: _Container | null, value: T);
|
|
2979
|
+
/**
|
|
2980
|
+
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
2981
|
+
* remained the same object
|
|
2982
|
+
*/
|
|
2983
|
+
force(): void;
|
|
2789
2984
|
get untrackedValue(): T;
|
|
2790
2985
|
set untrackedValue(value: T);
|
|
2791
2986
|
get value(): T;
|
|
@@ -2797,6 +2992,8 @@ declare class SignalImpl<T = any> implements Signal<T> {
|
|
|
2797
2992
|
};
|
|
2798
2993
|
}
|
|
2799
2994
|
|
|
2995
|
+
declare type SimpleSsrAttrValue = string | Signal<SimpleSsrAttrValue> | boolean | object | null;
|
|
2996
|
+
|
|
2800
2997
|
declare interface SimplifiedServerRequestEvent<T = unknown> {
|
|
2801
2998
|
url: URL;
|
|
2802
2999
|
locale: string | undefined;
|
|
@@ -3076,26 +3273,27 @@ declare type SsrAttrKey = string;
|
|
|
3076
3273
|
|
|
3077
3274
|
declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
|
|
3078
3275
|
|
|
3079
|
-
declare type SsrAttrValue =
|
|
3276
|
+
declare type SsrAttrValue = SimpleSsrAttrValue | Promise<SimpleSsrAttrValue>;
|
|
3080
3277
|
|
|
3081
3278
|
/** @public */
|
|
3082
3279
|
export declare const SSRComment: FunctionComponent<{
|
|
3083
3280
|
data: string;
|
|
3084
3281
|
}>;
|
|
3085
3282
|
|
|
3086
|
-
declare interface SSRContainer extends
|
|
3283
|
+
declare interface SSRContainer extends _Container {
|
|
3087
3284
|
readonly tag: string;
|
|
3088
3285
|
readonly isHtml: boolean;
|
|
3286
|
+
readonly size: number;
|
|
3089
3287
|
readonly writer: StreamWriter;
|
|
3090
3288
|
readonly serializationCtx: SerializationContext;
|
|
3091
3289
|
readonly symbolToChunkResolver: SymbolToChunkResolver;
|
|
3092
3290
|
readonly resolvedManifest: ResolvedManifest;
|
|
3093
3291
|
additionalHeadNodes: Array<JSXNodeInternal>;
|
|
3094
3292
|
additionalBodyNodes: Array<JSXNodeInternal>;
|
|
3095
|
-
|
|
3293
|
+
write(text: string): void;
|
|
3096
3294
|
openContainer(): void;
|
|
3097
3295
|
closeContainer(): ValueOrPromise<void>;
|
|
3098
|
-
openElement(elementName: string, varAttrs: SsrAttrs | null, constAttrs?: SsrAttrs | null, currentFile?: string | null): string | undefined;
|
|
3296
|
+
openElement(elementName: string, key: string | null, varAttrs: SsrAttrs | null, constAttrs?: SsrAttrs | null, currentFile?: string | null): string | undefined;
|
|
3099
3297
|
closeElement(): ValueOrPromise<void>;
|
|
3100
3298
|
openFragment(attrs: SsrAttrs): void;
|
|
3101
3299
|
closeFragment(): void;
|
|
@@ -3104,7 +3302,7 @@ declare interface SSRContainer extends Container {
|
|
|
3104
3302
|
openComponent(attrs: SsrAttrs): void;
|
|
3105
3303
|
getComponentFrame(projectionDepth: number): ISsrComponentFrame | null;
|
|
3106
3304
|
getParentComponentFrame(): ISsrComponentFrame | null;
|
|
3107
|
-
closeComponent(): void
|
|
3305
|
+
closeComponent(): Promise<void>;
|
|
3108
3306
|
textNode(text: string): void;
|
|
3109
3307
|
htmlNode(rawHtml: string): void;
|
|
3110
3308
|
commentNode(text: string): void;
|
|
@@ -3115,6 +3313,8 @@ declare interface SSRContainer extends Container {
|
|
|
3115
3313
|
render(jsx: JSXOutput): Promise<void>;
|
|
3116
3314
|
emitPreloaderPre(): void;
|
|
3117
3315
|
emitQwikLoaderAtTopIfNeeded(): void;
|
|
3316
|
+
emitPatchDataIfNeeded(): void;
|
|
3317
|
+
addBackpatchEntry(ssrNodeId: string, attrName: string, serializedValue: string | boolean | null): void;
|
|
3118
3318
|
}
|
|
3119
3319
|
|
|
3120
3320
|
/** @public */
|
|
@@ -3130,6 +3330,10 @@ declare type SsrNode = {
|
|
|
3130
3330
|
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
3131
3331
|
};
|
|
3132
3332
|
|
|
3333
|
+
declare const enum SsrNodeFlags {
|
|
3334
|
+
Updatable = 1
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3133
3337
|
/** @public */
|
|
3134
3338
|
export declare const SSRRaw: FunctionComponent<{
|
|
3135
3339
|
data: string;
|
|
@@ -3144,38 +3348,22 @@ export declare const SSRStreamBlock: FunctionComponent<{
|
|
|
3144
3348
|
}>;
|
|
3145
3349
|
|
|
3146
3350
|
/** @public */
|
|
3147
|
-
export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream:
|
|
3351
|
+
export declare type SSRStreamChildren = AsyncGenerator<JSXChildren, void, any> | ((stream: SSRStreamWriter) => Promise<void>) | (() => AsyncGenerator<JSXChildren, void, any>);
|
|
3148
3352
|
|
|
3149
3353
|
/** @public */
|
|
3150
3354
|
export declare type SSRStreamProps = {
|
|
3151
3355
|
children: SSRStreamChildren;
|
|
3152
3356
|
};
|
|
3153
3357
|
|
|
3358
|
+
/** @public */
|
|
3359
|
+
export declare interface SSRStreamWriter {
|
|
3360
|
+
write(chunk: JSXOutput): void;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3154
3363
|
declare type StopPropagation = {
|
|
3155
3364
|
[K in keyof HTMLElementEventMap as `stoppropagation:${K}`]?: boolean;
|
|
3156
3365
|
};
|
|
3157
3366
|
|
|
3158
|
-
declare const enum StoreFlags {
|
|
3159
|
-
NONE = 0,
|
|
3160
|
-
RECURSIVE = 1,
|
|
3161
|
-
IMMUTABLE = 2
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
declare class StoreHandler implements ProxyHandler<StoreTarget> {
|
|
3165
|
-
$flags$: StoreFlags;
|
|
3166
|
-
$container$: Container | null;
|
|
3167
|
-
$effects$: null | Map<string | symbol, Set<EffectSubscription>>;
|
|
3168
|
-
constructor($flags$: StoreFlags, $container$: Container | null);
|
|
3169
|
-
toString(): string;
|
|
3170
|
-
get(target: StoreTarget, prop: string | symbol): any;
|
|
3171
|
-
/** In the case of oldValue and value are the same, the effects are not triggered. */
|
|
3172
|
-
set(target: StoreTarget, prop: string | symbol, value: any): boolean;
|
|
3173
|
-
deleteProperty(target: StoreTarget, prop: string | symbol): boolean;
|
|
3174
|
-
has(target: StoreTarget, prop: string | symbol): boolean;
|
|
3175
|
-
ownKeys(target: StoreTarget): ArrayLike<string | symbol>;
|
|
3176
|
-
getOwnPropertyDescriptor(target: StoreTarget, prop: string | symbol): PropertyDescriptor | undefined;
|
|
3177
|
-
}
|
|
3178
|
-
|
|
3179
3367
|
declare type StoreTarget = Record<string | symbol, any>;
|
|
3180
3368
|
|
|
3181
3369
|
/** @internal */
|
|
@@ -3482,18 +3670,11 @@ declare type SymbolToChunkResolver = (symbol: string) => string;
|
|
|
3482
3670
|
export declare const sync$: <T extends Function>(fn: T) => SyncQRL<T>;
|
|
3483
3671
|
|
|
3484
3672
|
/** @public */
|
|
3485
|
-
export declare
|
|
3673
|
+
export declare type SyncQRL<TYPE extends Function> = QRL<TYPE> & {
|
|
3486
3674
|
__brand__SyncQRL__: TYPE;
|
|
3487
|
-
/**
|
|
3488
|
-
* Resolve the QRL of closure and invoke it.
|
|
3489
|
-
*
|
|
3490
|
-
* @param args - Closure arguments.
|
|
3491
|
-
* @returns A return value of the closure.
|
|
3492
|
-
*/
|
|
3493
|
-
(...args: TYPE extends (...args: infer ARGS) => any ? ARGS : never): TYPE extends (...args: any[]) => infer RETURN ? RETURN : never;
|
|
3494
3675
|
resolved: TYPE;
|
|
3495
|
-
dev
|
|
3496
|
-
}
|
|
3676
|
+
dev?: QRLDev | null;
|
|
3677
|
+
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
3497
3678
|
|
|
3498
3679
|
declare type TableCellSpecialAttrs = {
|
|
3499
3680
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
|
|
@@ -3506,18 +3687,19 @@ declare class Task<T = unknown, B = T> extends BackRef implements DescriptorBase
|
|
|
3506
3687
|
$flags$: number;
|
|
3507
3688
|
$index$: number;
|
|
3508
3689
|
$el$: HostElement;
|
|
3509
|
-
$qrl$:
|
|
3690
|
+
$qrl$: _QRLInternal<T>;
|
|
3510
3691
|
$state$: Signal<B> | ResourceReturnInternal<B> | undefined;
|
|
3511
3692
|
$destroy$: NoSerialize<() => void> | null;
|
|
3512
|
-
constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$:
|
|
3693
|
+
constructor($flags$: number, $index$: number, $el$: HostElement, $qrl$: _QRLInternal<T>, $state$: Signal<B> | ResourceReturnInternal<B> | undefined, $destroy$: NoSerialize<() => void> | null);
|
|
3513
3694
|
}
|
|
3514
3695
|
|
|
3515
3696
|
/**
|
|
3516
|
-
* Used internally as a
|
|
3697
|
+
* Used internally as a qwikloader event handler to schedule a task. The `this` context is the
|
|
3698
|
+
* captures part of the QRL, provided by qwikloader.
|
|
3517
3699
|
*
|
|
3518
3700
|
* @internal
|
|
3519
3701
|
*/
|
|
3520
|
-
export declare
|
|
3702
|
+
export declare function _task(this: string, _event: Event, element: Element): void;
|
|
3521
3703
|
|
|
3522
3704
|
/** @public */
|
|
3523
3705
|
export declare interface TaskCtx {
|
|
@@ -3530,21 +3712,18 @@ declare const TaskEvent = "qTask";
|
|
|
3530
3712
|
/** @public */
|
|
3531
3713
|
export declare type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;
|
|
3532
3714
|
|
|
3715
|
+
/** @public */
|
|
3716
|
+
export declare interface TaskOptions {
|
|
3717
|
+
/** Block the rendering of the component until the task completes. Default is `true` */
|
|
3718
|
+
deferUpdates?: boolean;
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3533
3721
|
/** @internal */
|
|
3534
|
-
export declare
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
_VNode | null,
|
|
3538
|
-
|
|
3539
|
-
_VNode | null,
|
|
3540
|
-
///////////////// 2 - Previous sibling
|
|
3541
|
-
_VNode | null,
|
|
3542
|
-
///////////////// 3 - Next sibling
|
|
3543
|
-
Text | null | undefined,
|
|
3544
|
-
string
|
|
3545
|
-
] & {
|
|
3546
|
-
__brand__: 'TextVNode';
|
|
3547
|
-
};
|
|
3722
|
+
export declare class _TextVNode extends _VNode {
|
|
3723
|
+
node: Text | null;
|
|
3724
|
+
text: string | undefined;
|
|
3725
|
+
constructor(flags: _VNodeFlags, parent: _VNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null, node: Text | null, text: string | undefined);
|
|
3726
|
+
}
|
|
3548
3727
|
|
|
3549
3728
|
/**
|
|
3550
3729
|
* Used to signal to Qwik which state should be watched for changes.
|
|
@@ -3565,6 +3744,8 @@ string
|
|
|
3565
3744
|
* useTask$(({ track }) => {
|
|
3566
3745
|
* // Any signals or stores accessed inside the task will be tracked
|
|
3567
3746
|
* const count = track(() => store.count);
|
|
3747
|
+
* // For stores you can also pass the store and specify the property
|
|
3748
|
+
* track(store, 'count');
|
|
3568
3749
|
* // You can also pass a signal to track() directly
|
|
3569
3750
|
* const signalCount = track(signal);
|
|
3570
3751
|
* store.doubleCount = count + signalCount;
|
|
@@ -3631,12 +3812,22 @@ export declare interface Tracker {
|
|
|
3631
3812
|
<T extends object, P extends keyof T>(obj: T, prop: P): T[P];
|
|
3632
3813
|
}
|
|
3633
3814
|
|
|
3815
|
+
/** @internal */
|
|
3816
|
+
export declare const _UNINITIALIZED: unique symbol;
|
|
3817
|
+
|
|
3634
3818
|
/**
|
|
3635
|
-
*
|
|
3819
|
+
* Get the value of the expression without tracking listeners. A function will be invoked, signals
|
|
3820
|
+
* will return their value, and stores will be unwrapped (they return the backing object).
|
|
3636
3821
|
*
|
|
3822
|
+
* When you pass a function, you can also pass additional arguments that the function will receive.
|
|
3823
|
+
*
|
|
3824
|
+
* Note that stores are not unwrapped recursively.
|
|
3825
|
+
*
|
|
3826
|
+
* @param expr - The function or object to evaluate without tracking.
|
|
3827
|
+
* @param args - Additional arguments to pass when `expr` is a function.
|
|
3637
3828
|
* @public
|
|
3638
3829
|
*/
|
|
3639
|
-
export declare const untrack: <T>(
|
|
3830
|
+
export declare const untrack: <T, A extends any[]>(expr: ((...args: A) => T) | Signal<T> | T, ...args: A) => T;
|
|
3640
3831
|
|
|
3641
3832
|
declare type UnwantedKeys = keyof HTMLAttributesBase | keyof DOMAttributes<any> | keyof ARIAMixin | keyof GlobalEventHandlers | 'enterKeyHint' | 'innerText' | 'innerHTML' | 'outerHTML' | 'inputMode' | 'outerText' | 'nodeValue' | 'textContent';
|
|
3642
3833
|
|
|
@@ -3649,19 +3840,30 @@ declare type UnwantedKeys = keyof HTMLAttributesBase | keyof DOMAttributes<any>
|
|
|
3649
3840
|
export declare const unwrapStore: <T>(value: T) => T;
|
|
3650
3841
|
|
|
3651
3842
|
/**
|
|
3652
|
-
* Creates
|
|
3653
|
-
*
|
|
3654
|
-
*
|
|
3655
|
-
*
|
|
3843
|
+
* Creates an AsyncSignal which holds the result of the given async function. If the function uses
|
|
3844
|
+
* `track()` to track reactive state, and that state changes, the AsyncSignal is recalculated, and
|
|
3845
|
+
* if the result changed, all tasks which are tracking the AsyncSignal will be re-run and all
|
|
3846
|
+
* subscribers (components, tasks etc) that read the AsyncSignal will be updated.
|
|
3656
3847
|
*
|
|
3657
|
-
*
|
|
3848
|
+
* If the async function throws an error, the AsyncSignal will capture the error and set the `error`
|
|
3849
|
+
* property. The error can be cleared by re-running the async function successfully.
|
|
3850
|
+
*
|
|
3851
|
+
* While the async function is running, the `loading` property will be set to `true`. Once the
|
|
3852
|
+
* function completes, `loading` will be set to `false`.
|
|
3853
|
+
*
|
|
3854
|
+
* If the value has not yet been resolved, reading the AsyncSignal will throw a Promise, which will
|
|
3855
|
+
* retry the component or task once the value resolves.
|
|
3856
|
+
*
|
|
3857
|
+
* If the value has been resolved, but the async function is re-running, reading the AsyncSignal
|
|
3858
|
+
* will subscribe to it and return the last resolved value until the new value is ready. As soon as
|
|
3859
|
+
* the new value is ready, the subscribers will be updated.
|
|
3658
3860
|
*
|
|
3659
3861
|
* @public
|
|
3660
3862
|
*/
|
|
3661
|
-
export declare const
|
|
3863
|
+
export declare const useAsync$: <T>(qrl: AsyncFn<T>, options?: ComputedOptions | undefined) => AsyncSignal<T>;
|
|
3662
3864
|
|
|
3663
3865
|
/** @internal */
|
|
3664
|
-
export declare const
|
|
3866
|
+
export declare const useAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: ComputedOptions) => AsyncSignal<T>;
|
|
3665
3867
|
|
|
3666
3868
|
/**
|
|
3667
3869
|
* Creates a computed signal which is calculated from the given function. A computed signal is a
|
|
@@ -3673,20 +3875,32 @@ export declare const useAsyncComputedQrl: <T>(qrl: QRL<AsyncComputedFn<T>>) => A
|
|
|
3673
3875
|
*
|
|
3674
3876
|
* @public
|
|
3675
3877
|
*/
|
|
3676
|
-
export declare const useComputed$: <T>(qrl: ComputedFn<T
|
|
3878
|
+
export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions | undefined) => ComputedReturnType<T>;
|
|
3677
3879
|
|
|
3678
3880
|
/** @internal */
|
|
3679
|
-
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T
|
|
3881
|
+
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions) => ComputedReturnType<T>;
|
|
3680
3882
|
|
|
3681
3883
|
/**
|
|
3682
3884
|
* Stores a value which is retained for the lifetime of the component. Subsequent calls to
|
|
3683
3885
|
* `useConstant` will always return the first value given.
|
|
3684
3886
|
*
|
|
3685
|
-
* If the value is a function, the function is invoked once to calculate the actual value.
|
|
3887
|
+
* If the value is a function, the function is invoked once to calculate the actual value. You can
|
|
3888
|
+
* then also pass arguments to call the function with, so that you don't need to create a new
|
|
3889
|
+
* function on every render.
|
|
3890
|
+
*
|
|
3891
|
+
* @example
|
|
3892
|
+
*
|
|
3893
|
+
* ```tsx
|
|
3894
|
+
* const fixedRandomValue = useConstant(() => Math.random);
|
|
3895
|
+
* const otherFixedRandomValue = useConstant(Math.random);
|
|
3896
|
+
*
|
|
3897
|
+
* const getConfig = (env: string) => { ... }
|
|
3898
|
+
* const config = useConstant(getConfig, environment);
|
|
3899
|
+
* ```
|
|
3686
3900
|
*
|
|
3687
3901
|
* @public
|
|
3688
3902
|
*/
|
|
3689
|
-
export declare const useConstant: <T>(value: (() => T) | T) => T;
|
|
3903
|
+
export declare const useConstant: <T, A extends any[]>(value: ((...args: A) => T) | T, ...args: A) => T;
|
|
3690
3904
|
|
|
3691
3905
|
declare interface UseContext {
|
|
3692
3906
|
<STATE, T>(context: ContextId<STATE>, transformer: (value: STATE) => T): T;
|
|
@@ -3809,6 +4023,7 @@ export declare const useId: () => string;
|
|
|
3809
4023
|
* NOTE: `useLexicalScope` method can only be used in the synchronous portion of the callback
|
|
3810
4024
|
* (before any `await` statements.)
|
|
3811
4025
|
*
|
|
4026
|
+
* @deprecated Read from `_captures` directly instead.
|
|
3812
4027
|
* @internal
|
|
3813
4028
|
*/
|
|
3814
4029
|
export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
@@ -3819,6 +4034,8 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
|
3819
4034
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3820
4035
|
* have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.
|
|
3821
4036
|
*
|
|
4037
|
+
* Events are case sensitive.
|
|
4038
|
+
*
|
|
3822
4039
|
* @public
|
|
3823
4040
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3824
4041
|
*/
|
|
@@ -3830,6 +4047,8 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
|
|
|
3830
4047
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3831
4048
|
* have access to the JSX.
|
|
3832
4049
|
*
|
|
4050
|
+
* Events are case sensitive.
|
|
4051
|
+
*
|
|
3833
4052
|
* @public
|
|
3834
4053
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3835
4054
|
*
|
|
@@ -3857,6 +4076,8 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
|
|
|
3857
4076
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3858
4077
|
* have access to the JSX.
|
|
3859
4078
|
*
|
|
4079
|
+
* Events are case sensitive.
|
|
4080
|
+
*
|
|
3860
4081
|
* @public
|
|
3861
4082
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3862
4083
|
*
|
|
@@ -4002,7 +4223,7 @@ export declare const useResourceQrl: <T>(qrl: QRL<ResourceFn<T>>, opts?: Resourc
|
|
|
4002
4223
|
export declare const useSerializer$: typeof createSerializer$;
|
|
4003
4224
|
|
|
4004
4225
|
/** @internal */
|
|
4005
|
-
export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) =>
|
|
4226
|
+
export declare const useSerializerQrl: <T, S>(qrl: QRL<SerializerArg<T, S>>) => SerializerSignalImpl<T, S>;
|
|
4006
4227
|
|
|
4007
4228
|
/** @public */
|
|
4008
4229
|
export declare function useServerData<T>(key: string): T | undefined;
|
|
@@ -4016,14 +4237,61 @@ export declare interface UseSignal {
|
|
|
4016
4237
|
<T>(value: T | (() => T)): Signal<T>;
|
|
4017
4238
|
}
|
|
4018
4239
|
|
|
4019
|
-
/**
|
|
4240
|
+
/**
|
|
4241
|
+
* Creates an object with a single reactive `.value` property, that Qwik can track across
|
|
4242
|
+
* serializations.
|
|
4243
|
+
*
|
|
4244
|
+
* Use it to create state for your application. The object has a getter and setter to track reads
|
|
4245
|
+
* and writes of the `.value` property. When the value changes, any functions that read from it will
|
|
4246
|
+
* re-run.
|
|
4247
|
+
*
|
|
4248
|
+
* Prefer `useSignal` over `useStore` when possible, as it is more efficient.
|
|
4249
|
+
*
|
|
4250
|
+
* ### Example
|
|
4251
|
+
*
|
|
4252
|
+
* ```tsx
|
|
4253
|
+
* const Signals = component$(() => {
|
|
4254
|
+
* const counter = useSignal(1);
|
|
4255
|
+
* const text = useSignal('changeme');
|
|
4256
|
+
* const toggle = useSignal(false);
|
|
4257
|
+
*
|
|
4258
|
+
* // useSignal() can also accept a function to calculate the initial value
|
|
4259
|
+
* const state = useSignal(() => {
|
|
4260
|
+
* return expensiveInitialValue();
|
|
4261
|
+
* });
|
|
4262
|
+
*
|
|
4263
|
+
* return (
|
|
4264
|
+
* <div>
|
|
4265
|
+
* <button onClick$={() => counter.value++}>Counter: {counter.value}</button>
|
|
4266
|
+
* {
|
|
4267
|
+
* // pass signal values as the value, the optimizer will make it pass the signal
|
|
4268
|
+
* }
|
|
4269
|
+
* <Child state={state.value} />
|
|
4270
|
+
* {
|
|
4271
|
+
* // signals can be bound to inputs. A property named `bind:x` implies that the property
|
|
4272
|
+
* is a signal
|
|
4273
|
+
* }
|
|
4274
|
+
* <input type="text" bind:value={text} />
|
|
4275
|
+
* <input type="checkbox" bind:checked={toggle} />
|
|
4276
|
+
* </div>
|
|
4277
|
+
* );
|
|
4278
|
+
* });
|
|
4279
|
+
* ```
|
|
4280
|
+
*
|
|
4281
|
+
* @public
|
|
4282
|
+
*/
|
|
4020
4283
|
export declare const useSignal: UseSignal;
|
|
4021
4284
|
|
|
4022
4285
|
/**
|
|
4023
|
-
* Creates
|
|
4286
|
+
* Creates a reactive object that Qwik can track across serialization.
|
|
4024
4287
|
*
|
|
4025
|
-
* Use
|
|
4026
|
-
*
|
|
4288
|
+
* Use it to create state for your application. The returned object is a Proxy that tracks reads and
|
|
4289
|
+
* writes. When any of the properties change, the functions that read those properties will re-run.
|
|
4290
|
+
*
|
|
4291
|
+
* `Store`s are deep by default, meaning that any objects assigned to properties will also become
|
|
4292
|
+
* `Store`s. This includes arrays.
|
|
4293
|
+
*
|
|
4294
|
+
* Prefer `useSignal` over `useStore` when possible, as it is more efficient.
|
|
4027
4295
|
*
|
|
4028
4296
|
* ### Example
|
|
4029
4297
|
*
|
|
@@ -4203,10 +4471,10 @@ export declare const useStylesScopedQrl: (styles: QRL<string>) => UseStylesScope
|
|
|
4203
4471
|
* @public
|
|
4204
4472
|
* @see `Tracker`
|
|
4205
4473
|
*/
|
|
4206
|
-
export declare const useTask$: (fn: TaskFn) => void;
|
|
4474
|
+
export declare const useTask$: (fn: TaskFn, opts?: TaskOptions) => void;
|
|
4207
4475
|
|
|
4208
4476
|
/** @internal */
|
|
4209
|
-
export declare const useTaskQrl: (qrl: QRL<TaskFn
|
|
4477
|
+
export declare const useTaskQrl: (qrl: QRL<TaskFn>, opts?: TaskOptions) => void;
|
|
4210
4478
|
|
|
4211
4479
|
/**
|
|
4212
4480
|
* ```tsx
|
|
@@ -4236,6 +4504,13 @@ export declare const useVisibleTask$: (fn: TaskFn, opts?: OnVisibleTaskOptions)
|
|
|
4236
4504
|
/** @internal */
|
|
4237
4505
|
export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;
|
|
4238
4506
|
|
|
4507
|
+
/**
|
|
4508
|
+
* Handles events for bind:value
|
|
4509
|
+
*
|
|
4510
|
+
* @internal
|
|
4511
|
+
*/
|
|
4512
|
+
export declare function _val(this: string | undefined, _: any, element: HTMLInputElement): void;
|
|
4513
|
+
|
|
4239
4514
|
/**
|
|
4240
4515
|
* Type representing a value which is either resolve or a promise.
|
|
4241
4516
|
*
|
|
@@ -4250,38 +4525,59 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4250
4525
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4251
4526
|
|
|
4252
4527
|
/**
|
|
4253
|
-
* 2.0.0-beta.
|
|
4528
|
+
* 2.0.0-beta.21-dev+c008e88
|
|
4254
4529
|
*
|
|
4255
4530
|
* @public
|
|
4256
4531
|
*/
|
|
4257
4532
|
export declare const version: string;
|
|
4258
4533
|
|
|
4259
4534
|
/** @internal */
|
|
4260
|
-
export declare
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
_VNode | null
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
/////////////// 2 - Previous sibling
|
|
4267
|
-
_VNode | null,
|
|
4268
|
-
/////////////// 3 - Next sibling
|
|
4269
|
-
_VNode | null,
|
|
4270
|
-
/////////////// 4 - First child
|
|
4271
|
-
_VNode | null,
|
|
4272
|
-
(string | null | boolean)[]
|
|
4273
|
-
] & {
|
|
4274
|
-
__brand__: 'FragmentNode' & 'HostElement';
|
|
4275
|
-
};
|
|
4535
|
+
export declare class _VirtualVNode extends _VNode {
|
|
4536
|
+
key: string | null;
|
|
4537
|
+
firstChild: _VNode | null | undefined;
|
|
4538
|
+
lastChild: _VNode | null | undefined;
|
|
4539
|
+
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);
|
|
4540
|
+
}
|
|
4276
4541
|
|
|
4277
4542
|
/** @public */
|
|
4278
4543
|
export declare type VisibleTaskStrategy = 'intersection-observer' | 'document-ready' | 'document-idle';
|
|
4279
4544
|
|
|
4280
4545
|
/** @internal */
|
|
4281
|
-
export declare
|
|
4546
|
+
export declare abstract class _VNode implements BackRef {
|
|
4547
|
+
flags: _VNodeFlags;
|
|
4548
|
+
parent: _VNode | null;
|
|
4549
|
+
previousSibling: _VNode | null | undefined;
|
|
4550
|
+
nextSibling: _VNode | null | undefined;
|
|
4551
|
+
props: Props | null;
|
|
4552
|
+
[_EFFECT_BACK_REF]: Map<any, any> | undefined;
|
|
4553
|
+
slotParent: _VNode | null;
|
|
4554
|
+
dirty: ChoreBits;
|
|
4555
|
+
dirtyChildren: _VNode[] | null;
|
|
4556
|
+
nextDirtyChildIndex: number;
|
|
4557
|
+
constructor(flags: _VNodeFlags, parent: _VNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, props: Props | null);
|
|
4558
|
+
toString(): string;
|
|
4559
|
+
}
|
|
4560
|
+
|
|
4561
|
+
/** @internal */
|
|
4562
|
+
export declare const _vnode_ensureElementInflated: (container: _Container, vnode: _VNode) => void;
|
|
4563
|
+
|
|
4564
|
+
/** @internal */
|
|
4565
|
+
export declare const _vnode_getAttrKeys: (container: _Container, vnode: _ElementVNode | _VirtualVNode) => string[];
|
|
4566
|
+
|
|
4567
|
+
/** @internal */
|
|
4568
|
+
export declare const _vnode_getFirstChild: (vnode: _VNode) => _VNode | null;
|
|
4569
|
+
|
|
4570
|
+
/** @internal */
|
|
4571
|
+
export declare const _vnode_isMaterialized: (vNode: _VNode) => boolean;
|
|
4282
4572
|
|
|
4283
4573
|
/** @internal */
|
|
4284
|
-
export declare
|
|
4574
|
+
export declare const _vnode_isTextVNode: (vNode: _VNode) => vNode is _TextVNode;
|
|
4575
|
+
|
|
4576
|
+
/** @internal */
|
|
4577
|
+
export declare const _vnode_isVirtualVNode: (vNode: _VNode) => vNode is _VirtualVNode;
|
|
4578
|
+
|
|
4579
|
+
/** @internal */
|
|
4580
|
+
export declare function _vnode_toString(this: _VNode | null, depth?: number, offset?: string, materialize?: boolean, siblings?: boolean, colorize?: boolean, container?: ClientContainer | null): string;
|
|
4285
4581
|
|
|
4286
4582
|
/**
|
|
4287
4583
|
* Array of numbers which describes virtual nodes in the tree.
|
|
@@ -4349,40 +4645,25 @@ export declare const enum _VNodeFlags {
|
|
|
4349
4645
|
Element = 1,
|
|
4350
4646
|
Virtual = 2,
|
|
4351
4647
|
ELEMENT_OR_VIRTUAL_MASK = 3,
|
|
4648
|
+
Text = 4,
|
|
4352
4649
|
ELEMENT_OR_TEXT_MASK = 5,
|
|
4353
4650
|
TYPE_MASK = 7,
|
|
4354
4651
|
INFLATED_TYPE_MASK = 15,
|
|
4355
|
-
Text = 4,
|
|
4356
4652
|
Inflated = 8,
|
|
4357
4653
|
Resolved = 16,
|
|
4358
4654
|
Deleted = 32,
|
|
4359
|
-
|
|
4360
|
-
|
|
4655
|
+
HasIterationItems = 64,
|
|
4656
|
+
InflatedIterationItems = 128,
|
|
4657
|
+
Cursor = 256,
|
|
4658
|
+
NAMESPACE_MASK = 1536,
|
|
4659
|
+
NEGATED_NAMESPACE_MASK = -1537,
|
|
4361
4660
|
NS_html = 0,// http://www.w3.org/1999/xhtml
|
|
4362
|
-
NS_svg =
|
|
4363
|
-
NS_math =
|
|
4364
|
-
}
|
|
4365
|
-
|
|
4366
|
-
declare type VNodeJournal = Array<VNodeJournalOpCode | Document | Element | Text | string | boolean | null>;
|
|
4367
|
-
|
|
4368
|
-
/**
|
|
4369
|
-
* Fundamental DOM operations are:
|
|
4370
|
-
*
|
|
4371
|
-
* - Insert new DOM element/text
|
|
4372
|
-
* - Remove DOM element/text
|
|
4373
|
-
* - Set DOM element attributes
|
|
4374
|
-
* - Set text node value
|
|
4375
|
-
*/
|
|
4376
|
-
declare const enum VNodeJournalOpCode {
|
|
4377
|
-
SetText = 1,// ------ [SetAttribute, target, text]
|
|
4378
|
-
SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
|
|
4379
|
-
HoistStyles = 3,// -- [HoistStyles, document]
|
|
4380
|
-
Remove = 4,// ------- [Insert, target(parent), ...nodes]
|
|
4381
|
-
Insert = 5
|
|
4661
|
+
NS_svg = 512,// http://www.w3.org/2000/svg
|
|
4662
|
+
NS_math = 1024
|
|
4382
4663
|
}
|
|
4383
4664
|
|
|
4384
4665
|
/** @internal */
|
|
4385
|
-
export declare const _waitUntilRendered: (
|
|
4666
|
+
export declare const _waitUntilRendered: (container: _Container) => Promise<void>;
|
|
4386
4667
|
|
|
4387
4668
|
/** @internal */
|
|
4388
4669
|
export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
|
|
@@ -4390,9 +4671,6 @@ export declare function _walkJSX(ssr: SSRContainer, value: JSXOutput, options: {
|
|
|
4390
4671
|
parentComponentFrame: ISsrComponentFrame | null;
|
|
4391
4672
|
}): Promise<void>;
|
|
4392
4673
|
|
|
4393
|
-
/** @internal */
|
|
4394
|
-
export declare const _weakSerialize: <T extends object>(input: T) => Partial<T>;
|
|
4395
|
-
|
|
4396
4674
|
/**
|
|
4397
4675
|
* Override the `getLocale` with `lang` within the `fn` execution.
|
|
4398
4676
|
*
|
|
@@ -4400,8 +4678,10 @@ export declare const _weakSerialize: <T extends object>(input: T) => Partial<T>;
|
|
|
4400
4678
|
*/
|
|
4401
4679
|
export declare function withLocale<T>(locale: string, fn: () => T): T;
|
|
4402
4680
|
|
|
4681
|
+
declare type WrappedProp<T extends object, P extends keyof T> = T extends Signal ? WrappedSignalImpl<PropType<T, P>> : PropType<T, P>;
|
|
4682
|
+
|
|
4403
4683
|
declare const enum WrappedSignalFlags {
|
|
4404
|
-
UNWRAP =
|
|
4684
|
+
UNWRAP = 4
|
|
4405
4685
|
}
|
|
4406
4686
|
|
|
4407
4687
|
declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
@@ -4409,18 +4689,18 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
|
4409
4689
|
$func$: (...args: any[]) => T;
|
|
4410
4690
|
$funcStr$: string | null;
|
|
4411
4691
|
$flags$: AllSignalFlags;
|
|
4412
|
-
$hostElement$: HostElement |
|
|
4413
|
-
|
|
4414
|
-
[
|
|
4415
|
-
|
|
4416
|
-
$invalidate$(): void;
|
|
4692
|
+
$hostElement$: HostElement | undefined;
|
|
4693
|
+
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | undefined;
|
|
4694
|
+
constructor(container: _Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
|
|
4695
|
+
invalidate(): void;
|
|
4417
4696
|
/**
|
|
4418
4697
|
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
4419
4698
|
* remained the same object.
|
|
4420
4699
|
*/
|
|
4421
4700
|
force(): void;
|
|
4422
4701
|
get untrackedValue(): T;
|
|
4423
|
-
$computeIfNeeded$():
|
|
4702
|
+
$computeIfNeeded$(): void;
|
|
4703
|
+
$unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
|
|
4424
4704
|
set value(_: any);
|
|
4425
4705
|
get value(): any;
|
|
4426
4706
|
}
|
|
@@ -4436,12 +4716,9 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
|
4436
4716
|
*
|
|
4437
4717
|
* @internal
|
|
4438
4718
|
*/
|
|
4439
|
-
export declare const _wrapProp: <T extends
|
|
4719
|
+
export declare const _wrapProp: <T extends object, P extends keyof T>(...args: [T, P?]) => WrappedProp<T, P>;
|
|
4440
4720
|
|
|
4441
4721
|
/** @internal @deprecated v1 compat */
|
|
4442
|
-
export declare const _wrapSignal: <T extends
|
|
4443
|
-
|
|
4444
|
-
/** @internal */
|
|
4445
|
-
export declare const _wrapStore: <T extends Record<any, any>, P extends keyof T>(obj: T, prop: P) => Signal<T>;
|
|
4722
|
+
export declare const _wrapSignal: <T extends object, P extends keyof T>(obj: T, prop: P) => T[P] | WrappedProp<T, P>;
|
|
4446
4723
|
|
|
4447
4724
|
export { }
|