@qwik.dev/core 2.0.0-beta.37 → 2.0.0-beta.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backpatch/package.json +1 -1
- package/dist/build/package.json +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/core-internal.d.ts +448 -317
- package/dist/core.min.mjs +9 -8
- package/dist/core.mjs +1767 -953
- package/dist/core.mjs.map +1 -1
- package/dist/core.prod.mjs +4280 -3613
- package/dist/loader/package.json +1 -1
- package/dist/optimizer.d.ts +5 -3
- package/dist/optimizer.mjs +1254 -1227
- package/dist/preloader.mjs +1 -1
- package/dist/server.d.ts +7 -0
- package/dist/server.mjs +49 -8
- package/dist/server.prod.mjs +360 -312
- package/dist/starters/adapters/bun/src/entry.bun.ts +35 -0
- package/dist/starters/adapters/cloud-run/src/entry.cloud-run.tsx +20 -0
- package/dist/starters/adapters/deno/src/entry.deno.ts +41 -0
- package/dist/starters/adapters/express/src/entry.express.tsx +20 -0
- package/dist/starters/adapters/fastify/src/entry.fastify.tsx +20 -0
- package/dist/starters/adapters/fastify/src/plugins/fastify-qwik.ts +10 -1
- package/dist/starters/adapters/node-server/src/entry.node-server.tsx +20 -0
- package/dist/testing/index.d.ts +37 -30
- package/dist/testing/index.mjs +1392 -697
- package/dist/testing/package.json +1 -1
- package/dist/worker/package.json +1 -1
- package/dist/worker/worker.shared.js +1 -1
- package/handlers.mjs +3 -0
- package/package.json +3 -3
- package/public.d.ts +3 -0
package/dist/core-internal.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ declare type AllEventsMap = Omit<AllEventMapRaw, keyof EventCorrectionMap> & Eve
|
|
|
108
108
|
|
|
109
109
|
declare type _AllowPlainQrl<Q> = QRLEventHandlerMulti<any, any> extends Q ? Q extends QRLEventHandlerMulti<infer EV, infer EL> ? Q | (EL extends Element ? EventHandler<EV, EL> : never) : Q : Q extends QRL<infer U> ? Q | U : NonNullable<Q> extends never ? Q : QRL<Q> | Q;
|
|
110
110
|
|
|
111
|
-
declare type AllSignalFlags =
|
|
111
|
+
declare type AllSignalFlags = ComputedSignalFlags | SerializationSignalFlags | AsyncSignalFlags;
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
114
|
* TS defines these with the React syntax which is not compatible with Qwik. E.g. `ariaAtomic`
|
|
@@ -366,56 +366,17 @@ declare interface AriaAttributes {
|
|
|
366
366
|
/** @public */
|
|
367
367
|
declare type AriaRole = 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'gridcell' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listbox' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'search' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'textbox' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' | (string & {});
|
|
368
368
|
|
|
369
|
-
declare type AsyncCtx<T = unknown> = {
|
|
370
|
-
track: Tracker;
|
|
371
|
-
/**
|
|
372
|
-
* Register a cleanup callback to be called when the async computation is aborted or completed.
|
|
373
|
-
* The next invocation will await the previous cleanup. If you do not want this, do not return a
|
|
374
|
-
* Promise.
|
|
375
|
-
*/
|
|
376
|
-
cleanup: (callback: () => void | Promise<void>) => void;
|
|
377
|
-
/**
|
|
378
|
-
* A lazily created AbortSignal, for interrupting the async computation when needed, e.g. when the
|
|
379
|
-
* component is unmounted or the computation is invalidated. Pass it to `fetch` or other APIs that
|
|
380
|
-
* support it to ensure that unnecessary work is not performed.
|
|
381
|
-
*/
|
|
382
|
-
readonly abortSignal: AbortSignal;
|
|
383
|
-
/** The result of the previous computation, if any */
|
|
384
|
-
readonly previous: T | undefined;
|
|
385
|
-
/** Extra info passed to `invalidate(info)` for this computation, if any. */
|
|
386
|
-
readonly info?: unknown;
|
|
387
|
-
};
|
|
388
|
-
|
|
389
369
|
/**
|
|
390
|
-
* Note, we don't pass the generic type to
|
|
370
|
+
* Note, we don't pass the generic type to ComputeCtx because it causes TypeScript to not infer the
|
|
391
371
|
* type of the resource correctly. The type is only used for the `previous` property, which is not
|
|
392
372
|
* commonly used, and can be easily cast if needed.
|
|
393
373
|
*
|
|
374
|
+
* @deprecated Use `useComputed$` with an async function instead.
|
|
394
375
|
* @public
|
|
395
376
|
*/
|
|
396
|
-
export declare type AsyncFn<T> = (ctx:
|
|
397
|
-
|
|
398
|
-
/** Retains job metadata and also serves as the argument for the compute function */
|
|
399
|
-
declare class AsyncJob<T> implements AsyncCtx<T> {
|
|
400
|
-
readonly $signal$: _AsyncSignalImpl<T>;
|
|
401
|
-
/** First holds the compute promise and then the cleanup promise */
|
|
402
|
-
$promise$: Promise<void> | null | void;
|
|
403
|
-
$cleanupRequested$: boolean;
|
|
404
|
-
$canWrite$: boolean;
|
|
405
|
-
$track$: AsyncCtx<T>['track'] | undefined;
|
|
406
|
-
$cleanups$: Parameters<AsyncCtx<T>['cleanup']>[0][] | undefined;
|
|
407
|
-
$abortController$: AbortController | undefined;
|
|
408
|
-
info: unknown;
|
|
409
|
-
$infoVersion$: number | undefined;
|
|
410
|
-
constructor($signal$: _AsyncSignalImpl<T>, info: unknown, $infoVersion$: number | undefined);
|
|
411
|
-
get track(): AsyncCtx<T>['track'];
|
|
412
|
-
get abortSignal(): AbortSignal;
|
|
413
|
-
/** Backward compatible cache method for resource */
|
|
414
|
-
cache(): void;
|
|
415
|
-
get previous(): T | undefined;
|
|
416
|
-
cleanup(callback: () => void): void;
|
|
417
|
-
}
|
|
377
|
+
export declare type AsyncFn<T> = (ctx: ComputeCtx) => ValueOrPromise<T>;
|
|
418
378
|
|
|
379
|
+
/** @deprecated Use `ComputeQRL` instead. */
|
|
419
380
|
declare type AsyncQRL<T> = _QRLInternal<AsyncFn<T>>;
|
|
420
381
|
|
|
421
382
|
/**
|
|
@@ -440,70 +401,20 @@ declare type AsyncQRL<T> = _QRLInternal<AsyncFn<T>>;
|
|
|
440
401
|
* If the async function threw an error, reading the `.value` will throw that same error. Read from
|
|
441
402
|
* `.error` to check if there was an error.
|
|
442
403
|
*
|
|
404
|
+
* @deprecated Use `ComputedSignal` instead, it has async support now.
|
|
443
405
|
* @public
|
|
444
406
|
*/
|
|
445
|
-
export declare
|
|
446
|
-
/**
|
|
447
|
-
* Whether the signal is currently loading. This will trigger lazy loading of the signal, so you
|
|
448
|
-
* can use it like this:
|
|
449
|
-
*
|
|
450
|
-
* ```tsx
|
|
451
|
-
* signal.loading ? <Loading /> : signal.error ? <Error /> : <Component
|
|
452
|
-
* value={signal.value} />
|
|
453
|
-
* ```
|
|
454
|
-
*/
|
|
455
|
-
loading: boolean;
|
|
456
|
-
/**
|
|
457
|
-
* Lets you read the loading state without subscribing to `.loading` updates. It also triggers
|
|
458
|
-
* lazy loading of the signal.
|
|
459
|
-
*
|
|
460
|
-
* Setting it will trigger listeners for `.loading`.
|
|
461
|
-
*/
|
|
462
|
-
untrackedLoading: boolean;
|
|
463
|
-
/**
|
|
464
|
-
* The error that occurred while computing the signal, if any. This will be cleared when the
|
|
465
|
-
* signal is successfully computed. It does not trigger lazy loading of the signal.
|
|
466
|
-
*/
|
|
467
|
-
error: Error | undefined;
|
|
468
|
-
/**
|
|
469
|
-
* Lets you read the error state without subscribing to `.error` updates. It does not trigger lazy
|
|
470
|
-
* loading of the signal.
|
|
471
|
-
*
|
|
472
|
-
* Setting it will trigger listeners for `.error`.
|
|
473
|
-
*/
|
|
474
|
-
untrackedError: Error | undefined;
|
|
475
|
-
/**
|
|
476
|
-
* Expiration time in ms. Writable and immediately effective.
|
|
477
|
-
*
|
|
478
|
-
* When set, the signal is invalidated after this many ms. Whether it auto-recomputes depends on
|
|
479
|
-
* the `poll` property. `0` means no expiration.
|
|
480
|
-
*/
|
|
481
|
-
expires: number;
|
|
482
|
-
/**
|
|
483
|
-
* Whether to automatically re-run the function when the value expires. Writable and immediately
|
|
484
|
-
* effective. Only relevant when `expires` is set.
|
|
485
|
-
*
|
|
486
|
-
* Defaults to `true`.
|
|
487
|
-
*/
|
|
488
|
-
poll: boolean;
|
|
489
|
-
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
490
|
-
interval: number;
|
|
491
|
-
/** A promise that resolves when the value is computed or rejected. */
|
|
492
|
-
promise(): Promise<void>;
|
|
493
|
-
/** Abort the current computation and run cleanups if needed. */
|
|
494
|
-
abort(reason?: any): void;
|
|
495
|
-
/**
|
|
496
|
-
* Use this to force recalculation. If you pass `info`, it will be provided to the calculation
|
|
497
|
-
* function.
|
|
498
|
-
*/
|
|
499
|
-
invalidate(info?: unknown): void;
|
|
500
|
-
}
|
|
407
|
+
export declare type AsyncSignal<T = unknown> = ComputedSignal<T>;
|
|
501
408
|
|
|
502
409
|
declare const enum AsyncSignalFlags {
|
|
503
410
|
EAGER_CLEANUP = 32,
|
|
504
411
|
CLIENT_ONLY = 64,
|
|
505
412
|
CLEAR_ON_INVALIDATE = 128,
|
|
506
|
-
NO_POLL = 256
|
|
413
|
+
NO_POLL = 256,
|
|
414
|
+
/** The compute fn is async: the async engine (jobs, loading, error) is active */
|
|
415
|
+
ASYNC_MODE = 512,
|
|
416
|
+
/** Invoke the compute fn AsyncSignal-style: pass the ComputeCtx argument, no auto-tracking */
|
|
417
|
+
CTX_ARG = 1024
|
|
507
418
|
}
|
|
508
419
|
|
|
509
420
|
/**
|
|
@@ -513,157 +424,21 @@ declare const enum AsyncSignalFlags {
|
|
|
513
424
|
*
|
|
514
425
|
* # ================================
|
|
515
426
|
*
|
|
427
|
+
* The async engine (jobs, loading, error, polling) lives in ComputedSignalImpl; this subclass
|
|
428
|
+
* configures it from options and switches the compute invocation to CTX_ARG mode: the compute fn
|
|
429
|
+
* receives the ComputeCtx argument and tracks only via its explicit `track()` (no auto-tracking).
|
|
430
|
+
*
|
|
516
431
|
* @internal
|
|
517
432
|
*/
|
|
518
|
-
export declare class _AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements
|
|
519
|
-
|
|
520
|
-
$untrackedError$: Error | undefined;
|
|
521
|
-
$current$: AsyncJob<T> | null;
|
|
522
|
-
$jobs$: AsyncJob<T>[] | undefined;
|
|
523
|
-
$concurrency$: number | undefined;
|
|
524
|
-
$expires$: number | undefined;
|
|
525
|
-
$timeoutMs$: number | undefined;
|
|
526
|
-
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
527
|
-
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
528
|
-
$pollTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
529
|
-
$computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
530
|
-
$info$: unknown | undefined;
|
|
531
|
-
$infoVersion$: number | undefined;
|
|
532
|
-
[_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
|
|
533
|
-
constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: SignalFlags | SerializationSignalFlags, options?: AsyncSignalOptions<T>);
|
|
534
|
-
get untrackedValue(): T;
|
|
535
|
-
set untrackedValue(value: T);
|
|
536
|
-
/**
|
|
537
|
-
* Read the value, subscribing if in a tracking context. Triggers computation if needed.
|
|
538
|
-
*
|
|
539
|
-
* Setting the value will mark the signal as not loading and clear any error, and prevent any
|
|
540
|
-
* pending computations from writing their results.
|
|
541
|
-
*
|
|
542
|
-
* If you want to set the value without affecting loading or error state, set `untrackedValue`
|
|
543
|
-
* instead and make sure to trigger effects manually if needed.
|
|
544
|
-
*
|
|
545
|
-
* If you want to abort pending computations when setting, you have to call `abort()` manually.
|
|
546
|
-
*/
|
|
547
|
-
get value(): T;
|
|
548
|
-
set value(value: T);
|
|
549
|
-
/**
|
|
550
|
-
* Loading is true if the signal is still waiting for the promise to resolve, false if the promise
|
|
551
|
-
* has resolved or rejected.
|
|
552
|
-
*
|
|
553
|
-
* Accessing .loading will trigger computation if needed, since it's often used like
|
|
554
|
-
* `signal.loading ? <Loading /> : signal.value`.
|
|
555
|
-
*/
|
|
556
|
-
get loading(): boolean;
|
|
557
|
-
set untrackedLoading(value: boolean);
|
|
558
|
-
get untrackedLoading(): boolean;
|
|
559
|
-
/** The error that occurred when the signal was resolved. */
|
|
560
|
-
get error(): Error | undefined;
|
|
561
|
-
set untrackedError(value: Error | undefined);
|
|
562
|
-
get untrackedError(): Error | undefined;
|
|
563
|
-
get expires(): number;
|
|
564
|
-
set expires(value: number);
|
|
565
|
-
get poll(): boolean;
|
|
566
|
-
set poll(value: boolean);
|
|
567
|
-
/** @deprecated Use `expires` and `poll` instead. */
|
|
568
|
-
get interval(): number;
|
|
569
|
-
set interval(value: number);
|
|
570
|
-
/** Invalidates the signal, causing it to re-compute its value. */
|
|
571
|
-
invalidate(info?: unknown): Promise<void>;
|
|
572
|
-
$setInvalid$(allowRecalc: boolean, mustClear: boolean | number): void;
|
|
573
|
-
/** Abort the current computation and run cleanups if needed. */
|
|
574
|
-
abort(reason?: any): void;
|
|
575
|
-
/** Schedule eager cleanup on next macro task if no subscribers remain. */
|
|
576
|
-
$scheduleEagerCleanup$(): void;
|
|
577
|
-
/** Returns a promise resolves when the signal finished computing. */
|
|
578
|
-
promise(): Promise<void>;
|
|
579
|
-
/** Run the computation if needed */
|
|
580
|
-
$computeIfNeeded$(): void;
|
|
581
|
-
$runComputation$(running: AsyncJob<T>): Promise<void>;
|
|
582
|
-
/**
|
|
583
|
-
* Sets the error from the given job. We only accept errors from the current job and we ignore
|
|
584
|
-
* AbortErrors.
|
|
585
|
-
*/
|
|
586
|
-
$setError$(job: AsyncJob<T>, error: Error): void;
|
|
587
|
-
/** Called after SSR/unmount */
|
|
588
|
-
$destroy$(): Promise<void>;
|
|
589
|
-
private $clearNextPoll$;
|
|
590
|
-
private $scheduleNextPoll$;
|
|
591
|
-
private $hasSubscribers$;
|
|
592
|
-
$requestCleanups$(job: AsyncJob<T>, reason?: any): void;
|
|
593
|
-
/** Clean up and trigger signal compute once complete */
|
|
594
|
-
$runCleanups$(job: AsyncJob<T>): Promise<void> | undefined;
|
|
433
|
+
export declare class _AsyncSignalImpl<T> extends ComputedSignalImpl<T, AsyncQRL<T>> implements AsyncSignal<T> {
|
|
434
|
+
constructor(container: _Container | null, fn: AsyncQRL<T>, flags?: number, options?: AsyncSignalOptions<T>);
|
|
595
435
|
}
|
|
596
436
|
|
|
597
|
-
/**
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
* Maximum number of concurrent computations. Use `0` for unlimited.
|
|
603
|
-
*
|
|
604
|
-
* Defaults to `1`.
|
|
605
|
-
*/
|
|
606
|
-
concurrency?: number;
|
|
607
|
-
/**
|
|
608
|
-
* When subscribers drop to 0, run cleanup in the next tick, instead of waiting for the function
|
|
609
|
-
* inputs to change.
|
|
610
|
-
*
|
|
611
|
-
* Defaults to `false`, meaning cleanup happens only when inputs change.
|
|
612
|
-
*/
|
|
613
|
-
eagerCleanup?: boolean;
|
|
614
|
-
/**
|
|
615
|
-
* Time in milliseconds after which the value expires.
|
|
616
|
-
*
|
|
617
|
-
* When the value expires and subscribers exist, the signal is invalidated. If `poll` is `true`
|
|
618
|
-
* (default), the function is re-run automatically. If `poll` is `false`, the value is marked
|
|
619
|
-
* stale and recomputation happens when reading `.value` or `.loading`.
|
|
620
|
-
*
|
|
621
|
-
* `0` (default) means no expiration.
|
|
622
|
-
*/
|
|
623
|
-
expires?: number;
|
|
624
|
-
/**
|
|
625
|
-
* Whether to automatically re-run the function when the value expires. Only relevant when
|
|
626
|
-
* `expires` is set.
|
|
627
|
-
*
|
|
628
|
-
* Defaults to `true`.
|
|
629
|
-
*/
|
|
630
|
-
poll?: boolean;
|
|
631
|
-
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
632
|
-
interval?: number;
|
|
633
|
-
/**
|
|
634
|
-
* When true, the async computation is postponed to the browser. On SSR, the signal remains
|
|
635
|
-
* INVALID and does not execute the function. On the client, it will compute on first read.
|
|
636
|
-
*
|
|
637
|
-
* Defaults to `false`.
|
|
638
|
-
*/
|
|
639
|
-
clientOnly?: boolean;
|
|
640
|
-
/**
|
|
641
|
-
* When true (default), the previous value is kept while the signal re-computes after
|
|
642
|
-
* invalidation, so reads return stale data instead of throwing a promise. Reactivity will then
|
|
643
|
-
* update the readers when the new value is ready.
|
|
644
|
-
*
|
|
645
|
-
* When false, invalidation clears the value so reads throw the computation promise (like the
|
|
646
|
-
* initial load), which is useful for navigations where showing old data would be confusing.
|
|
647
|
-
*
|
|
648
|
-
* Note that polling invalidations (`expires` with `poll: true`) are not affected by this option
|
|
649
|
-
* and will keep the old value while the new value is loading, to avoid flashing loaders.
|
|
650
|
-
*
|
|
651
|
-
* This option only affects manual invalidations via `invalidate()`, and non-polling expirations
|
|
652
|
-
* (`poll: false`, or there are no subscribers).
|
|
653
|
-
*
|
|
654
|
-
* Defaults to `true`.
|
|
655
|
-
*/
|
|
656
|
-
allowStale?: boolean;
|
|
657
|
-
/**
|
|
658
|
-
* Maximum time in milliseconds to wait for the async computation to complete. If exceeded, the
|
|
659
|
-
* computation is aborted and an error is thrown.
|
|
660
|
-
*
|
|
661
|
-
* If `0`, no timeout is applied.
|
|
662
|
-
*
|
|
663
|
-
* Defaults to `0`.
|
|
664
|
-
*/
|
|
665
|
-
timeout?: number;
|
|
666
|
-
}
|
|
437
|
+
/**
|
|
438
|
+
* @deprecated Use `ComputedOptions` instead.
|
|
439
|
+
* @public
|
|
440
|
+
*/
|
|
441
|
+
export declare type AsyncSignalOptions<T> = ComputedOptions<T>;
|
|
667
442
|
|
|
668
443
|
/**
|
|
669
444
|
* Replace given element's props with custom types and return all props specific to the element. Use
|
|
@@ -709,7 +484,7 @@ export declare let _captures: Readonly<unknown[]> | null;
|
|
|
709
484
|
*
|
|
710
485
|
* @internal
|
|
711
486
|
*/
|
|
712
|
-
export declare function _chk(this: string | undefined, _: any, element: HTMLInputElement): void
|
|
487
|
+
export declare function _chk(this: string | undefined, _: any, element: HTMLInputElement): void | Promise<void>;
|
|
713
488
|
|
|
714
489
|
declare const enum ChoreBits {
|
|
715
490
|
NONE = 0,
|
|
@@ -838,17 +613,117 @@ declare type ComponentChildren<PROPS> = PROPS extends {
|
|
|
838
613
|
/** @internal */
|
|
839
614
|
export declare const componentQrl: <PROPS extends Record<any, any>>(componentQrl: QRL<OnRenderFn<PROPS>>) => Component<PROPS>;
|
|
840
615
|
|
|
841
|
-
|
|
842
|
-
|
|
616
|
+
declare type ComputeCtx<T = unknown> = {
|
|
617
|
+
/**
|
|
618
|
+
* Track reactive reads so the computation re-runs when they change. Computed functions track
|
|
619
|
+
* synchronous reads automatically, but after the first `await` the tracking context is lost, so
|
|
620
|
+
* later reads must go through `track()`.
|
|
621
|
+
*/
|
|
622
|
+
readonly track: Tracker;
|
|
623
|
+
/**
|
|
624
|
+
* Register a cleanup callback to be called when the async computation is aborted or completed.
|
|
625
|
+
* The next invocation will await the previous cleanup. If you do not want this, do not return a
|
|
626
|
+
* Promise.
|
|
627
|
+
*/
|
|
628
|
+
cleanup: (callback: () => void | Promise<void>) => void;
|
|
629
|
+
/**
|
|
630
|
+
* A lazily created AbortSignal, for interrupting the async computation when needed, e.g. when the
|
|
631
|
+
* component is unmounted or the computation is invalidated. Pass it to `fetch` or other APIs that
|
|
632
|
+
* support it to ensure that unnecessary work is not performed.
|
|
633
|
+
*/
|
|
634
|
+
readonly abortSignal: AbortSignal;
|
|
635
|
+
/** The result of the previous computation, if any */
|
|
636
|
+
readonly previous: T | undefined;
|
|
637
|
+
/** Extra info passed to `invalidate(info)` for this computation, if any. */
|
|
638
|
+
readonly info?: unknown;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* The compute function. The context provides `track()`, `previous` (the last computed value),
|
|
643
|
+
* `info` (the argument of the `invalidate(info)` call that triggered this computation), `cleanup()`
|
|
644
|
+
* and `abortSignal`. Synchronous reactive state reads are tracked automatically, use `untrack()` to
|
|
645
|
+
* read signals without tracking. Return a `Promise` (or use an `async` function) for async values.
|
|
646
|
+
* After the first `await`, reads are no longer tracked automatically and must use `track()`.
|
|
647
|
+
*
|
|
648
|
+
* @public
|
|
649
|
+
*/
|
|
650
|
+
export declare type ComputedFn<T> = (ctx: ComputeCtx) => ValueOrPromise<T>;
|
|
843
651
|
|
|
844
652
|
/** @public */
|
|
845
|
-
export declare interface ComputedOptions {
|
|
653
|
+
export declare interface ComputedOptions<T = unknown> {
|
|
846
654
|
serializationStrategy?: SerializationStrategy;
|
|
847
655
|
container?: _Container;
|
|
656
|
+
/** Like useSignal's `initial`; prevents the throw on first read when uninitialized */
|
|
657
|
+
initial?: Awaited<T> | (() => Awaited<T>);
|
|
658
|
+
/**
|
|
659
|
+
* Maximum number of concurrent computations. Use `0` for unlimited.
|
|
660
|
+
*
|
|
661
|
+
* Defaults to `1`.
|
|
662
|
+
*/
|
|
663
|
+
concurrency?: number;
|
|
664
|
+
/**
|
|
665
|
+
* When subscribers drop to 0, run cleanup in the next tick, instead of waiting for the function
|
|
666
|
+
* inputs to change.
|
|
667
|
+
*
|
|
668
|
+
* Defaults to `false`, meaning cleanup happens only when inputs change.
|
|
669
|
+
*/
|
|
670
|
+
eagerCleanup?: boolean;
|
|
671
|
+
/**
|
|
672
|
+
* Time in milliseconds after which the value expires.
|
|
673
|
+
*
|
|
674
|
+
* When the value expires and subscribers exist, the signal is invalidated. If `poll` is `true`
|
|
675
|
+
* (default), the function is re-run automatically. If `poll` is `false`, the value is marked
|
|
676
|
+
* stale and recomputation happens when reading `.value` or `.loading`.
|
|
677
|
+
*
|
|
678
|
+
* `0` (default) means no expiration.
|
|
679
|
+
*/
|
|
680
|
+
expires?: number;
|
|
681
|
+
/**
|
|
682
|
+
* Whether to automatically re-run the function when the value expires. Only relevant when
|
|
683
|
+
* `expires` is set.
|
|
684
|
+
*
|
|
685
|
+
* Defaults to `true`.
|
|
686
|
+
*/
|
|
687
|
+
poll?: boolean;
|
|
688
|
+
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
689
|
+
interval?: number;
|
|
690
|
+
/**
|
|
691
|
+
* When true, the async computation is postponed to the browser. On SSR, the signal remains
|
|
692
|
+
* INVALID and does not execute the function. On the client, it will compute on first read.
|
|
693
|
+
*
|
|
694
|
+
* Defaults to `false`.
|
|
695
|
+
*/
|
|
696
|
+
clientOnly?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* When true (default), the previous value is kept while the signal re-computes after
|
|
699
|
+
* invalidation, so reads return stale data instead of throwing a promise. Reactivity will then
|
|
700
|
+
* update the readers when the new value is ready.
|
|
701
|
+
*
|
|
702
|
+
* When false, invalidation clears the value so reads throw the computation promise (like the
|
|
703
|
+
* initial load), which is useful for navigations where showing old data would be confusing.
|
|
704
|
+
*
|
|
705
|
+
* Note that polling invalidations (`expires` with `poll: true`) are not affected by this option
|
|
706
|
+
* and will keep the old value while the new value is loading, to avoid flashing loaders.
|
|
707
|
+
*
|
|
708
|
+
* This option only affects manual invalidations via `invalidate()`, and non-polling expirations
|
|
709
|
+
* (`poll: false`, or there are no subscribers).
|
|
710
|
+
*
|
|
711
|
+
* Defaults to `true`.
|
|
712
|
+
*/
|
|
713
|
+
allowStale?: boolean;
|
|
714
|
+
/**
|
|
715
|
+
* Maximum time in milliseconds to wait for the async computation to complete. If exceeded, the
|
|
716
|
+
* computation is aborted and an error is thrown.
|
|
717
|
+
*
|
|
718
|
+
* If `0`, no timeout is applied.
|
|
719
|
+
*
|
|
720
|
+
* Defaults to `0`.
|
|
721
|
+
*/
|
|
722
|
+
timeout?: number;
|
|
848
723
|
}
|
|
849
724
|
|
|
850
725
|
/** @public */
|
|
851
|
-
export declare type ComputedReturnType<T> =
|
|
726
|
+
export declare type ComputedReturnType<T> = ComputedSignal<Awaited<T>>;
|
|
852
727
|
|
|
853
728
|
/**
|
|
854
729
|
* A computed signal is a signal which is calculated from other signals. When the signals change,
|
|
@@ -862,28 +737,194 @@ export declare interface ComputedSignal<T> extends Signal<T> {
|
|
|
862
737
|
force(): void;
|
|
863
738
|
/** Use this to force recalculation. */
|
|
864
739
|
invalidate(): void;
|
|
740
|
+
/**
|
|
741
|
+
* Whether the signal is currently loading. This will trigger lazy computation of the signal, so
|
|
742
|
+
* you can use it like this:
|
|
743
|
+
*
|
|
744
|
+
* ```tsx
|
|
745
|
+
* signal.pending ? <Loading /> : signal.error ? <Error /> : <Component
|
|
746
|
+
* value={signal.value} />
|
|
747
|
+
* ```
|
|
748
|
+
*/
|
|
749
|
+
pending: boolean;
|
|
750
|
+
/**
|
|
751
|
+
* Lets you read the pending state without subscribing to `.pending` updates. It also triggers
|
|
752
|
+
* lazy computation of the signal.
|
|
753
|
+
*
|
|
754
|
+
* Setting it will trigger listeners for `.pending`.
|
|
755
|
+
*/
|
|
756
|
+
untrackedPending: boolean;
|
|
757
|
+
/** @deprecated Use `pending` instead */
|
|
758
|
+
loading: boolean;
|
|
759
|
+
/** @deprecated Use `untrackedPending` instead */
|
|
760
|
+
untrackedLoading: boolean;
|
|
761
|
+
/**
|
|
762
|
+
* The error that occurred while computing the signal, if any, including synchronous throws. This
|
|
763
|
+
* will be cleared when the signal is successfully computed. It also triggers lazy computation of
|
|
764
|
+
* the signal. While the error is set, reading `.value` throws it.
|
|
765
|
+
*/
|
|
766
|
+
error: Error | undefined;
|
|
767
|
+
/**
|
|
768
|
+
* Lets you read the error state without subscribing to `.error` updates. It also triggers lazy
|
|
769
|
+
* computation of the signal.
|
|
770
|
+
*
|
|
771
|
+
* Setting it will trigger listeners for `.error`.
|
|
772
|
+
*/
|
|
773
|
+
untrackedError: Error | undefined;
|
|
774
|
+
/**
|
|
775
|
+
* Expiration time in ms. Writable and immediately effective.
|
|
776
|
+
*
|
|
777
|
+
* When set, the signal is invalidated after this many ms. Whether it auto-recomputes depends on
|
|
778
|
+
* the `poll` property. `0` means no expiration.
|
|
779
|
+
*/
|
|
780
|
+
expires: number;
|
|
781
|
+
/**
|
|
782
|
+
* Whether to automatically re-run the function when the value expires. Writable and immediately
|
|
783
|
+
* effective. Only relevant when `expires` is set.
|
|
784
|
+
*
|
|
785
|
+
* Defaults to `true`.
|
|
786
|
+
*/
|
|
787
|
+
poll: boolean;
|
|
788
|
+
/** @deprecated Use `expires` and `poll` instead. Will be removed before v2 */
|
|
789
|
+
interval: number;
|
|
790
|
+
/** A promise that resolves when the value is computed or rejected. */
|
|
791
|
+
promise(): Promise<void>;
|
|
792
|
+
/** Abort the current computation and run cleanups if needed. */
|
|
793
|
+
abort(reason?: any): void;
|
|
794
|
+
/**
|
|
795
|
+
* Use this to force recalculation. If you pass `info`, it will be provided to the calculation
|
|
796
|
+
* function.
|
|
797
|
+
*/
|
|
798
|
+
invalidate(info?: unknown): void;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
declare const enum ComputedSignalFlags {
|
|
802
|
+
INVALID = 1,
|
|
803
|
+
RUN_EFFECTS = 2,
|
|
804
|
+
PRESERVE_ON_SEQ_CLEANUP = 4
|
|
865
805
|
}
|
|
866
806
|
|
|
867
807
|
/**
|
|
868
808
|
* A signal which is computed from other signals.
|
|
869
809
|
*
|
|
870
|
-
*
|
|
810
|
+
* Sync compute functions resolve synchronously and every read they perform is auto-tracked. When
|
|
811
|
+
* the compute function turns out to be async (it returned a promise), the signal lazily switches on
|
|
812
|
+
* the async engine — jobs, `loading`, `error`, polling — giving it the same API as an AsyncSignal.
|
|
813
|
+
* Auto-tracking only covers reads before the first await point (the invoke context is lost after
|
|
814
|
+
* it); later reads must use the ComputeCtx `track()`.
|
|
871
815
|
*/
|
|
872
816
|
declare class ComputedSignalImpl<T, S extends _QRLInternal = ComputeQRL<T>> extends SignalImpl<T> implements BackRef {
|
|
873
817
|
/**
|
|
874
818
|
* The compute function is stored here.
|
|
875
819
|
*
|
|
876
|
-
*
|
|
877
|
-
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous).
|
|
820
|
+
* Sync computed functions must be executed synchronously (because of this we need to eagerly
|
|
821
|
+
* resolve the QRL during the mark dirty phase so that any call to it will be synchronous).
|
|
878
822
|
*/
|
|
879
823
|
$computeQrl$: S;
|
|
880
|
-
$flags$:
|
|
824
|
+
$flags$: number;
|
|
881
825
|
[_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
|
|
882
|
-
|
|
883
|
-
|
|
826
|
+
$untrackedPending$: boolean | undefined;
|
|
827
|
+
$untrackedError$: Error | undefined;
|
|
828
|
+
$current$: Job<T> | null | undefined;
|
|
829
|
+
$jobs$: Job<T>[] | undefined;
|
|
830
|
+
$concurrency$: number | undefined;
|
|
831
|
+
$expires$: number | undefined;
|
|
832
|
+
$timeoutMs$: number | undefined;
|
|
833
|
+
$loadingEffects$: undefined | Set<EffectSubscription>;
|
|
834
|
+
$errorEffects$: undefined | Set<EffectSubscription>;
|
|
835
|
+
$pollTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
836
|
+
$computationTimeoutId$: ReturnType<typeof setTimeout> | undefined;
|
|
837
|
+
$info$: unknown | undefined;
|
|
838
|
+
$infoVersion$: number | undefined;
|
|
839
|
+
constructor(container: _Container | null, fn: S, flags?: number, options?: ComputedOptions<T>);
|
|
840
|
+
invalidate(info?: unknown): void;
|
|
841
|
+
/**
|
|
842
|
+
* Read the value, subscribing if in a tracking context. Triggers computation if needed.
|
|
843
|
+
*
|
|
844
|
+
* Setting the value will mark the signal as not loading and clear any error, and prevent any
|
|
845
|
+
* pending computations from writing their results.
|
|
846
|
+
*
|
|
847
|
+
* If you want to set the value without affecting loading or error state, set `untrackedValue`
|
|
848
|
+
* instead and make sure to trigger effects manually if needed.
|
|
849
|
+
*
|
|
850
|
+
* If you want to abort pending computations when setting, you have to call `abort()` manually.
|
|
851
|
+
*/
|
|
852
|
+
get value(): T;
|
|
853
|
+
set value(value: T);
|
|
884
854
|
get untrackedValue(): T;
|
|
885
855
|
set untrackedValue(value: T);
|
|
856
|
+
/**
|
|
857
|
+
* Loading is true if the signal is still waiting for the promise to resolve, false if the promise
|
|
858
|
+
* has resolved or rejected (or the compute function is synchronous).
|
|
859
|
+
*
|
|
860
|
+
* Accessing `.pending` will trigger computation if needed, since it's often used like
|
|
861
|
+
*
|
|
862
|
+
* ```ts
|
|
863
|
+
* signal.pending ? <Loading /> : signal.value
|
|
864
|
+
* ```
|
|
865
|
+
*/
|
|
866
|
+
get pending(): boolean;
|
|
867
|
+
set untrackedPending(value: boolean);
|
|
868
|
+
get untrackedPending(): boolean;
|
|
869
|
+
/** @deprecated Use `pending` instead */
|
|
870
|
+
get loading(): boolean;
|
|
871
|
+
/** @deprecated Use `untrackedPending` instead */
|
|
872
|
+
get untrackedLoading(): boolean;
|
|
873
|
+
set untrackedLoading(value: boolean);
|
|
874
|
+
/**
|
|
875
|
+
* The error the compute function threw or rejected with.
|
|
876
|
+
*
|
|
877
|
+
* Accessing .error will trigger computation if needed, since it's often used like
|
|
878
|
+
*
|
|
879
|
+
* ```ts
|
|
880
|
+
* signal.error ? <Failed /> : signal.value
|
|
881
|
+
* ```
|
|
882
|
+
*/
|
|
883
|
+
get error(): Error | undefined;
|
|
884
|
+
set untrackedError(value: Error | undefined);
|
|
885
|
+
get untrackedError(): Error | undefined;
|
|
886
|
+
get expires(): number;
|
|
887
|
+
set expires(value: number);
|
|
888
|
+
get poll(): boolean;
|
|
889
|
+
set poll(value: boolean);
|
|
890
|
+
/** @deprecated Use `expires` and `poll` instead. */
|
|
891
|
+
get interval(): number;
|
|
892
|
+
set interval(value: number);
|
|
893
|
+
$setInvalid$(allowRecalc: boolean, mustClear: boolean | number): void;
|
|
894
|
+
/** Abort the current computation and run cleanups if needed. */
|
|
895
|
+
abort(reason?: any): void;
|
|
896
|
+
/** Schedule eager cleanup on next macro task if no subscribers remain. */
|
|
897
|
+
$scheduleEagerCleanup$(): void;
|
|
898
|
+
/** Returns a promise resolves when the signal finished computing. */
|
|
899
|
+
promise(): Promise<void>;
|
|
900
|
+
/** Run the computation if needed */
|
|
886
901
|
$computeIfNeeded$(): void;
|
|
902
|
+
/**
|
|
903
|
+
* Invoke the compute fn with the ComputeCtx argument. CTX_ARG signals (useAsync$, useResource$)
|
|
904
|
+
* only track via its explicit track(). Computeds auto-track every synchronous read instead; after
|
|
905
|
+
* the first await they must use the explicit track() too.
|
|
906
|
+
*/
|
|
907
|
+
$invokeComputeFn$(fn: Function, job: Job<T>): T | Promise<T>;
|
|
908
|
+
/** Start an async computation (the async engine; assumes the INVALID flag is set) */
|
|
909
|
+
$computeAsync$(): void;
|
|
910
|
+
$runComputation$(running: Job<T>): Promise<void>;
|
|
911
|
+
/** Await the computation and publish its result, error, and loading transitions. */
|
|
912
|
+
$settleComputation$(running: Job<T>, compute: () => ValueOrPromise<T>): Promise<void>;
|
|
913
|
+
/**
|
|
914
|
+
* Sets the error from the given job. We only accept errors from the current job and we ignore
|
|
915
|
+
* AbortErrors.
|
|
916
|
+
*/
|
|
917
|
+
$setError$(job: Job<T>, error: Error): void;
|
|
918
|
+
/** Called after SSR/unmount */
|
|
919
|
+
$destroy$(): Promise<void>;
|
|
920
|
+
private $clearNextPoll$;
|
|
921
|
+
private $scheduleNextPoll$;
|
|
922
|
+
private $hasSubscribers$;
|
|
923
|
+
$requestCleanups$(job: Job<T>, reason?: any): void;
|
|
924
|
+
/** Run a job's cleanup callbacks, returning a promise when any of them are async. */
|
|
925
|
+
$runCleanupCallbacks$(job: Job<T>): Promise<void> | undefined;
|
|
926
|
+
/** Clean up and trigger signal compute once complete */
|
|
927
|
+
$runCleanups$(job: Job<T>): Promise<void> | undefined;
|
|
887
928
|
}
|
|
888
929
|
|
|
889
930
|
declare type ComputeQRL<T> = _QRLInternal<ComputedFn<T>>;
|
|
@@ -945,6 +986,13 @@ export declare interface _Container {
|
|
|
945
986
|
} | null, symbolToChunkResolver: SymbolToChunkResolver, writer?: StreamWriter): SerializationContext;
|
|
946
987
|
}
|
|
947
988
|
|
|
989
|
+
declare const enum ContainerDataProcessState {
|
|
990
|
+
NotStarted = 0,
|
|
991
|
+
ProcessingVNode = 1,
|
|
992
|
+
ProcessingState = 2,
|
|
993
|
+
ProcessingStateDone = 3
|
|
994
|
+
}
|
|
995
|
+
|
|
948
996
|
/** @internal */
|
|
949
997
|
export declare interface _ContainerElement extends HTMLElement {
|
|
950
998
|
qContainer?: ClientContainer;
|
|
@@ -962,6 +1010,7 @@ export declare interface _ContainerElement extends HTMLElement {
|
|
|
962
1010
|
qVNodeRefs?: Map<number, Element | _ElementVNode>;
|
|
963
1011
|
/** String from `<script type="qwik/vnode">` tag. */
|
|
964
1012
|
qVnodeData?: string;
|
|
1013
|
+
qDestroy?: () => void;
|
|
965
1014
|
/** Segment-local strings from `<script type="qwik/vnode" q:r="...">` tags. */
|
|
966
1015
|
qSegmentVnodeData?: Map<string, string>;
|
|
967
1016
|
}
|
|
@@ -1096,9 +1145,10 @@ export declare interface CorrectedToggleEvent extends Event {
|
|
|
1096
1145
|
* Create a signal holding a `.value` which is calculated from the given async function (QRL). The
|
|
1097
1146
|
* standalone version of `useAsync$`.
|
|
1098
1147
|
*
|
|
1148
|
+
* @deprecated Use `createComputed$` instead, it has async support now.
|
|
1099
1149
|
* @public
|
|
1100
1150
|
*/
|
|
1101
|
-
export declare const createAsync$: <T>(qrl: (arg:
|
|
1151
|
+
export declare const createAsync$: <T>(qrl: (arg: ComputeCtx<T>) => Promise<T>, options?: AsyncSignalOptions<T>) => AsyncSignal<T>;
|
|
1102
1152
|
|
|
1103
1153
|
/** @internal */
|
|
1104
1154
|
export declare const createAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSignalOptions<T>) => _AsyncSignalImpl<T>;
|
|
@@ -1109,16 +1159,17 @@ export declare const createAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSi
|
|
|
1109
1159
|
* recalculated.
|
|
1110
1160
|
*
|
|
1111
1161
|
* The QRL must be a function which returns the value of the signal. The function must not have side
|
|
1112
|
-
* effects
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1162
|
+
* effects. Every synchronous signal or store read is tracked automatically; reads after the first
|
|
1163
|
+
* `await` must use the `track()` provided on the context argument. When the function is async, the
|
|
1164
|
+
* returned signal exposes the async API (`.pending`, `.error`, `.promise()`), and reading an
|
|
1165
|
+
* unresolved `.value` throws the computation promise.
|
|
1115
1166
|
*
|
|
1116
1167
|
* @public
|
|
1117
1168
|
*/
|
|
1118
|
-
export declare const createComputed$: <T>(qrl: () => T
|
|
1169
|
+
export declare const createComputed$: <T>(qrl: (ctx: ComputeCtx) => ValueOrPromise<T>, options?: ComputedOptions<T>) => ComputedReturnType<T>;
|
|
1119
1170
|
|
|
1120
1171
|
/** @internal */
|
|
1121
|
-
export declare const createComputedQrl: <T>(qrl: QRL<
|
|
1172
|
+
export declare const createComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions<T>) => ComputedSignalImpl<T>;
|
|
1122
1173
|
|
|
1123
1174
|
/**
|
|
1124
1175
|
* Create a context ID to be used in your application. The name should be written with no spaces.
|
|
@@ -1188,7 +1239,7 @@ export declare function _createDeserializeContainer(stateData: unknown[]): Deser
|
|
|
1188
1239
|
*
|
|
1189
1240
|
* @internal
|
|
1190
1241
|
*/
|
|
1191
|
-
export declare const _createQRL: <TYPE>(chunk: string | null, symbol: string, symbolRef?: null | ValueOrPromise<TYPE>, symbolFn?: null | (() => Promise<Record<string, TYPE>>), captures?:
|
|
1242
|
+
export declare const _createQRL: <TYPE>(chunk: string | null, symbol: string, symbolRef?: null | ValueOrPromise<TYPE>, symbolFn?: null | (() => Promise<Record<string, TYPE>>), captures?: QrlCaptures, container?: _Container) => _QRLInternal<TYPE>;
|
|
1192
1243
|
|
|
1193
1244
|
/**
|
|
1194
1245
|
* Create a signal that holds a custom serializable value. See {@link useSerializer$} for more
|
|
@@ -1239,26 +1290,21 @@ declare class DeleteOperation {
|
|
|
1239
1290
|
constructor(target: Element | Text);
|
|
1240
1291
|
}
|
|
1241
1292
|
|
|
1242
|
-
declare interface DescriptorBase<T = unknown, B = unknown> extends BackRef {
|
|
1243
|
-
$flags$: number;
|
|
1244
|
-
$index$: number;
|
|
1245
|
-
$el$: _HostElement;
|
|
1246
|
-
$qrl$: _QRLInternal<T>;
|
|
1247
|
-
$state$: B | undefined;
|
|
1248
|
-
$destroy$: (() => void) | null;
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
1293
|
/**
|
|
1252
|
-
* Deserialize data from string
|
|
1294
|
+
* Deserialize data from string.
|
|
1253
1295
|
*
|
|
1254
1296
|
* @param rawStateData - Data to deserialize
|
|
1255
1297
|
* @internal
|
|
1256
1298
|
*/
|
|
1257
|
-
export declare function _deserialize<T>(rawStateData: string): T
|
|
1299
|
+
export declare function _deserialize<T>(rawStateData: string): Promise<T>;
|
|
1258
1300
|
|
|
1259
1301
|
declare interface DeserializeContainer {
|
|
1260
1302
|
$getObjectById$: (id: number | string) => unknown;
|
|
1261
1303
|
$getForwardRef$: (id: number) => number | string | undefined;
|
|
1304
|
+
$pendingStoreTargets$?: Map<object, {
|
|
1305
|
+
t: number;
|
|
1306
|
+
v: unknown;
|
|
1307
|
+
}>;
|
|
1262
1308
|
element: HTMLElement | null;
|
|
1263
1309
|
getSyncFn: (id: number) => (...args: unknown[]) => unknown;
|
|
1264
1310
|
$state$?: unknown[];
|
|
@@ -1295,15 +1341,17 @@ declare class DomContainer extends _SharedContainer implements ClientContainer {
|
|
|
1295
1341
|
$instanceHash$: string;
|
|
1296
1342
|
$forwardRefs$: Array<number | string> | null;
|
|
1297
1343
|
vNodeLocate: (id: string | Element) => _VNode;
|
|
1344
|
+
$containerDataProcessState$: ContainerDataProcessState;
|
|
1345
|
+
$containerStateReadyCallbacks$: Array<() => void> | undefined;
|
|
1346
|
+
$containerStateDataState$: unknown;
|
|
1298
1347
|
private $rawStateData$;
|
|
1299
1348
|
private $stateData$;
|
|
1300
1349
|
private $rootForwardRefs$;
|
|
1301
1350
|
private $styleIds$;
|
|
1302
1351
|
constructor(element: _ContainerElement);
|
|
1352
|
+
$processContainerData$(): Generator<void, void, void>;
|
|
1303
1353
|
/** Tear down this container so stale references fail gracefully. */
|
|
1304
1354
|
$destroy$(): void;
|
|
1305
|
-
private $processRootStateScript$;
|
|
1306
|
-
private $stateScriptSelector$;
|
|
1307
1355
|
/**
|
|
1308
1356
|
* The first time we render we need to hoist the styles. (Meaning we need to move all styles from
|
|
1309
1357
|
* component inline to <head>)
|
|
@@ -1587,7 +1635,7 @@ export declare const _hasStoreEffects: (value: StoreTarget, prop: keyof StoreTar
|
|
|
1587
1635
|
export declare const _hmr: (this: string | undefined, event: CustomEvent<{
|
|
1588
1636
|
files: string[];
|
|
1589
1637
|
t: number;
|
|
1590
|
-
}>, element: Element) => void
|
|
1638
|
+
}>, element: Element) => void | Promise<void>;
|
|
1591
1639
|
|
|
1592
1640
|
/** @internal */
|
|
1593
1641
|
export declare type _HostElement = _VNode | ISsrNode;
|
|
@@ -1702,14 +1750,14 @@ export declare const _IMMUTABLE: unique symbol;
|
|
|
1702
1750
|
export declare const implicit$FirstArg: <FIRST, REST extends any[], RET>(fn: (qrl: QRL<FIRST>, ...rest: REST) => RET) => ((qrl: FIRST, ...rest: REST) => RET);
|
|
1703
1751
|
|
|
1704
1752
|
/**
|
|
1705
|
-
* Inject a pre-loaded value into
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1708
|
-
*
|
|
1753
|
+
* Inject a pre-loaded value into a signal while preserving subscriptions. Calls `invalidate({__v})`
|
|
1754
|
+
* so the compute function reads the value from `info`, then triggers an immediate synchronous
|
|
1755
|
+
* compute via the private `$computeIfNeeded$()` method (which is mangled in core builds, so callers
|
|
1756
|
+
* from other packages must go through this helper).
|
|
1709
1757
|
*
|
|
1710
1758
|
* @internal
|
|
1711
1759
|
*/
|
|
1712
|
-
export declare const _injectAsyncSignalValue: (signal:
|
|
1760
|
+
export declare const _injectAsyncSignalValue: (signal: ComputedSignal<unknown>, value: unknown) => void;
|
|
1713
1761
|
|
|
1714
1762
|
/**
|
|
1715
1763
|
* Create an inlined QRL. This is mostly useful on the server side for serialization.
|
|
@@ -1851,6 +1899,27 @@ declare interface IStreamHandler {
|
|
|
1851
1899
|
streamBlockEnd(): ValueOrPromise<void>;
|
|
1852
1900
|
}
|
|
1853
1901
|
|
|
1902
|
+
/** Retains job metadata and also serves as the argument for CTX_ARG compute functions */
|
|
1903
|
+
declare class Job<T> implements ComputeCtx<T> {
|
|
1904
|
+
readonly $signal$: ComputedSignalImpl<T, any>;
|
|
1905
|
+
/** First holds the compute promise and then the cleanup promise */
|
|
1906
|
+
$promise$: Promise<void> | null | void;
|
|
1907
|
+
$cleanupRequested$: boolean;
|
|
1908
|
+
$canWrite$: boolean;
|
|
1909
|
+
$track$: Tracker | undefined;
|
|
1910
|
+
$cleanups$: Parameters<ComputeCtx<T>['cleanup']>[0][] | undefined;
|
|
1911
|
+
$abortController$: AbortController | undefined;
|
|
1912
|
+
info: unknown;
|
|
1913
|
+
$infoVersion$: number | undefined;
|
|
1914
|
+
constructor($signal$: ComputedSignalImpl<T, any>, info: unknown, $infoVersion$: number | undefined);
|
|
1915
|
+
get track(): Tracker;
|
|
1916
|
+
get abortSignal(): AbortSignal;
|
|
1917
|
+
/** Backward compatible cache method for resource */
|
|
1918
|
+
cache(): void;
|
|
1919
|
+
get previous(): T | undefined;
|
|
1920
|
+
cleanup(callback: () => void): void;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1854
1923
|
/**
|
|
1855
1924
|
* Used by the JSX transpilers to create a JSXNode. Note that the optimizer will normally not use
|
|
1856
1925
|
* this, instead using _jsxSplit and _jsxSorted directly.
|
|
@@ -2118,6 +2187,16 @@ export declare const _mapArray_get: <T>(array: (T | null)[], key: string, start:
|
|
|
2118
2187
|
/** @internal */
|
|
2119
2188
|
export declare const _mapArray_set: <T>(array: (T | null)[], key: string, value: T | null, start: number, allowNullValue?: boolean) => void;
|
|
2120
2189
|
|
|
2190
|
+
/**
|
|
2191
|
+
* Mark this signal as owned outside of the component that read it.
|
|
2192
|
+
*
|
|
2193
|
+
* Externally owned signals are preserved when found in a component's sequential scope during
|
|
2194
|
+
* component cleanup.
|
|
2195
|
+
*
|
|
2196
|
+
* @internal
|
|
2197
|
+
*/
|
|
2198
|
+
export declare const _markSignalAsExternallyOwned: (signal: ComputedSignal<unknown>) => void;
|
|
2199
|
+
|
|
2121
2200
|
declare class MaybeAsyncSignal {
|
|
2122
2201
|
}
|
|
2123
2202
|
|
|
@@ -2433,6 +2512,14 @@ export declare type PublicProps<PROPS> = (PROPS extends Record<any, any> ? Omit<
|
|
|
2433
2512
|
/** @internal */
|
|
2434
2513
|
export declare interface _QDocument extends Document {
|
|
2435
2514
|
qVNodeData: WeakMap<Element, string>;
|
|
2515
|
+
/** True once root document VNode data has been scheduled at least once. */
|
|
2516
|
+
qVNodeDataStarted?: boolean;
|
|
2517
|
+
/** True when root, segment, and patch VNode data work is fully drained. */
|
|
2518
|
+
qVNodeDataReady?: boolean;
|
|
2519
|
+
/** Internal yielding state for queued VNode data jobs. */
|
|
2520
|
+
qVNodeDataState?: unknown;
|
|
2521
|
+
/** Callbacks waiting for root, segment, and patch VNode data work to drain. */
|
|
2522
|
+
qVNodeDataCallbacks?: Array<() => void>;
|
|
2436
2523
|
/** True once the root document VNode data has been fully processed. */
|
|
2437
2524
|
qVNodeDataProcessed?: boolean;
|
|
2438
2525
|
/** Processes one vnode patch script. */
|
|
@@ -2592,6 +2679,8 @@ export declare const qrl: <T = any>(chunkOrFn: string | (() => Promise<any>), sy
|
|
|
2592
2679
|
|
|
2593
2680
|
declare type QrlArgs<T> = T extends (...args: infer ARGS) => any ? ARGS : unknown[];
|
|
2594
2681
|
|
|
2682
|
+
declare type QrlCaptures = Readonly<unknown[]> | string | null;
|
|
2683
|
+
|
|
2595
2684
|
/** @public */
|
|
2596
2685
|
declare interface QRLDev {
|
|
2597
2686
|
file: string;
|
|
@@ -2616,8 +2705,8 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
2616
2705
|
readonly $chunk$: string | null;
|
|
2617
2706
|
readonly $symbol$: string;
|
|
2618
2707
|
readonly $hash$: string;
|
|
2619
|
-
/**
|
|
2620
|
-
readonly $captures$?:
|
|
2708
|
+
/** Captures are stored lazily after deserialization. */
|
|
2709
|
+
readonly $captures$?: QrlCaptures;
|
|
2621
2710
|
dev?: QRLDev | null;
|
|
2622
2711
|
resolve(container?: _Container): Promise<TYPE>;
|
|
2623
2712
|
resolved: undefined | TYPE;
|
|
@@ -2634,7 +2723,7 @@ declare type QRLInternalMethods<TYPE> = {
|
|
|
2634
2723
|
* method but we need to have a stable name because it gets called in user code by the optimizer,
|
|
2635
2724
|
* after the $name$ props are mangled
|
|
2636
2725
|
*/
|
|
2637
|
-
w(captures:
|
|
2726
|
+
w(captures: QrlCaptures): _QRLInternal<TYPE>;
|
|
2638
2727
|
/**
|
|
2639
2728
|
* "set ref" - Set the ref of the QRL. It's an internal method but we need to have a stable name
|
|
2640
2729
|
* because it gets called in user code by the optimizer, after the $name$ props are mangled
|
|
@@ -2963,7 +3052,7 @@ export declare const _reR: () => boolean;
|
|
|
2963
3052
|
*
|
|
2964
3053
|
* @internal
|
|
2965
3054
|
*/
|
|
2966
|
-
export declare function _res(this: string | undefined, _: any, element: Element): void
|
|
3055
|
+
export declare function _res(this: string | undefined, _: any, element: Element): void | Promise<void>;
|
|
2967
3056
|
|
|
2968
3057
|
/** @internal */
|
|
2969
3058
|
export declare const _resolveContextWithoutSequentialScope: <STATE>(context: ContextId<STATE>) => STATE | undefined;
|
|
@@ -3005,7 +3094,7 @@ export declare const _resolveContextWithoutSequentialScope: <STATE>(context: Con
|
|
|
3005
3094
|
export declare const Resource: <T>({ value, onResolved, onPending, onRejected, }: ResourceProps<T>) => JSXOutput;
|
|
3006
3095
|
|
|
3007
3096
|
/** @public */
|
|
3008
|
-
export declare interface ResourceCtx<T = unknown> extends
|
|
3097
|
+
export declare interface ResourceCtx<T = unknown> extends ComputeCtx<T> {
|
|
3009
3098
|
/** @deprecated Does not do anything */
|
|
3010
3099
|
cache(policyOrMilliseconds: number | 'immutable'): void;
|
|
3011
3100
|
}
|
|
@@ -3375,6 +3464,25 @@ export declare abstract class _SharedContainer implements _Container {
|
|
|
3375
3464
|
abstract $appendStyle$(content: string, styleId: string, host: _HostElement, scoped: boolean): void;
|
|
3376
3465
|
}
|
|
3377
3466
|
|
|
3467
|
+
/** @internal */
|
|
3468
|
+
export declare const _shC: (props: ShowProps<any>) => JSXNode<unknown>;
|
|
3469
|
+
|
|
3470
|
+
/** @public @experimental */
|
|
3471
|
+
export declare const Show: ShowComponent;
|
|
3472
|
+
|
|
3473
|
+
/** @public @experimental */
|
|
3474
|
+
export declare type ShowComponent = <WHEN = unknown, THEN extends JSXOutput = JSXOutput, ELSE extends JSXOutput = JSXOutput>(props: PublicProps<ShowProps<WHEN, THEN, ELSE>>, key: string | null, flags: number, dev?: DevJSX) => JSXOutput;
|
|
3475
|
+
|
|
3476
|
+
/** @public @experimental */
|
|
3477
|
+
export declare interface ShowProps<WHEN = unknown, THEN extends JSXOutput = JSXOutput, ELSE extends JSXOutput = JSXOutput> {
|
|
3478
|
+
when$: QRL<() => WHEN>;
|
|
3479
|
+
then$: QRL<(when: WHEN) => THEN>;
|
|
3480
|
+
else$?: QRL<(when: WHEN) => ELSE>;
|
|
3481
|
+
}
|
|
3482
|
+
|
|
3483
|
+
/** @internal */
|
|
3484
|
+
export declare const _shT: ({ track }: TaskCtx) => ValueOrPromise<void | undefined>;
|
|
3485
|
+
|
|
3378
3486
|
/**
|
|
3379
3487
|
* A signal is a reactive value which can be read and written. When the signal is written, all tasks
|
|
3380
3488
|
* which are tracking the signal will be re-run and all components that read the signal will be
|
|
@@ -3399,11 +3507,6 @@ export declare interface Signal<T = any> {
|
|
|
3399
3507
|
trigger(): void;
|
|
3400
3508
|
}
|
|
3401
3509
|
|
|
3402
|
-
declare const enum SignalFlags {
|
|
3403
|
-
INVALID = 1,
|
|
3404
|
-
RUN_EFFECTS = 2
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
3510
|
declare class SignalImpl<T = any> implements Signal<T> {
|
|
3408
3511
|
$untrackedValue$: T;
|
|
3409
3512
|
/** Store a list of effects which are dependent on this signal. */
|
|
@@ -3762,11 +3865,13 @@ export declare type SSRHintProps = {
|
|
|
3762
3865
|
declare interface SSRInternalStreamWriter extends StreamWriter {
|
|
3763
3866
|
writeRootRef(id: number): ValueOrPromise<void>;
|
|
3764
3867
|
writeRootRefPath(path: number[]): ValueOrPromise<void>;
|
|
3868
|
+
writeRootRefDelta(id: number, base: number): ValueOrPromise<void>;
|
|
3765
3869
|
toString(remap?: number[]): string;
|
|
3766
3870
|
}
|
|
3767
3871
|
|
|
3768
3872
|
declare const enum SsrNodeFlags {
|
|
3769
|
-
Updatable = 1
|
|
3873
|
+
Updatable = 1,
|
|
3874
|
+
WarnedStreamedChore = 2
|
|
3770
3875
|
}
|
|
3771
3876
|
|
|
3772
3877
|
declare type SSROutOfOrderSegment = SegmentRenderContext;
|
|
@@ -3785,6 +3890,12 @@ declare type SSRRevealSlotProps = {
|
|
|
3785
3890
|
coordinator: OutOfOrderRevealCoordinator;
|
|
3786
3891
|
};
|
|
3787
3892
|
|
|
3893
|
+
/** @internal */
|
|
3894
|
+
declare interface SSRRootRefDeltaChunk {
|
|
3895
|
+
readonly id: number;
|
|
3896
|
+
readonly base: number;
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3788
3899
|
/** @internal */
|
|
3789
3900
|
declare interface SSRRootRefPathChunk {
|
|
3790
3901
|
readonly path: number[];
|
|
@@ -3806,6 +3917,10 @@ declare type SSRSegmentWriteChunk = string | {
|
|
|
3806
3917
|
} | {
|
|
3807
3918
|
readonly type: 'root-ref-path';
|
|
3808
3919
|
readonly localPath: number[];
|
|
3920
|
+
} | {
|
|
3921
|
+
readonly type: 'root-ref-delta';
|
|
3922
|
+
readonly localId: number;
|
|
3923
|
+
readonly localBaseId: number;
|
|
3809
3924
|
};
|
|
3810
3925
|
|
|
3811
3926
|
/** @public */
|
|
@@ -3830,7 +3945,7 @@ export declare interface SSRStreamWriter {
|
|
|
3830
3945
|
}
|
|
3831
3946
|
|
|
3832
3947
|
/** @internal */
|
|
3833
|
-
declare type SSRWriteChunk = string | number | SSRRootRefPathChunk;
|
|
3948
|
+
declare type SSRWriteChunk = string | number | SSRRootRefPathChunk | SSRRootRefDeltaChunk;
|
|
3834
3949
|
|
|
3835
3950
|
declare type StackFn = () => ValueOrPromise<void>;
|
|
3836
3951
|
|
|
@@ -4196,16 +4311,15 @@ declare type TableCellSpecialAttrs = {
|
|
|
4196
4311
|
};
|
|
4197
4312
|
|
|
4198
4313
|
/** @internal */
|
|
4199
|
-
export declare class _Task<T = unknown, B = T> extends BackRef
|
|
4200
|
-
$flags$:
|
|
4314
|
+
export declare class _Task<T = unknown, B = T> extends BackRef {
|
|
4315
|
+
$flags$: TaskFlags;
|
|
4201
4316
|
$index$: number;
|
|
4202
4317
|
$el$: _HostElement;
|
|
4203
4318
|
$qrl$: _QRLInternal<T>;
|
|
4204
|
-
$state$: Signal<B> | undefined;
|
|
4205
4319
|
$destroy$: (() => void) | null;
|
|
4206
4320
|
$destroyPromise$: Promise<void> | undefined;
|
|
4207
4321
|
$taskPromise$: Promise<void> | null;
|
|
4208
|
-
constructor($flags$:
|
|
4322
|
+
constructor($flags$: TaskFlags, $index$: number, $el$: _HostElement, $qrl$: _QRLInternal<T>, $destroy$: (() => void) | null);
|
|
4209
4323
|
}
|
|
4210
4324
|
|
|
4211
4325
|
/**
|
|
@@ -4214,7 +4328,7 @@ export declare class _Task<T = unknown, B = T> extends BackRef implements Descri
|
|
|
4214
4328
|
*
|
|
4215
4329
|
* @internal
|
|
4216
4330
|
*/
|
|
4217
|
-
export declare function _task(this: string, _event: Event, element: Element): void
|
|
4331
|
+
export declare function _task(this: string, _event: Event, element: Element): void | Promise<void>;
|
|
4218
4332
|
|
|
4219
4333
|
/** @public */
|
|
4220
4334
|
export declare interface TaskCtx {
|
|
@@ -4224,6 +4338,16 @@ export declare interface TaskCtx {
|
|
|
4224
4338
|
|
|
4225
4339
|
declare const TaskEvent = "qTask";
|
|
4226
4340
|
|
|
4341
|
+
/** @internal */
|
|
4342
|
+
declare const enum TaskFlags {
|
|
4343
|
+
VISIBLE_TASK = 1,
|
|
4344
|
+
TASK = 2,
|
|
4345
|
+
DIRTY = 4,
|
|
4346
|
+
RENDER_BLOCKING = 8,
|
|
4347
|
+
NEEDS_CLEANUP = 16,
|
|
4348
|
+
EVENTS_REGISTERED = 32
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4227
4351
|
/** @public */
|
|
4228
4352
|
export declare type TaskFn = (ctx: TaskCtx) => ValueOrPromise<void | (() => ValueOrPromise<void>)>;
|
|
4229
4353
|
|
|
@@ -4380,11 +4504,16 @@ export declare function _updateProjectionProps(container: _Container, vnode: _Vi
|
|
|
4380
4504
|
* will subscribe to it and return the last resolved value until the new value is ready. As soon as
|
|
4381
4505
|
* the new value is ready, the subscribers will be updated.
|
|
4382
4506
|
*
|
|
4507
|
+
* @deprecated Use `useComputed$` instead, it has async support now. It auto-tracks synchronous
|
|
4508
|
+
* reads; after the first `await`, use the provided `track()` like before.
|
|
4383
4509
|
* @public
|
|
4384
4510
|
*/
|
|
4385
4511
|
export declare const useAsync$: <T>(qrl: AsyncFn<T>, options?: AsyncSignalOptions<T> | undefined) => AsyncSignal<T>;
|
|
4386
4512
|
|
|
4387
|
-
/**
|
|
4513
|
+
/**
|
|
4514
|
+
* @deprecated Use `useComputed$` instead, it has async support now.
|
|
4515
|
+
* @internal
|
|
4516
|
+
*/
|
|
4388
4517
|
export declare const useAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSignalOptions<T>) => AsyncSignal<T>;
|
|
4389
4518
|
|
|
4390
4519
|
/**
|
|
@@ -4393,14 +4522,20 @@ export declare const useAsyncQrl: <T>(qrl: QRL<AsyncFn<T>>, options?: AsyncSigna
|
|
|
4393
4522
|
* recalculated, and if the result changed, all tasks which are tracking the signal will be re-run
|
|
4394
4523
|
* and all components that read the signal will be re-rendered.
|
|
4395
4524
|
*
|
|
4396
|
-
*
|
|
4525
|
+
* Every synchronous signal or store read is tracked automatically. Reads after an `await` are not:
|
|
4526
|
+
* the tracking context is lost, so track them explicitly with the `track()` provided on the context
|
|
4527
|
+
* argument. When the function is async, the returned signal exposes the async API: reading an
|
|
4528
|
+
* unresolved `.value` throws the computation promise, and `.pending` and `.error` expose the
|
|
4529
|
+
* computation state.
|
|
4530
|
+
*
|
|
4531
|
+
* The function must not have any side effects.
|
|
4397
4532
|
*
|
|
4398
4533
|
* @public
|
|
4399
4534
|
*/
|
|
4400
|
-
export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions | undefined) => ComputedReturnType<T>;
|
|
4535
|
+
export declare const useComputed$: <T>(qrl: ComputedFn<T>, options?: ComputedOptions<T> | undefined) => ComputedReturnType<T>;
|
|
4401
4536
|
|
|
4402
4537
|
/** @internal */
|
|
4403
|
-
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions) => ComputedReturnType<T>;
|
|
4538
|
+
export declare const useComputedQrl: <T>(qrl: QRL<ComputedFn<T>>, options?: ComputedOptions<T>) => ComputedReturnType<T>;
|
|
4404
4539
|
|
|
4405
4540
|
/**
|
|
4406
4541
|
* Stores a value which is retained for the lifetime of the component. Subsequent calls to
|
|
@@ -4660,11 +4795,11 @@ export declare const useOnWindow: <T extends KnownEventNames>(event: T | T[], ev
|
|
|
4660
4795
|
* Be careful when using a `try/catch` statement in `useResource$`. If you catch the error and don't
|
|
4661
4796
|
* re-throw it (or a new Error), the resource status will never be `rejected`.
|
|
4662
4797
|
*
|
|
4663
|
-
* @deprecated Use `
|
|
4664
|
-
* available for backward compatibility but it is recommended to migrate to `
|
|
4665
|
-
* code and when updating existing code.
|
|
4798
|
+
* @deprecated Use `useComputed$` instead, which is more powerful and flexible. `useResource$` is
|
|
4799
|
+
* still available for backward compatibility but it is recommended to migrate to `useComputed$`
|
|
4800
|
+
* for new code and when updating existing code.
|
|
4666
4801
|
* @public
|
|
4667
|
-
* @see
|
|
4802
|
+
* @see useComputed$
|
|
4668
4803
|
* @see Resource
|
|
4669
4804
|
* @see ResourceReturn
|
|
4670
4805
|
*/
|
|
@@ -5023,7 +5158,7 @@ export declare const useVisibleTaskQrl: (qrl: QRL<TaskFn>, opts?: OnVisibleTaskO
|
|
|
5023
5158
|
*
|
|
5024
5159
|
* @internal
|
|
5025
5160
|
*/
|
|
5026
|
-
export declare function _val(this: string | undefined, _: any, element: HTMLInputElement): void
|
|
5161
|
+
export declare function _val(this: string | undefined, _: any, element: HTMLInputElement): void | Promise<void>;
|
|
5027
5162
|
|
|
5028
5163
|
/**
|
|
5029
5164
|
* Type representing a value which is either resolve or a promise.
|
|
@@ -5039,7 +5174,7 @@ export declare const _VAR_PROPS: unique symbol;
|
|
|
5039
5174
|
export declare const _verifySerializable: <T>(value: T, preMessage?: string) => T;
|
|
5040
5175
|
|
|
5041
5176
|
/**
|
|
5042
|
-
* 2.0.0-beta.
|
|
5177
|
+
* 2.0.0-beta.38-dev+0339f17
|
|
5043
5178
|
*
|
|
5044
5179
|
* @public
|
|
5045
5180
|
*/
|
|
@@ -5221,10 +5356,6 @@ export declare function withLocale<T>(locale: string, fn: () => T): T;
|
|
|
5221
5356
|
|
|
5222
5357
|
declare type WrappedProp<T extends object, P extends keyof T> = T extends Signal ? WrappedSignalImpl<PropType<T, P>> : PropType<T, P>;
|
|
5223
5358
|
|
|
5224
|
-
declare const enum WrappedSignalFlags {
|
|
5225
|
-
UNWRAP = 4
|
|
5226
|
-
}
|
|
5227
|
-
|
|
5228
5359
|
declare class WrappedSignalImpl<T> extends SignalImpl<T> {
|
|
5229
5360
|
$args$: any[];
|
|
5230
5361
|
$func$: (...args: any[]) => T;
|
|
@@ -5232,7 +5363,7 @@ declare class WrappedSignalImpl<T> extends SignalImpl<T> {
|
|
|
5232
5363
|
$flags$: AllSignalFlags;
|
|
5233
5364
|
$hostElement$: _HostElement | undefined;
|
|
5234
5365
|
[_EFFECT_BACK_REF]: Map<_EffectProperty | string, EffectSubscription> | undefined;
|
|
5235
|
-
constructor(container: _Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?:
|
|
5366
|
+
constructor(container: _Container | null, fn: (...args: any[]) => T, args: any[], fnStr: string | null, flags?: AllSignalFlags);
|
|
5236
5367
|
invalidate(): void;
|
|
5237
5368
|
get untrackedValue(): T;
|
|
5238
5369
|
$computeIfNeeded$(): void;
|