@effect-app/vue 4.0.0-beta.33 → 4.0.0-beta.331
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/CHANGELOG.md +2463 -0
- package/dist/atomQuery.d.ts +120 -0
- package/dist/atomQuery.d.ts.map +1 -0
- package/dist/atomQuery.js +434 -0
- package/dist/commander.d.ts +634 -0
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +1068 -0
- package/dist/{experimental/confirm.d.ts → confirm.d.ts} +6 -4
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +26 -0
- package/dist/dependencyMetadata.d.ts +18 -0
- package/dist/dependencyMetadata.d.ts.map +1 -0
- package/dist/dependencyMetadata.js +67 -0
- package/dist/errorReporter.d.ts +6 -4
- package/dist/errorReporter.d.ts.map +1 -1
- package/dist/errorReporter.js +14 -19
- package/dist/form.d.ts +5 -5
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +42 -16
- package/dist/internal/tanstackQuery.d.ts +9 -0
- package/dist/internal/tanstackQuery.d.ts.map +1 -0
- package/dist/internal/tanstackQuery.js +204 -0
- package/dist/intl.d.ts +15 -0
- package/dist/intl.d.ts.map +1 -0
- package/dist/intl.js +9 -0
- package/dist/lib.d.ts +7 -9
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +35 -10
- package/dist/liveQueryInvalidation.d.ts +16 -0
- package/dist/liveQueryInvalidation.d.ts.map +1 -0
- package/dist/liveQueryInvalidation.js +115 -0
- package/dist/makeClient.d.ts +236 -336
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +417 -408
- package/dist/makeContext.d.ts.map +1 -1
- package/dist/makeIntl.d.ts.map +1 -1
- package/dist/{experimental/makeUseCommand.d.ts → makeUseCommand.d.ts} +4 -3
- package/dist/makeUseCommand.d.ts.map +1 -0
- package/dist/makeUseCommand.js +13 -0
- package/dist/mutate.d.ts +109 -40
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +235 -58
- package/dist/query.d.ts +158 -45
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +380 -122
- package/dist/queryLifetime.d.ts +25 -0
- package/dist/queryLifetime.d.ts.map +1 -0
- package/dist/queryLifetime.js +54 -0
- package/dist/routeParams.d.ts +4 -4
- package/dist/routeParams.d.ts.map +1 -1
- package/dist/routeParams.js +4 -3
- package/dist/runtime.d.ts +1 -14
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +2 -26
- package/dist/suspense.d.ts +19 -0
- package/dist/suspense.d.ts.map +1 -0
- package/dist/suspense.js +38 -0
- package/dist/toast.d.ts +2 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +2 -0
- package/dist/withToast.d.ts +2 -0
- package/dist/withToast.d.ts.map +1 -0
- package/dist/withToast.js +2 -0
- package/docs/atom-query-api-redesign.md +207 -0
- package/docs/mutation-command-atoms.md +40 -0
- package/docs/query-key-invalidation.md +107 -0
- package/examples/streamMutation.ts +72 -0
- package/package.json +36 -95
- package/src/atomQuery.ts +600 -0
- package/src/commander.ts +3408 -0
- package/src/{experimental/confirm.ts → confirm.ts} +13 -15
- package/src/dependencyMetadata.ts +84 -0
- package/src/errorReporter.ts +65 -75
- package/src/form.ts +57 -21
- package/src/index.ts +7 -7
- package/src/internal/tanstackQuery.ts +308 -0
- package/src/intl.ts +12 -0
- package/src/lib.ts +49 -21
- package/src/liveQueryInvalidation.ts +138 -0
- package/src/makeClient.ts +971 -1159
- package/src/makeIntl.ts +2 -2
- package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +9 -6
- package/src/mutate.ts +406 -153
- package/src/query.ts +763 -260
- package/src/queryLifetime.ts +74 -0
- package/src/routeParams.ts +7 -7
- package/src/runtime.ts +1 -31
- package/src/suspense.ts +43 -0
- package/src/toast.ts +1 -0
- package/src/withToast.ts +1 -0
- package/test/Mutation.test.ts +181 -24
- package/test/dependencyInvalidation.test.ts +444 -0
- package/test/dist/dependencyInvalidation.test.d.ts.map +1 -0
- package/test/dist/form.test.d.ts.map +1 -1
- package/test/dist/inactiveInvalidation.test.d.ts.map +1 -0
- package/test/dist/interrupt-refetch-repro.test.d.ts.map +1 -0
- package/test/dist/lib.test.d.ts.map +1 -0
- package/test/dist/liveQueryInvalidation.test.d.ts.map +1 -0
- package/test/dist/query-span.test.d.ts.map +1 -0
- package/test/dist/queryOptions.test.d.ts.map +1 -0
- package/test/dist/streamFinal.test.d.ts.map +1 -0
- package/test/dist/streamFn.test.d.ts.map +1 -0
- package/test/dist/stubs.d.ts +3751 -120
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +190 -30
- package/test/dist/suspense-regression.test.d.ts.map +1 -0
- package/test/dist/suspense.test.d.ts.map +1 -0
- package/test/form-validation-errors.test.ts +24 -19
- package/test/form.test.ts +25 -6
- package/test/inactiveInvalidation.test.ts +172 -0
- package/test/interrupt-refetch-repro.test.ts +625 -0
- package/test/lib.test.ts +240 -0
- package/test/liveQueryInvalidation.test.ts +108 -0
- package/test/makeClient.test.ts +437 -38
- package/test/query-span.test.ts +92 -0
- package/test/queryOptions.test.ts +88 -0
- package/test/streamFinal.test.ts +64 -0
- package/test/streamFn.test.ts +457 -0
- package/test/stubs.ts +227 -42
- package/test/suspense-regression.test.ts +168 -0
- package/test/suspense.test.ts +160 -0
- package/tsconfig.examples.json +20 -0
- package/tsconfig.json +9 -2
- package/tsconfig.src.json +34 -34
- package/tsconfig.test.json +2 -2
- package/vitest.config.ts +5 -5
- package/dist/experimental/commander.d.ts +0 -359
- package/dist/experimental/commander.d.ts.map +0 -1
- package/dist/experimental/commander.js +0 -557
- package/dist/experimental/confirm.d.ts.map +0 -1
- package/dist/experimental/confirm.js +0 -28
- package/dist/experimental/intl.d.ts +0 -16
- package/dist/experimental/intl.d.ts.map +0 -1
- package/dist/experimental/intl.js +0 -5
- package/dist/experimental/makeUseCommand.d.ts.map +0 -1
- package/dist/experimental/makeUseCommand.js +0 -13
- package/dist/experimental/toast.d.ts +0 -47
- package/dist/experimental/toast.d.ts.map +0 -1
- package/dist/experimental/toast.js +0 -41
- package/dist/experimental/withToast.d.ts +0 -25
- package/dist/experimental/withToast.d.ts.map +0 -1
- package/dist/experimental/withToast.js +0 -45
- package/eslint.config.mjs +0 -24
- package/src/experimental/commander.ts +0 -1835
- package/src/experimental/intl.ts +0 -9
- package/src/experimental/toast.ts +0 -66
- package/src/experimental/withToast.ts +0 -99
- package/tsconfig.json.bak +0 -12
package/dist/makeClient.d.ts
CHANGED
|
@@ -1,151 +1,206 @@
|
|
|
1
|
-
import { type InvalidateOptions, type InvalidateQueryFilters, type QueryObserverResult, type RefetchOptions, type UseQueryReturnType } from "@tanstack/vue-query";
|
|
2
|
-
import { Cause, Effect, Exit, Layer, type ManagedRuntime, S, ServiceMap } from "effect-app";
|
|
3
1
|
import { type ApiClientFactory, type Req } from "effect-app/client";
|
|
4
|
-
import type {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import type { ExtractModuleName, HandlerInput, RequestHandlers, RequestHandlerWithInput, RequestsAny, RequestStreamHandlerWithInput } from "effect-app/client/clientFor";
|
|
3
|
+
import type { CauseException } from "effect-app/client/errors";
|
|
4
|
+
import type { InvalidationCallback } from "effect-app/client/makeClient";
|
|
5
|
+
import * as Context from "effect-app/Context";
|
|
6
|
+
import * as Effect from "effect-app/Effect";
|
|
7
|
+
import * as Layer from "effect-app/Layer";
|
|
8
|
+
import * as S from "effect-app/Schema";
|
|
9
|
+
import * as Cause from "effect/Cause";
|
|
10
|
+
import * as Exit from "effect/Exit";
|
|
7
11
|
import { type Fiber } from "effect/Fiber";
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import { type
|
|
13
|
-
import {
|
|
14
|
-
import { type
|
|
15
|
-
import { type
|
|
16
|
-
|
|
12
|
+
import type * as ManagedRuntime from "effect/ManagedRuntime";
|
|
13
|
+
import type * as Stream from "effect/Stream";
|
|
14
|
+
import type * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
|
|
15
|
+
import { type ComputedRef, type WatchSource } from "vue";
|
|
16
|
+
import { type AtomClientRuntime } from "./atomQuery.js";
|
|
17
|
+
import { type Commander, type Progress } from "./commander.js";
|
|
18
|
+
import { type I18n } from "./intl.js";
|
|
19
|
+
import { type CommanderResolved } from "./makeUseCommand.js";
|
|
20
|
+
import { type InvalidationEntry, type MutationOptionsBase, type QueryInvalidator } from "./mutate.js";
|
|
21
|
+
import { type AtomQueryNewOptions, type CustomUndefinedInitialQueryOptions, makeQuery, makeQueryAtom, makeQueryFamily, makeQueryNew, makeStreamQuery, makeStreamQueryAtom, makeStreamQueryFamily, makeStreamQueryNew, type QueryObserverResult, type RefetchOptions, type StreamQueryAtomFamily, type SuspenseQueryView, type UseQueryReturnType } from "./query.js";
|
|
22
|
+
import { type Toast } from "./toast.js";
|
|
23
|
+
export type { Progress };
|
|
24
|
+
declare const SuspenseInterruptedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
|
|
25
|
+
readonly _tag: "SuspenseInterruptedError";
|
|
26
|
+
} & Readonly<A>;
|
|
27
|
+
/**
|
|
28
|
+
* A suspense query settled with an interrupt-only cause while its component was still MOUNTED.
|
|
29
|
+
*
|
|
30
|
+
* That combination classifies the interrupt's origin: a navigation/unmount cancel interrupts the
|
|
31
|
+
* suspense *fiber* (via the scope's AbortSignal) or is hidden by effect-core before it can settle —
|
|
32
|
+
* it never yields a still-mounted `Failure` exit. A `Failure(interrupt-only)` observed while mounted
|
|
33
|
+
* therefore came from the QUERY side — e.g. the server returned an RPC interrupt `Exit` (over a 200),
|
|
34
|
+
* or the fetch was superseded — and silencing it leaves the user staring at a blank page.
|
|
35
|
+
*
|
|
36
|
+
* Error boundaries can rely on this split: keep silencing raw interrupt-only causes (those are
|
|
37
|
+
* genuinely "user navigated away"), and render this error as "the request was interrupted — reload?".
|
|
38
|
+
*/
|
|
39
|
+
export declare class SuspenseInterruptedError extends SuspenseInterruptedError_base<{
|
|
40
|
+
readonly originalCause: Cause.Cause<unknown>;
|
|
41
|
+
readonly source: "suspense" | "suspenseNew";
|
|
42
|
+
}> {
|
|
43
|
+
get message(): string;
|
|
44
|
+
}
|
|
45
|
+
/** Structural check (by `_tag`) so consumers compiled against older published types can detect it. */
|
|
46
|
+
export declare const isSuspenseInterruptedError: (e: unknown) => e is SuspenseInterruptedError;
|
|
47
|
+
export interface CommandRequestExtensions<RT, Id extends string, I, A, E, R> {
|
|
17
48
|
/** Defines a Command based on this call, taking the `id` of the call as the `id` of the Command.
|
|
18
49
|
* The Request function will be taken as the first member of the Command, the Command required input will be the Request input.
|
|
19
50
|
* see Command.wrap for details */
|
|
20
|
-
wrap: Commander.CommanderWrap<RT, Id,
|
|
51
|
+
wrap: <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.CommanderWrap<RT, Id, I18nKey, State, I, A, E, R>;
|
|
21
52
|
/** Defines a Command based on this call, taking the `id` of the call as the `id` of the Command.
|
|
22
53
|
* see Command.fn for details */
|
|
23
|
-
fn: Commander.CommanderFn<RT, Id,
|
|
54
|
+
fn: <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.CommanderFn<RT, Id, I18nKey, State>;
|
|
24
55
|
}
|
|
25
56
|
/** my other doc */
|
|
26
|
-
export interface
|
|
57
|
+
export interface RequestExt<RT, Id extends string, I, A, E, R> extends Commander.CommandContextLocal<Id, Id>, Commander.CommanderWrap<RT, Id, Id, undefined, I, A, E, R>, CommandRequestExtensions<RT, Id, I, A, E, R> {
|
|
27
58
|
/**
|
|
28
|
-
*
|
|
59
|
+
* Send the request to the endpoint and return the raw Effect response.
|
|
60
|
+
* This does not perform query cache invalidation.
|
|
29
61
|
*/
|
|
30
|
-
(i: I)
|
|
62
|
+
request: (i: I) => Effect.Effect<A, E, R>;
|
|
31
63
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
64
|
+
export type CommandRequestWithExtensions<RT, Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer _Request, infer Id> ? RequestExt<RT, Id, I, A, E, R> : never;
|
|
65
|
+
export interface QueryExtensions<I, A, E, R> {
|
|
66
|
+
/**
|
|
67
|
+
* Send the request to the endpoint and return the raw Effect response.
|
|
68
|
+
* This does not set up query state tracking.
|
|
69
|
+
*/
|
|
70
|
+
request: (i: I) => Effect.Effect<A, E, R>;
|
|
36
71
|
}
|
|
37
|
-
export type
|
|
72
|
+
export type QueryRequestWithExtensions<Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer _Request, infer _Id> ? QueryExtensions<I, A, E, R> : never;
|
|
73
|
+
type QueryHandler<Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id> ? Request["type"] extends "query" ? RequestHandlerWithInput<I, A, E, R, Request, Id> : never : never;
|
|
74
|
+
type CommandHandler<Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id> ? Request["type"] extends "command" ? RequestHandlerWithInput<I, A, E, R, Request, Id> : never : never;
|
|
75
|
+
type QueryStreamHandler<Req> = Req extends RequestStreamHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id, infer Final> ? [Request["stream"], Request["type"]] extends [true, "query"] ? RequestStreamHandlerWithInput<I, A, E, R, Request, Id, Final> : never : never;
|
|
76
|
+
type CommandStreamHandler<Req> = Req extends RequestStreamHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id, infer Final> ? [Request["stream"], Request["type"]] extends [true, "command"] ? RequestStreamHandlerWithInput<I, A, E, R, Request, Id, Final> : never : never;
|
|
38
77
|
export interface MutationExtensions<RT, Id extends string, I, A, E, R> {
|
|
39
78
|
/** Defines a Command based on this mutation, taking the `id` of the mutation as the `id` of the Command.
|
|
40
79
|
* The Mutation function will be taken as the first member of the Command, the Command required input will be the Mutation input.
|
|
41
80
|
* see Command.wrap for details */
|
|
42
|
-
wrap: Commander.CommanderWrap<RT, Id,
|
|
43
|
-
/** Defines a Command based on this
|
|
81
|
+
wrap: <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.CommanderWrap<RT, Id, I18nKey, State, I, A, E, R>;
|
|
82
|
+
/** Defines a Command based on this call, taking the `id` of the mutation as the `id` of the Command.
|
|
44
83
|
* see Command.fn for details */
|
|
45
|
-
fn: Commander.CommanderFn<RT, Id,
|
|
46
|
-
}
|
|
47
|
-
/** my other doc */
|
|
48
|
-
export interface MutationExtWithInput<RT, Id extends string, I, A, E, R> extends Commander.CommandContextLocal<Id, Id>, MutationExtensions<RT, Id, I, A, E, R> {
|
|
49
|
-
/**
|
|
50
|
-
* Call the endpoint with input
|
|
51
|
-
* Invalidate queries based on namespace of this mutation.
|
|
52
|
-
* Do not use for queries.
|
|
53
|
-
*/
|
|
54
|
-
(i: I): Effect.Effect<A, E, R>;
|
|
84
|
+
fn: <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.CommanderFn<RT, Id, I18nKey, State>;
|
|
55
85
|
}
|
|
56
86
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
87
|
+
* Send the request to the endpoint and return the raw Effect response.
|
|
88
|
+
* Also invalidates query caches using the request namespace by default.
|
|
89
|
+
* Namespace invalidation targets parent namespace keys
|
|
90
|
+
* (for example `$project/$configuration.get` invalidates `$project`).
|
|
91
|
+
* Override invalidation in client options via `queryInvalidation`.
|
|
92
|
+
*
|
|
93
|
+
* Pass `options` to attach a `select` Effect that runs after the mutation
|
|
94
|
+
* succeeds (its output is returned to the caller) and/or override the default
|
|
95
|
+
* `queryInvalidation`.
|
|
96
|
+
*
|
|
97
|
+
* When `I = void` the input argument may be omitted.
|
|
60
98
|
*/
|
|
61
|
-
export interface MutationExt<RT, Id extends string, A, E, R
|
|
99
|
+
export interface MutationExt<RT, Id extends string, I, A, E, R, EA = unknown> extends MutationExtensions<RT, Id, I, A, E, R> {
|
|
100
|
+
<B = A, E2 = never, R2 = never>(input: I, options?: MutationOptionsBase<A, B, E2, R2>): Effect.Effect<B, E | E2, R | R2>;
|
|
101
|
+
project: <ProjSchema extends S.Top>(schema: EA extends ProjSchema["Encoded"] ? ProjSchema : never) => MutationExt<RT, Id, I, ProjSchema["Type"], E | S.SchemaError, R | ProjSchema["DecodingServices"], ProjSchema["Encoded"]>;
|
|
62
102
|
}
|
|
63
|
-
export type MutationWithExtensions<RT, Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer
|
|
103
|
+
export type MutationWithExtensions<RT, Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id> ? MutationExt<RT, Id, I, A, E, R, Request["success"]["Encoded"]> : never;
|
|
104
|
+
/**
|
|
105
|
+
* The `streamFn` builder for a stream-type request handler, using the stream-specific overloads.
|
|
106
|
+
*/
|
|
107
|
+
export type StreamFnStreamExtension<RT, Req> = Req extends RequestStreamHandlerWithInput<infer _I, infer _A, infer _E, infer _R, infer _Request, infer Id, infer _Final> ? <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.StreamGen<RT, Id, I18nKey, State> & Commander.NonGenStream<RT, Id, I18nKey, State> : never;
|
|
108
|
+
/**
|
|
109
|
+
* `mutate` factory — wraps per-invocation invalidation scaffolding
|
|
110
|
+
* into the stream itself (via `Stream.unwrap`) for use with `streamFn` combinators.
|
|
111
|
+
*/
|
|
112
|
+
export type StreamMutation2WithExtensions<RT, Req> = Req extends RequestStreamHandlerWithInput<infer I, infer A, infer E, infer R, infer _Request, infer Id, infer _Final> ? ((input: I) => Stream.Stream<A, E, R>) & {
|
|
113
|
+
readonly id: Id;
|
|
114
|
+
readonly wrap: <I18nKey extends string = Id, State extends Commander.IntlRecord | undefined = undefined>(options?: Commander.FnOptions<Id, I18nKey, State>) => Commander.StreamerWrap<RT, Id, I18nKey, State, I, A, E, R>;
|
|
115
|
+
} : never;
|
|
64
116
|
declare const useQuery_: QueryImpl<any>["useQuery"];
|
|
117
|
+
declare const useQueryNew_: QueryImpl<any>["useQueryNew"];
|
|
118
|
+
declare const useQueryAtom_: QueryImpl<any>["useQueryAtom"];
|
|
119
|
+
declare const useQueryFamily_: QueryImpl<any>["useQueryFamily"];
|
|
120
|
+
declare const useSuspenseQueryNew_: QueryImpl<any>["useSuspenseQueryNew"];
|
|
65
121
|
declare const useSuspenseQuery_: QueryImpl<any>["useSuspenseQuery"];
|
|
66
|
-
|
|
122
|
+
declare const useStreamQuery_: QueryImpl<any>["useStreamQuery"];
|
|
123
|
+
declare const useStreamQueryAtom_: QueryImpl<any>["useStreamQueryAtom"];
|
|
124
|
+
declare const useStreamQueryNew_: QueryImpl<any>["useStreamQueryNew"];
|
|
125
|
+
export interface ProjectResult<RT, I, B, E, R, Request extends Req, Id extends string> {
|
|
126
|
+
request: (i: I) => Effect.Effect<B, E, R>;
|
|
127
|
+
family: Exclude<R, RT> extends never ? ReturnType<typeof useQueryFamily_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
128
|
+
query: Exclude<R, RT> extends never ? ReturnType<typeof useQuery_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
129
|
+
queryNew: Exclude<R, RT> extends never ? ReturnType<typeof useQueryNew_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
130
|
+
suspense: Exclude<R, RT> extends never ? ReturnType<typeof useSuspenseQuery_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
131
|
+
suspenseNew: Exclude<R, RT> extends never ? ReturnType<typeof useSuspenseQueryNew_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
132
|
+
atom: Exclude<R, RT> extends never ? ReturnType<typeof useQueryAtom_<I, E, B, Request, Id>> : MissingDependencies<RT, R> & {};
|
|
133
|
+
}
|
|
134
|
+
export type QueryProjection<RT, HandlerReq> = HandlerReq extends RequestHandlerWithInput<infer I, infer _A, infer E, infer R, infer Request, infer Id> ? Request["type"] extends "query" ? {
|
|
135
|
+
project: <ProjSchema extends S.Top>(schema: Request["success"]["Encoded"] extends ProjSchema["Encoded"] ? ProjSchema : never) => ProjectResult<RT, I, ProjSchema["Type"], E | S.SchemaError, R | ProjSchema["DecodingServices"], Request, Id>;
|
|
136
|
+
} : {} : {};
|
|
137
|
+
export interface QueryResultExtensions<Request extends Req, Id extends string, I, A, E> {
|
|
67
138
|
/**
|
|
68
|
-
*
|
|
139
|
+
* Read helper for query requests.
|
|
140
|
+
* Runs as a tracked Vue Query and returns reactive state.
|
|
141
|
+
* Queries read state and should not be used to mutate it.
|
|
142
|
+
* When `I = void` the input argument may be omitted.
|
|
69
143
|
*/
|
|
70
144
|
query: ReturnType<typeof useQuery_<I, E, A, Request, Id>>;
|
|
71
145
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
146
|
+
* Atom-native query helper with object return shape.
|
|
147
|
+
* Additive migration surface; `.query()` remains the compatibility tuple API.
|
|
148
|
+
*/
|
|
149
|
+
queryNew: ReturnType<typeof useQueryNew_<I, E, A, Request, Id>>;
|
|
150
|
+
/**
|
|
151
|
+
* Like `.query`, but returns a Promise for setup-time awaiting.
|
|
152
|
+
* Use this when integrating with Vue Suspense / error boundaries.
|
|
75
153
|
*/
|
|
76
154
|
suspense: ReturnType<typeof useSuspenseQuery_<I, E, A, Request, Id>>;
|
|
77
|
-
}
|
|
78
|
-
export interface QueriesWithoutInput<Request extends Req, Id extends string, A, E> {
|
|
79
155
|
/**
|
|
80
|
-
*
|
|
156
|
+
* Promise-based setup helper with object return shape.
|
|
157
|
+
* Additive migration surface; `.suspense()` remains the compatibility tuple API.
|
|
81
158
|
*/
|
|
82
|
-
|
|
159
|
+
suspenseNew: ReturnType<typeof useSuspenseQueryNew_<I, E, A, Request, Id>>;
|
|
83
160
|
/**
|
|
84
|
-
*
|
|
85
|
-
* which ensures that either there always is a latest value, or an error occurs on load.
|
|
86
|
-
* So that Suspense and error boundaries can be used.
|
|
161
|
+
* Raw query atom for composition outside Vue refs.
|
|
87
162
|
*/
|
|
88
|
-
|
|
163
|
+
atom: ReturnType<typeof useQueryAtom_<I, E, A, Request, Id>>;
|
|
164
|
+
/**
|
|
165
|
+
* Raw query atom family for composing query graphs before choosing a Vue observer.
|
|
166
|
+
*/
|
|
167
|
+
family: ReturnType<typeof useQueryFamily_<I, E, A, Request, Id>>;
|
|
89
168
|
}
|
|
90
169
|
export type MissingDependencies<RT, R> = {
|
|
91
170
|
message: "Dependencies required that are not provided by the runtime";
|
|
92
171
|
dependencies: Exclude<R, RT>;
|
|
93
172
|
};
|
|
94
|
-
export type Queries<RT, Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id> ? Exclude<R, RT> extends never ?
|
|
173
|
+
export type Queries<RT, Req> = Req extends RequestHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id> ? Request["type"] extends "query" ? Exclude<R, RT> extends never ? QueryResultExtensions<Request, Id, I, A, E> : {
|
|
174
|
+
atom: MissingDependencies<RT, R> & {};
|
|
175
|
+
family: MissingDependencies<RT, R> & {};
|
|
95
176
|
query: MissingDependencies<RT, R> & {};
|
|
177
|
+
queryNew: MissingDependencies<RT, R> & {};
|
|
96
178
|
suspense: MissingDependencies<RT, R> & {};
|
|
97
|
-
|
|
179
|
+
suspenseNew: MissingDependencies<RT, R> & {};
|
|
180
|
+
} : never : never;
|
|
181
|
+
export interface StreamQueryExtensions<Request extends Req, Id extends string, I, A, E> {
|
|
182
|
+
atom: ReturnType<typeof useStreamQueryAtom_<I, E, A, Request, Id>>;
|
|
183
|
+
family: StreamQueryAtomFamily<I, A, E>;
|
|
184
|
+
/**
|
|
185
|
+
* Stream helper for query-stream requests.
|
|
186
|
+
* Legacy compatibility helper. Collects the whole stream into an array before
|
|
187
|
+
* publishing data.
|
|
188
|
+
* When `I = void` the input argument may be omitted.
|
|
189
|
+
*/
|
|
190
|
+
query: ReturnType<typeof useStreamQuery_<I, E, A, Request, Id>>;
|
|
191
|
+
/**
|
|
192
|
+
* Atom-native stream query helper. Exposes incremental pull state and a `pull`
|
|
193
|
+
* command instead of collecting the whole stream first.
|
|
194
|
+
*/
|
|
195
|
+
queryNew: ReturnType<typeof useStreamQueryNew_<I, E, A, Request, Id>>;
|
|
196
|
+
}
|
|
197
|
+
export type StreamQueries<RT, HandlerReq> = HandlerReq extends RequestStreamHandlerWithInput<infer I, infer A, infer E, infer R, infer Request, infer Id, infer _Final> ? Exclude<R, RT> extends never ? StreamQueryExtensions<Request, Id, I, A, E> : {
|
|
198
|
+
atom: MissingDependencies<RT, R> & {};
|
|
199
|
+
family: MissingDependencies<RT, R> & {};
|
|
98
200
|
query: MissingDependencies<RT, R> & {};
|
|
99
|
-
|
|
201
|
+
queryNew: MissingDependencies<RT, R> & {};
|
|
100
202
|
} : never;
|
|
101
|
-
declare const
|
|
102
|
-
readonly _tag: "SuppressErrors";
|
|
103
|
-
} & Readonly<A>;
|
|
104
|
-
/**
|
|
105
|
-
* Use this after handling an error yourself, still continueing on the Error track, but the error will not be reported.
|
|
106
|
-
*/
|
|
107
|
-
export declare class SuppressErrors extends SuppressErrors_base<{}> {
|
|
108
|
-
readonly [ErrorSilenced]: true;
|
|
109
|
-
}
|
|
110
|
-
export type ResponseErrors = S.SchemaError | SupportedErrors | SuppressErrors | OperationFailure;
|
|
111
|
-
export interface Opts<A, E, R, I = void, A2 = A, E2 = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never> extends MutationOptions<A, E, R, A2, E2, R2, I> {
|
|
112
|
-
/** set to `undefined` to use default message */
|
|
113
|
-
successMessage?: ((a: A2, i: I) => Effect.Effect<string | undefined, ESuccess, RSuccess>) | undefined;
|
|
114
|
-
/** set to `undefined` to use default message */
|
|
115
|
-
failMessage?: ((e: E2, i: I) => Effect.Effect<string | undefined, EError, RError>) | undefined;
|
|
116
|
-
/** set to `undefined` to use default message */
|
|
117
|
-
defectMessage?: ((e: Cause.Cause<E2>, i: I) => Effect.Effect<string | undefined, EDefect, RDefect>) | undefined;
|
|
118
|
-
}
|
|
119
|
-
export interface LowOpts<A, E, I = void, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never> {
|
|
120
|
-
onSuccess: (a: A, i: I) => Effect.Effect<void, ESuccess, RSuccess>;
|
|
121
|
-
onFail: (e: E, i: I) => Effect.Effect<void, EError, RError>;
|
|
122
|
-
onDefect: (e: Cause.Cause<E>, i: I) => Effect.Effect<void, EDefect, RDefect>;
|
|
123
|
-
}
|
|
124
|
-
export interface LowOptsOptional<A, E, R, I = void, A2 = A, E2 = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never> extends MutationOptions<A, E, R, A2, E2, R2, I> {
|
|
125
|
-
onSuccess?: (a: A, i: I) => Effect.Effect<void, ESuccess, RSuccess>;
|
|
126
|
-
onFail?: (e: E, i: I) => Effect.Effect<void, EError, RError>;
|
|
127
|
-
onDefect?: (e: Cause.Cause<E>, i: I) => Effect.Effect<void, EDefect, RDefect>;
|
|
128
|
-
}
|
|
129
|
-
type WithAction<A> = A & {
|
|
130
|
-
action: string;
|
|
131
|
-
};
|
|
132
|
-
type Resp<I, A, E, R, V = ComputedRef<Res<A, E>>> = readonly [
|
|
133
|
-
V,
|
|
134
|
-
WithAction<(I: I) => Effect.Effect<Exit.Exit<A, E>, never, R>>
|
|
135
|
-
];
|
|
136
|
-
type ActResp<A, E, R, V = ComputedRef<Res<A, E>>> = readonly [
|
|
137
|
-
V,
|
|
138
|
-
WithAction<Effect.Effect<Exit.Exit<A, E>, never, R>>
|
|
139
|
-
];
|
|
140
|
-
export declare const suppressToast: import("effect/Function").LazyArg<Effect.Effect<undefined, never, never>>;
|
|
141
|
-
declare const _useMutation: {
|
|
142
|
-
<I, E, A, R, Request extends Req, Id extends string>(self: RequestHandlerWithInput<I, A, E, R, Request, Id>, options?: MutationOptionsBase): ((i: I) => Effect.Effect<A, E, R>) & {
|
|
143
|
-
readonly id: Id;
|
|
144
|
-
};
|
|
145
|
-
<E, A, R, Request extends Req, Id extends string>(self: RequestHandler<A, E, R, Request, Id>, options?: MutationOptionsBase): Effect.Effect<A, E, R> & {
|
|
146
|
-
readonly id: Id;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
203
|
+
declare const _useMutation: <I, E, A, R, Request extends Req, Id extends string>(self: RequestHandlerWithInput<I, A, E, R, Request, Id>) => import("./mutate.js").MutationFn<I, A, E, R, Id>;
|
|
149
204
|
/**
|
|
150
205
|
* Pass an Effect or a function that returns an Effect, e.g from a client action
|
|
151
206
|
* Executes query cache invalidation based on default rules or provided option.
|
|
@@ -157,202 +212,34 @@ export declare const useMutation: typeof _useMutation;
|
|
|
157
212
|
* Executes query cache invalidation based on default rules or provided option.
|
|
158
213
|
* adds a span with the mutation id
|
|
159
214
|
*/
|
|
160
|
-
export declare const useMutationInt: () =>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
};
|
|
164
|
-
<E, A, R, Request extends Req, Id extends string>(self: RequestHandler<A, E, R, Request, Id>, options?: MutationOptionsBase): Effect.Effect<A, E, R> & {
|
|
165
|
-
readonly id: Id;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
export declare class LegacyMutationImpl<RT> {
|
|
169
|
-
private readonly getRuntime;
|
|
170
|
-
private readonly toast;
|
|
171
|
-
private readonly intl;
|
|
172
|
-
constructor(getRuntime: () => ServiceMap.ServiceMap<RT>, toast: Toast, intl: I18n);
|
|
215
|
+
export declare const useMutationInt: (queryInvalidator: QueryInvalidator) => <I, E, A, R, Request extends Req, Id extends string>(self: RequestHandlerWithInput<I, A, E, R, Request, Id>) => import("./mutate.js").MutationFn<I, A, E, R, Id>;
|
|
216
|
+
export type ClientFrom<M extends RequestsAny> = RequestHandlers<never, never, M, ExtractModuleName<M>>;
|
|
217
|
+
export interface MakeClientOptions {
|
|
173
218
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* @deprecated use `Command.fn` and friends instead
|
|
219
|
+
* Selects the engine behind legacy `.query()` / `.suspense()` helpers.
|
|
220
|
+
* Atom-native `.atom()` / `.family()` / `.queryNew()` / `.suspenseNew()` always use Atom.
|
|
177
221
|
*/
|
|
178
|
-
readonly
|
|
179
|
-
/**
|
|
180
|
-
* Effect results are converted to Exit, so errors are ignored by default.
|
|
181
|
-
* you should use the result ref to render errors!
|
|
182
|
-
* @deprecated use `Command.fn` and friends instead
|
|
183
|
-
*/
|
|
184
|
-
<I, E, A, R, Request extends Req, Name extends string, A2 = A, E2 = E, R2 = R>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, options?: MutationOptions<A, E, R, A2, E2, R2, I>): readonly [
|
|
185
|
-
ComputedRef<AsyncResult.AsyncResult<A2, E2>>,
|
|
186
|
-
(i: I) => Effect.Effect<Exit.Exit<A2, E2>, never, R2>
|
|
187
|
-
];
|
|
188
|
-
/**
|
|
189
|
-
* Effect results are converted to Exit, so errors are ignored by default.
|
|
190
|
-
* you should use the result ref to render errors!
|
|
191
|
-
* @deprecated use `Command.fn` and friends instead
|
|
192
|
-
*/
|
|
193
|
-
<E, A, R, Request extends Req, Name extends string, A2 = A, E2 = E, R2 = R>(self: RequestHandler<A, E, R, Request, Name>, options?: MutationOptions<A, E, R, A2, E2, R2>): readonly [
|
|
194
|
-
ComputedRef<AsyncResult.AsyncResult<A2, E2>>,
|
|
195
|
-
Effect.Effect<Exit.Exit<A2, E2>, never, R2>
|
|
196
|
-
];
|
|
197
|
-
};
|
|
198
|
-
/** handles errors as toasts and reports defects
|
|
199
|
-
* @deprecated use `Command.fn` and friends instead
|
|
200
|
-
*/
|
|
201
|
-
readonly useHandleRequestWithToast: () => <A, E extends ResponseErrors, R, I = void, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(f: Effect.Effect<Exit.Exit<A2, E2>, never, R2> | ((i: I) => Effect.Effect<Exit.Exit<A2, E2>, never, R2>), id: string, action: string, options?: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>) => (Effect.Effect<Exit.Exit<A2, E2>, ESuccess | EError | EDefect, Exclude<R2, import("effect/Tracer").ParentSpan> | Exclude<RSuccess, import("effect/Tracer").ParentSpan> | Exclude<RError, import("effect/Tracer").ParentSpan> | Exclude<RDefect, import("effect/Tracer").ParentSpan>> | ((i: any) => Effect.Effect<Exit.Exit<A2, E2>, ESuccess | EError | EDefect, Exclude<R2, import("effect/Tracer").ParentSpan> | Exclude<RSuccess, import("effect/Tracer").ParentSpan> | Exclude<RError, import("effect/Tracer").ParentSpan> | Exclude<RDefect, import("effect/Tracer").ParentSpan>>)) & {
|
|
202
|
-
action: string;
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
206
|
-
* Returns a tuple with raw Result and execution function which reports success and errors as Toast.
|
|
207
|
-
* @deprecated use `Command.fn` and friends instead
|
|
208
|
-
*/
|
|
209
|
-
readonly useAndHandleMutationResult: {
|
|
210
|
-
/**
|
|
211
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
212
|
-
* Returns a tuple with raw Result and execution function which reports success and errors as Toast.
|
|
213
|
-
* @deprecated use `Command.fn` and friends instead
|
|
214
|
-
*/
|
|
215
|
-
<I, E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): Resp<I, A2, E2, R2, ComputedRef<AsyncResult.AsyncResult<A2, E2>>>;
|
|
216
|
-
/**
|
|
217
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
218
|
-
* Returns a tuple with raw Result and execution function which reports success and errors as Toast.
|
|
219
|
-
* @deprecated use `Command.fn` and friends instead
|
|
220
|
-
*/
|
|
221
|
-
<E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandler<A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, void, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): ActResp<A2, E2, R2, ComputedRef<AsyncResult.AsyncResult<A2, E2>>>;
|
|
222
|
-
};
|
|
223
|
-
/**
|
|
224
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
225
|
-
* Returns a tuple with state ref and execution function which reports success and errors as Toast.
|
|
226
|
-
*
|
|
227
|
-
* @deprecated use `Command.fn` and friends instead
|
|
228
|
-
*/
|
|
229
|
-
readonly useAndHandleMutation: {
|
|
230
|
-
/**
|
|
231
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
232
|
-
* Returns a tuple with state ref and execution function which reports success and errors as Toast.
|
|
233
|
-
*
|
|
234
|
-
* @deprecated use `Command.fn` and friends instead
|
|
235
|
-
*/
|
|
236
|
-
<I, E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): Resp<I, A2, E2, R2>;
|
|
237
|
-
/**
|
|
238
|
-
* Pass a function that returns an Effect, e.g from a client action, give it a name.
|
|
239
|
-
* Returns a tuple with state ref and execution function which reports success and errors as Toast.
|
|
240
|
-
*
|
|
241
|
-
* @deprecated use `Command.fn` and friends instead
|
|
242
|
-
*/
|
|
243
|
-
<E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandler<A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, void, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): ActResp<A2, E2, R2>;
|
|
244
|
-
};
|
|
245
|
-
/** @deprecated use `Command.fn` and friends instead */
|
|
246
|
-
readonly makeUseAndHandleMutation: (defaultOptions?: Opts<any, any, any, any, any, any, any, any, any>) => {
|
|
247
|
-
<I, E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): Resp<I, A2, E2, R2>;
|
|
248
|
-
<E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandler<A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, void, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): ActResp<A2, E2, R2>;
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* The same as @see useAndHandleMutation, but does not display any toasts by default.
|
|
252
|
-
* Messages for success, error and defect toasts can be provided in the Options.
|
|
253
|
-
* @deprecated use `Command.fn` and friends instead
|
|
254
|
-
*/
|
|
255
|
-
readonly useAndHandleMutationSilently: {
|
|
256
|
-
/**
|
|
257
|
-
* The same as @see useAndHandleMutation, but does not display any toasts by default.
|
|
258
|
-
* Messages for success, error and defect toasts can be provided in the Options.
|
|
259
|
-
* @deprecated use `Command.fn` and friends instead
|
|
260
|
-
*/
|
|
261
|
-
<I, E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): Resp<I, A2, E2, R>;
|
|
262
|
-
/**
|
|
263
|
-
* The same as @see useAndHandleMutation, but does not display any toasts by default.
|
|
264
|
-
* Messages for success, error and defect toasts can be provided in the Options.
|
|
265
|
-
* @deprecated use `Command.fn` and friends instead
|
|
266
|
-
*/
|
|
267
|
-
<E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandler<A, E, R, Request, Name>, action: string, options?: Opts<A, E, R, void, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): ActResp<void, never, R>;
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* The same as @see useAndHandleMutation, but does not act on success, error or defect by default.
|
|
271
|
-
* Actions for success, error and defect can be provided in the Options.
|
|
272
|
-
* @deprecated use `Command.fn` and friends instead
|
|
273
|
-
*/
|
|
274
|
-
readonly useAndHandleMutationCustom: {
|
|
275
|
-
/**
|
|
276
|
-
* The same as @see useAndHandleMutation, but does not act on success, error or defect by default.
|
|
277
|
-
* Actions for success, error and defect can be provided in the Options.
|
|
278
|
-
* @deprecated use `Command.fn` and friends instead
|
|
279
|
-
*/
|
|
280
|
-
<I, E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, action: string, options?: LowOptsOptional<A, E, R, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): Resp<I, A2, E2, R2>;
|
|
281
|
-
/**
|
|
282
|
-
* The same as @see useAndHandleMutation, but does not act on success, error or defect by default.
|
|
283
|
-
* Actions for success, error and defect can be provided in the Options.
|
|
284
|
-
* @deprecated use `Command.fn` and friends instead
|
|
285
|
-
*/
|
|
286
|
-
<E extends ResponseErrors, A, R, Request extends Req, Name extends string, A2 = A, E2 extends ResponseErrors = E, R2 = R, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandler<A, E, R, Request, Name>, action: string, options?: LowOptsOptional<A, E, R, void, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect>): ActResp<A2, E2, R2>;
|
|
287
|
-
};
|
|
288
|
-
/**
|
|
289
|
-
* Effect results are converted to Exit, so errors are ignored by default.
|
|
290
|
-
* you should use the result ref to render errors!
|
|
291
|
-
* @deprecated use `Command.fn` and friends instead
|
|
292
|
-
*/
|
|
293
|
-
readonly useSafeMutationWithState: {
|
|
294
|
-
/**
|
|
295
|
-
* Effect results are converted to Exit, so errors are ignored by default.
|
|
296
|
-
* you should use the result ref to render errors!
|
|
297
|
-
* @deprecated use `Command.fn` and friends instead
|
|
298
|
-
*/
|
|
299
|
-
<I, E, A, R, Request extends Req, Name extends string, A2 = A, E2 = E, R2 = R>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>, options?: MutationOptions<A, E, R, A2, E2, R2, I>): readonly [
|
|
300
|
-
ComputedRef<Res<A, E>>,
|
|
301
|
-
(i: I) => Effect.Effect<Exit.Exit<A2, E2>, never, R2>
|
|
302
|
-
];
|
|
303
|
-
/**
|
|
304
|
-
* Effect results are converted to Exit, so errors are ignored by default.
|
|
305
|
-
* you should use the result ref to render errors!
|
|
306
|
-
* @deprecated use `Command.fn` and friends instead
|
|
307
|
-
*/
|
|
308
|
-
<E, A, R, Request extends Req, Name extends string, A2 = A, E2 = E, R2 = R>(self: RequestHandler<A, E, R, Request, Name>, options?: MutationOptions<A, E, R, A2, E2, R2>): readonly [
|
|
309
|
-
ComputedRef<Res<A, E>>,
|
|
310
|
-
Effect.Effect<Exit.Exit<A2, E2>, never, R2>
|
|
311
|
-
];
|
|
312
|
-
};
|
|
313
|
-
/** @deprecated use OmegaForm */
|
|
314
|
-
readonly buildFormFromSchema: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, C extends Record<PropertyKey, any>, OnSubmitA>(s: S.Codec<To> & {
|
|
315
|
-
new (c: C): any;
|
|
316
|
-
extend: any;
|
|
317
|
-
fields: S.Struct.Fields;
|
|
318
|
-
}, state: Ref<Omit<From, "_tag">>, onSubmit: (a: To) => Effect.Effect<OnSubmitA, never, RT>) => {
|
|
319
|
-
fields: { [K in keyof To]-?: {
|
|
320
|
-
true: {
|
|
321
|
-
true: To[K] extends {
|
|
322
|
-
_tag: string;
|
|
323
|
-
} ? import("./form.js").DiscriminatedUnionFieldInfo<{ [P in import("./form.js").DistributiveNestedFieldInfoKey<To[K]> as P["_infoTag" & keyof P] & string]: P; }> : import("./form.js").UnionFieldInfo<import("./form.js").DistributiveNestedFieldInfoKey<To[K]>[]>;
|
|
324
|
-
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
325
|
-
}[`${To[K] extends object ? true : false}`];
|
|
326
|
-
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
327
|
-
}[`${import("effect-app/utils").IsUnion<To[K]>}`]; };
|
|
328
|
-
/** optimized for Vuetify v-form submit callback */
|
|
329
|
-
submit: <T extends Promise<{
|
|
330
|
-
valid: boolean;
|
|
331
|
-
}>>(e: T) => Promise<unknown>;
|
|
332
|
-
/** optimized for Native form submit callback or general use */
|
|
333
|
-
submitFromState: Effect.Effect<any, unknown, unknown>;
|
|
334
|
-
submitFromStatePromise: () => Promise<unknown>;
|
|
335
|
-
isDirty: Ref<boolean, boolean>;
|
|
336
|
-
isValid: Ref<boolean, boolean>;
|
|
337
|
-
isLoading: Ref<boolean, boolean>;
|
|
338
|
-
};
|
|
222
|
+
readonly legacyQueryEngine?: "atom" | "tanstack";
|
|
339
223
|
}
|
|
340
|
-
declare const LegacyMutation_base: ServiceMap.ServiceClass<LegacyMutation, "LegacyMutation", <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => LegacyMutationImpl<R>> & {
|
|
341
|
-
readonly make: Effect.Effect<(<R>(getRuntime: () => ServiceMap.ServiceMap<R>) => LegacyMutationImpl<R>), never, I18n | Toast>;
|
|
342
|
-
};
|
|
343
|
-
export declare class LegacyMutation extends LegacyMutation_base {
|
|
344
|
-
static readonly DefaultWithoutDependencies: Layer.Layer<LegacyMutation, never, I18n | Toast>;
|
|
345
|
-
static readonly Default: Layer.Layer<LegacyMutation, never, I18n | Toast>;
|
|
346
|
-
}
|
|
347
|
-
export type ClientFrom<M extends Requests> = RequestHandlers<never, never, M, M["meta"]["moduleName"]>;
|
|
348
224
|
export declare class QueryImpl<R> {
|
|
349
|
-
readonly getRuntime: () =>
|
|
350
|
-
constructor(getRuntime: () =>
|
|
225
|
+
readonly getRuntime: () => Context.Context<R>;
|
|
226
|
+
constructor(getRuntime: () => Context.Context<R>, getAtomRt: () => AtomClientRuntime, legacyUseQuery?: ReturnType<typeof makeQuery<R>>);
|
|
351
227
|
/**
|
|
352
228
|
* Effect results are passed to the caller, including errors.
|
|
353
229
|
* @deprecated use client helpers instead (.query())
|
|
354
230
|
*/
|
|
355
231
|
readonly useQuery: ReturnType<typeof makeQuery<R>>;
|
|
232
|
+
readonly useQueryNew: ReturnType<typeof makeQueryNew<R>>;
|
|
233
|
+
readonly useQueryAtom: ReturnType<typeof makeQueryAtom<R>>;
|
|
234
|
+
readonly useQueryFamily: ReturnType<typeof makeQueryFamily<R>>;
|
|
235
|
+
/**
|
|
236
|
+
* Stream results are accumulated as an array of chunks and returned as reactive state.
|
|
237
|
+
* @deprecated use client helpers instead (.query())
|
|
238
|
+
*/
|
|
239
|
+
readonly useStreamQuery: ReturnType<typeof makeStreamQuery<R>>;
|
|
240
|
+
readonly useStreamQueryFamily: ReturnType<typeof makeStreamQueryFamily<R>>;
|
|
241
|
+
readonly useStreamQueryAtom: ReturnType<typeof makeStreamQueryAtom<R>>;
|
|
242
|
+
readonly useStreamQueryNew: ReturnType<typeof makeStreamQueryNew<R>>;
|
|
356
243
|
/**
|
|
357
244
|
* The difference with useQuery is that this function will return a Promise you can await in the Setup,
|
|
358
245
|
* which ensures that either there always is a latest value, or an error occurs on load.
|
|
@@ -364,73 +251,86 @@ export declare class QueryImpl<R> {
|
|
|
364
251
|
* The difference with useQuery is that this function will return a Promise you can await in the Setup,
|
|
365
252
|
* which ensures that either there always is a latest value, or an error occurs on load.
|
|
366
253
|
* So that Suspense and error boundaries can be used.
|
|
367
|
-
*
|
|
254
|
+
* When `I = void` the input argument may be omitted.
|
|
368
255
|
*/
|
|
369
|
-
<E, A, Request extends Req, Name extends string>(self:
|
|
370
|
-
|
|
371
|
-
* The difference with useQuery is that this function will return a Promise you can await in the Setup,
|
|
372
|
-
* which ensures that either there always is a latest value, or an error occurs on load.
|
|
373
|
-
* So that Suspense and error boundaries can be used.
|
|
374
|
-
*/
|
|
375
|
-
<TData = A>(options?: CustomUndefinedInitialQueryOptions<A, E, TData>): Promise<readonly [
|
|
256
|
+
<I, E, A, Request extends Req, Name extends string>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>): {
|
|
257
|
+
<TData = A>(arg: I | WatchSource<I>, options?: CustomUndefinedInitialQueryOptions<A, CauseException<E>, TData>): Promise<readonly [
|
|
376
258
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
377
259
|
ComputedRef<TData>,
|
|
378
260
|
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, E>>,
|
|
379
261
|
UseQueryReturnType<any, any>
|
|
380
262
|
]>;
|
|
381
263
|
};
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
*/
|
|
387
|
-
<Arg, E, A, Request extends Req, Name extends string>(self: RequestHandlerWithInput<Arg, A, E, R, Request, Name>): {
|
|
388
|
-
/**
|
|
389
|
-
* The difference with useQuery is that this function will return a Promise you can await in the Setup,
|
|
390
|
-
* which ensures that either there always is a latest value, or an error occurs on load.
|
|
391
|
-
* So that Suspense and error boundaries can be used.
|
|
392
|
-
*/
|
|
393
|
-
<TData = A>(arg: Arg | WatchSource<Arg>, options?: CustomUndefinedInitialQueryOptions<A, E, TData>): Promise<readonly [
|
|
394
|
-
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
395
|
-
ComputedRef<TData>,
|
|
396
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, E>>,
|
|
397
|
-
UseQueryReturnType<any, any>
|
|
398
|
-
]>;
|
|
264
|
+
};
|
|
265
|
+
readonly useSuspenseQueryNew: {
|
|
266
|
+
<I, E, A, Request extends Req, Name extends string>(self: RequestHandlerWithInput<I, A, E, R, Request, Name>): {
|
|
267
|
+
<TData = A>(arg: I | WatchSource<I>, options?: AtomQueryNewOptions<A, TData>): Promise<SuspenseQueryView<TData, E>>;
|
|
399
268
|
};
|
|
400
269
|
};
|
|
401
270
|
}
|
|
402
271
|
type Base = I18n | Toast;
|
|
403
|
-
type Mix = ApiClientFactory | Commander |
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
272
|
+
type Mix = ApiClientFactory | Commander | Base;
|
|
273
|
+
type InvalidationResources = Record<string, Record<string, unknown>>;
|
|
274
|
+
type UnionToIntersection<U> = (U extends unknown ? (arg: U) => void : never) extends ((arg: infer I) => void) ? I : never;
|
|
275
|
+
type CommandInvalidationResources<Req> = Req extends {
|
|
276
|
+
readonly type: "command";
|
|
277
|
+
readonly "~invalidationResources"?: infer Resources;
|
|
278
|
+
} ? NonNullable<Resources> extends InvalidationResources ? NonNullable<Resources> : never : Req extends {
|
|
279
|
+
readonly type: "command";
|
|
280
|
+
readonly config?: infer Config;
|
|
281
|
+
} ? Config extends {
|
|
282
|
+
readonly invalidationResources?: infer LegacyResources;
|
|
283
|
+
} ? NonNullable<LegacyResources> extends InvalidationResources ? NonNullable<LegacyResources> : never : Config extends {
|
|
284
|
+
readonly invalidatesQueries?: InvalidationCallback<infer LegacyResources, any, any, any>;
|
|
285
|
+
} ? NonNullable<LegacyResources> extends InvalidationResources ? NonNullable<LegacyResources> : never : never : never;
|
|
286
|
+
type InvalidationResourcesForUnion<M extends RequestsAny> = {
|
|
287
|
+
[K in keyof M]: CommandInvalidationResources<M[K]>;
|
|
288
|
+
}[keyof M];
|
|
289
|
+
type InvalidationResourcesFor<M extends RequestsAny> = [InvalidationResourcesForUnion<M>] extends [never] ? never : UnionToIntersection<InvalidationResourcesForUnion<M>> extends infer R ? R extends InvalidationResources ? R : never : never;
|
|
290
|
+
type QueryInvalidationFactory<M extends RequestsAny> = (client: ClientFrom<M>) => QueryInvalidation<M>;
|
|
291
|
+
type StrictResourcesArg<Shape, Actual extends Shape = Shape> = Actual & Record<Exclude<keyof Actual, keyof Shape>, never>;
|
|
292
|
+
type ClientForArgs<M extends RequestsAny, Resources extends InvalidationResourcesFor<M> = InvalidationResourcesFor<M>> = [InvalidationResourcesFor<M>] extends [never] ? [
|
|
293
|
+
queryInvalidation?: QueryInvalidationFactory<M>,
|
|
294
|
+
invalidationResources?: StrictResourcesArg<InvalidationResourcesFor<M>, Resources>
|
|
295
|
+
] : [
|
|
296
|
+
queryInvalidation: QueryInvalidationFactory<M> | undefined,
|
|
297
|
+
invalidationResources: StrictResourcesArg<InvalidationResourcesFor<M>, Resources>
|
|
298
|
+
];
|
|
299
|
+
export declare const makeClient: <RT_, RTHooks>(getBaseMrt: () => ManagedRuntime.ManagedRuntime<RT_ | Mix, never>, clientFor_: ReturnType<typeof ApiClientFactory["makeFor"]>, rtHooks: Layer.Layer<RTHooks, never, Mix>, options?: MakeClientOptions) => {
|
|
300
|
+
Command: CommanderResolved<RT_ | Mix, RTHooks>;
|
|
301
|
+
useCommand: () => CommanderResolved<RT_ | Mix, RTHooks>;
|
|
302
|
+
clientFor: <M extends RequestsAny, Resources extends InvalidationResourcesFor<M> = InvalidationResourcesFor<M>>(m: M, ...args: ClientForArgs<M, Resources>) => { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>>]: RequestHandlers<never, never, M, ExtractModuleName<M>>[Key] & (QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? {} : QueryRequestWithExtensions<QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>> & Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>> & QueryProjection<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>) & (QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? {} : StreamQueries<RT_ | Mix, QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>) & (CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? {} : CommandRequestWithExtensions<RTHooks | (RT_ | Mix), CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>) & (CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? {} : {
|
|
303
|
+
mutate: MutationWithExtensions<RTHooks | (RT_ | Mix), CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>;
|
|
304
|
+
}) & (CommandStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? {} : {
|
|
305
|
+
fn: StreamFnStreamExtension<RTHooks | (RT_ | Mix), CommandStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>;
|
|
306
|
+
mutate: StreamMutation2WithExtensions<RTHooks | (RT_ | Mix), CommandStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>;
|
|
307
|
+
}) & {
|
|
308
|
+
Input: RequestHandlers<never, never, M, ExtractModuleName<M>>[Key] extends RequestStreamHandlerWithInput<infer I, any, any, any, any, any, any> ? I : RequestHandlers<never, never, M, ExtractModuleName<M>>[Key] extends RequestHandlerWithInput<infer I_1, any, any, any, any, any> ? I_1 : never;
|
|
309
|
+
}; } & {
|
|
310
|
+
helpers: { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}Request`]: CommandRequestWithExtensions<RTHooks | (RT_ | Mix), CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}Mutation`]: MutationWithExtensions<RTHooks | (RT_ | Mix), CommandHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}QueryFamily`]: Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["family"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}Query`]: Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["query"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}QueryNew`]: Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["queryNew"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}SuspenseQuery`]: Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["suspense"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}SuspenseQueryNew`]: Queries<RT_ | Mix, QueryHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["suspenseNew"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}QueryFamily`]: StreamQueries<RT_ | Mix, QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["family"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}Query`]: StreamQueries<RT_ | Mix, QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["query"]; } & { [Key in keyof RequestHandlers<never, never, M, ExtractModuleName<M>> as QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]> extends never ? never : `${ToCamel<string & Key>}QueryNew`]: StreamQueries<RT_ | Mix, QueryStreamHandler<RequestHandlers<never, never, M, ExtractModuleName<M>>[Key]>>["queryNew"]; };
|
|
411
311
|
};
|
|
412
|
-
|
|
312
|
+
tanstackQueryClient: import("@tanstack/vue-query").QueryClient;
|
|
413
313
|
};
|
|
414
|
-
export interface Legacy<R> extends Pick<QueryImpl<R>, "useQuery" | "useSuspenseQuery">, Omit<LegacyMutationImpl<R>, "getRuntime" | "toast" | "intl"> {
|
|
415
|
-
}
|
|
416
314
|
export type QueryInvalidation<M> = {
|
|
417
|
-
[K in keyof M]?: (defaultKey: string[], name: string) =>
|
|
418
|
-
filters?: InvalidateQueryFilters | undefined;
|
|
419
|
-
options?: InvalidateOptions | undefined;
|
|
420
|
-
}[];
|
|
315
|
+
[K in keyof M]?: (defaultKey: string[], name: string, input?: unknown, output?: Exit.Exit<unknown, unknown>) => InvalidationEntry[];
|
|
421
316
|
};
|
|
422
317
|
export type ToCamel<S extends string | number | symbol> = S extends string ? S extends `${infer Head}_${infer Tail}` ? `${Uncapitalize<Head>}${Capitalize<ToCamel<Tail>>}` : Uncapitalize<S> : never;
|
|
423
|
-
export interface CommandBase<I = void, A = void> {
|
|
318
|
+
export interface CommandBase<I = void, A = void, RA = unknown, RE = unknown> {
|
|
424
319
|
handle: (input: I) => A;
|
|
425
320
|
waiting: boolean;
|
|
426
321
|
blocked: boolean;
|
|
427
322
|
allowed: boolean;
|
|
428
323
|
action: string;
|
|
429
324
|
label: string;
|
|
325
|
+
/** formatted progress info for current `running` state, when `progress` was supplied */
|
|
326
|
+
progress?: Progress | undefined;
|
|
327
|
+
/** reactive result state, available on stream-backed commands */
|
|
328
|
+
result?: AsyncResult.AsyncResult<RA, RE>;
|
|
430
329
|
}
|
|
431
|
-
export interface EffectCommand<I = void, A = unknown, E = unknown> extends CommandBase<I, Fiber<A, E
|
|
330
|
+
export interface EffectCommand<I = void, A = unknown, E = unknown> extends CommandBase<I, Fiber<A, E>, A, E> {
|
|
432
331
|
}
|
|
433
|
-
export interface CommandFromRequest<I extends
|
|
332
|
+
export interface CommandFromRequest<I extends {
|
|
333
|
+
readonly make: (...args: any[]) => any;
|
|
334
|
+
}, A = unknown, E = unknown> extends EffectCommand<HandlerInput<I>, A, E> {
|
|
434
335
|
}
|
|
435
|
-
export {};
|
|
436
336
|
//# sourceMappingURL=makeClient.d.ts.map
|