@qwik.dev/core 2.0.0-beta.11 → 2.0.0-beta.14
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.darwin-x64.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.mjs +2 -2
- package/dist/backpatch/package.json +1 -1
- package/dist/backpatch-executor.debug.js +7 -2
- package/dist/backpatch-executor.js +1 -1
- package/dist/build/package.json +1 -1
- package/dist/{cli.cjs → cli.mjs} +444 -2624
- package/dist/core-internal.d.ts +219 -123
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +9416 -8957
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +5225 -4890
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +3 -0
- package/dist/optimizer.mjs +1354 -1341
- package/dist/qwikloader.debug.js +14 -8
- package/dist/qwikloader.js +1 -1
- package/dist/server.d.ts +20 -12
- package/dist/server.mjs +466 -381
- package/dist/starters/adapters/aws-lambda/adapters/aws-lambda/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/aws-lambda/package.json +3 -2
- package/dist/starters/adapters/azure-swa/adapters/azure-swa/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/azure-swa/package.json +3 -2
- package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/bun/package.json +3 -2
- package/dist/starters/adapters/cloud-run/adapters/cloud-run/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/cloud-run/package.json +3 -2
- package/dist/starters/adapters/cloudflare-pages/adapters/cloudflare-pages/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/cloudflare-pages/package.json +3 -2
- package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/deno/package.json +3 -2
- package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/express/package.json +3 -2
- package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/fastify/package.json +3 -2
- package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/firebase/package.json +3 -2
- package/dist/starters/adapters/netlify-edge/adapters/netlify-edge/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/netlify-edge/package.json +3 -2
- package/dist/starters/adapters/node-server/adapters/node-server/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/node-server/package.json +3 -2
- package/dist/starters/adapters/ssg/adapters/ssg/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/ssg/package.json +4 -3
- 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} +1 -1
- package/dist/starters/adapters/vercel-edge/package.json +3 -2
- package/dist/starters/features/csr/package.json +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/testing/index.d.ts +75 -27
- package/dist/testing/index.mjs +2809 -2178
- package/dist/testing/package.json +1 -1
- package/handlers.mjs +1 -1
- package/package.json +16 -50
- package/public.d.ts +1 -0
- package/{qwik-cli.cjs → qwik-cli.mjs} +1 -1
- package/dist/backpatch/index.cjs +0 -6
- 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/core.cjs +0 -12672
- package/dist/core.cjs.map +0 -1
- package/dist/core.prod.cjs +0 -6111
- 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 -212
- package/dist/preloader.cjs +0 -266
- package/dist/server.cjs +0 -3209
- package/dist/testing/index.cjs +0 -35696
- /package/dist/starters/features/csr/{vite.config.mts → vite.config.ts} +0 -0
package/dist/core-internal.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as CSS_2 from 'csstype';
|
|
|
3
3
|
import { isBrowser } from './build';
|
|
4
4
|
import { isDev } from './build';
|
|
5
5
|
import { isServer } from './build';
|
|
6
|
+
import { JSXNode as JSXNode_2 } from './types/jsx-node';
|
|
6
7
|
import { QRL as QRL_2 } from './qrl.public';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -81,22 +82,19 @@ import { QRL as QRL_2 } from './qrl.public';
|
|
|
81
82
|
*/
|
|
82
83
|
export declare const $: <T>(expression: T) => QRL<T>;
|
|
83
84
|
|
|
85
|
+
declare interface AddRootFn {
|
|
86
|
+
(obj: unknown, returnRef?: never): number;
|
|
87
|
+
(obj: unknown, returnRef: true): SeenRef;
|
|
88
|
+
}
|
|
89
|
+
|
|
84
90
|
declare type AllEventKeys = keyof AllEventsMap;
|
|
85
91
|
|
|
86
|
-
declare type AllEventMapRaw =
|
|
87
|
-
qidle: QwikIdleEvent;
|
|
88
|
-
qinit: QwikInitEvent;
|
|
89
|
-
qsymbol: QwikSymbolEvent;
|
|
90
|
-
qvisible: QwikVisibleEvent;
|
|
91
|
-
qviewtransition: QwikViewTransitionEvent;
|
|
92
|
-
};
|
|
92
|
+
declare type AllEventMapRaw = QwikHTMLElementEventMap & QwikDocumentEventMap & QwikWindowEventMap;
|
|
93
93
|
|
|
94
94
|
declare type AllEventsMap = Omit<AllEventMapRaw, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
95
95
|
|
|
96
96
|
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;
|
|
97
97
|
|
|
98
|
-
declare type AllPascalEventMaps = PascalMap<AllEventsMap>;
|
|
99
|
-
|
|
100
98
|
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags;
|
|
101
99
|
|
|
102
100
|
/**
|
|
@@ -369,6 +367,8 @@ export declare interface AsyncComputedReadonlySignal<T = unknown> extends Comput
|
|
|
369
367
|
loading: boolean;
|
|
370
368
|
/** The error that occurred while computing the signal. */
|
|
371
369
|
error: Error | null;
|
|
370
|
+
/** A promise that resolves when the value is computed. */
|
|
371
|
+
promise(): Promise<T>;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
/** @public */
|
|
@@ -381,13 +381,14 @@ export declare type AsyncComputedReturnType<T> = T extends Promise<infer T> ? As
|
|
|
381
381
|
*
|
|
382
382
|
* # ================================
|
|
383
383
|
*/
|
|
384
|
-
declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T, AsyncComputeQRL<T>> implements BackRef {
|
|
384
|
+
declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T | undefined, AsyncComputeQRL<T>> implements BackRef {
|
|
385
385
|
$untrackedLoading$: boolean;
|
|
386
386
|
$untrackedError$: Error | null;
|
|
387
387
|
$loadingEffects$: null | Set<EffectSubscription>;
|
|
388
388
|
$errorEffects$: null | Set<EffectSubscription>;
|
|
389
389
|
$destroy$: NoSerialize<() => void> | null;
|
|
390
|
-
|
|
390
|
+
$promiseValue$: T | typeof NEEDS_COMPUTATION;
|
|
391
|
+
private $promise$;
|
|
391
392
|
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
392
393
|
constructor(container: Container | null, fn: AsyncComputeQRL<T>, flags?: SignalFlags | SerializationSignalFlags);
|
|
393
394
|
/**
|
|
@@ -402,7 +403,10 @@ declare class AsyncComputedSignalImpl<T> extends ComputedSignalImpl<T, AsyncComp
|
|
|
402
403
|
set untrackedError(value: Error | null);
|
|
403
404
|
get untrackedError(): Error | null;
|
|
404
405
|
invalidate(): void;
|
|
405
|
-
|
|
406
|
+
promise(): Promise<T>;
|
|
407
|
+
$computeIfNeeded$(): Promise<void> | undefined;
|
|
408
|
+
private $promiseComputation$;
|
|
409
|
+
private setValue;
|
|
406
410
|
}
|
|
407
411
|
|
|
408
412
|
declare type AsyncComputeQRL<T> = QRLInternal<AsyncComputedFn<T>>;
|
|
@@ -433,6 +437,13 @@ declare type BivariantQrlFn<ARGS extends any[], RETURN> = {
|
|
|
433
437
|
/** @public */
|
|
434
438
|
declare type Booleanish = boolean | `${boolean}`;
|
|
435
439
|
|
|
440
|
+
/**
|
|
441
|
+
* Handles events for bind:checked
|
|
442
|
+
*
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
export declare const _chk: (_: any, element: HTMLInputElement) => void;
|
|
446
|
+
|
|
436
447
|
declare interface Chore<T extends ChoreType = ChoreType> {
|
|
437
448
|
$type$: T;
|
|
438
449
|
$idx$: number | string;
|
|
@@ -440,7 +451,7 @@ declare interface Chore<T extends ChoreType = ChoreType> {
|
|
|
440
451
|
$target$: ChoreTarget | null;
|
|
441
452
|
$payload$: unknown;
|
|
442
453
|
$state$: ChoreState;
|
|
443
|
-
$blockedChores$:
|
|
454
|
+
$blockedChores$: ChoreArray | null;
|
|
444
455
|
$startTime$: number | undefined;
|
|
445
456
|
$endTime$: number | undefined;
|
|
446
457
|
$resolve$: ((value: any) => void) | undefined;
|
|
@@ -989,7 +1000,6 @@ export declare interface CSSProperties extends CSS_2.Properties<string | number>
|
|
|
989
1000
|
[v: `--${string}`]: string | number | undefined;
|
|
990
1001
|
}
|
|
991
1002
|
|
|
992
|
-
/** @public */
|
|
993
1003
|
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
994
1004
|
$flags$: number;
|
|
995
1005
|
$index$: number;
|
|
@@ -1015,7 +1025,6 @@ declare interface DeserializeContainer {
|
|
|
1015
1025
|
$state$?: unknown[];
|
|
1016
1026
|
$storeProxyMap$: ObjToProxyMap;
|
|
1017
1027
|
$forwardRefs$: Array<number> | null;
|
|
1018
|
-
$initialQRLs$: Array<string> | null;
|
|
1019
1028
|
readonly $scheduler$: Scheduler | null;
|
|
1020
1029
|
}
|
|
1021
1030
|
|
|
@@ -1049,7 +1058,6 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1049
1058
|
$qFuncs$: Array<(...args: unknown[]) => unknown>;
|
|
1050
1059
|
$instanceHash$: string;
|
|
1051
1060
|
$forwardRefs$: Array<number> | null;
|
|
1052
|
-
$initialQRLs$: Array<string> | null;
|
|
1053
1061
|
vNodeLocate: (id: string | Element) => _VNode;
|
|
1054
1062
|
private $stateData$;
|
|
1055
1063
|
private $styleIds$;
|
|
@@ -1068,24 +1076,6 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1068
1076
|
$appendStyle$(content: string, styleId: string, host: _VirtualVNode, scoped: boolean): void;
|
|
1069
1077
|
/** Set the server data for the Qwik Router. */
|
|
1070
1078
|
private $setServerData$;
|
|
1071
|
-
/**
|
|
1072
|
-
* Schedule the initial QRLs to be resolved.
|
|
1073
|
-
*
|
|
1074
|
-
* Schedules the QRLs that are defined in the state data as `PreloadQRL`.
|
|
1075
|
-
*
|
|
1076
|
-
* This is done because when computed and custom serializer QRLs are called they need QRL to work.
|
|
1077
|
-
* If the QRL is not resolved at this point, it will be resolved by throwing a promise and
|
|
1078
|
-
* rerunning the whole wrapping function again. We want to avoid that, because it means that the
|
|
1079
|
-
* function can execute twice.
|
|
1080
|
-
*
|
|
1081
|
-
* ```ts
|
|
1082
|
-
* useVisibleTask$(() => {
|
|
1083
|
-
* runHeavyLogic(); // This will be called again if the QRL of `computedOrCustomSerializer` is not resolved.
|
|
1084
|
-
* console.log(computedOrCustomSerializer.value); // Throw a promise if QRL not resolved and execute visible task again.
|
|
1085
|
-
* });
|
|
1086
|
-
* ```
|
|
1087
|
-
*/
|
|
1088
|
-
private $scheduleInitialQRLs$;
|
|
1089
1079
|
}
|
|
1090
1080
|
export { DomContainer }
|
|
1091
1081
|
export { DomContainer as _DomContainer }
|
|
@@ -1155,9 +1145,9 @@ _SubscriptionData | null
|
|
|
1155
1145
|
export declare class _ElementVNode extends _VNode {
|
|
1156
1146
|
firstChild: _VNode | null | undefined;
|
|
1157
1147
|
lastChild: _VNode | null | undefined;
|
|
1158
|
-
element:
|
|
1148
|
+
element: QElement;
|
|
1159
1149
|
elementName: string | undefined;
|
|
1160
|
-
constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined, element:
|
|
1150
|
+
constructor(flags: _VNodeFlags, parent: _ElementVNode | _VirtualVNode | null, previousSibling: _VNode | null | undefined, nextSibling: _VNode | null | undefined, firstChild: _VNode | null | undefined, lastChild: _VNode | null | undefined, element: QElement, elementName: string | undefined);
|
|
1161
1151
|
}
|
|
1162
1152
|
|
|
1163
1153
|
/** @internal */
|
|
@@ -1176,11 +1166,10 @@ export declare const event$: <T>(qrl: T) => QRL_2<T>;
|
|
|
1176
1166
|
|
|
1177
1167
|
declare type EventCorrectionMap = {
|
|
1178
1168
|
auxclick: PointerEvent;
|
|
1179
|
-
beforetoggle: CorrectedToggleEvent;
|
|
1180
1169
|
click: PointerEvent;
|
|
1181
1170
|
dblclick: PointerEvent;
|
|
1182
1171
|
input: InputEvent;
|
|
1183
|
-
|
|
1172
|
+
qvisible: QwikVisibleEvent;
|
|
1184
1173
|
};
|
|
1185
1174
|
|
|
1186
1175
|
declare type EventFromName<T extends string> = LcEvent<T>;
|
|
@@ -1235,8 +1224,8 @@ export declare type FunctionComponent<P = unknown> = {
|
|
|
1235
1224
|
renderFn(props: P, key: string | null, flags: number, dev?: DevJSX): JSXOutput;
|
|
1236
1225
|
}['renderFn'];
|
|
1237
1226
|
|
|
1238
|
-
/** @internal */
|
|
1239
|
-
export declare const _getConstProps:
|
|
1227
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1228
|
+
export declare const _getConstProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1240
1229
|
|
|
1241
1230
|
/** @internal */
|
|
1242
1231
|
export declare const _getContextContainer: () => ClientContainer | undefined;
|
|
@@ -1279,8 +1268,8 @@ export declare const getPlatform: () => CorePlatform;
|
|
|
1279
1268
|
/** @internal */
|
|
1280
1269
|
export declare function _getQContainerElement(element: Element | _VNode): Element | null;
|
|
1281
1270
|
|
|
1282
|
-
/** @internal */
|
|
1283
|
-
export declare const _getVarProps:
|
|
1271
|
+
/** Used by the optimizer for spread props operations @internal */
|
|
1272
|
+
export declare const _getVarProps: (props: PropsProxy | Record<string, unknown> | null | undefined) => Props | null;
|
|
1284
1273
|
|
|
1285
1274
|
/** @public */
|
|
1286
1275
|
declare interface GlobalInjections {
|
|
@@ -1292,10 +1281,8 @@ declare interface GlobalInjections {
|
|
|
1292
1281
|
}
|
|
1293
1282
|
|
|
1294
1283
|
/**
|
|
1295
|
-
* The legacy transform, used
|
|
1296
|
-
*
|
|
1297
|
-
*
|
|
1298
|
-
* Also note that this disables optimizations.
|
|
1284
|
+
* The legacy transform, used by some JSX transpilers. The optimizer normally replaces this with
|
|
1285
|
+
* optimized calls, with the same caveat as `jsx()`.
|
|
1299
1286
|
*
|
|
1300
1287
|
* @public
|
|
1301
1288
|
*/
|
|
@@ -1431,8 +1418,16 @@ export declare const _IMMUTABLE: unique symbol;
|
|
|
1431
1418
|
*/
|
|
1432
1419
|
export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
|
|
1433
1420
|
|
|
1434
|
-
/**
|
|
1435
|
-
|
|
1421
|
+
/**
|
|
1422
|
+
* Create an inlined QRL. This is mostly useful on the server side for serialization.
|
|
1423
|
+
*
|
|
1424
|
+
* @param symbol - The object/function to register, or `null` to retrieve a previously registered
|
|
1425
|
+
* one by hash
|
|
1426
|
+
* @param symbolName - The name of the symbol.
|
|
1427
|
+
* @param lexicalScopeCapture - A set of lexically scoped variables to capture.
|
|
1428
|
+
* @public
|
|
1429
|
+
*/
|
|
1430
|
+
export declare const inlinedQrl: <T>(symbol: T | null, symbolName: string, lexicalScopeCapture?: any[]) => QRL<T>;
|
|
1436
1431
|
|
|
1437
1432
|
/** @internal */
|
|
1438
1433
|
export declare const inlinedQrlDEV: <T = any>(symbol: T, symbolName: string, opts: QRLDev, lexicalScopeCapture?: any[]) => QRL<T>;
|
|
@@ -1468,8 +1463,6 @@ declare type IntrinsicSVGElements = {
|
|
|
1468
1463
|
/** The shared state during an invoke() call */
|
|
1469
1464
|
declare interface InvokeContext {
|
|
1470
1465
|
$url$: URL | undefined;
|
|
1471
|
-
/** The next available index for the sequentialScope array */
|
|
1472
|
-
$i$: number;
|
|
1473
1466
|
/** The Virtual parent component for the current component code */
|
|
1474
1467
|
$hostElement$: HostElement | undefined;
|
|
1475
1468
|
/** The current DOM element */
|
|
@@ -1543,25 +1536,33 @@ export declare function _isStringifiable(value: unknown): value is _Stringifiabl
|
|
|
1543
1536
|
export declare const _isTask: (value: any) => value is Task;
|
|
1544
1537
|
|
|
1545
1538
|
/**
|
|
1539
|
+
* Used by the JSX transpilers to create a JSXNode. Note that the optimizer will normally not use
|
|
1540
|
+
* this, instead using _jsxSplit and _jsxSorted directly.
|
|
1541
|
+
*
|
|
1542
|
+
* The optimizer will also replace all `jsx()` calls with the more optimized versions.
|
|
1543
|
+
*
|
|
1544
|
+
* The exception is when the props are not a literal object, which can only happen when the `jsx`
|
|
1545
|
+
* call is written directly.
|
|
1546
|
+
*
|
|
1546
1547
|
* @public
|
|
1547
|
-
* Used by the JSX transpilers to create a JSXNode.
|
|
1548
|
-
* Note that the optimizer will not use this, instead using _jsxSplit and _jsxSorted directly.
|
|
1549
1548
|
*/
|
|
1550
|
-
declare const jsx: <T extends string | FunctionComponent<any>>(type: T, props: T extends FunctionComponent<infer PROPS> ? PROPS : Props, key?: string | number | null) => JSXNode<T>;
|
|
1551
|
-
export { jsx }
|
|
1552
|
-
export { jsx as jsxs }
|
|
1549
|
+
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>;
|
|
1553
1550
|
|
|
1554
1551
|
/** @internal */
|
|
1555
1552
|
export declare const _jsxBranch: <T>(input?: T) => T | undefined;
|
|
1556
1553
|
|
|
1557
1554
|
/** @internal @deprecated v1 compat */
|
|
1558
|
-
export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) =>
|
|
1555
|
+
export declare const _jsxC: (type: any, mutable: any, _flags: any, key: any) => JSXNode_2<any>;
|
|
1559
1556
|
|
|
1560
1557
|
/** @public */
|
|
1561
1558
|
export declare type JSXChildren = string | number | boolean | null | undefined | Function | RegExp | JSXChildren[] | Promise<JSXChildren> | Signal<JSXChildren> | JSXNode;
|
|
1562
1559
|
|
|
1563
|
-
/**
|
|
1564
|
-
|
|
1560
|
+
/**
|
|
1561
|
+
* Alias of `jsx` for development purposes.
|
|
1562
|
+
*
|
|
1563
|
+
* @public
|
|
1564
|
+
*/
|
|
1565
|
+
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>;
|
|
1565
1566
|
|
|
1566
1567
|
declare interface JsxDevOpts {
|
|
1567
1568
|
fileName: string;
|
|
@@ -1569,6 +1570,14 @@ declare interface JsxDevOpts {
|
|
|
1569
1570
|
columnNumber: number;
|
|
1570
1571
|
}
|
|
1571
1572
|
|
|
1573
|
+
declare type JSXDocumentEvents = {
|
|
1574
|
+
[K in keyof QwikDocumentEventMap as `document:on${PascalCaseName<K>}$`]: QwikDocumentEventMap[K];
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
declare type JSXElementEvents = {
|
|
1578
|
+
[K in keyof QwikHTMLElementEventMap as `on${PascalCaseName<K>}$`]: QwikHTMLElementEventMap[K];
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1572
1581
|
/**
|
|
1573
1582
|
* A JSX Node, an internal structure. You probably want to use `JSXOutput` instead.
|
|
1574
1583
|
*
|
|
@@ -1588,9 +1597,38 @@ export declare interface JSXNode<T extends string | FunctionComponent | unknown
|
|
|
1588
1597
|
* @internal
|
|
1589
1598
|
*/
|
|
1590
1599
|
export declare interface JSXNodeInternal<T extends string | FunctionComponent | unknown = unknown> extends JSXNode<T> {
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1600
|
+
/** The type of node */
|
|
1601
|
+
type: T;
|
|
1602
|
+
/** Do the varProps need sorting */
|
|
1603
|
+
toSort: boolean;
|
|
1604
|
+
/** The key property */
|
|
1605
|
+
key: string | null;
|
|
1606
|
+
/**
|
|
1607
|
+
* Props that are not guaranteed shallow equal across runs.
|
|
1608
|
+
*
|
|
1609
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1610
|
+
*
|
|
1611
|
+
* Does not contain `children` or `key`.
|
|
1612
|
+
*
|
|
1613
|
+
* `onEvent$` props are normalized to the html `on:event` version
|
|
1614
|
+
*/
|
|
1615
|
+
varProps: Props;
|
|
1616
|
+
/**
|
|
1617
|
+
* Props that will be shallow equal across runs. Does not contain any props that are in varProps.
|
|
1618
|
+
*
|
|
1619
|
+
* Any prop that is in `constProps` takes precedence over `varProps`.
|
|
1620
|
+
*
|
|
1621
|
+
* Does not contain `children` or `key`.
|
|
1622
|
+
*
|
|
1623
|
+
* `onEvent$` props are normalized to the html `on:event` version
|
|
1624
|
+
*/
|
|
1625
|
+
constProps: Props | null;
|
|
1626
|
+
/** The children of the node */
|
|
1627
|
+
children: JSXChildren;
|
|
1628
|
+
/** Filename etc for debugging */
|
|
1629
|
+
dev?: DevJSX & {
|
|
1630
|
+
stack: string | undefined;
|
|
1631
|
+
};
|
|
1594
1632
|
}
|
|
1595
1633
|
|
|
1596
1634
|
/**
|
|
@@ -1601,10 +1639,17 @@ export declare interface JSXNodeInternal<T extends string | FunctionComponent |
|
|
|
1601
1639
|
export declare type JSXOutput = JSXNode | string | number | boolean | null | undefined | JSXOutput[];
|
|
1602
1640
|
|
|
1603
1641
|
/** @internal @deprecated v1 compat */
|
|
1604
|
-
export declare const _jsxQ: (type: any, mutable: any, immutable: any, children: any, _flags: any, key: any) =>
|
|
1642
|
+
export declare const _jsxQ: (type: any, mutable: any, immutable: any, children: any, _flags: any, key: any) => JSXNode_2<any>;
|
|
1605
1643
|
|
|
1606
1644
|
/** @internal @deprecated v1 compat */
|
|
1607
|
-
export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) =>
|
|
1645
|
+
export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: any, key: any) => JSXNode_2<any>;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Alias of `jsx` to support JSX syntax.
|
|
1649
|
+
*
|
|
1650
|
+
* @public
|
|
1651
|
+
*/
|
|
1652
|
+
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>;
|
|
1608
1653
|
|
|
1609
1654
|
/**
|
|
1610
1655
|
* Create a JSXNode with the properties fully split into variable and constant parts, and children
|
|
@@ -1616,7 +1661,7 @@ export declare const _jsxS: (type: any, mutable: any, immutable: any, _flags: an
|
|
|
1616
1661
|
* still update the attribute on the vnode.
|
|
1617
1662
|
*
|
|
1618
1663
|
* @param type - The JSX type
|
|
1619
|
-
* @param varProps - The properties of the tag, sorted, excluding children,
|
|
1664
|
+
* @param varProps - The properties of the tag, sorted, excluding children, key and any constProps
|
|
1620
1665
|
* @param constProps - The properties of the tag that are known to be constant references and don't
|
|
1621
1666
|
* need checking for changes on re-render
|
|
1622
1667
|
* @param children - JSX children. Any `children` in the props objects are ignored.
|
|
@@ -1626,13 +1671,13 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1626
1671
|
|
|
1627
1672
|
/**
|
|
1628
1673
|
* Create a JSXNode, with the properties split into variable and constant parts, but the variable
|
|
1629
|
-
* parts could include keys from constProps
|
|
1674
|
+
* parts could include keys from `constProps`, as well as `key` and `children`.
|
|
1630
1675
|
*
|
|
1631
|
-
* The constant parts are expected to be the same
|
|
1632
|
-
*
|
|
1633
|
-
* still update the attribute on the vnode.
|
|
1676
|
+
* `constProps` cannot include `key` or `children`. The constant parts are expected to be the same
|
|
1677
|
+
* on every render, and are not checked for changes. This means that they are constant scalars or
|
|
1678
|
+
* refs. When the ref is a signal or a store, it can still update the attribute on the vnode.
|
|
1634
1679
|
*
|
|
1635
|
-
* If `children`
|
|
1680
|
+
* If `children` or `key` are defined, any `children`/`key` in the props will be ignored.
|
|
1636
1681
|
*
|
|
1637
1682
|
* @param type - The tag type
|
|
1638
1683
|
* @param varProps - The properties of the tag that could change, including children
|
|
@@ -1640,11 +1685,15 @@ export declare const _jsxSorted: <T>(type: T, varProps: Props | null, constProps
|
|
|
1640
1685
|
* for changes on re-render
|
|
1641
1686
|
* @internal
|
|
1642
1687
|
*/
|
|
1643
|
-
export declare const _jsxSplit: <T extends string | FunctionComponent<any>>(type: T, varProps: Props | null, constProps: Props | null, children: JSXChildren | null | undefined, flags: number, key
|
|
1688
|
+
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>;
|
|
1644
1689
|
|
|
1645
1690
|
/** @public */
|
|
1646
1691
|
export declare type JSXTagName = keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
|
|
1647
1692
|
|
|
1693
|
+
declare type JSXWindowEvents = {
|
|
1694
|
+
[K in keyof QwikWindowEventMap as `window:on${PascalCaseName<K>}$`]: QwikWindowEventMap[K];
|
|
1695
|
+
};
|
|
1696
|
+
|
|
1648
1697
|
/**
|
|
1649
1698
|
* The names of events that Qwik knows about. They are all lowercase, but on the JSX side, they are
|
|
1650
1699
|
* PascalCase for nicer DX. (`onAuxClick$` vs `onauxclick$`)
|
|
@@ -1745,6 +1794,12 @@ export declare type NativeUIEvent = UIEvent;
|
|
|
1745
1794
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
1746
1795
|
export declare type NativeWheelEvent = WheelEvent;
|
|
1747
1796
|
|
|
1797
|
+
/**
|
|
1798
|
+
* Special value used to mark that a given signal needs to be computed. This is essentially a
|
|
1799
|
+
* "marked as dirty" flag.
|
|
1800
|
+
*/
|
|
1801
|
+
declare const NEEDS_COMPUTATION: any;
|
|
1802
|
+
|
|
1748
1803
|
declare interface NodePropData {
|
|
1749
1804
|
$scopedStyleIdPrefix$: string | null;
|
|
1750
1805
|
$isConst$: boolean;
|
|
@@ -1821,6 +1876,11 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1821
1876
|
strategy?: VisibleTaskStrategy;
|
|
1822
1877
|
}
|
|
1823
1878
|
|
|
1879
|
+
/** @internal */
|
|
1880
|
+
declare const _OWNER: unique symbol;
|
|
1881
|
+
|
|
1882
|
+
declare type PascalCaseName<T extends string> = T extends keyof LcEventNameMap ? LcEventNameMap[T] : Capitalize<T>;
|
|
1883
|
+
|
|
1824
1884
|
/**
|
|
1825
1885
|
* Capitalized multi-word names of some known events so we have nicer qwik attributes. For example,
|
|
1826
1886
|
* instead of `oncompositionEnd$` we can use `onCompositionEnd$`. Note that any capitalization
|
|
@@ -1828,15 +1888,7 @@ export declare interface OnVisibleTaskOptions {
|
|
|
1828
1888
|
*
|
|
1829
1889
|
* Add any multi-word event names to this list. Single word events are automatically converted.
|
|
1830
1890
|
*/
|
|
1831
|
-
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';
|
|
1832
|
-
|
|
1833
|
-
/**
|
|
1834
|
-
* Convert an event map to PascalCase. For example, `HTMLElementEventMap` contains lowercase keys,
|
|
1835
|
-
* so this will capitalize them, and use the `LcEventNameMap` for multi-word events names.
|
|
1836
|
-
*/
|
|
1837
|
-
declare type PascalMap<M> = {
|
|
1838
|
-
[K in Extract<keyof M, string> as K extends keyof LcEventNameMap ? LcEventNameMap[K] : Capitalize<K>]: M[K];
|
|
1839
|
-
};
|
|
1891
|
+
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';
|
|
1840
1892
|
|
|
1841
1893
|
declare type PopoverTargetAction = 'hide' | 'show' | 'toggle';
|
|
1842
1894
|
|
|
@@ -1960,6 +2012,7 @@ export declare type PropsOf<COMP> = COMP extends string ? COMP extends keyof Qwi
|
|
|
1960
2012
|
declare type PropsProxy = {
|
|
1961
2013
|
[_VAR_PROPS]: Props;
|
|
1962
2014
|
[_CONST_PROPS]: Props | null;
|
|
2015
|
+
[_OWNER]: JSXNodeInternal;
|
|
1963
2016
|
};
|
|
1964
2017
|
|
|
1965
2018
|
declare type PropType<T extends object, P extends keyof T> = P extends keyof T ? T[P] : 'value' extends keyof T ? T['value'] : never;
|
|
@@ -1977,6 +2030,11 @@ export declare interface _QDocument extends Document {
|
|
|
1977
2030
|
qVNodeData: WeakMap<Element, string>;
|
|
1978
2031
|
}
|
|
1979
2032
|
|
|
2033
|
+
declare interface QElement extends Element {
|
|
2034
|
+
qDispatchEvent?: (event: Event, scope: QwikLoaderEventScope) => ValueOrPromise<unknown>;
|
|
2035
|
+
vNode?: _VNode;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
1980
2038
|
/**
|
|
1981
2039
|
* The `QRL` type represents a lazy-loadable AND serializable resource.
|
|
1982
2040
|
*
|
|
@@ -2109,7 +2167,7 @@ export declare type QRL<TYPE = unknown> = {
|
|
|
2109
2167
|
getCaptured(): unknown[] | null;
|
|
2110
2168
|
getSymbol(): string;
|
|
2111
2169
|
getHash(): string;
|
|
2112
|
-
dev
|
|
2170
|
+
dev?: QRLDev | null;
|
|
2113
2171
|
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
2114
2172
|
|
|
2115
2173
|
/**
|
|
@@ -2143,7 +2201,7 @@ export declare const qrlDEV: <T = any>(chunkOrFn: string | (() => Promise<any>),
|
|
|
2143
2201
|
*
|
|
2144
2202
|
* @public
|
|
2145
2203
|
*/
|
|
2146
|
-
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[]
|
|
2204
|
+
export declare type QRLEventHandlerMulti<EV extends Event, EL> = QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[];
|
|
2147
2205
|
|
|
2148
2206
|
declare type QRLInternal<TYPE = unknown> = QRL<TYPE> & QRLInternalMethods<TYPE>;
|
|
2149
2207
|
|
|
@@ -2230,13 +2288,19 @@ export declare type QwikClipboardEvent<T = Element> = NativeClipboardEvent;
|
|
|
2230
2288
|
/** @public @deprecated Use `CompositionEvent` and use the second argument to the handler function for the current event target */
|
|
2231
2289
|
export declare type QwikCompositionEvent<T = Element> = NativeCompositionEvent;
|
|
2232
2290
|
|
|
2233
|
-
declare type QwikCustomEvents<EL> = {};
|
|
2234
|
-
|
|
2235
2291
|
declare type QwikCustomEventsPlain<EL> = {
|
|
2236
2292
|
/** The handler */
|
|
2237
2293
|
[key: `${'document:' | 'window:' | ''}on${string}$`]: QRLEventHandlerMulti<Event, EL> | EventHandler<Event, EL>;
|
|
2238
2294
|
};
|
|
2239
2295
|
|
|
2296
|
+
declare type QwikDocumentEventMap = Omit<DocumentEventMap, keyof QwikHTMLElementEventMap> & Omit<QwikHTMLElementEventMap, 'qvisible' | 'focus' | 'blur'> & {
|
|
2297
|
+
qidle: QwikIdleEvent;
|
|
2298
|
+
qinit: QwikInitEvent;
|
|
2299
|
+
qsymbol: QwikSymbolEvent;
|
|
2300
|
+
qresume: QwikResumeEvent;
|
|
2301
|
+
qviewtransition: QwikViewTransitionEvent;
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2240
2304
|
/** @public */
|
|
2241
2305
|
export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
2242
2306
|
}
|
|
@@ -2245,11 +2309,13 @@ export declare interface QwikDOMAttributes extends DOMAttributes<Element> {
|
|
|
2245
2309
|
export declare type QwikDragEvent<T = Element> = NativeDragEvent;
|
|
2246
2310
|
|
|
2247
2311
|
/** @public */
|
|
2248
|
-
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL
|
|
2312
|
+
declare type QwikEvents<EL, Plain extends boolean = true> = Plain extends true ? QwikKnownEventsPlain<EL> & QwikCustomEventsPlain<EL> : QwikKnownEvents<EL>;
|
|
2249
2313
|
|
|
2250
2314
|
/** @public @deprecated Use `FocusEvent` and use the second argument to the handler function for the current event target */
|
|
2251
2315
|
export declare type QwikFocusEvent<T = Element> = NativeFocusEvent;
|
|
2252
2316
|
|
|
2317
|
+
declare type QwikHTMLElementEventMap = Omit<HTMLElementEventMap, keyof EventCorrectionMap> & EventCorrectionMap;
|
|
2318
|
+
|
|
2253
2319
|
/**
|
|
2254
2320
|
* The DOM props without plain handlers, for use inside functions
|
|
2255
2321
|
*
|
|
@@ -2320,17 +2386,21 @@ declare namespace QwikJSX {
|
|
|
2320
2386
|
export { QwikJSX as JSX }
|
|
2321
2387
|
export { QwikJSX }
|
|
2322
2388
|
|
|
2389
|
+
declare type QwikJSXEvents = JSXElementEvents & JSXDocumentEvents & JSXWindowEvents;
|
|
2390
|
+
|
|
2323
2391
|
/** @public @deprecated Use `KeyboardEvent` and use the second argument to the handler function for the current event target */
|
|
2324
2392
|
export declare type QwikKeyboardEvent<T = Element> = NativeKeyboardEvent;
|
|
2325
2393
|
|
|
2326
2394
|
declare type QwikKnownEvents<EL> = {
|
|
2327
|
-
[K in keyof
|
|
2395
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL>;
|
|
2328
2396
|
};
|
|
2329
2397
|
|
|
2330
2398
|
declare type QwikKnownEventsPlain<EL> = {
|
|
2331
|
-
[K in keyof
|
|
2399
|
+
[K in keyof QwikJSXEvents]?: QRLEventHandlerMulti<QwikJSXEvents[K], EL> | EventHandler<QwikJSXEvents[K], EL>;
|
|
2332
2400
|
};
|
|
2333
2401
|
|
|
2402
|
+
declare type QwikLoaderEventScope = '-document' | '-window' | '';
|
|
2403
|
+
|
|
2334
2404
|
/**
|
|
2335
2405
|
* The metadata of the build. One of its uses is storing where QRL symbols are located.
|
|
2336
2406
|
*
|
|
@@ -2392,6 +2462,12 @@ export declare type QwikMouseEvent<T = Element, E = NativeMouseEvent> = E;
|
|
|
2392
2462
|
/** @public @deprecated Use `PointerEvent` and use the second argument to the handler function for the current event target */
|
|
2393
2463
|
export declare type QwikPointerEvent<T = Element> = NativePointerEvent;
|
|
2394
2464
|
|
|
2465
|
+
/**
|
|
2466
|
+
* Emitted by qwik-core on the container element when it resumes from a paused state. You cannot put
|
|
2467
|
+
* a Qwik event handler on the container so you must listen on the document instead. @public
|
|
2468
|
+
*/
|
|
2469
|
+
export declare type QwikResumeEvent = CustomEvent<{}>;
|
|
2470
|
+
|
|
2395
2471
|
/** @public @deprecated Use `SubmitEvent` and use the second argument to the handler function for the current event target */
|
|
2396
2472
|
export declare type QwikSubmitEvent<T = Element> = SubmitEvent;
|
|
2397
2473
|
|
|
@@ -2422,7 +2498,7 @@ declare interface QwikSymbol {
|
|
|
2422
2498
|
captureNames?: string[];
|
|
2423
2499
|
}
|
|
2424
2500
|
|
|
2425
|
-
/** Emitted by qwik-loader when a module was lazily loaded @public */
|
|
2501
|
+
/** Emitted by qwik-loader on document when a module was lazily loaded @public */
|
|
2426
2502
|
export declare type QwikSymbolEvent = CustomEvent<{
|
|
2427
2503
|
symbol: string;
|
|
2428
2504
|
element: Element;
|
|
@@ -2443,14 +2519,19 @@ export declare type QwikTransitionEvent<T = Element> = NativeTransitionEvent;
|
|
|
2443
2519
|
export declare type QwikUIEvent<T = Element> = NativeUIEvent;
|
|
2444
2520
|
|
|
2445
2521
|
/** Emitted by qwik-core on document when the a view transition start @public */
|
|
2446
|
-
declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2522
|
+
export declare type QwikViewTransitionEvent = CustomEvent<ViewTransition>;
|
|
2447
2523
|
|
|
2448
|
-
/**
|
|
2524
|
+
/**
|
|
2525
|
+
* Handled by qwik-loader when an element becomes visible. Used by `useVisibleTask$`. Does not
|
|
2526
|
+
* bubble. @public
|
|
2527
|
+
*/
|
|
2449
2528
|
export declare type QwikVisibleEvent = CustomEvent<IntersectionObserverEntry>;
|
|
2450
2529
|
|
|
2451
2530
|
/** @public @deprecated Use `WheelEvent` and use the second argument to the handler function for the current event target */
|
|
2452
2531
|
export declare type QwikWheelEvent<T = Element> = NativeWheelEvent;
|
|
2453
2532
|
|
|
2533
|
+
declare type QwikWindowEventMap = Omit<WindowEventHandlersEventMap, keyof QwikDocumentEventMap> & QwikDocumentEventMap;
|
|
2534
|
+
|
|
2454
2535
|
/** @public */
|
|
2455
2536
|
export declare interface ReadonlySignal<T = unknown> {
|
|
2456
2537
|
readonly value: T;
|
|
@@ -2472,7 +2553,12 @@ declare type RefFnInterface<EL> = {
|
|
|
2472
2553
|
(el: EL): void;
|
|
2473
2554
|
};
|
|
2474
2555
|
|
|
2475
|
-
/**
|
|
2556
|
+
/**
|
|
2557
|
+
* Register a QRL symbol globally for lookup by its hash. This is used by the optimizer to register
|
|
2558
|
+
* the names passed in `reg_ctx_name`.
|
|
2559
|
+
*
|
|
2560
|
+
* @internal
|
|
2561
|
+
*/
|
|
2476
2562
|
export declare const _regSymbol: (symbol: any, hash: string) => any;
|
|
2477
2563
|
|
|
2478
2564
|
/**
|
|
@@ -2658,7 +2744,7 @@ declare interface ResourceReturnInternal<T> {
|
|
|
2658
2744
|
export declare const _restProps: (props: PropsProxy, omit?: string[], target?: Props) => Props;
|
|
2659
2745
|
|
|
2660
2746
|
/**
|
|
2661
|
-
* This is called by qwik-loader to
|
|
2747
|
+
* This is called by qwik-loader to run a QRL. It has to be synchronous.
|
|
2662
2748
|
*
|
|
2663
2749
|
* @internal
|
|
2664
2750
|
*/
|
|
@@ -2666,10 +2752,10 @@ export declare const _run: (...args: unknown[]) => ValueOrPromise<unknown>;
|
|
|
2666
2752
|
|
|
2667
2753
|
declare type Scheduler = ReturnType<typeof createScheduler>;
|
|
2668
2754
|
|
|
2755
|
+
/** Stores the location of an object. If no parent, it's a root. */
|
|
2669
2756
|
declare type SeenRef = {
|
|
2670
|
-
$parent$: unknown | null;
|
|
2671
2757
|
$index$: number;
|
|
2672
|
-
$
|
|
2758
|
+
$parent$?: SeenRef | null;
|
|
2673
2759
|
};
|
|
2674
2760
|
|
|
2675
2761
|
/** @public */
|
|
@@ -2691,28 +2777,21 @@ declare interface SerializationContext {
|
|
|
2691
2777
|
* - `{ parent, index }` - The parent object and the index within that parent.
|
|
2692
2778
|
* - `undefined` - Object has not been seen yet.
|
|
2693
2779
|
*/
|
|
2694
|
-
|
|
2780
|
+
getSeenRef: (obj: unknown) => SeenRef | undefined;
|
|
2781
|
+
/** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
|
|
2695
2782
|
$hasRootId$: (obj: unknown) => number | undefined;
|
|
2696
2783
|
/**
|
|
2697
2784
|
* Root objects which need to be serialized.
|
|
2698
2785
|
*
|
|
2699
2786
|
* Roots are entry points into the object graph. Typically the roots are held by the listeners.
|
|
2700
2787
|
*
|
|
2701
|
-
* Returns
|
|
2702
|
-
* Format: "3 2 0" where each number is the index within its parent, from root to leaf.
|
|
2788
|
+
* Returns the index of the root object.
|
|
2703
2789
|
*/
|
|
2704
|
-
$addRoot$:
|
|
2705
|
-
/**
|
|
2706
|
-
|
|
2707
|
-
*
|
|
2708
|
-
* This is used during serialization, as new roots can't be created during serialization.
|
|
2709
|
-
*
|
|
2710
|
-
* The function throws if the root was not found.
|
|
2711
|
-
*/
|
|
2712
|
-
$addRootPath$: (obj: any) => string | number;
|
|
2713
|
-
$seen$: (obj: unknown, parent: unknown | null, index: number) => void;
|
|
2790
|
+
$addRoot$: AddRootFn;
|
|
2791
|
+
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
2792
|
+
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
2714
2793
|
$roots$: unknown[];
|
|
2715
|
-
$
|
|
2794
|
+
$promoteToRoot$: (ref: SeenRef, index?: number) => void;
|
|
2716
2795
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
2717
2796
|
$isSsrNode$: (obj: unknown) => obj is SsrNode;
|
|
2718
2797
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
@@ -2905,6 +2984,7 @@ declare class SignalImpl<T = any> implements Signal<T> {
|
|
|
2905
2984
|
/** Store a list of effects which are dependent on this signal. */
|
|
2906
2985
|
$effects$: null | Set<EffectSubscription>;
|
|
2907
2986
|
$container$: Container | null;
|
|
2987
|
+
$wrappedSignal$: WrappedSignalImpl<T> | null;
|
|
2908
2988
|
constructor(container: Container | null, value: T);
|
|
2909
2989
|
/**
|
|
2910
2990
|
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
@@ -3201,7 +3281,7 @@ declare type SsrAttrKey = string;
|
|
|
3201
3281
|
|
|
3202
3282
|
declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
|
|
3203
3283
|
|
|
3204
|
-
declare type SsrAttrValue = string | Signal<any> | boolean | object | null;
|
|
3284
|
+
declare type SsrAttrValue = string | Signal<any> | Promise<any> | boolean | object | null;
|
|
3205
3285
|
|
|
3206
3286
|
/** @public */
|
|
3207
3287
|
export declare const SSRComment: FunctionComponent<{
|
|
@@ -3211,6 +3291,7 @@ export declare const SSRComment: FunctionComponent<{
|
|
|
3211
3291
|
declare interface SSRContainer extends Container {
|
|
3212
3292
|
readonly tag: string;
|
|
3213
3293
|
readonly isHtml: boolean;
|
|
3294
|
+
readonly size: number;
|
|
3214
3295
|
readonly writer: StreamWriter;
|
|
3215
3296
|
readonly serializationCtx: SerializationContext;
|
|
3216
3297
|
readonly symbolToChunkResolver: SymbolToChunkResolver;
|
|
@@ -3218,6 +3299,7 @@ declare interface SSRContainer extends Container {
|
|
|
3218
3299
|
additionalHeadNodes: Array<JSXNodeInternal>;
|
|
3219
3300
|
additionalBodyNodes: Array<JSXNodeInternal>;
|
|
3220
3301
|
unclaimedProjectionComponentFrameQueue: ISsrComponentFrame[];
|
|
3302
|
+
write(text: string): void;
|
|
3221
3303
|
openContainer(): void;
|
|
3222
3304
|
closeContainer(): ValueOrPromise<void>;
|
|
3223
3305
|
openElement(elementName: string, varAttrs: SsrAttrs | null, constAttrs?: SsrAttrs | null, currentFile?: string | null): string | undefined;
|
|
@@ -3597,18 +3679,11 @@ declare type SymbolToChunkResolver = (symbol: string) => string;
|
|
|
3597
3679
|
export declare const sync$: <T extends Function>(fn: T) => SyncQRL<T>;
|
|
3598
3680
|
|
|
3599
3681
|
/** @public */
|
|
3600
|
-
export declare
|
|
3682
|
+
export declare type SyncQRL<TYPE extends Function> = QRL<TYPE> & {
|
|
3601
3683
|
__brand__SyncQRL__: TYPE;
|
|
3602
|
-
/**
|
|
3603
|
-
* Resolve the QRL of closure and invoke it.
|
|
3604
|
-
*
|
|
3605
|
-
* @param args - Closure arguments.
|
|
3606
|
-
* @returns A return value of the closure.
|
|
3607
|
-
*/
|
|
3608
|
-
(...args: TYPE extends (...args: infer ARGS) => any ? ARGS : never): TYPE extends (...args: any[]) => infer RETURN ? RETURN : never;
|
|
3609
3684
|
resolved: TYPE;
|
|
3610
|
-
dev
|
|
3611
|
-
}
|
|
3685
|
+
dev?: QRLDev | null;
|
|
3686
|
+
} & BivariantQrlFn<QrlArgs<TYPE>, QrlReturn<TYPE>>;
|
|
3612
3687
|
|
|
3613
3688
|
declare type TableCellSpecialAttrs = {
|
|
3614
3689
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined;
|
|
@@ -3645,6 +3720,12 @@ declare const TaskEvent = "qTask";
|
|
|
3645
3720
|
/** @public */
|
|
3646
3721
|
export declare type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => void)>;
|
|
3647
3722
|
|
|
3723
|
+
/** @public */
|
|
3724
|
+
export declare interface TaskOptions {
|
|
3725
|
+
/** Block the rendering of the component until the task completes. Default is `true` */
|
|
3726
|
+
deferUpdates?: boolean;
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3648
3729
|
/** @internal */
|
|
3649
3730
|
export declare class _TextVNode extends _VNode {
|
|
3650
3731
|
textNode: Text | null;
|
|
@@ -3928,6 +4009,8 @@ export declare const useLexicalScope: <VARS extends any[]>() => VARS;
|
|
|
3928
4009
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3929
4010
|
* have access to the JSX. Otherwise, it's adding a JSX listener in the `<div>` is a better idea.
|
|
3930
4011
|
*
|
|
4012
|
+
* Events are case sensitive.
|
|
4013
|
+
*
|
|
3931
4014
|
* @public
|
|
3932
4015
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3933
4016
|
*/
|
|
@@ -3939,6 +4022,8 @@ export declare const useOn: <T extends KnownEventNames>(event: T | T[], eventQrl
|
|
|
3939
4022
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3940
4023
|
* have access to the JSX.
|
|
3941
4024
|
*
|
|
4025
|
+
* Events are case sensitive.
|
|
4026
|
+
*
|
|
3942
4027
|
* @public
|
|
3943
4028
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3944
4029
|
*
|
|
@@ -3966,6 +4051,8 @@ export declare const useOnDocument: <T extends KnownEventNames>(event: T | T[],
|
|
|
3966
4051
|
* Used to programmatically add event listeners. Useful from custom `use*` methods, which do not
|
|
3967
4052
|
* have access to the JSX.
|
|
3968
4053
|
*
|
|
4054
|
+
* Events are case sensitive.
|
|
4055
|
+
*
|
|
3969
4056
|
* @public
|
|
3970
4057
|
* @see `useOn`, `useOnWindow`, `useOnDocument`.
|
|
3971
4058
|
*
|
|
@@ -4312,10 +4399,10 @@ export declare const useStylesScopedQrl: (styles: QRL<string>) => UseStylesScope
|
|
|
4312
4399
|
* @public
|
|
4313
4400
|
* @see `Tracker`
|
|
4314
4401
|
*/
|
|
4315
|
-
export declare const useTask$: (fn: TaskFn) => void;
|
|
4402
|
+
export declare const useTask$: (fn: TaskFn, opts?: TaskOptions) => void;
|
|
4316
4403
|
|
|
4317
4404
|
/** @internal */
|
|
4318
|
-
export declare const useTaskQrl: (qrl: QRL<TaskFn
|
|
4405
|
+
export declare const useTaskQrl: (qrl: QRL<TaskFn>, opts?: TaskOptions) => void;
|
|
4319
4406
|
|
|
4320
4407
|
/**
|
|
4321
4408
|
* ```tsx
|
|
@@ -4345,6 +4432,13 @@ export declare const useVisibleTask$: (fn: TaskFn, opts?: OnVisibleTaskOptions)
|
|
|
4345
4432
|
/** @internal */
|
|
4346
4433
|
export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskOptions) => void;
|
|
4347
4434
|
|
|
4435
|
+
/**
|
|
4436
|
+
* Handles events for bind:value
|
|
4437
|
+
*
|
|
4438
|
+
* @internal
|
|
4439
|
+
*/
|
|
4440
|
+
export declare const _val: (_: any, element: HTMLInputElement) => void;
|
|
4441
|
+
|
|
4348
4442
|
/**
|
|
4349
4443
|
* Type representing a value which is either resolve or a promise.
|
|
4350
4444
|
*
|
|
@@ -4359,7 +4453,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
4359
4453
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
4360
4454
|
|
|
4361
4455
|
/**
|
|
4362
|
-
* 2.0.0-beta.
|
|
4456
|
+
* 2.0.0-beta.14-dev+1e7496d
|
|
4363
4457
|
*
|
|
4364
4458
|
* @public
|
|
4365
4459
|
*/
|
|
@@ -4511,8 +4605,9 @@ declare const enum VNodeJournalOpCode {
|
|
|
4511
4605
|
SetText = 1,// ------ [SetAttribute, target, text]
|
|
4512
4606
|
SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
|
|
4513
4607
|
HoistStyles = 3,// -- [HoistStyles, document]
|
|
4514
|
-
Remove = 4,// ------- [
|
|
4515
|
-
|
|
4608
|
+
Remove = 4,// ------- [Remove, target(parent), ...nodes]
|
|
4609
|
+
RemoveAll = 5,// ------- [RemoveAll, target(parent)]
|
|
4610
|
+
Insert = 6
|
|
4516
4611
|
}
|
|
4517
4612
|
|
|
4518
4613
|
/** @internal */
|
|
@@ -4553,6 +4648,7 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
|
4553
4648
|
force(): void;
|
|
4554
4649
|
get untrackedValue(): T;
|
|
4555
4650
|
$computeIfNeeded$(): void;
|
|
4651
|
+
$unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
|
|
4556
4652
|
set value(_: any);
|
|
4557
4653
|
get value(): any;
|
|
4558
4654
|
}
|