@qwik.dev/core 2.0.0-beta.10 → 2.0.0-beta.13
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.cjs +2 -2
- 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 +6484 -1341
- package/dist/core-internal.d.ts +199 -175
- package/dist/core.cjs +9262 -8793
- package/dist/core.cjs.map +1 -1
- package/dist/core.min.mjs +1 -1
- package/dist/core.mjs +9259 -8788
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.cjs +4825 -4514
- package/dist/core.prod.mjs +5165 -4831
- package/dist/loader/index.cjs +2 -2
- package/dist/loader/index.mjs +2 -2
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.cjs +41 -29
- package/dist/optimizer.d.ts +4 -1
- package/dist/optimizer.mjs +1001 -938
- package/dist/qwikloader.debug.js +9 -8
- package/dist/qwikloader.js +1 -1
- package/dist/server.cjs +487 -402
- package/dist/server.d.ts +21 -13
- package/dist/server.mjs +468 -387
- 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 +1 -1
- 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 +1 -1
- package/dist/starters/adapters/bun/adapters/bun/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/bun/package.json +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/starters/adapters/deno/adapters/deno/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/deno/package.json +1 -1
- package/dist/starters/adapters/express/adapters/express/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/express/package.json +1 -1
- package/dist/starters/adapters/fastify/adapters/fastify/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/fastify/package.json +1 -1
- package/dist/starters/adapters/firebase/adapters/firebase/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/firebase/package.json +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/starters/adapters/ssg/adapters/ssg/{vite.config.mts → vite.config.ts} +1 -1
- package/dist/starters/adapters/ssg/package.json +2 -2
- 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 +1 -1
- package/dist/starters/features/csr/package.json +1 -1
- package/dist/testing/index.cjs +4690 -4068
- package/dist/testing/index.d.ts +129 -103
- package/dist/testing/index.mjs +4509 -3898
- package/dist/testing/package.json +1 -1
- package/handlers.mjs +1 -1
- package/package.json +5 -5
- package/public.d.ts +1 -0
- package/server.d.ts +2 -0
- /package/dist/starters/features/csr/{vite.config.mts → vite.config.ts} +0 -0
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ClientContainer } from '
|
|
1
|
+
import { ClientContainer } from '..';
|
|
2
|
+
import type { ClientContainer as ClientContainer_2 } from '../internal';
|
|
2
3
|
import type { CorePlatform } from '..';
|
|
3
4
|
import type { _DomContainer } from '../internal';
|
|
4
5
|
import type { _ElementVNode } from '../internal';
|
|
@@ -6,11 +7,17 @@ import type { JSXNodeInternal } from '../internal';
|
|
|
6
7
|
import { JSXOutput } from '..';
|
|
7
8
|
import type { _QDocument } from '../internal';
|
|
8
9
|
import { RenderResult } from '..';
|
|
9
|
-
import type { StreamWriter as StreamWriter_2 } from '..';
|
|
10
10
|
import type { _Stringifiable } from '../internal';
|
|
11
11
|
import type { _VirtualVNode } from '../internal';
|
|
12
12
|
import type { _VNode } from '../internal';
|
|
13
13
|
|
|
14
|
+
declare interface AddRootFn {
|
|
15
|
+
(obj: unknown, returnRef?: never): number;
|
|
16
|
+
(obj: unknown, returnRef: true): SeenRef;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare type AllSignalFlags = SignalFlags | WrappedSignalFlags | SerializationSignalFlags;
|
|
20
|
+
|
|
14
21
|
declare type AsyncComputedCtx = {
|
|
15
22
|
track: Tracker;
|
|
16
23
|
cleanup: (callback: () => void) => void;
|
|
@@ -43,7 +50,7 @@ declare interface Chore<T extends ChoreType = ChoreType> {
|
|
|
43
50
|
$target$: ChoreTarget | null;
|
|
44
51
|
$payload$: unknown;
|
|
45
52
|
$state$: ChoreState;
|
|
46
|
-
$blockedChores$:
|
|
53
|
+
$blockedChores$: ChoreArray | null;
|
|
47
54
|
$startTime$: number | undefined;
|
|
48
55
|
$endTime$: number | undefined;
|
|
49
56
|
$resolve$: ((value: any) => void) | undefined;
|
|
@@ -51,6 +58,11 @@ declare interface Chore<T extends ChoreType = ChoreType> {
|
|
|
51
58
|
$returnValue$: ValueOrPromise<ChoreReturnValue<T>>;
|
|
52
59
|
}
|
|
53
60
|
|
|
61
|
+
declare class ChoreArray extends Array<Chore> {
|
|
62
|
+
add(value: Chore): number;
|
|
63
|
+
delete(value: Chore): number;
|
|
64
|
+
}
|
|
65
|
+
|
|
54
66
|
declare type ChoreReturnValue<T extends ChoreType = ChoreType> = T extends ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS | ChoreType.WAIT_FOR_QUEUE | ChoreType.NODE_PROP ? void : T extends ChoreType.NODE_DIFF | ChoreType.COMPONENT ? JSXOutput_2 : unknown;
|
|
55
67
|
|
|
56
68
|
declare enum ChoreState {
|
|
@@ -207,10 +219,10 @@ export declare const createDOM: ({ html }?: {
|
|
|
207
219
|
userEvent: (queryOrElement: string | Element | keyof HTMLElementTagNameMap | null, eventNameCamel: string | keyof WindowEventMap, eventPayload?: any) => Promise<void>;
|
|
208
220
|
}>;
|
|
209
221
|
|
|
210
|
-
declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue
|
|
222
|
+
declare const createScheduler: (container: Container, journalFlush: () => void, choreQueue: ChoreArray, blockedChores: Set<Chore>, runningChores: Set<Chore>) => {
|
|
211
223
|
(type: ChoreType.QRL_RESOLVE, ignore: null, target: ComputeQRL<any> | AsyncComputeQRL<any>): Chore<ChoreType.QRL_RESOLVE>;
|
|
212
224
|
(type: ChoreType.WAIT_FOR_QUEUE): Chore<ChoreType.WAIT_FOR_QUEUE>;
|
|
213
|
-
(type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal |
|
|
225
|
+
(type: ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS, host: HostElement | null, target: Signal<unknown> | StoreTarget, effects: Set<EffectSubscription> | null): Chore<ChoreType.RECOMPUTE_AND_SCHEDULE_EFFECTS>;
|
|
214
226
|
(type: ChoreType.TASK | ChoreType.VISIBLE, task: Task): Chore<ChoreType.TASK | ChoreType.VISIBLE>;
|
|
215
227
|
(type: ChoreType.RUN_QRL, host: HostElement, target: QRLInternal<(...args: unknown[]) => unknown>, args: unknown[]): Chore<ChoreType.RUN_QRL>;
|
|
216
228
|
(type: ChoreType.COMPONENT, host: HostElement, qrl: QRLInternal<OnRenderFn<unknown>>, props: Props | null): Chore<ChoreType.COMPONENT>;
|
|
@@ -335,25 +347,13 @@ declare interface ElementFixtureOptions {
|
|
|
335
347
|
}
|
|
336
348
|
|
|
337
349
|
/** @internal */
|
|
338
|
-
declare
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
VNode | null,
|
|
344
|
-
|
|
345
|
-
VNode | null,
|
|
346
|
-
/////////////// 3 - Next sibling
|
|
347
|
-
VNode | null | undefined,
|
|
348
|
-
/// 4 - First child - undefined if children need to be materialize
|
|
349
|
-
VNode | null | undefined,
|
|
350
|
-
Element,
|
|
351
|
-
//////////////////// 6 - Element
|
|
352
|
-
string | undefined,
|
|
353
|
-
(string | null)[]
|
|
354
|
-
] & {
|
|
355
|
-
__brand__: 'ElementVNode';
|
|
356
|
-
};
|
|
350
|
+
declare class ElementVNode extends VNode {
|
|
351
|
+
firstChild: VNode | null | undefined;
|
|
352
|
+
lastChild: VNode | null | undefined;
|
|
353
|
+
element: QElement;
|
|
354
|
+
elementName: string | undefined;
|
|
355
|
+
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);
|
|
356
|
+
}
|
|
357
357
|
|
|
358
358
|
/** @public */
|
|
359
359
|
export declare function emulateExecutionOfQwikFuncs(document: Document): void;
|
|
@@ -380,8 +380,6 @@ declare type HostElement = VNode | ISsrNode;
|
|
|
380
380
|
/** The shared state during an invoke() call */
|
|
381
381
|
declare interface InvokeContext {
|
|
382
382
|
$url$: URL | undefined;
|
|
383
|
-
/** The next available index for the sequentialScope array */
|
|
384
|
-
$i$: number;
|
|
385
383
|
/** The Virtual parent component for the current component code */
|
|
386
384
|
$hostElement$: HostElement | undefined;
|
|
387
385
|
/** The current DOM element */
|
|
@@ -476,6 +474,11 @@ declare type PossibleEvents = Event | SimplifiedServerRequestEvent | typeof Task
|
|
|
476
474
|
|
|
477
475
|
declare type Props = Record<string, unknown>;
|
|
478
476
|
|
|
477
|
+
declare interface QElement extends Element {
|
|
478
|
+
qDispatchEvent?: (event: Event, scope: QwikLoaderEventScope) => boolean;
|
|
479
|
+
vNode?: VNode;
|
|
480
|
+
}
|
|
481
|
+
|
|
479
482
|
/**
|
|
480
483
|
* The `QRL` type represents a lazy-loadable AND serializable resource.
|
|
481
484
|
*
|
|
@@ -640,6 +643,8 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
640
643
|
|
|
641
644
|
declare type QrlReturn<T> = T extends (...args: any) => infer R ? Awaited<R> : unknown;
|
|
642
645
|
|
|
646
|
+
declare type QwikLoaderEventScope = '-document' | '-window' | '';
|
|
647
|
+
|
|
643
648
|
/** @public */
|
|
644
649
|
declare interface ReadonlySignal<T = unknown> {
|
|
645
650
|
readonly value: T;
|
|
@@ -662,10 +667,10 @@ declare interface ResourceReturnInternal<T> {
|
|
|
662
667
|
|
|
663
668
|
declare type Scheduler = ReturnType<typeof createScheduler>;
|
|
664
669
|
|
|
670
|
+
/** Stores the location of an object. If no parent, it's a root. */
|
|
665
671
|
declare type SeenRef = {
|
|
666
|
-
$parent$: unknown | null;
|
|
667
672
|
$index$: number;
|
|
668
|
-
$
|
|
673
|
+
$parent$?: SeenRef | null;
|
|
669
674
|
};
|
|
670
675
|
|
|
671
676
|
declare interface SerializationContext {
|
|
@@ -681,32 +686,25 @@ declare interface SerializationContext {
|
|
|
681
686
|
* - `{ parent, index }` - The parent object and the index within that parent.
|
|
682
687
|
* - `undefined` - Object has not been seen yet.
|
|
683
688
|
*/
|
|
684
|
-
|
|
689
|
+
getSeenRef: (obj: unknown) => SeenRef | undefined;
|
|
690
|
+
/** Returns the root index of the object, if it is a root. Otherwise returns undefined. */
|
|
685
691
|
$hasRootId$: (obj: unknown) => number | undefined;
|
|
686
692
|
/**
|
|
687
693
|
* Root objects which need to be serialized.
|
|
688
694
|
*
|
|
689
695
|
* Roots are entry points into the object graph. Typically the roots are held by the listeners.
|
|
690
696
|
*
|
|
691
|
-
* Returns
|
|
692
|
-
* Format: "3 2 0" where each number is the index within its parent, from root to leaf.
|
|
697
|
+
* Returns the index of the root object.
|
|
693
698
|
*/
|
|
694
|
-
$addRoot$:
|
|
695
|
-
/**
|
|
696
|
-
|
|
697
|
-
*
|
|
698
|
-
* This is used during serialization, as new roots can't be created during serialization.
|
|
699
|
-
*
|
|
700
|
-
* The function throws if the root was not found.
|
|
701
|
-
*/
|
|
702
|
-
$addRootPath$: (obj: any) => string | number;
|
|
703
|
-
$seen$: (obj: unknown, parent: unknown | null, index: number) => void;
|
|
699
|
+
$addRoot$: AddRootFn;
|
|
700
|
+
/** Mark an object as seen during serialization. This is used to handle backreferences and cycles */
|
|
701
|
+
$markSeen$: (obj: unknown, parent: SeenRef | undefined, index: number) => SeenRef;
|
|
704
702
|
$roots$: unknown[];
|
|
705
|
-
$
|
|
703
|
+
$promoteToRoot$: (ref: SeenRef, index?: number) => void;
|
|
706
704
|
$addSyncFn$($funcStr$: string | null, argsCount: number, fn: Function): number;
|
|
707
705
|
$isSsrNode$: (obj: unknown) => obj is SsrNode;
|
|
708
706
|
$isDomRef$: (obj: unknown) => obj is DomRef;
|
|
709
|
-
$writer$:
|
|
707
|
+
$writer$: StreamWriter;
|
|
710
708
|
$syncFns$: string[];
|
|
711
709
|
$eventQrls$: Set<QRL>;
|
|
712
710
|
$eventNames$: Set<string>;
|
|
@@ -717,6 +715,11 @@ declare interface SerializationContext {
|
|
|
717
715
|
$setProp$: (obj: any, prop: string, value: any) => void;
|
|
718
716
|
}
|
|
719
717
|
|
|
718
|
+
declare const enum SerializationSignalFlags {
|
|
719
|
+
SERIALIZATION_STRATEGY_NEVER = 16,
|
|
720
|
+
SERIALIZATION_STRATEGY_ALWAYS = 32
|
|
721
|
+
}
|
|
722
|
+
|
|
720
723
|
/**
|
|
721
724
|
* A signal is a reactive value which can be read and written. When the signal is written, all tasks
|
|
722
725
|
* which are tracking the signal will be re-run and all components that read the signal will be
|
|
@@ -733,11 +736,17 @@ declare interface Signal<T = any> extends ReadonlySignal<T> {
|
|
|
733
736
|
value: T;
|
|
734
737
|
}
|
|
735
738
|
|
|
739
|
+
declare const enum SignalFlags {
|
|
740
|
+
INVALID = 1,
|
|
741
|
+
RUN_EFFECTS = 2
|
|
742
|
+
}
|
|
743
|
+
|
|
736
744
|
declare class SignalImpl<T = any> implements Signal<T> {
|
|
737
745
|
$untrackedValue$: T;
|
|
738
746
|
/** Store a list of effects which are dependent on this signal. */
|
|
739
747
|
$effects$: null | Set<EffectSubscription>;
|
|
740
748
|
$container$: Container | null;
|
|
749
|
+
$wrappedSignal$: WrappedSignalImpl<T> | null;
|
|
741
750
|
constructor(container: Container | null, value: T);
|
|
742
751
|
/**
|
|
743
752
|
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
@@ -765,7 +774,7 @@ declare type SsrAttrKey = string;
|
|
|
765
774
|
|
|
766
775
|
declare type SsrAttrs = Array<SsrAttrKey | SsrAttrValue>;
|
|
767
776
|
|
|
768
|
-
declare type SsrAttrValue = string | Signal<any> | boolean | object | null;
|
|
777
|
+
declare type SsrAttrValue = string | Signal<any> | Promise<any> | boolean | object | null;
|
|
769
778
|
|
|
770
779
|
/** A selection of attributes of the real thing */
|
|
771
780
|
declare type SsrNode = {
|
|
@@ -781,37 +790,21 @@ declare const enum SsrNodeFlags {
|
|
|
781
790
|
|
|
782
791
|
/** @public */
|
|
783
792
|
export declare function ssrRenderToDom(jsx: JSXOutput, opts?: {
|
|
793
|
+
/** Print debug information to console. */
|
|
784
794
|
debug?: boolean;
|
|
795
|
+
/** Treat JSX as raw, (don't wrap in in head/body) */
|
|
785
796
|
raw?: boolean;
|
|
797
|
+
/** Include QwikLoader */
|
|
798
|
+
qwikLoader?: boolean;
|
|
799
|
+
/** Inject nodes into the document before test runs (for testing purposes) */
|
|
800
|
+
onBeforeResume?: (document: Document) => void;
|
|
786
801
|
}): Promise<{
|
|
787
802
|
container: _DomContainer;
|
|
788
803
|
document: Document;
|
|
789
|
-
vNode:
|
|
804
|
+
vNode: _VNode | null;
|
|
790
805
|
getStyles: () => Record<string, string | string[]>;
|
|
791
806
|
}>;
|
|
792
807
|
|
|
793
|
-
declare const enum StoreFlags {
|
|
794
|
-
NONE = 0,
|
|
795
|
-
RECURSIVE = 1,
|
|
796
|
-
IMMUTABLE = 2
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
declare class StoreHandler implements ProxyHandler<StoreTarget> {
|
|
800
|
-
$flags$: StoreFlags;
|
|
801
|
-
$container$: Container | null;
|
|
802
|
-
$effects$: null | Map<string | symbol, Set<EffectSubscription>>;
|
|
803
|
-
constructor($flags$: StoreFlags, $container$: Container | null);
|
|
804
|
-
toString(): string;
|
|
805
|
-
force(prop: keyof StoreTarget): void;
|
|
806
|
-
get(target: StoreTarget, prop: string | symbol): any;
|
|
807
|
-
/** In the case of oldValue and value are the same, the effects are not triggered. */
|
|
808
|
-
set(target: StoreTarget, prop: string | symbol, value: any): boolean;
|
|
809
|
-
deleteProperty(target: StoreTarget, prop: string | symbol): boolean;
|
|
810
|
-
has(target: StoreTarget, prop: string | symbol): boolean;
|
|
811
|
-
ownKeys(target: StoreTarget): ArrayLike<string | symbol>;
|
|
812
|
-
getOwnPropertyDescriptor(target: StoreTarget, prop: string | symbol): PropertyDescriptor | undefined;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
808
|
declare type StoreTarget = Record<string | symbol, any>;
|
|
816
809
|
|
|
817
810
|
/** @internal */
|
|
@@ -864,22 +857,6 @@ declare interface TestPlatform extends CorePlatform {
|
|
|
864
857
|
flush: () => Promise<void>;
|
|
865
858
|
}
|
|
866
859
|
|
|
867
|
-
/** @internal */
|
|
868
|
-
declare type TextVNode = [
|
|
869
|
-
VNodeFlags.Text | VNodeFlags.Inflated,
|
|
870
|
-
// 0 - Flags
|
|
871
|
-
VNode | null,
|
|
872
|
-
///////////////// 1 - Parent
|
|
873
|
-
VNode | null,
|
|
874
|
-
///////////////// 2 - Previous sibling
|
|
875
|
-
VNode | null,
|
|
876
|
-
///////////////// 3 - Next sibling
|
|
877
|
-
Text | null | undefined,
|
|
878
|
-
string
|
|
879
|
-
] & {
|
|
880
|
-
__brand__: 'TextVNode';
|
|
881
|
-
};
|
|
882
|
-
|
|
883
860
|
/**
|
|
884
861
|
* Used to signal to Qwik which state should be watched for changes.
|
|
885
862
|
*
|
|
@@ -966,7 +943,8 @@ declare interface Tracker {
|
|
|
966
943
|
}
|
|
967
944
|
|
|
968
945
|
/**
|
|
969
|
-
* Trigger an event in unit tests on an element.
|
|
946
|
+
* Trigger an event in unit tests on an element. Needs to be kept in sync with the Qwik Loader event
|
|
947
|
+
* dispatching.
|
|
970
948
|
*
|
|
971
949
|
* Future deprecation candidate.
|
|
972
950
|
*
|
|
@@ -984,32 +962,36 @@ export declare function trigger(root: Element, queryOrElement: string | Element
|
|
|
984
962
|
declare type ValueOrPromise<T> = T | Promise<T>;
|
|
985
963
|
|
|
986
964
|
/** @internal */
|
|
987
|
-
declare
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
VNode | null,
|
|
991
|
-
|
|
992
|
-
VNode | null,
|
|
993
|
-
/////////////// 2 - Previous sibling
|
|
994
|
-
VNode | null,
|
|
995
|
-
/////////////// 3 - Next sibling
|
|
996
|
-
VNode | null,
|
|
997
|
-
/////////////// 4 - First child
|
|
998
|
-
VNode | null,
|
|
999
|
-
(string | null | boolean)[]
|
|
1000
|
-
] & {
|
|
1001
|
-
__brand__: 'FragmentNode' & 'HostElement';
|
|
1002
|
-
};
|
|
965
|
+
declare class VirtualVNode extends VNode {
|
|
966
|
+
firstChild: VNode | null | undefined;
|
|
967
|
+
lastChild: VNode | null | undefined;
|
|
968
|
+
constructor(flags: VNodeFlags, parent: ElementVNode | VirtualVNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined, firstChild: VNode | null | undefined, lastChild: VNode | null | undefined);
|
|
969
|
+
}
|
|
1003
970
|
|
|
1004
971
|
/** @internal */
|
|
1005
|
-
declare
|
|
972
|
+
declare abstract class VNode extends BackRef {
|
|
973
|
+
flags: VNodeFlags;
|
|
974
|
+
parent: ElementVNode | VirtualVNode | null;
|
|
975
|
+
previousSibling: VNode | null | undefined;
|
|
976
|
+
nextSibling: VNode | null | undefined;
|
|
977
|
+
props: unknown[] | null;
|
|
978
|
+
slotParent: VNode | null;
|
|
979
|
+
chores: ChoreArray | null;
|
|
980
|
+
blockedChores: ChoreArray | null;
|
|
981
|
+
constructor(flags: VNodeFlags, parent: ElementVNode | VirtualVNode | null, previousSibling: VNode | null | undefined, nextSibling: VNode | null | undefined);
|
|
982
|
+
getProp<T>(key: string, getObject: ((id: string) => any) | null): T | null;
|
|
983
|
+
setProp(key: string, value: any): void;
|
|
984
|
+
getAttr(key: string): string | null;
|
|
985
|
+
setAttr(key: string, value: string | null | boolean, journal: VNodeJournal | null): void;
|
|
986
|
+
toString(): string;
|
|
987
|
+
}
|
|
1006
988
|
|
|
1007
989
|
/** @public */
|
|
1008
990
|
export declare function vnode_fromJSX(jsx: JSXOutput): {
|
|
1009
|
-
vParent: _ElementVNode;
|
|
991
|
+
vParent: _ElementVNode | _VirtualVNode;
|
|
1010
992
|
vNode: _VNode | null;
|
|
1011
993
|
document: _QDocument;
|
|
1012
|
-
container:
|
|
994
|
+
container: ClientContainer_2;
|
|
1013
995
|
};
|
|
1014
996
|
|
|
1015
997
|
/**
|
|
@@ -1092,6 +1074,25 @@ declare const enum VNodeFlags {
|
|
|
1092
1074
|
NS_math = 128
|
|
1093
1075
|
}
|
|
1094
1076
|
|
|
1077
|
+
declare type VNodeJournal = Array<VNodeJournalOpCode | Document | Element | Text | string | boolean | null>;
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Fundamental DOM operations are:
|
|
1081
|
+
*
|
|
1082
|
+
* - Insert new DOM element/text
|
|
1083
|
+
* - Remove DOM element/text
|
|
1084
|
+
* - Set DOM element attributes
|
|
1085
|
+
* - Set text node value
|
|
1086
|
+
*/
|
|
1087
|
+
declare const enum VNodeJournalOpCode {
|
|
1088
|
+
SetText = 1,// ------ [SetAttribute, target, text]
|
|
1089
|
+
SetAttribute = 2,// - [SetAttribute, target, ...(key, values)]]
|
|
1090
|
+
HoistStyles = 3,// -- [HoistStyles, document]
|
|
1091
|
+
Remove = 4,// ------- [Remove, target(parent), ...nodes]
|
|
1092
|
+
RemoveAll = 5,// ------- [RemoveAll, target(parent)]
|
|
1093
|
+
Insert = 6
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1095
1096
|
/**
|
|
1096
1097
|
* Wait for the scheduler to drain.
|
|
1097
1098
|
*
|
|
@@ -1109,4 +1110,29 @@ export declare function walkJSX(jsx: JSXOutput, apply: {
|
|
|
1109
1110
|
text: (text: _Stringifiable) => void;
|
|
1110
1111
|
}): void;
|
|
1111
1112
|
|
|
1113
|
+
declare const enum WrappedSignalFlags {
|
|
1114
|
+
UNWRAP = 4
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
declare class WrappedSignalImpl<T> extends SignalImpl<T> implements BackRef {
|
|
1118
|
+
$args$: any[];
|
|
1119
|
+
$func$: (...args: any[]) => T;
|
|
1120
|
+
$funcStr$: string | null;
|
|
1121
|
+
$flags$: AllSignalFlags;
|
|
1122
|
+
$hostElement$: HostElement | null;
|
|
1123
|
+
[_EFFECT_BACK_REF]: Map<EffectProperty | string, EffectSubscription> | null;
|
|
1124
|
+
constructor(container: Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: SignalFlags);
|
|
1125
|
+
invalidate(): void;
|
|
1126
|
+
/**
|
|
1127
|
+
* Use this to force running subscribers, for example when the calculated value has mutated but
|
|
1128
|
+
* remained the same object.
|
|
1129
|
+
*/
|
|
1130
|
+
force(): void;
|
|
1131
|
+
get untrackedValue(): T;
|
|
1132
|
+
$computeIfNeeded$(): void;
|
|
1133
|
+
$unwrapIfSignal$(): SignalImpl<T> | WrappedSignalImpl<T>;
|
|
1134
|
+
set value(_: any);
|
|
1135
|
+
get value(): any;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1112
1138
|
export { }
|