@effect-app/vue 2.68.0 → 2.69.1
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 +12 -0
- package/dist/experimental/commander.d.ts +3 -3
- package/dist/experimental/makeUseCommand.d.ts +3 -3
- package/dist/makeClient.d.ts +329 -95
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +83 -5
- package/package.json +2 -1
- package/src/makeClient.ts +273 -7
- package/test/dist/stubs.d.ts +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -169,9 +169,9 @@ export declare namespace Commander {
|
|
|
169
169
|
type ErrorRenderer<E, Args extends readonly any[]> = (e: E, action: string, ...args: Args) => string | undefined;
|
|
170
170
|
export declare const CommanderStatic: {
|
|
171
171
|
/** Version of @see confirmOrInterrupt that automatically includes the action name in the default messages */
|
|
172
|
-
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never,
|
|
172
|
+
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, I18n | Confirm | CommandContext>;
|
|
173
173
|
/** Version of @see confirm that automatically includes the action name in the default messages */
|
|
174
|
-
confirm: (message?: string | undefined) => Effect.Effect<boolean, never,
|
|
174
|
+
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, I18n | Confirm | CommandContext>;
|
|
175
175
|
updateAction: <Args extends Array<unknown>>(update: (currentActionId: string, ...args: Args) => string) => <A, E, R>(_: Effect.Effect<A, E, R>, ...input: Args) => Effect.Effect<A, E, CommandContext | R>;
|
|
176
176
|
defaultFailureMessageHandler: <E, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: Option.Option<E>, ...args: Args) => string) | ((o: Option.Option<E>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: ErrorRenderer<E, Args>) => (o: Option.Option<E>, ...args: Args) => Effect.Effect<string | {
|
|
177
177
|
level: "warn";
|
|
@@ -183,7 +183,7 @@ export declare const CommanderStatic: {
|
|
|
183
183
|
errorRenderer?: ErrorRenderer<E, Args>;
|
|
184
184
|
onWaiting?: null | undefined | string | ((action: string, ...args: Args) => string | null | undefined);
|
|
185
185
|
onSuccess?: null | undefined | string | ((a: A, action: string, ...args: Args) => string | null | undefined);
|
|
186
|
-
}) => (self: Effect.Effect<A, E, R>, ...args: Args) => Effect.Effect<A, E, I18n |
|
|
186
|
+
}) => (self: Effect.Effect<A, E, R>, ...args: Args) => Effect.Effect<A, E, I18n | WithToast | CommandContext | R>;
|
|
187
187
|
};
|
|
188
188
|
declare const Commander_base: Effect.Service.Class<Commander, "Commander", {
|
|
189
189
|
readonly dependencies: readonly [import("effect/Layer").Layer<WithToast, never, import("./toast.js").Toast>, import("effect/Layer").Layer<Confirm, never, I18n>];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect-app";
|
|
2
2
|
import { Commander } from "./commander.js";
|
|
3
3
|
export declare const makeUseCommand: <R = never>() => Effect.Effect<{
|
|
4
|
-
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, import("./
|
|
5
|
-
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, import("./
|
|
4
|
+
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, import("./intl.js").I18n | import("./confirm.js").Confirm | import("./commander.js").CommandContext>;
|
|
5
|
+
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, import("./intl.js").I18n | import("./confirm.js").Confirm | import("./commander.js").CommandContext>;
|
|
6
6
|
updateAction: <Args extends Array<unknown>>(update: (currentActionId: string, ...args: Args) => string) => <A, E, R_1>(_: Effect.Effect<A, E, R_1>, ...input: Args) => Effect.Effect<A, E, import("./commander.js").CommandContext | R_1>;
|
|
7
7
|
defaultFailureMessageHandler: <E_1, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: import("effect/Option").Option<E_1>, ...args: Args) => string) | ((o: import("effect/Option").Option<E_1>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: (e: E_1, action: string, ...args: Args) => string | undefined) => (o: import("effect/Option").Option<E_1>, ...args: Args) => Effect.Effect<string | {
|
|
8
8
|
level: "warn";
|
|
@@ -13,7 +13,7 @@ export declare const makeUseCommand: <R = never>() => Effect.Effect<{
|
|
|
13
13
|
errorRenderer?: (e: E_1, action: string, ...args: Args_2) => string | undefined;
|
|
14
14
|
onWaiting?: null | undefined | string | ((action: string, ...args: Args_2) => string | null | undefined);
|
|
15
15
|
onSuccess?: null | undefined | string | ((a: A, action: string, ...args: Args_2) => string | null | undefined);
|
|
16
|
-
}) => (self: Effect.Effect<A, E_1, R_2>, ...args: Args_2) => Effect.Effect<A, E_1, import("./intl.js").I18n | import("./
|
|
16
|
+
}) => (self: Effect.Effect<A, E_1, R_2>, ...args: Args_2) => Effect.Effect<A, E_1, import("./intl.js").I18n | import("./withToast.js").WithToast | import("./commander.js").CommandContext | R_2>;
|
|
17
17
|
alt: <const Id extends string>(id: Id) => Commander.CommandContextLocal<Id> & (<Args_3 extends Array<unknown>, A, E_2, R_3 extends import("./commander.js").CommandContext | R>(handler: (...args: Args_3) => Effect.Effect<A, E_2, R_3>) => Commander.CommandOut<Args_3, A, E_2, R_3, Id>);
|
|
18
18
|
fn: <const Id extends string>(id: Id) => Commander.Gen<R, Id> & Commander.NonGen<R, Id>;
|
|
19
19
|
wrap: <const Id extends string, Args_3 extends Array<unknown>, A_1, E_3, R_4>(mutation: (((...args: Args_3) => Effect.Effect<A_1, E_3, R_4>) & {
|
package/dist/makeClient.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as Result from "@effect-atom/atom/Result";
|
|
2
|
-
import { type InitialDataFunction, type QueryObserverResult, type RefetchOptions, type UseQueryReturnType } from "@tanstack/vue-query";
|
|
2
|
+
import { type InitialDataFunction, type InvalidateOptions, type InvalidateQueryFilters, type QueryObserverResult, type RefetchOptions, type UseQueryReturnType } from "@tanstack/vue-query";
|
|
3
3
|
import { Cause, Effect, Exit, Layer, ManagedRuntime, Option, Runtime, S } from "effect-app";
|
|
4
|
-
import type { RequestHandler, RequestHandlerWithInput, TaggedRequestClassAny } from "effect-app/client/clientFor";
|
|
4
|
+
import type { RequestHandler, RequestHandlers, RequestHandlerWithInput, Requests, TaggedRequestClassAny } from "effect-app/client/clientFor";
|
|
5
5
|
import { ErrorSilenced, type SupportedErrors } from "effect-app/client/errors";
|
|
6
6
|
import { type OperationFailure } from "effect-app/Operations";
|
|
7
7
|
import type { Schema } from "effect-app/Schema";
|
|
8
|
+
import { type RuntimeFiber } from "effect/Fiber";
|
|
8
9
|
import { type ComputedRef, type Ref, type WatchSource } from "vue";
|
|
9
10
|
import { Commander } from "./experimental/commander.js";
|
|
10
11
|
import { I18n } from "./experimental/intl.js";
|
|
11
12
|
import { Toast } from "./experimental/toast.js";
|
|
12
13
|
import { type MutationOptions, type MutationOptionsBase, type Res } from "./mutate.js";
|
|
13
14
|
import { type CustomDefinedInitialQueryOptions, type CustomUndefinedInitialQueryOptions, type KnownFiberFailure } from "./query.js";
|
|
15
|
+
import { type ApiClientFactory } from "effect-app/client";
|
|
14
16
|
/**
|
|
15
17
|
* Use this after handling an error yourself, still continueing on the Error track, but the error will not be reported.
|
|
16
18
|
*/
|
|
@@ -138,117 +140,349 @@ declare const LegacyMutation_base: Effect.Service.Class<LegacyMutation, "LegacyM
|
|
|
138
140
|
export declare class LegacyMutation extends LegacyMutation_base {
|
|
139
141
|
}
|
|
140
142
|
type Base = I18n | Toast;
|
|
141
|
-
export declare const makeClient: <RT, RE, RL>(getBaseMrt: () => ManagedRuntime.ManagedRuntime<RT, never>, rootLayer: Layer.Layer<RL | Base, RE>) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}, state: Ref<Omit<From, "_tag">, Omit<From, "_tag">>, onSubmit: (a: To) => Effect.Effect<OnSubmitA, never, LegacyMutation | Base | RL>) => {
|
|
174
|
-
fields: { [K in keyof To]-?: {
|
|
175
|
-
true: {
|
|
176
|
-
true: To[K] extends {
|
|
177
|
-
_tag: string;
|
|
178
|
-
} ? 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]>[]>;
|
|
179
|
-
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
180
|
-
}[`${To[K] extends object ? true : false}`];
|
|
181
|
-
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
182
|
-
}[`${import("effect-app/utils").IsUnion<To[K]>}`]; };
|
|
183
|
-
/** optimized for Vuetify v-form submit callback */
|
|
184
|
-
submit: <T extends Promise<{
|
|
185
|
-
valid: boolean;
|
|
186
|
-
}>>(e: T) => Promise<OnSubmitA | undefined>;
|
|
187
|
-
/** optimized for Native form submit callback or general use */
|
|
188
|
-
submitFromState: Effect.Effect<OnSubmitA, S.ParseResult.ParseError, LegacyMutation | Base | RL>;
|
|
189
|
-
submitFromStatePromise: () => Promise<OnSubmitA>;
|
|
190
|
-
isDirty: Ref<boolean, boolean>;
|
|
191
|
-
isValid: Ref<boolean, boolean>;
|
|
192
|
-
isLoading: Ref<boolean, boolean>;
|
|
193
|
-
};
|
|
194
|
-
useSafeMutation: {
|
|
195
|
-
<I_1, E_7, A_12, R_12, Request_12 extends TaggedRequestClassAny, Name_12 extends string, A2_13 = A_12, E2_13 = E_7, R2_13 = R_12>(self: RequestHandlerWithInput<I_1, A_12, E_7, R_12, Request_12, Name_12>, options?: MutationOptions<A_12, E_7, R_12, A2_13, E2_13, R2_13, I_1> | undefined): readonly [ComputedRef<Result.Result<A2_13, E2_13>>, (i: I_1) => Effect.Effect<Exit.Exit<A2_13, E2_13>, never, R2_13>];
|
|
196
|
-
<E_8, A_13, R_13, Request_13 extends TaggedRequestClassAny, Name_13 extends string, A2_14 = A_13, E2_14 = E_8, R2_14 = R_13>(self: RequestHandler<A_13, E_8, R_13, Request_13, Name_13>, options?: MutationOptions<A_13, E_8, R_13, A2_14, E2_14, R2_14, void> | undefined): readonly [ComputedRef<Result.Result<A2_14, E2_14>>, Effect.Effect<Exit.Exit<A2_14, E2_14>, never, R2_14>];
|
|
197
|
-
};
|
|
198
|
-
useQuery: {
|
|
199
|
-
<E_8, A_14, Request_14 extends TaggedRequestClassAny, Name_14 extends string>(self: RequestHandler<A_14, E_8, RT, Request_14, Name_14>): {
|
|
200
|
-
<TData = A_14>(options: CustomDefinedInitialQueryOptions<A_14, KnownFiberFailure<E_8>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_8>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_14, KnownFiberFailure<E_8>>, never, never>, UseQueryReturnType<any, any>];
|
|
201
|
-
<TData = A_14>(options?: CustomUndefinedInitialQueryOptions<A_14, KnownFiberFailure<E_8>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_14, E_8>>, ComputedRef<A_14 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_14, KnownFiberFailure<E_8>>, never, never>, UseQueryReturnType<any, any>];
|
|
202
|
-
};
|
|
203
|
-
<Arg, E_8, A_15, Request_15 extends TaggedRequestClassAny, Name_15 extends string>(self: RequestHandlerWithInput<Arg, A_15, E_8, RT, Request_15, Name_15>): {
|
|
204
|
-
<TData = A_15>(arg: Arg | WatchSource<Arg>, options: CustomDefinedInitialQueryOptions<A_15, KnownFiberFailure<E_8>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_8>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_15, KnownFiberFailure<E_8>>, never, never>, UseQueryReturnType<any, any>];
|
|
205
|
-
<TData = A_15>(arg: Arg | WatchSource<Arg>, options?: CustomUndefinedInitialQueryOptions<A_15, KnownFiberFailure<E_8>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_15, E_8>>, ComputedRef<A_15 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_15, KnownFiberFailure<E_8>>, never, never>, UseQueryReturnType<any, any>];
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
|
-
useSuspenseQuery: {
|
|
209
|
-
<E_9, A_16, Request_16 extends TaggedRequestClassAny, Name_16 extends string>(self: RequestHandler<A_16, E_9, RT, Request_16, Name_16>): {
|
|
210
|
-
<TData = A_16>(options?: CustomUndefinedInitialQueryOptions<A_16, E_9, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
211
|
-
<TData = A_16>(options?: (CustomDefinedInitialQueryOptions<A_16, E_9, TData, readonly unknown[]> & {
|
|
212
|
-
initialData: TData | InitialDataFunction<TData>;
|
|
213
|
-
}) | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
214
|
-
};
|
|
215
|
-
<Arg, E_9, A_17, Request_17 extends TaggedRequestClassAny, Name_17 extends string>(self: RequestHandlerWithInput<Arg, A_17, E_9, RT, Request_17, Name_17>): {
|
|
216
|
-
<TData = A_17>(arg: Arg | WatchSource<Arg>, options?: CustomDefinedInitialQueryOptions<A_17, E_9, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
217
|
-
<TData = A_17>(arg: Arg | WatchSource<Arg>, options?: CustomUndefinedInitialQueryOptions<A_17, E_9, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
218
|
-
};
|
|
143
|
+
export declare const makeClient: <RT, RE, RL>(getBaseMrt: () => ManagedRuntime.ManagedRuntime<RT | ApiClientFactory, never>, rootLayer: Layer.Layer<RL | Base, RE>, clientFor_: ReturnType<(typeof ApiClientFactory)["makeFor"]>) => {
|
|
144
|
+
Command: {
|
|
145
|
+
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, I18n | import("./experimental/confirm.js").Confirm | import("./experimental/commander.js").CommandContext>;
|
|
146
|
+
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, I18n | import("./experimental/confirm.js").Confirm | import("./experimental/commander.js").CommandContext>;
|
|
147
|
+
updateAction: <Args extends Array<unknown>>(update: (currentActionId: string, ...args: Args) => string) => <A, E, R>(_: Effect.Effect<A, E, R>, ...input: Args) => Effect.Effect<A, E, import("./experimental/commander.js").CommandContext | R>;
|
|
148
|
+
defaultFailureMessageHandler: <E_1, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: Option.Option<E_1>, ...args: Args) => string) | ((o: Option.Option<E_1>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: (e: E_1, action: string, ...args: Args) => string | undefined) => (o: Option.Option<E_1>, ...args: Args) => Effect.Effect<string | {
|
|
149
|
+
level: "warn";
|
|
150
|
+
message: string;
|
|
151
|
+
}, AME, I18n | AMR>;
|
|
152
|
+
renderError: Effect.Effect<(<E_1, Args_1 extends readonly any[]>(action: string, errorRenderer?: (e: E_1, action: string, ...args: Args_1) => string | undefined) => (e: E_1, ...args: Args_1) => string), never, I18n>;
|
|
153
|
+
withDefaultToast: <A, E_1, R_1, Args_2 extends Array<unknown>>(options?: {
|
|
154
|
+
errorRenderer?: (e: E_1, action: string, ...args: Args_2) => string | undefined;
|
|
155
|
+
onWaiting?: null | undefined | string | ((action: string, ...args: Args_2) => string | null | undefined);
|
|
156
|
+
onSuccess?: null | undefined | string | ((a: A, action: string, ...args: Args_2) => string | null | undefined);
|
|
157
|
+
}) => (self: Effect.Effect<A, E_1, R_1>, ...args: Args_2) => Effect.Effect<A, E_1, I18n | import("./experimental/withToast.js").WithToast | import("./experimental/commander.js").CommandContext | R_1>;
|
|
158
|
+
alt: <const Id extends string>(id: Id) => Commander.CommandContextLocal<Id> & (<Args_3 extends Array<unknown>, A, E_2, R_2 extends I18n | Toast | RL | import("./experimental/commander.js").CommandContext>(handler: (...args: Args_3) => Effect.Effect<A, E_2, R_2>) => Commander.CommandOut<Args_3, A, E_2, R_2, Id>);
|
|
159
|
+
fn: <const Id extends string>(id: Id) => Commander.Gen<I18n | Toast | RL, Id> & Commander.NonGen<I18n | Toast | RL, Id>;
|
|
160
|
+
wrap: <const Id extends string, Args_3 extends Array<unknown>, A_1, E_3, R_3>(mutation: (((...args: Args_3) => Effect.Effect<A_1, E_3, R_3>) & {
|
|
161
|
+
id: Id;
|
|
162
|
+
}) | {
|
|
163
|
+
mutate: (...args: Args_3) => Effect.Effect<A_1, E_3, R_3>;
|
|
164
|
+
id: Id;
|
|
165
|
+
}) => Commander.CommandContextLocal<Id> & Commander.GenWrap<I18n | Toast | RL, Id, Args_3, A_1, E_3, R_3> & Commander.NonGenWrap<I18n | Toast | RL, Id, Args_3, A_1, E_3, R_3>;
|
|
166
|
+
alt2: <const Id extends string, MutArgs extends Array<unknown>, MutA, MutE, MutR>(id: Id | (((...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>) & {
|
|
167
|
+
id: Id;
|
|
168
|
+
}) | {
|
|
169
|
+
id: Id;
|
|
170
|
+
mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>;
|
|
171
|
+
}) => Commander.CommandContextLocal<Id> & (<Args_4 extends Array<unknown>, A_2, E_4, R_4 extends I18n | Toast | RL | import("./experimental/commander.js").CommandContext>(handler: (ctx: Effect.fn.Gen & Effect.fn.NonGen & Commander.CommandContextLocal<Id> & {
|
|
172
|
+
mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>;
|
|
173
|
+
}) => (...args: Args_4) => Effect.Effect<A_2, E_4, R_4>) => Commander.CommandOut<Args_4, A_2, E_4, R_4, Id>);
|
|
174
|
+
_tag: "Commander";
|
|
219
175
|
};
|
|
220
176
|
useCommand: () => {
|
|
221
|
-
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, import("./experimental/confirm.js").Confirm |
|
|
222
|
-
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, import("./experimental/confirm.js").Confirm |
|
|
223
|
-
updateAction: <
|
|
224
|
-
defaultFailureMessageHandler: <
|
|
177
|
+
confirmOrInterrupt: (message?: string | undefined) => Effect.Effect<void, never, I18n | import("./experimental/confirm.js").Confirm | import("./experimental/commander.js").CommandContext>;
|
|
178
|
+
confirm: (message?: string | undefined) => Effect.Effect<boolean, never, I18n | import("./experimental/confirm.js").Confirm | import("./experimental/commander.js").CommandContext>;
|
|
179
|
+
updateAction: <Args_4 extends Array<unknown>>(update: (currentActionId: string, ...args: Args_4) => string) => <A_3, E, R>(_: Effect.Effect<A_3, E, R>, ...input: Args_4) => Effect.Effect<A_3, E, import("./experimental/commander.js").CommandContext | R>;
|
|
180
|
+
defaultFailureMessageHandler: <E_5, Args extends Array<unknown>, AME, AMR>(actionMaker: string | ((o: Option.Option<E_5>, ...args: Args) => string) | ((o: Option.Option<E_5>, ...args: Args) => Effect.Effect<string, AME, AMR>), errorRenderer?: (e: E_5, action: string, ...args: Args) => string | undefined) => (o: Option.Option<E_5>, ...args: Args) => Effect.Effect<string | {
|
|
225
181
|
level: "warn";
|
|
226
182
|
message: string;
|
|
227
183
|
}, AME, I18n | AMR>;
|
|
228
|
-
renderError: Effect.Effect<(<
|
|
229
|
-
withDefaultToast: <
|
|
230
|
-
errorRenderer?: (e:
|
|
184
|
+
renderError: Effect.Effect<(<E_5, Args_1 extends readonly any[]>(action: string, errorRenderer?: (e: E_5, action: string, ...args: Args_1) => string | undefined) => (e: E_5, ...args: Args_1) => string), never, I18n>;
|
|
185
|
+
withDefaultToast: <A_3, E_1, R_1, Args_2 extends Array<unknown>>(options?: {
|
|
186
|
+
errorRenderer?: (e: E_1, action: string, ...args: Args_2) => string | undefined;
|
|
231
187
|
onWaiting?: null | undefined | string | ((action: string, ...args: Args_2) => string | null | undefined);
|
|
232
|
-
onSuccess?: null | undefined | string | ((a:
|
|
233
|
-
}) => (self: Effect.Effect<
|
|
234
|
-
alt: <const Id extends string>(id: Id) => Commander.CommandContextLocal<Id> & (<
|
|
188
|
+
onSuccess?: null | undefined | string | ((a: A_3, action: string, ...args: Args_2) => string | null | undefined);
|
|
189
|
+
}) => (self: Effect.Effect<A_3, E_1, R_1>, ...args: Args_2) => Effect.Effect<A_3, E_1, I18n | import("./experimental/withToast.js").WithToast | import("./experimental/commander.js").CommandContext | R_1>;
|
|
190
|
+
alt: <const Id extends string>(id: Id) => Commander.CommandContextLocal<Id> & (<Args_4 extends Array<unknown>, A, E_2, R_2 extends I18n | Toast | RL | import("./experimental/commander.js").CommandContext>(handler: (...args: Args_4) => Effect.Effect<A, E_2, R_2>) => Commander.CommandOut<Args_4, A, E_2, R_2, Id>);
|
|
235
191
|
fn: <const Id extends string>(id: Id) => Commander.Gen<I18n | Toast | RL, Id> & Commander.NonGen<I18n | Toast | RL, Id>;
|
|
236
|
-
wrap: <const Id extends string, Args_3 extends Array<unknown>,
|
|
192
|
+
wrap: <const Id extends string, Args_3 extends Array<unknown>, A_1, E_3, R_3>(mutation: (((...args: Args_3) => Effect.Effect<A_1, E_3, R_3>) & {
|
|
237
193
|
id: Id;
|
|
238
194
|
}) | {
|
|
239
|
-
mutate: (...args: Args_3) => Effect.Effect<
|
|
195
|
+
mutate: (...args: Args_3) => Effect.Effect<A_1, E_3, R_3>;
|
|
240
196
|
id: Id;
|
|
241
|
-
}) => Commander.CommandContextLocal<Id> & Commander.GenWrap<I18n | Toast | RL, Id, Args_3,
|
|
197
|
+
}) => Commander.CommandContextLocal<Id> & Commander.GenWrap<I18n | Toast | RL, Id, Args_3, A_1, E_3, R_3> & Commander.NonGenWrap<I18n | Toast | RL, Id, Args_3, A_1, E_3, R_3>;
|
|
242
198
|
alt2: <const Id extends string, MutArgs extends Array<unknown>, MutA, MutE, MutR>(id: Id | (((...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>) & {
|
|
243
199
|
id: Id;
|
|
244
200
|
}) | {
|
|
245
201
|
id: Id;
|
|
246
202
|
mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>;
|
|
247
|
-
}) => Commander.CommandContextLocal<Id> & (<Args_4 extends Array<unknown>,
|
|
203
|
+
}) => Commander.CommandContextLocal<Id> & (<Args_4 extends Array<unknown>, A_2, E_4, R_4 extends I18n | Toast | RL | import("./experimental/commander.js").CommandContext>(handler: (ctx: Effect.fn.Gen & Effect.fn.NonGen & Commander.CommandContextLocal<Id> & {
|
|
248
204
|
mutate: (...args: MutArgs) => Effect.Effect<MutA, MutE, MutR>;
|
|
249
|
-
}) => (...args: Args_4) => Effect.Effect<
|
|
205
|
+
}) => (...args: Args_4) => Effect.Effect<A_2, E_4, R_4>) => Commander.CommandOut<Args_4, A_2, E_4, R_4, Id>);
|
|
250
206
|
_tag: "Commander";
|
|
251
207
|
};
|
|
208
|
+
clientFor: <M extends Requests>(m: M, queryInvalidation?: QueryInvalidation<M>) => { [Key in keyof RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>]: (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer _I, infer _A, infer _E, infer _R, infer _Request extends Schema.Any & {
|
|
209
|
+
readonly _tag: string;
|
|
210
|
+
readonly success: any;
|
|
211
|
+
readonly failure: any;
|
|
212
|
+
}, infer Id extends string> ? Commander.CommandContextLocal<Id> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer _A_1, infer _E_1, infer _R_1, infer _Request_1 extends Schema.Any & {
|
|
213
|
+
readonly _tag: string;
|
|
214
|
+
readonly success: any;
|
|
215
|
+
readonly failure: any;
|
|
216
|
+
}, infer Id_1 extends string> ? Commander.CommandContextLocal<Id_1> : never) & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer _I_1, infer _A_2, infer _E_2, infer _R_2, infer _Request_2 extends Schema.Any & {
|
|
217
|
+
readonly _tag: string;
|
|
218
|
+
readonly success: any;
|
|
219
|
+
readonly failure: any;
|
|
220
|
+
}, infer Id_2 extends string> ? Commander.CommandContextLocal<Id_2> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer _A_3, infer _E_3, infer _R_3, infer _Request_3 extends Schema.Any & {
|
|
221
|
+
readonly _tag: string;
|
|
222
|
+
readonly success: any;
|
|
223
|
+
readonly failure: any;
|
|
224
|
+
}, infer Id_3 extends string> ? Commander.CommandContextLocal<Id_3> : never) & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer I, infer A_3, infer E_5, infer R_5, infer Request extends Schema.Any & {
|
|
225
|
+
readonly _tag: string;
|
|
226
|
+
readonly success: any;
|
|
227
|
+
readonly failure: any;
|
|
228
|
+
}, infer Id_4 extends string> ? ((i: I) => Effect.Effect<A_3, E_5, R_5>) & {
|
|
229
|
+
readonly id: Id_4;
|
|
230
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer A_4, infer E_6, infer R_6, infer Request_1 extends Schema.Any & {
|
|
231
|
+
readonly _tag: string;
|
|
232
|
+
readonly success: any;
|
|
233
|
+
readonly failure: any;
|
|
234
|
+
}, infer Id_5 extends string> ? Effect.Effect<A_4, E_6, R_6> & {
|
|
235
|
+
readonly id: Id_5;
|
|
236
|
+
} : never) & {
|
|
237
|
+
wrap: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer I_1, infer A_5, infer E_7, infer _R_4, infer _Request_4 extends Schema.Any & {
|
|
238
|
+
readonly _tag: string;
|
|
239
|
+
readonly success: any;
|
|
240
|
+
readonly failure: any;
|
|
241
|
+
}, infer Id_6 extends string> ? Commander.CommandContextLocal<Id_6> & Commander.GenWrap<I18n | Toast | RL, Id_6, [I_1], A_5, E_7, never> & Commander.NonGenWrap<I18n | Toast | RL, Id_6, [I_1], A_5, E_7, never> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer A_6, infer E_8, infer _R_5, infer _Request_5 extends Schema.Any & {
|
|
242
|
+
readonly _tag: string;
|
|
243
|
+
readonly success: any;
|
|
244
|
+
readonly failure: any;
|
|
245
|
+
}, infer Id_7 extends string> ? Commander.CommandContextLocal<Id_7> & Commander.GenWrap<I18n | Toast | RL, Id_7, [], A_6, E_8, never> & Commander.NonGenWrap<I18n | Toast | RL, Id_7, [], A_6, E_8, never> : never;
|
|
246
|
+
fn: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer _I_2, infer _A_4, infer _E_4, infer _R_6, infer _Request_6 extends Schema.Any & {
|
|
247
|
+
readonly _tag: string;
|
|
248
|
+
readonly success: any;
|
|
249
|
+
readonly failure: any;
|
|
250
|
+
}, infer Id_8 extends string> ? Commander.Gen<I18n | Toast | RL, Id_8> & Commander.NonGen<I18n | Toast | RL, Id_8> & Commander.CommandContextLocal<Id_8> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer _A_5, infer _E_5, infer _R_7, infer _Request_7 extends Schema.Any & {
|
|
251
|
+
readonly _tag: string;
|
|
252
|
+
readonly success: any;
|
|
253
|
+
readonly failure: any;
|
|
254
|
+
}, infer Id_9 extends string> ? Commander.Gen<I18n | Toast | RL, Id_9> & Commander.NonGen<I18n | Toast | RL, Id_9> & Commander.CommandContextLocal<Id_9> : never;
|
|
255
|
+
} & RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] & {
|
|
256
|
+
query: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer I_2, infer A_7, infer E_9, infer _R_8, infer Request_2 extends Schema.Any & {
|
|
257
|
+
readonly _tag: string;
|
|
258
|
+
readonly success: any;
|
|
259
|
+
readonly failure: any;
|
|
260
|
+
}, infer Id_10 extends string> ? {
|
|
261
|
+
<TData = A_7>(arg: I_2 | WatchSource<I_2>, options: CustomDefinedInitialQueryOptions<A_7, KnownFiberFailure<E_9>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_7, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
262
|
+
<TData = A_7>(arg: I_2 | WatchSource<I_2>, options?: CustomUndefinedInitialQueryOptions<A_7, KnownFiberFailure<E_9>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_7, E_9>>, ComputedRef<A_7 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_7, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
263
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer A_8, infer E_10, infer _R_9, infer Request_3 extends Schema.Any & {
|
|
264
|
+
readonly _tag: string;
|
|
265
|
+
readonly success: any;
|
|
266
|
+
readonly failure: any;
|
|
267
|
+
}, infer Id_11 extends string> ? {
|
|
268
|
+
<TData = A_8>(options: CustomDefinedInitialQueryOptions<A_8, KnownFiberFailure<E_10>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_10>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_8, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>];
|
|
269
|
+
<TData = A_8>(options?: CustomUndefinedInitialQueryOptions<A_8, KnownFiberFailure<E_10>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_8, E_10>>, ComputedRef<A_8 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_8, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>];
|
|
270
|
+
} : never;
|
|
271
|
+
suspense: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandlerWithInput<infer I_3, infer A_9, infer E_11, infer _R_10, infer Request_4 extends Schema.Any & {
|
|
272
|
+
readonly _tag: string;
|
|
273
|
+
readonly success: any;
|
|
274
|
+
readonly failure: any;
|
|
275
|
+
}, infer Id_12 extends string> ? {
|
|
276
|
+
<TData = A_9>(arg: I_3 | WatchSource<I_3>, options?: CustomDefinedInitialQueryOptions<A_9, E_11, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_11>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_11>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
277
|
+
<TData = A_9>(arg: I_3 | WatchSource<I_3>, options?: CustomUndefinedInitialQueryOptions<A_9, E_11, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_11>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_11>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
278
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key] extends RequestHandler<infer A_10, infer E_12, infer _R_11, infer Request_5 extends Schema.Any & {
|
|
279
|
+
readonly _tag: string;
|
|
280
|
+
readonly success: any;
|
|
281
|
+
readonly failure: any;
|
|
282
|
+
}, infer Id_13 extends string> ? {
|
|
283
|
+
<TData = A_10>(options?: CustomUndefinedInitialQueryOptions<A_10, E_12, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_12>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_12>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
284
|
+
<TData = A_10>(options?: (CustomDefinedInitialQueryOptions<A_10, E_12, TData, readonly unknown[]> & {
|
|
285
|
+
initialData: TData | InitialDataFunction<TData>;
|
|
286
|
+
}) | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_12>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_12>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
287
|
+
} : never;
|
|
288
|
+
}; } & {
|
|
289
|
+
helpers: { [Key_1 in keyof RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]> as `${ToCamel<string & Key_1>}Mutation`]: (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer I, infer A_3, infer E_5, infer R_5, infer Request extends Schema.Any & {
|
|
290
|
+
readonly _tag: string;
|
|
291
|
+
readonly success: any;
|
|
292
|
+
readonly failure: any;
|
|
293
|
+
}, infer Id extends string> ? ((i: I) => Effect.Effect<A_3, E_5, R_5>) & {
|
|
294
|
+
readonly id: Id;
|
|
295
|
+
} & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer _I, infer _A, infer _E, infer _R, infer _Request extends Schema.Any & {
|
|
296
|
+
readonly _tag: string;
|
|
297
|
+
readonly success: any;
|
|
298
|
+
readonly failure: any;
|
|
299
|
+
}, infer Id_1 extends string> ? Commander.CommandContextLocal<Id_1> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer _A_1, infer _E_1, infer _R_1, infer _Request_1 extends Schema.Any & {
|
|
300
|
+
readonly _tag: string;
|
|
301
|
+
readonly success: any;
|
|
302
|
+
readonly failure: any;
|
|
303
|
+
}, infer Id_2 extends string> ? Commander.CommandContextLocal<Id_2> : never) : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer A_4, infer E_6, infer R_6, infer Request_1 extends Schema.Any & {
|
|
304
|
+
readonly _tag: string;
|
|
305
|
+
readonly success: any;
|
|
306
|
+
readonly failure: any;
|
|
307
|
+
}, infer Id_3 extends string> ? Effect.Effect<A_4, E_6, R_6> & {
|
|
308
|
+
readonly id: Id_3;
|
|
309
|
+
} & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer _I_1, infer _A_2, infer _E_2, infer _R_2, infer _Request_2 extends Schema.Any & {
|
|
310
|
+
readonly _tag: string;
|
|
311
|
+
readonly success: any;
|
|
312
|
+
readonly failure: any;
|
|
313
|
+
}, infer Id_4 extends string> ? Commander.CommandContextLocal<Id_4> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer _A_3, infer _E_3, infer _R_3, infer _Request_3 extends Schema.Any & {
|
|
314
|
+
readonly _tag: string;
|
|
315
|
+
readonly success: any;
|
|
316
|
+
readonly failure: any;
|
|
317
|
+
}, infer Id_5 extends string> ? Commander.CommandContextLocal<Id_5> : never) : never) & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer _I_2, infer _A_4, infer _E_4, infer _R_4, infer _Request_4 extends Schema.Any & {
|
|
318
|
+
readonly _tag: string;
|
|
319
|
+
readonly success: any;
|
|
320
|
+
readonly failure: any;
|
|
321
|
+
}, infer Id_6 extends string> ? Commander.CommandContextLocal<Id_6> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer _A_5, infer _E_5, infer _R_5, infer _Request_5 extends Schema.Any & {
|
|
322
|
+
readonly _tag: string;
|
|
323
|
+
readonly success: any;
|
|
324
|
+
readonly failure: any;
|
|
325
|
+
}, infer Id_7 extends string> ? Commander.CommandContextLocal<Id_7> : never) & (RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer I_1, infer A_5, infer E_7, infer R_7, infer Request_2 extends Schema.Any & {
|
|
326
|
+
readonly _tag: string;
|
|
327
|
+
readonly success: any;
|
|
328
|
+
readonly failure: any;
|
|
329
|
+
}, infer Id_8 extends string> ? ((i: I_1) => Effect.Effect<A_5, E_7, R_7>) & {
|
|
330
|
+
readonly id: Id_8;
|
|
331
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer A_6, infer E_8, infer R_8, infer Request_3 extends Schema.Any & {
|
|
332
|
+
readonly _tag: string;
|
|
333
|
+
readonly success: any;
|
|
334
|
+
readonly failure: any;
|
|
335
|
+
}, infer Id_9 extends string> ? Effect.Effect<A_6, E_8, R_8> & {
|
|
336
|
+
readonly id: Id_9;
|
|
337
|
+
} : never) & {
|
|
338
|
+
wrap: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer I_2, infer A_7, infer E_9, infer _R_6, infer _Request_6 extends Schema.Any & {
|
|
339
|
+
readonly _tag: string;
|
|
340
|
+
readonly success: any;
|
|
341
|
+
readonly failure: any;
|
|
342
|
+
}, infer Id_10 extends string> ? Commander.CommandContextLocal<Id_10> & Commander.GenWrap<I18n | Toast | RL, Id_10, [I_2], A_7, E_9, never> & Commander.NonGenWrap<I18n | Toast | RL, Id_10, [I_2], A_7, E_9, never> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer A_8, infer E_10, infer _R_7, infer _Request_7 extends Schema.Any & {
|
|
343
|
+
readonly _tag: string;
|
|
344
|
+
readonly success: any;
|
|
345
|
+
readonly failure: any;
|
|
346
|
+
}, infer Id_11 extends string> ? Commander.CommandContextLocal<Id_11> & Commander.GenWrap<I18n | Toast | RL, Id_11, [], A_8, E_10, never> & Commander.NonGenWrap<I18n | Toast | RL, Id_11, [], A_8, E_10, never> : never;
|
|
347
|
+
fn: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandlerWithInput<infer _I_3, infer _A_6, infer _E_6, infer _R_8, infer _Request_8 extends Schema.Any & {
|
|
348
|
+
readonly _tag: string;
|
|
349
|
+
readonly success: any;
|
|
350
|
+
readonly failure: any;
|
|
351
|
+
}, infer Id_12 extends string> ? Commander.Gen<I18n | Toast | RL, Id_12> & Commander.NonGen<I18n | Toast | RL, Id_12> & Commander.CommandContextLocal<Id_12> : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_1] extends RequestHandler<infer _A_7, infer _E_7, infer _R_9, infer _Request_9 extends Schema.Any & {
|
|
352
|
+
readonly _tag: string;
|
|
353
|
+
readonly success: any;
|
|
354
|
+
readonly failure: any;
|
|
355
|
+
}, infer Id_13 extends string> ? Commander.Gen<I18n | Toast | RL, Id_13> & Commander.NonGen<I18n | Toast | RL, Id_13> & Commander.CommandContextLocal<Id_13> : never;
|
|
356
|
+
}; } & { [Key_2 in keyof RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]> as `${ToCamel<string & Key_2>}Query`]: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_2] extends RequestHandlerWithInput<infer I, infer A_3, infer E_5, infer _R, infer Request extends Schema.Any & {
|
|
357
|
+
readonly _tag: string;
|
|
358
|
+
readonly success: any;
|
|
359
|
+
readonly failure: any;
|
|
360
|
+
}, infer Id extends string> ? {
|
|
361
|
+
<TData = A_3>(arg: I | WatchSource<I>, options: CustomDefinedInitialQueryOptions<A_3, KnownFiberFailure<E_5>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_5>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_3, KnownFiberFailure<E_5>>, never, never>, UseQueryReturnType<any, any>];
|
|
362
|
+
<TData = A_3>(arg: I | WatchSource<I>, options?: CustomUndefinedInitialQueryOptions<A_3, KnownFiberFailure<E_5>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_3, E_5>>, ComputedRef<A_3 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_3, KnownFiberFailure<E_5>>, never, never>, UseQueryReturnType<any, any>];
|
|
363
|
+
} & {
|
|
364
|
+
id: Id;
|
|
365
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_2] extends RequestHandler<infer A_4, infer E_6, infer _R_1, infer Request_1 extends Schema.Any & {
|
|
366
|
+
readonly _tag: string;
|
|
367
|
+
readonly success: any;
|
|
368
|
+
readonly failure: any;
|
|
369
|
+
}, infer Id_1 extends string> ? {
|
|
370
|
+
<TData = A_4>(options: CustomDefinedInitialQueryOptions<A_4, KnownFiberFailure<E_6>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_6>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_4, KnownFiberFailure<E_6>>, never, never>, UseQueryReturnType<any, any>];
|
|
371
|
+
<TData = A_4>(options?: CustomUndefinedInitialQueryOptions<A_4, KnownFiberFailure<E_6>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_4, E_6>>, ComputedRef<A_4 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_4, KnownFiberFailure<E_6>>, never, never>, UseQueryReturnType<any, any>];
|
|
372
|
+
} & {
|
|
373
|
+
id: Id_1;
|
|
374
|
+
} : never; } & { [Key_3 in keyof RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]> as `${ToCamel<string & Key_3>}SuspenseQuery`]: RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_3] extends RequestHandlerWithInput<infer I, infer A_3, infer E_5, infer _R, infer Request extends Schema.Any & {
|
|
375
|
+
readonly _tag: string;
|
|
376
|
+
readonly success: any;
|
|
377
|
+
readonly failure: any;
|
|
378
|
+
}, infer Id extends string> ? {
|
|
379
|
+
<TData = A_3>(arg: I | WatchSource<I>, options?: CustomDefinedInitialQueryOptions<A_3, E_5, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_5>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_5>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
380
|
+
<TData = A_3>(arg: I | WatchSource<I>, options?: CustomUndefinedInitialQueryOptions<A_3, E_5, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_5>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_5>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
381
|
+
} & {
|
|
382
|
+
id: Id;
|
|
383
|
+
} : RequestHandlers<never, never, Omit<M, "meta">, M["meta"]["moduleName"]>[Key_3] extends RequestHandler<infer A_4, infer E_6, infer _R_1, infer Request_1 extends Schema.Any & {
|
|
384
|
+
readonly _tag: string;
|
|
385
|
+
readonly success: any;
|
|
386
|
+
readonly failure: any;
|
|
387
|
+
}, infer Id_1 extends string> ? {
|
|
388
|
+
<TData = A_4>(options?: CustomUndefinedInitialQueryOptions<A_4, E_6, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_6>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_6>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
389
|
+
<TData = A_4>(options?: (CustomDefinedInitialQueryOptions<A_4, E_6, TData, readonly unknown[]> & {
|
|
390
|
+
initialData: TData | InitialDataFunction<TData>;
|
|
391
|
+
}) | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_6>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_6>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
392
|
+
} & {
|
|
393
|
+
id: Id_1;
|
|
394
|
+
} : never; };
|
|
395
|
+
};
|
|
396
|
+
legacy: {
|
|
397
|
+
/** @deprecated use OmegaForm */
|
|
398
|
+
buildFormFromSchema: <From extends Record<PropertyKey, any>, To extends Record<PropertyKey, any>, C extends Record<PropertyKey, any>, OnSubmitA>(s: S.Schema<To, From, LegacyMutation | RL | Base> & {
|
|
399
|
+
new (c: C): any;
|
|
400
|
+
extend: any;
|
|
401
|
+
fields: S.Struct.Fields;
|
|
402
|
+
}, state: Ref<Omit<From, "_tag">, Omit<From, "_tag">>, onSubmit: (a: To) => Effect.Effect<OnSubmitA, never, LegacyMutation | RL | Base>) => {
|
|
403
|
+
fields: { [K in keyof To]-?: {
|
|
404
|
+
true: {
|
|
405
|
+
true: To[K] extends {
|
|
406
|
+
_tag: string;
|
|
407
|
+
} ? 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]>[]>;
|
|
408
|
+
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
409
|
+
}[`${To[K] extends object ? true : false}`];
|
|
410
|
+
false: import("./form.js").NestedFieldInfoKey<To[K]>;
|
|
411
|
+
}[`${import("effect-app/utils").IsUnion<To[K]>}`]; };
|
|
412
|
+
/** optimized for Vuetify v-form submit callback */
|
|
413
|
+
submit: <T extends Promise<{
|
|
414
|
+
valid: boolean;
|
|
415
|
+
}>>(e: T) => Promise<OnSubmitA | undefined>;
|
|
416
|
+
/** optimized for Native form submit callback or general use */
|
|
417
|
+
submitFromState: Effect.Effect<OnSubmitA, S.ParseResult.ParseError, LegacyMutation | RL | Base>;
|
|
418
|
+
submitFromStatePromise: () => Promise<OnSubmitA>;
|
|
419
|
+
isDirty: Ref<boolean, boolean>;
|
|
420
|
+
isValid: Ref<boolean, boolean>;
|
|
421
|
+
isLoading: Ref<boolean, boolean>;
|
|
422
|
+
};
|
|
423
|
+
/** @deprecated use Command pattern */
|
|
424
|
+
makeUseAndHandleMutation: (defaultOptions?: Opts<any, any, any, any, any, any, any, any, any>) => {
|
|
425
|
+
<I, E_5 extends ResponseErrors, A_3, R_5, Request extends TaggedRequestClassAny, Name extends string, A2 = A_3, E2 extends ResponseErrors = E_5, R2 = R_5, ESuccess = never, RSuccess = never, EError = never, RError = never, EDefect = never, RDefect = never>(self: RequestHandlerWithInput<I, A_3, E_5, R_5, Request, Name>, action: string, options?: Opts<A_3, E_5, R_5, I, A2, E2, R2, ESuccess, RSuccess, EError, RError, EDefect, RDefect> | undefined): Resp<I, A2, E2, R2, ComputedRef<Res<A2, E2>>>;
|
|
426
|
+
<E_6 extends ResponseErrors, A_4, Request_1 extends TaggedRequestClassAny, Name_1 extends string, A2_1 = A_4, E2_1 extends ResponseErrors = E_6, R2_1 = LegacyMutation | RL | Base, ESuccess_1 = never, RSuccess_1 = never, EError_1 = never, RError_1 = never, EDefect_1 = never, RDefect_1 = never>(self: RequestHandler<A_4, E_6, LegacyMutation | RL | Base, Request_1, Name_1>, action: string, options?: Opts<A_4, E_6, LegacyMutation | RL | Base, void, A2_1, E2_1, R2_1, ESuccess_1, RSuccess_1, EError_1, RError_1, EDefect_1, RDefect_1> | undefined): ActResp<A2_1, E2_1, R2_1, ComputedRef<Res<A2_1, E2_1>>>;
|
|
427
|
+
};
|
|
428
|
+
/** @deprecated use Command pattern */
|
|
429
|
+
useAndHandleMutation: {
|
|
430
|
+
<I, E_6 extends ResponseErrors, A_5, R_6, Request_2 extends TaggedRequestClassAny, Name_2 extends string, A2_2 = A_5, E2_2 extends ResponseErrors = E_6, R2_2 = R_6, ESuccess_2 = never, RSuccess_2 = never, EError_2 = never, RError_2 = never, EDefect_2 = never, RDefect_2 = never>(self: RequestHandlerWithInput<I, A_5, E_6, R_6, Request_2, Name_2>, action: string, options?: Opts<A_5, E_6, R_6, I, A2_2, E2_2, R2_2, ESuccess_2, RSuccess_2, EError_2, RError_2, EDefect_2, RDefect_2> | undefined): Resp<I, A2_2, E2_2, R2_2, ComputedRef<Res<A2_2, E2_2>>>;
|
|
431
|
+
<E_7 extends ResponseErrors, A_6, R_7, Request_3 extends TaggedRequestClassAny, Name_3 extends string, A2_3 = A_6, E2_3 extends ResponseErrors = E_7, R2_3 = R_7, ESuccess_3 = never, RSuccess_3 = never, EError_3 = never, RError_3 = never, EDefect_3 = never, RDefect_3 = never>(self: RequestHandler<A_6, E_7, R_7, Request_3, Name_3>, action: string, options?: Opts<A_6, E_7, R_7, void, A2_3, E2_3, R2_3, ESuccess_3, RSuccess_3, EError_3, RError_3, EDefect_3, RDefect_3> | undefined): ActResp<A2_3, E2_3, R2_3, ComputedRef<Res<A2_3, E2_3>>>;
|
|
432
|
+
};
|
|
433
|
+
/** @deprecated use Command pattern */
|
|
434
|
+
useSafeMutation: {
|
|
435
|
+
<I, E_7, A_7, R_8, Request_4 extends TaggedRequestClassAny, Name_4 extends string, A2_4 = A_7, E2_4 = E_7, R2_4 = R_8>(self: RequestHandlerWithInput<I, A_7, E_7, R_8, Request_4, Name_4>, options?: MutationOptions<A_7, E_7, R_8, A2_4, E2_4, R2_4, I> | undefined): readonly [ComputedRef<Result.Result<A2_4, E2_4>>, (i: I) => Effect.Effect<Exit.Exit<A2_4, E2_4>, never, R2_4>];
|
|
436
|
+
<E_8, A_8, R_9, Request_5 extends TaggedRequestClassAny, Name_5 extends string, A2_5 = A_8, E2_5 = E_8, R2_5 = R_9>(self: RequestHandler<A_8, E_8, R_9, Request_5, Name_5>, options?: MutationOptions<A_8, E_8, R_9, A2_5, E2_5, R2_5, void> | undefined): readonly [ComputedRef<Result.Result<A2_5, E2_5>>, Effect.Effect<Exit.Exit<A2_5, E2_5>, never, R2_5>];
|
|
437
|
+
};
|
|
438
|
+
/** @deprecated use Command pattern */
|
|
439
|
+
useSafeMutationWithState: {
|
|
440
|
+
<I, E_8, A_9, R_10, Request_6 extends TaggedRequestClassAny, Name_6 extends string, A2_6 = A_9, E2_6 = E_8, R2_6 = R_10>(self: RequestHandlerWithInput<I, A_9, E_8, R_10, Request_6, Name_6>, options?: MutationOptions<A_9, E_8, R_10, A2_6, E2_6, R2_6, I> | undefined): readonly [ComputedRef<Res<A_9, E_8>>, (i: I) => Effect.Effect<Exit.Exit<A2_6, E2_6>, never, R2_6>];
|
|
441
|
+
<E_9, A_10, R_11, Request_7 extends TaggedRequestClassAny, Name_7 extends string, A2_7 = A_10, E2_7 = E_9, R2_7 = R_11>(self: RequestHandler<A_10, E_9, R_11, Request_7, Name_7>, options?: MutationOptions<A_10, E_9, R_11, A2_7, E2_7, R2_7, void> | undefined): readonly [ComputedRef<Res<A_10, E_9>>, Effect.Effect<Exit.Exit<A2_7, E2_7>, never, R2_7>];
|
|
442
|
+
};
|
|
443
|
+
/** @deprecated use .query on the clientFor(x).Action */
|
|
444
|
+
useQuery: {
|
|
445
|
+
<E_9, A_11, Request_8 extends TaggedRequestClassAny, Name_8 extends string>(self: RequestHandler<A_11, E_9, RT | ApiClientFactory, Request_8, Name_8>): {
|
|
446
|
+
<TData = A_11>(options: CustomDefinedInitialQueryOptions<A_11, KnownFiberFailure<E_9>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_11, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
447
|
+
<TData = A_11>(options?: CustomUndefinedInitialQueryOptions<A_11, KnownFiberFailure<E_9>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_11, E_9>>, ComputedRef<A_11 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_11, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
448
|
+
};
|
|
449
|
+
<Arg, E_9, A_12, Request_9 extends TaggedRequestClassAny, Name_9 extends string>(self: RequestHandlerWithInput<Arg, A_12, E_9, RT | ApiClientFactory, Request_9, Name_9>): {
|
|
450
|
+
<TData = A_12>(arg: Arg | WatchSource<Arg>, options: CustomDefinedInitialQueryOptions<A_12, KnownFiberFailure<E_9>, TData, readonly unknown[]>): readonly [ComputedRef<Result.Result<TData, E_9>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_12, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
451
|
+
<TData = A_12>(arg: Arg | WatchSource<Arg>, options?: CustomUndefinedInitialQueryOptions<A_12, KnownFiberFailure<E_9>, TData, readonly unknown[]> | undefined): readonly [ComputedRef<Result.Result<A_12, E_9>>, ComputedRef<A_12 | undefined>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<A_12, KnownFiberFailure<E_9>>, never, never>, UseQueryReturnType<any, any>];
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
/** @deprecated use .suspense on the clientFor(x).Action */
|
|
455
|
+
useSuspenseQuery: {
|
|
456
|
+
<E_10, A_13, Request_10 extends TaggedRequestClassAny, Name_10 extends string>(self: RequestHandler<A_13, E_10, RT | ApiClientFactory, Request_10, Name_10>): {
|
|
457
|
+
<TData = A_13>(options?: CustomUndefinedInitialQueryOptions<A_13, E_10, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_10>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
458
|
+
<TData = A_13>(options?: (CustomDefinedInitialQueryOptions<A_13, E_10, TData, readonly unknown[]> & {
|
|
459
|
+
initialData: TData | InitialDataFunction<TData>;
|
|
460
|
+
}) | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_10>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
461
|
+
};
|
|
462
|
+
<Arg, E_10, A_14, Request_11 extends TaggedRequestClassAny, Name_11 extends string>(self: RequestHandlerWithInput<Arg, A_14, E_10, RT | ApiClientFactory, Request_11, Name_11>): {
|
|
463
|
+
<TData = A_14>(arg: Arg | WatchSource<Arg>, options?: CustomDefinedInitialQueryOptions<A_14, E_10, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_10>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
464
|
+
<TData = A_14>(arg: Arg | WatchSource<Arg>, options?: CustomUndefinedInitialQueryOptions<A_14, E_10, TData, readonly unknown[]> | undefined): Promise<readonly [ComputedRef<Result.Result<TData, E_10>>, ComputedRef<TData>, (options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, KnownFiberFailure<E_10>>, never, never>, UseQueryReturnType<any, any>]>;
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
};
|
|
252
468
|
};
|
|
469
|
+
export type QueryInvalidation<M> = {
|
|
470
|
+
[K in keyof M]?: (defaultKey: string[], name: string) => {
|
|
471
|
+
filters?: InvalidateQueryFilters | undefined;
|
|
472
|
+
options?: InvalidateOptions | undefined;
|
|
473
|
+
}[];
|
|
474
|
+
};
|
|
475
|
+
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;
|
|
476
|
+
export interface CommandBase<I extends ReadonlyArray<any>, A = void> {
|
|
477
|
+
handle: (...input: I) => A;
|
|
478
|
+
waiting: boolean;
|
|
479
|
+
action: string;
|
|
480
|
+
}
|
|
481
|
+
export interface EffectCommand<I extends ReadonlyArray<any>, A = unknown, E = unknown> extends CommandBase<I, RuntimeFiber<A, E>> {
|
|
482
|
+
}
|
|
483
|
+
export interface UnaryCommand<I, A = unknown, E = unknown> extends CommandBase<[I], RuntimeFiber<A, E>> {
|
|
484
|
+
}
|
|
485
|
+
export interface CommandFromRequest<I extends abstract new (...args: any) => any, A = unknown, E = unknown> extends UnaryCommand<ConstructorParameters<I>[0], A, E> {
|
|
486
|
+
}
|
|
253
487
|
export {};
|
|
254
488
|
//# sourceMappingURL=makeClient.d.ts.map
|