@effect-app/vue 4.0.0-beta.7 → 4.0.0-beta.70
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 +455 -0
- package/dist/{experimental/commander.d.ts → commander.d.ts} +12 -13
- package/dist/commander.d.ts.map +1 -0
- package/dist/commander.js +556 -0
- package/dist/{experimental/confirm.d.ts → confirm.d.ts} +2 -2
- package/dist/confirm.d.ts.map +1 -0
- package/dist/confirm.js +28 -0
- package/dist/form.d.ts +9 -0
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js +38 -9
- package/dist/intl.d.ts +15 -0
- package/dist/intl.d.ts.map +1 -0
- package/dist/intl.js +9 -0
- package/dist/makeClient.d.ts +12 -235
- package/dist/makeClient.d.ts.map +1 -1
- package/dist/makeClient.js +12 -335
- package/dist/{experimental/makeUseCommand.d.ts → makeUseCommand.d.ts} +1 -1
- package/dist/makeUseCommand.d.ts.map +1 -0
- package/dist/makeUseCommand.js +13 -0
- package/dist/mutate.d.ts +1 -1
- package/dist/mutate.d.ts.map +1 -1
- package/dist/mutate.js +2 -2
- package/dist/query.d.ts +10 -14
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +23 -23
- package/dist/runtime.d.ts +3 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +15 -3
- package/dist/{experimental/toast.d.ts → toast.d.ts} +9 -10
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +32 -0
- package/dist/{experimental/withToast.d.ts → withToast.d.ts} +2 -2
- package/dist/withToast.d.ts.map +1 -0
- package/dist/withToast.js +45 -0
- package/package.json +43 -43
- package/src/{experimental/commander.ts → commander.ts} +15 -17
- package/src/{experimental/confirm.ts → confirm.ts} +2 -2
- package/src/form.ts +46 -8
- package/src/intl.ts +12 -0
- package/src/makeClient.ts +19 -916
- package/src/{experimental/makeUseCommand.ts → makeUseCommand.ts} +1 -1
- package/src/mutate.ts +1 -1
- package/src/query.ts +44 -45
- package/src/runtime.ts +25 -2
- package/src/{experimental/toast.ts → toast.ts} +11 -25
- package/src/{experimental/withToast.ts → withToast.ts} +2 -2
- package/test/Mutation.test.ts +1 -1
- package/test/dist/form.test.d.ts.map +1 -1
- package/test/dist/stubs.d.ts +42 -60
- package/test/dist/stubs.d.ts.map +1 -1
- package/test/dist/stubs.js +10 -11
- package/test/form-validation-errors.test.ts +23 -19
- package/test/form.test.ts +20 -2
- package/test/makeClient.test.ts +12 -21
- package/test/stubs.ts +9 -10
- package/tsconfig.json +0 -1
- package/dist/experimental/commander.d.ts.map +0 -1
- package/dist/experimental/commander.js +0 -558
- 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.map +0 -1
- package/dist/experimental/toast.js +0 -41
- package/dist/experimental/withToast.d.ts.map +0 -1
- package/dist/experimental/withToast.js +0 -45
- package/src/experimental/intl.ts +0 -9
|
@@ -12,7 +12,7 @@ export interface CommanderResolved<RT, RTHooks>
|
|
|
12
12
|
export const makeUseCommand = Effect.fnUntraced(
|
|
13
13
|
function*<R = never, RTHooks = never>(rtHooks: Layer.Layer<RTHooks, never, R>) {
|
|
14
14
|
const cmndr = yield* Commander
|
|
15
|
-
const runtime = yield* Effect.
|
|
15
|
+
const runtime = yield* Effect.context<R>()
|
|
16
16
|
|
|
17
17
|
const comm = cmndr(runtime, rtHooks)
|
|
18
18
|
|
package/src/mutate.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
|
3
2
|
import { type InvalidateOptions, type InvalidateQueryFilters, type QueryClient, useQueryClient } from "@tanstack/vue-query"
|
|
4
3
|
import { type Cause, Effect, type Exit, Option } from "effect-app"
|
|
5
4
|
import { type Req } from "effect-app/client"
|
|
6
5
|
import type { ClientForOptions, RequestHandler, RequestHandlerWithInput } from "effect-app/client/clientFor"
|
|
7
6
|
import { tuple } from "effect-app/Function"
|
|
7
|
+
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
|
8
8
|
import { computed, type ComputedRef, shallowRef } from "vue"
|
|
9
9
|
import { makeQueryKey } from "./lib.js"
|
|
10
10
|
|
package/src/query.ts
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
5
|
-
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
|
6
5
|
import { type DefaultError, type Enabled, type InitialDataFunction, type NonUndefinedGuard, type PlaceholderDataFunction, type QueryKey, type QueryObserverOptions, type QueryObserverResult, type RefetchOptions, useQuery as useTanstackQuery, useQueryClient, type UseQueryDefinedReturnType, type UseQueryReturnType } from "@tanstack/vue-query"
|
|
7
|
-
import { Array, Cause,
|
|
6
|
+
import { Array, Cause, type Context, Effect, Option, S } from "effect-app"
|
|
8
7
|
import { type Req } from "effect-app/client"
|
|
9
8
|
import type { RequestHandler, RequestHandlerWithInput } from "effect-app/client/clientFor"
|
|
10
|
-
import { ServiceUnavailableError } from "effect-app/client/errors"
|
|
9
|
+
import { CauseException, ServiceUnavailableError } from "effect-app/client/errors"
|
|
11
10
|
import { type Span } from "effect/Tracer"
|
|
12
11
|
import { isHttpClientError } from "effect/unstable/http/HttpClientError"
|
|
12
|
+
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult"
|
|
13
13
|
import { computed, type ComputedRef, type MaybeRefOrGetter, ref, shallowRef, watch, type WatchSource } from "vue"
|
|
14
14
|
import { makeQueryKey, reportRuntimeError } from "./lib.js"
|
|
15
|
+
import { makeRunPromise } from "./runtime.js"
|
|
15
16
|
|
|
16
17
|
// we must use interface extends, or we get the dreaded typescript error of isn't portable blabla @tanstack/vue-query/build/modern/types.js
|
|
17
18
|
// but because how they are dealing with some extends clause, we loose all properties except initialData
|
|
@@ -74,15 +75,7 @@ export interface CustomDefinedPlaceholderQueryOptions<
|
|
|
74
75
|
| PlaceholderDataFunction<NonFunctionGuard<TQueryData>, TError, NonFunctionGuard<TQueryData>, TQueryKey>
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
export
|
|
78
|
-
readonly error: unknown
|
|
79
|
-
constructor(public effectCause: Cause.Cause<E>) {
|
|
80
|
-
super("Query failed with cause: " + Cause.squash(effectCause))
|
|
81
|
-
this.error = Cause.squash(effectCause)
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
78
|
+
export const makeQuery = <R>(getRuntime: () => Context.Context<R>) => {
|
|
86
79
|
const useQuery_: {
|
|
87
80
|
<I, A, E, Request extends Req, Name extends string>(
|
|
88
81
|
q:
|
|
@@ -95,8 +88,8 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
95
88
|
): readonly [
|
|
96
89
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
97
90
|
ComputedRef<TData | undefined>,
|
|
98
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
99
|
-
UseQueryDefinedReturnType<TData,
|
|
91
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>, never, never>,
|
|
92
|
+
UseQueryDefinedReturnType<TData, CauseException<E>>
|
|
100
93
|
]
|
|
101
94
|
|
|
102
95
|
<TData = A>(
|
|
@@ -105,8 +98,8 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
105
98
|
): readonly [
|
|
106
99
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
107
100
|
ComputedRef<TData>,
|
|
108
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
109
|
-
UseQueryDefinedReturnType<TData,
|
|
101
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>, never, never>,
|
|
102
|
+
UseQueryDefinedReturnType<TData, CauseException<E>>
|
|
110
103
|
]
|
|
111
104
|
|
|
112
105
|
<TData = A>(
|
|
@@ -115,8 +108,8 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
115
108
|
): readonly [
|
|
116
109
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
117
110
|
ComputedRef<TData>,
|
|
118
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
119
|
-
UseQueryDefinedReturnType<TData,
|
|
111
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>, never, never>,
|
|
112
|
+
UseQueryDefinedReturnType<TData, CauseException<E>>
|
|
120
113
|
]
|
|
121
114
|
}
|
|
122
115
|
} = <I, A, E, Request extends Req, Name extends string>(
|
|
@@ -130,14 +123,8 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
130
123
|
options?: any
|
|
131
124
|
// TODO
|
|
132
125
|
) => {
|
|
133
|
-
// we wrap into
|
|
134
|
-
const runPromise =
|
|
135
|
-
_.then(
|
|
136
|
-
Exit.match({
|
|
137
|
-
onFailure: (cause) => Promise.reject(new KnownFiberFailure(cause)),
|
|
138
|
-
onSuccess: (value) => Promise.resolve(value)
|
|
139
|
-
})
|
|
140
|
-
))
|
|
126
|
+
// we wrap into CauseException because we want to keep the full cause of the failure.
|
|
127
|
+
const runPromise = makeRunPromise(getRuntime())
|
|
141
128
|
const arr = arg
|
|
142
129
|
const req: { value: I } = !arg
|
|
143
130
|
? undefined
|
|
@@ -151,13 +138,24 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
151
138
|
const queryKey = makeQueryKey(q)
|
|
152
139
|
const handler = q.handler
|
|
153
140
|
|
|
154
|
-
const
|
|
141
|
+
const defaultOptions = {
|
|
142
|
+
// we do not want to throw errors, because we turn the success and error responses into a Result type
|
|
143
|
+
// why don't we turn the error/success response into a Result type before returning to tanstack query? because we want to leverage tanstack query's retry and caching mechanism, which relies on throwing errors to trigger retries, and we don't want to interfere with that by catching the errors too early.
|
|
144
|
+
// but if we allow tanstack query to throw, it will trigger the error boundary in Vue - via a "watcher callback" error - which we currently report and log, which is not what we want.
|
|
145
|
+
// TODO: we might want to rethink the strategy of how to handle errors that happen after the initial load.
|
|
146
|
+
// For suspense, the initial load is captured by the suspense boundary.
|
|
147
|
+
// For subsequent loads (or non suspense use) we currently are required to use the QueryResult component to conditionally render error/loading/etc.
|
|
148
|
+
throwOnError: false
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const r = useTanstackQuery<A, CauseException<E>, TData>(
|
|
155
152
|
Effect.isEffect(handler)
|
|
156
153
|
? {
|
|
154
|
+
...defaultOptions,
|
|
157
155
|
...options,
|
|
158
156
|
retry: (retryCount, error) => {
|
|
159
|
-
if (error instanceof
|
|
160
|
-
if (!isHttpClientError(error.
|
|
157
|
+
if (error instanceof CauseException) {
|
|
158
|
+
if (!isHttpClientError(error.cause) && !S.is(ServiceUnavailableError)(error.cause)) {
|
|
161
159
|
return false
|
|
162
160
|
}
|
|
163
161
|
}
|
|
@@ -177,10 +175,11 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
177
175
|
)
|
|
178
176
|
}
|
|
179
177
|
: {
|
|
178
|
+
...defaultOptions,
|
|
180
179
|
...options,
|
|
181
180
|
retry: (retryCount, error) => {
|
|
182
|
-
if (error instanceof
|
|
183
|
-
if (!isHttpClientError(error.
|
|
181
|
+
if (error instanceof CauseException) {
|
|
182
|
+
if (!isHttpClientError(error.cause) && !S.is(ServiceUnavailableError)(error.cause)) {
|
|
184
183
|
return false
|
|
185
184
|
}
|
|
186
185
|
}
|
|
@@ -228,13 +227,13 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
228
227
|
}
|
|
229
228
|
|
|
230
229
|
function swrToQuery<E, A>(r: {
|
|
231
|
-
error:
|
|
230
|
+
error: CauseException<E> | undefined
|
|
232
231
|
data: A | undefined
|
|
233
232
|
isValidating: boolean
|
|
234
233
|
}): AsyncResult.AsyncResult<A, E> {
|
|
235
234
|
if (r.error !== undefined) {
|
|
236
235
|
return AsyncResult.failureWithPrevious(
|
|
237
|
-
r.error.
|
|
236
|
+
r.error.originalCause,
|
|
238
237
|
{
|
|
239
238
|
previous: r.data === undefined ? Option.none() : Option.some(AsyncResult.success(r.data)),
|
|
240
239
|
waiting: r.isValidating
|
|
@@ -261,11 +260,11 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
261
260
|
* Effect results are passed to the caller, including errors.
|
|
262
261
|
*/
|
|
263
262
|
<TData = A>(
|
|
264
|
-
options: CustomDefinedInitialQueryOptions<A,
|
|
263
|
+
options: CustomDefinedInitialQueryOptions<A, CauseException<E>, TData>
|
|
265
264
|
): readonly [
|
|
266
265
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
267
266
|
ComputedRef<TData>,
|
|
268
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
267
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>>,
|
|
269
268
|
UseQueryReturnType<any, any>
|
|
270
269
|
]
|
|
271
270
|
<TData = A>(
|
|
@@ -273,17 +272,17 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
273
272
|
): readonly [
|
|
274
273
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
275
274
|
ComputedRef<TData>,
|
|
276
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
277
|
-
UseQueryDefinedReturnType<TData,
|
|
275
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>, never, never>,
|
|
276
|
+
UseQueryDefinedReturnType<TData, CauseException<E>>
|
|
278
277
|
]
|
|
279
278
|
// optional options, optional A
|
|
280
279
|
/**
|
|
281
280
|
* Effect results are passed to the caller, including errors.
|
|
282
281
|
*/
|
|
283
|
-
<TData = A>(options?: CustomUndefinedInitialQueryOptions<A,
|
|
282
|
+
<TData = A>(options?: CustomUndefinedInitialQueryOptions<A, CauseException<E>, TData>): readonly [
|
|
284
283
|
ComputedRef<AsyncResult.AsyncResult<A, E>>,
|
|
285
284
|
ComputedRef<A | undefined>,
|
|
286
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
285
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>>,
|
|
287
286
|
UseQueryReturnType<any, any>
|
|
288
287
|
]
|
|
289
288
|
}
|
|
@@ -300,11 +299,11 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
300
299
|
*/
|
|
301
300
|
<TData = A>(
|
|
302
301
|
arg: Arg | WatchSource<Arg>,
|
|
303
|
-
options: CustomDefinedInitialQueryOptions<A,
|
|
302
|
+
options: CustomDefinedInitialQueryOptions<A, CauseException<E>, TData>
|
|
304
303
|
): readonly [
|
|
305
304
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
306
305
|
ComputedRef<TData>,
|
|
307
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
306
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>>,
|
|
308
307
|
UseQueryReturnType<any, any>
|
|
309
308
|
]
|
|
310
309
|
// required options, with placeholderData
|
|
@@ -313,11 +312,11 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
313
312
|
*/
|
|
314
313
|
<TData = A>(
|
|
315
314
|
arg: Arg | WatchSource<Arg>,
|
|
316
|
-
options: CustomDefinedPlaceholderQueryOptions<A,
|
|
315
|
+
options: CustomDefinedPlaceholderQueryOptions<A, CauseException<E>, TData>
|
|
317
316
|
): readonly [
|
|
318
317
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
319
318
|
ComputedRef<TData>,
|
|
320
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
319
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>>,
|
|
321
320
|
UseQueryReturnType<any, any>
|
|
322
321
|
]
|
|
323
322
|
// optional options, optional A
|
|
@@ -326,11 +325,11 @@ export const makeQuery = <R>(getRuntime: () => ServiceMap.ServiceMap<R>) => {
|
|
|
326
325
|
*/
|
|
327
326
|
<TData = A>(
|
|
328
327
|
arg: Arg | WatchSource<Arg>,
|
|
329
|
-
options?: CustomUndefinedInitialQueryOptions<A,
|
|
328
|
+
options?: CustomUndefinedInitialQueryOptions<A, CauseException<E>, TData>
|
|
330
329
|
): readonly [
|
|
331
330
|
ComputedRef<AsyncResult.AsyncResult<TData, E>>,
|
|
332
331
|
ComputedRef<TData | undefined>,
|
|
333
|
-
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData,
|
|
332
|
+
(options?: RefetchOptions) => Effect.Effect<QueryObserverResult<TData, CauseException<E>>>,
|
|
334
333
|
UseQueryReturnType<any, any>
|
|
335
334
|
]
|
|
336
335
|
}
|
package/src/runtime.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { ManagedRuntime } from "effect"
|
|
1
|
+
import { Exit, flow, ManagedRuntime } from "effect"
|
|
2
2
|
import { Effect, Layer, Logger } from "effect-app"
|
|
3
|
+
import { CauseException } from "effect-app/client/errors"
|
|
4
|
+
import { type Context } from "effect-app/Context"
|
|
3
5
|
|
|
4
6
|
export function makeAppRuntime<A, E>(layer: Layer.Layer<A, E>) {
|
|
5
7
|
return Effect.gen(function*() {
|
|
@@ -7,7 +9,7 @@ export function makeAppRuntime<A, E>(layer: Layer.Layer<A, E>) {
|
|
|
7
9
|
Layer.provide(Logger.layer([Logger.consolePretty()]))
|
|
8
10
|
) as Layer.Layer<A, never>
|
|
9
11
|
const mrt = ManagedRuntime.make(l)
|
|
10
|
-
yield* mrt.
|
|
12
|
+
yield* mrt.contextEffect
|
|
11
13
|
return Object.assign(mrt, {
|
|
12
14
|
[Symbol.dispose]() {
|
|
13
15
|
return Effect.runSync(mrt.disposeEffect)
|
|
@@ -29,3 +31,24 @@ export function initializeAsync<A, E>(layer: Layer.Layer<A, E, never>) {
|
|
|
29
31
|
return Effect
|
|
30
32
|
.runPromise(makeAppRuntime(layer))
|
|
31
33
|
}
|
|
34
|
+
|
|
35
|
+
// we wrap into CauseException because we want to keep the full cause of the failure.
|
|
36
|
+
export const makeRunPromise = <T>(services: Context<T>) =>
|
|
37
|
+
flow(Effect.runPromiseExitWith(services), (_) =>
|
|
38
|
+
_.then(
|
|
39
|
+
Exit.match({
|
|
40
|
+
onFailure: (cause) => Promise.reject(new CauseException(cause, "runPromise")),
|
|
41
|
+
onSuccess: (value) => Promise.resolve(value)
|
|
42
|
+
})
|
|
43
|
+
))
|
|
44
|
+
|
|
45
|
+
export const makeRunSync = <T>(services: Context<T>) =>
|
|
46
|
+
flow(
|
|
47
|
+
Effect.runSyncExitWith(services),
|
|
48
|
+
Exit.match({
|
|
49
|
+
onFailure: (cause) => {
|
|
50
|
+
throw new CauseException(cause, "runSync")
|
|
51
|
+
},
|
|
52
|
+
onSuccess: (value) => value
|
|
53
|
+
})
|
|
54
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Effect, Option
|
|
2
|
-
import {
|
|
1
|
+
import { Context, Effect, Option } from "effect-app"
|
|
2
|
+
import { accessEffectFn } from "effect-app/Context"
|
|
3
3
|
|
|
4
4
|
export type ToastId = string | number
|
|
5
5
|
export type ToastOpts = { id?: ToastId; timeout?: number }
|
|
@@ -13,7 +13,7 @@ export type UseToast = () => {
|
|
|
13
13
|
dismiss: (this: void, id: ToastId) => void
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export class CurrentToastId extends
|
|
16
|
+
export class CurrentToastId extends Context.Opaque<CurrentToastId, { toastId: ToastId }>()("CurrentToastId") {}
|
|
17
17
|
|
|
18
18
|
/** fallback to CurrentToastId when available unless id is explicitly set to a value or null */
|
|
19
19
|
export const wrap = (toast: ReturnType<UseToast>) => {
|
|
@@ -41,26 +41,12 @@ export const wrap = (toast: ReturnType<UseToast>) => {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
extends proxify(ServiceMap.Opaque<Toast, ReturnType<typeof wrap>>()("Toast"))<Toast, ReturnType<typeof wrap>>()
|
|
46
|
-
{
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// const a = Layer.effect(Toast, Effect.sync(() => Toast.of(null as any)))
|
|
50
|
-
|
|
51
|
-
// const A = Toast.of({
|
|
52
|
-
// error: () => Effect.succeed(null as any),
|
|
53
|
-
// info: () => Effect.succeed(null as any),
|
|
54
|
-
// success: () => Effect.succeed(null as any),
|
|
55
|
-
// warning: () => Effect.succeed(null as any),
|
|
56
|
-
// dismiss: () => Effect.succeed(null as any)
|
|
57
|
-
// })
|
|
44
|
+
type ToastShape = ReturnType<typeof wrap>
|
|
58
45
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// })
|
|
46
|
+
export class Toast extends Context.Opaque<Toast, ToastShape>()("Toast") {
|
|
47
|
+
static readonly error = accessEffectFn(this, "error")
|
|
48
|
+
static readonly info = accessEffectFn(this, "info")
|
|
49
|
+
static readonly success = accessEffectFn(this, "success")
|
|
50
|
+
static readonly warning = accessEffectFn(this, "warning")
|
|
51
|
+
static readonly dismiss = accessEffectFn(this, "dismiss")
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cause, Effect, Layer, type Option
|
|
1
|
+
import { Cause, Context, Effect, Layer, type Option } from "effect-app"
|
|
2
2
|
import { wrapEffect } from "effect-app/utils"
|
|
3
3
|
import { CurrentToastId, Toast } from "./toast.js"
|
|
4
4
|
|
|
@@ -33,7 +33,7 @@ export interface ToastOptions<A, E, Args extends ReadonlyArray<unknown>, WaiR, S
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// @effect-diagnostics-next-line missingEffectServiceDependency:off
|
|
36
|
-
export class WithToast extends
|
|
36
|
+
export class WithToast extends Context.Service<WithToast>()("WithToast", {
|
|
37
37
|
make: Effect.gen(function*() {
|
|
38
38
|
const toast = yield* Toast
|
|
39
39
|
return <A, E, Args extends Array<unknown>, R, WaiR = never, SucR = never, ErrR = never>(
|
package/test/Mutation.test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import { it } from "@effect/vitest"
|
|
3
3
|
import { Cause, Effect, Exit, Fiber, Option } from "effect-app"
|
|
4
|
-
import { CommandContext, DefaultIntl } from "../src/
|
|
4
|
+
import { CommandContext, DefaultIntl } from "../src/commander.js"
|
|
5
5
|
import { AsyncResult } from "../src/lib.js"
|
|
6
6
|
import { useExperimental } from "./stubs.js"
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.test.d.ts","sourceRoot":"","sources":["../form.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,CAAC,EAAE,MAAM,YAAY,CAAA
|
|
1
|
+
{"version":3,"file":"form.test.d.ts","sourceRoot":"","sources":["../form.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,CAAC,EAAE,MAAM,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtC,qBAAa,YAAa,SAAQ,iBAahC;CAAG;;;;AAEL,qBAAa,mBAAoB,SAAQ,wBAEvC;CAAG;;;;;;;;;;;AAEL,qBAAa,WAAY,SAAQ,gBAK/B;CAAG;;;;;;;;AAEL,cAAM,MAAO,SAAQ,WAEnB;CAAG;;;;;;;;AAEL,cAAM,MAAO,SAAQ,WAEnB;CAAG;;;;;;;;;;;AAEL,cAAM,QAAS,SAAQ,aAGrB;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBL,qBAAa,cAAe,SAAQ,mBAGlC;CAAG"}
|
package/test/dist/stubs.d.ts
CHANGED
|
@@ -2,18 +2,17 @@ import { type MessageFormatElement } from "@formatjs/icu-messageformat-parser";
|
|
|
2
2
|
import { Layer, S } from "effect-app";
|
|
3
3
|
import { ApiClientFactory } from "effect-app/client";
|
|
4
4
|
import { RpcContextMap } from "effect-app/rpc";
|
|
5
|
-
import { Commander } from "../src/
|
|
6
|
-
import { I18n } from "../src/
|
|
7
|
-
import * as Toast from "../src/experimental/toast.js";
|
|
8
|
-
import { WithToast } from "../src/experimental/withToast.js";
|
|
9
|
-
import { LegacyMutation } from "../src/makeClient.js";
|
|
5
|
+
import { Commander } from "../src/commander.js";
|
|
6
|
+
import { I18n } from "../src/intl.js";
|
|
10
7
|
import { type MakeIntlReturn } from "../src/makeIntl.js";
|
|
8
|
+
import * as Toast from "../src/toast.js";
|
|
9
|
+
import { WithToast } from "../src/withToast.js";
|
|
11
10
|
export declare const makeFakeIntl: (messages?: Record<string, string> | Record<string, MessageFormatElement[]>) => ReturnType<MakeIntlReturn<string>["useIntl"]>;
|
|
12
11
|
export declare const fakeIntlLayer: (messages?: Record<string, string> | Record<string, MessageFormatElement[]>) => Layer.Layer<I18n, never, never>;
|
|
13
12
|
export declare const useExperimental: (options?: {
|
|
14
13
|
messages?: Record<string, string> | Record<string, MessageFormatElement[]>;
|
|
15
14
|
toasts: any[];
|
|
16
|
-
}) => import("../src/
|
|
15
|
+
}) => import("../src/makeUseCommand.js").CommanderResolved<Toast.Toast | I18n | WithToast, never>;
|
|
17
16
|
declare const RequestContextMap_base: (new () => {
|
|
18
17
|
readonly config: {};
|
|
19
18
|
}) & {
|
|
@@ -23,16 +22,12 @@ declare const RequestContextMap_base: (new () => {
|
|
|
23
22
|
};
|
|
24
23
|
export declare class RequestContextMap extends RequestContextMap_base {
|
|
25
24
|
}
|
|
26
|
-
export declare const Req: <
|
|
25
|
+
export declare const Req: <Self>() => {
|
|
27
26
|
<Tag extends string, Payload extends S.Struct.Fields, C extends {
|
|
28
27
|
success: S.Top | S.Struct.Fields;
|
|
29
28
|
error: S.Top | S.Struct.Fields;
|
|
30
|
-
}>(tag: Tag, fields: Payload, config: RpcContextMap.GetContextConfig<{}> & C): S.TaggedStruct<Tag, Payload> & {
|
|
31
|
-
new (...args: any[]): any;
|
|
29
|
+
}>(tag: Tag, fields: Payload, config: RpcContextMap.GetContextConfig<{}> & C): S.EnhancedClass<Self, S.TaggedStruct<Tag, Payload>, {}> & {
|
|
32
30
|
readonly _tag: Tag;
|
|
33
|
-
readonly fields: {
|
|
34
|
-
readonly _tag: S.tag<Tag>;
|
|
35
|
-
} & Payload;
|
|
36
31
|
readonly success: C["success"] extends infer T ? T extends C["success"] ? T extends S.Top ? T : T extends S.Struct.Fields ? S.Struct<T> : S.Void : never : never;
|
|
37
32
|
readonly error: C extends {
|
|
38
33
|
error: infer E;
|
|
@@ -41,16 +36,15 @@ export declare const Req: <_Self>() => {
|
|
|
41
36
|
readonly "~decodingServices": S.Codec.DecodingServices<C["success"] extends infer T_1 ? T_1 extends C["success"] ? T_1 extends S.Top ? T_1 : T_1 extends S.Struct.Fields ? S.Struct<T_1> : S.Void : never : never> | S.Codec.DecodingServices<C extends {
|
|
42
37
|
error: infer E;
|
|
43
38
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
39
|
+
readonly "~encodingServices": S.Codec.EncodingServices<C["success"] extends infer T_2 ? T_2 extends C["success"] ? T_2 extends S.Top ? T_2 : T_2 extends S.Struct.Fields ? S.Struct<T_2> : S.Void : never : never> | S.Codec.EncodingServices<C extends {
|
|
40
|
+
error: infer E;
|
|
41
|
+
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
44
42
|
};
|
|
45
43
|
<Tag extends string, Payload_1 extends S.Struct.Fields, C_1 extends Pick<{
|
|
46
44
|
success: S.Top | S.Struct.Fields;
|
|
47
45
|
error: S.Top | S.Struct.Fields;
|
|
48
|
-
}, "success">>(tag: Tag, fields: Payload_1, config: RpcContextMap.GetContextConfig<{}> & C_1): S.TaggedStruct<Tag, Payload_1> & {
|
|
49
|
-
new (...args: any[]): any;
|
|
46
|
+
}, "success">>(tag: Tag, fields: Payload_1, config: RpcContextMap.GetContextConfig<{}> & C_1): S.EnhancedClass<Self, S.TaggedStruct<Tag, Payload_1>, {}> & {
|
|
50
47
|
readonly _tag: Tag;
|
|
51
|
-
readonly fields: {
|
|
52
|
-
readonly _tag: S.tag<Tag>;
|
|
53
|
-
} & Payload_1;
|
|
54
48
|
readonly success: C_1["success"] extends infer T ? T extends C_1["success"] ? T extends S.Top ? T : T extends S.Struct.Fields ? S.Struct<T> : S.Void : never : never;
|
|
55
49
|
readonly error: C_1 extends {
|
|
56
50
|
error: infer E;
|
|
@@ -59,17 +53,16 @@ export declare const Req: <_Self>() => {
|
|
|
59
53
|
readonly "~decodingServices": S.Codec.DecodingServices<C_1["success"] extends infer T_1 ? T_1 extends C_1["success"] ? T_1 extends S.Top ? T_1 : T_1 extends S.Struct.Fields ? S.Struct<T_1> : S.Void : never : never> | S.Codec.DecodingServices<C_1 extends {
|
|
60
54
|
error: infer E;
|
|
61
55
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
56
|
+
readonly "~encodingServices": S.Codec.EncodingServices<C_1["success"] extends infer T_2 ? T_2 extends C_1["success"] ? T_2 extends S.Top ? T_2 : T_2 extends S.Struct.Fields ? S.Struct<T_2> : S.Void : never : never> | S.Codec.EncodingServices<C_1 extends {
|
|
57
|
+
error: infer E;
|
|
58
|
+
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
62
59
|
};
|
|
63
60
|
<Tag extends string, Payload_2 extends S.Struct.Fields, C_2 extends Pick<{
|
|
64
61
|
success: S.Top | S.Struct.Fields;
|
|
65
62
|
error: S.Top | S.Struct.Fields;
|
|
66
|
-
}, "error">>(tag: Tag, fields: Payload_2, config: RpcContextMap.GetContextConfig<{}> & C_2): S.TaggedStruct<Tag, Payload_2> & {
|
|
67
|
-
new (...args: any[]): any;
|
|
63
|
+
}, "error">>(tag: Tag, fields: Payload_2, config: RpcContextMap.GetContextConfig<{}> & C_2): S.EnhancedClass<Self, S.TaggedStruct<Tag, Payload_2>, {}> & {
|
|
68
64
|
readonly _tag: Tag;
|
|
69
|
-
readonly
|
|
70
|
-
readonly _tag: S.tag<Tag>;
|
|
71
|
-
} & Payload_2;
|
|
72
|
-
readonly success: S.Codec<void, void, never, never>;
|
|
65
|
+
readonly success: S.decodeTo<S.Any, S.declare<unknown, unknown>, never, never>;
|
|
73
66
|
readonly error: C_2 extends {
|
|
74
67
|
error: infer E;
|
|
75
68
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never;
|
|
@@ -77,14 +70,13 @@ export declare const Req: <_Self>() => {
|
|
|
77
70
|
readonly "~decodingServices": S.Codec.DecodingServices<C_2 extends {
|
|
78
71
|
error: infer E;
|
|
79
72
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
73
|
+
readonly "~encodingServices": S.Codec.EncodingServices<C_2 extends {
|
|
74
|
+
error: infer E;
|
|
75
|
+
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
80
76
|
};
|
|
81
|
-
<Tag extends string, Payload_3 extends S.Struct.Fields, C_3 extends Record<string, any>>(tag: Tag, fields: Payload_3, config: C_3 & RpcContextMap.GetContextConfig<{}>): S.TaggedStruct<Tag, Payload_3> & {
|
|
82
|
-
new (...args: any[]): any;
|
|
77
|
+
<Tag extends string, Payload_3 extends S.Struct.Fields, C_3 extends Record<string, any>>(tag: Tag, fields: Payload_3, config: C_3 & RpcContextMap.GetContextConfig<{}>): S.EnhancedClass<Self, S.TaggedStruct<Tag, Payload_3>, {}> & {
|
|
83
78
|
readonly _tag: Tag;
|
|
84
|
-
readonly
|
|
85
|
-
readonly _tag: S.tag<Tag>;
|
|
86
|
-
} & Payload_3;
|
|
87
|
-
readonly success: S.Codec<void, void, never, never>;
|
|
79
|
+
readonly success: S.decodeTo<S.Any, S.declare<unknown, unknown>, never, never>;
|
|
88
80
|
readonly error: C_3 extends {
|
|
89
81
|
error: infer E;
|
|
90
82
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never;
|
|
@@ -92,48 +84,37 @@ export declare const Req: <_Self>() => {
|
|
|
92
84
|
readonly "~decodingServices": S.Codec.DecodingServices<C_3 extends {
|
|
93
85
|
error: infer E;
|
|
94
86
|
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
87
|
+
readonly "~encodingServices": S.Codec.EncodingServices<C_3 extends {
|
|
88
|
+
error: infer E;
|
|
89
|
+
} ? E extends S.Top ? E : E extends S.Struct.Fields ? S.Struct<E> : S.Void : never>;
|
|
95
90
|
};
|
|
96
|
-
<Tag extends string, Payload_4 extends S.Struct.Fields>(tag: Tag, fields: Payload_4): S.TaggedStruct<Tag, Payload_4> & {
|
|
97
|
-
new (...args: any[]): any;
|
|
91
|
+
<Tag extends string, Payload_4 extends S.Struct.Fields>(tag: Tag, fields: Payload_4): S.EnhancedClass<Self, S.TaggedStruct<Tag, Payload_4>, {}> & {
|
|
98
92
|
readonly _tag: Tag;
|
|
99
|
-
readonly
|
|
100
|
-
readonly _tag: S.tag<Tag>;
|
|
101
|
-
} & Payload_4;
|
|
102
|
-
readonly success: S.Codec<void, void, never, never>;
|
|
93
|
+
readonly success: S.decodeTo<S.Any, S.declare<unknown, unknown>, never, never>;
|
|
103
94
|
readonly error: never;
|
|
104
95
|
readonly config: Record<string, never>;
|
|
105
96
|
readonly "~decodingServices": never;
|
|
97
|
+
readonly "~encodingServices": never;
|
|
106
98
|
};
|
|
107
99
|
};
|
|
108
|
-
declare const GetSomething2_base: S.TaggedStruct<"GetSomething2", {
|
|
100
|
+
declare const GetSomething2_base: S.EnhancedClass<GetSomething2, S.TaggedStruct<"GetSomething2", {
|
|
109
101
|
id: S.String;
|
|
110
|
-
}> & {
|
|
111
|
-
new (...args: any[]): any;
|
|
102
|
+
}>, {}> & {
|
|
112
103
|
readonly _tag: "GetSomething2";
|
|
113
|
-
readonly
|
|
114
|
-
readonly _tag: S.tag<"GetSomething2">;
|
|
115
|
-
} & {
|
|
116
|
-
id: S.String;
|
|
117
|
-
};
|
|
118
|
-
readonly success: S.NumberFromString;
|
|
104
|
+
readonly success: S.FiniteFromString;
|
|
119
105
|
readonly error: never;
|
|
120
106
|
readonly config: Omit<{
|
|
121
|
-
success: S.
|
|
107
|
+
success: S.FiniteFromString;
|
|
122
108
|
}, "success" | "error">;
|
|
123
109
|
readonly "~decodingServices": never;
|
|
110
|
+
readonly "~encodingServices": never;
|
|
124
111
|
};
|
|
125
112
|
export declare class GetSomething2 extends GetSomething2_base {
|
|
126
113
|
}
|
|
127
|
-
declare const GetSomething2WithDependencies_base: S.TaggedStruct<"GetSomething2", {
|
|
114
|
+
declare const GetSomething2WithDependencies_base: S.EnhancedClass<GetSomething2WithDependencies, S.TaggedStruct<"GetSomething2", {
|
|
128
115
|
id: S.String;
|
|
129
|
-
}> & {
|
|
130
|
-
new (...args: any[]): any;
|
|
116
|
+
}>, {}> & {
|
|
131
117
|
readonly _tag: "GetSomething2";
|
|
132
|
-
readonly fields: {
|
|
133
|
-
readonly _tag: S.tag<"GetSomething2">;
|
|
134
|
-
} & {
|
|
135
|
-
id: S.String;
|
|
136
|
-
};
|
|
137
118
|
readonly success: S.Codec<number, string, "dep-a", never>;
|
|
138
119
|
readonly error: S.String;
|
|
139
120
|
readonly config: Omit<{
|
|
@@ -141,6 +122,7 @@ declare const GetSomething2WithDependencies_base: S.TaggedStruct<"GetSomething2"
|
|
|
141
122
|
error: S.String;
|
|
142
123
|
}, "success" | "error">;
|
|
143
124
|
readonly "~decodingServices": "dep-a";
|
|
125
|
+
readonly "~encodingServices": never;
|
|
144
126
|
};
|
|
145
127
|
export declare class GetSomething2WithDependencies extends GetSomething2WithDependencies_base {
|
|
146
128
|
}
|
|
@@ -155,14 +137,14 @@ export declare const useClient: (options?: {
|
|
|
155
137
|
messages?: Record<string, string> | Record<string, MessageFormatElement[]>;
|
|
156
138
|
toasts: any[];
|
|
157
139
|
}) => {
|
|
158
|
-
Command: import("../src/
|
|
159
|
-
useCommand: () => import("../src/
|
|
160
|
-
clientFor: <M extends import("effect-app/client").Requests>(m: M, queryInvalidation?: ((client: import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>) => import("../src/makeClient.js").QueryInvalidation<M>) | undefined) => { [Key in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>]: import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key] & import("../src/makeClient.js").RequestWithExtensions<WithToast | (Commander | ApiClientFactory |
|
|
161
|
-
mutate: import("../src/makeClient.js").MutationWithExtensions<WithToast | (Commander | ApiClientFactory |
|
|
162
|
-
|
|
163
|
-
|
|
140
|
+
Command: import("../src/makeUseCommand.js").CommanderResolved<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), never>;
|
|
141
|
+
useCommand: () => import("../src/makeUseCommand.js").CommanderResolved<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), never>;
|
|
142
|
+
clientFor: <M extends import("effect-app/client").Requests>(m: M, queryInvalidation?: ((client: import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>) => import("../src/makeClient.js").QueryInvalidation<M>) | undefined) => { [Key in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>]: import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key] & import("../src/makeClient.js").RequestWithExtensions<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key]> & {
|
|
143
|
+
mutate: import("../src/makeClient.js").MutationWithExtensions<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key]>;
|
|
144
|
+
Input: import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key] extends import("effect-app/client").RequestHandlerWithInput<infer I, any, any, any, any, any> ? I : never;
|
|
145
|
+
} & import("../src/makeClient.js").Queries<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key]>; } & {
|
|
146
|
+
helpers: { [Key_1 in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]> as `${import("../src/makeClient.js").ToCamel<string & Key_1>}Request`]: import("../src/makeClient.js").RequestWithExtensions<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key_1]>; } & { [Key_2 in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]> as `${import("../src/makeClient.js").ToCamel<string & Key_2>}Mutation`]: import("../src/makeClient.js").MutationWithExtensions<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key_2]>; } & { [Key_3 in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]> as `${import("../src/makeClient.js").ToCamel<string & Key_3>}Query`]: import("../src/makeClient.js").Queries<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key_3]>["query"]; } & { [Key_4 in keyof import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]> as `${import("../src/makeClient.js").ToCamel<string & Key_4>}SuspenseQuery`]: import("../src/makeClient.js").Queries<WithToast | (Commander | ApiClientFactory | (Toast.Toast | I18n)), import("effect-app/client").RequestHandlers<never, never, M, M["meta"]["moduleName"]>[Key_4]>["suspense"]; };
|
|
164
147
|
};
|
|
165
|
-
legacy: import("../src/makeClient.js").Legacy<WithToast | (Commander | ApiClientFactory | LegacyMutation | (Toast.Toast | I18n))>;
|
|
166
148
|
};
|
|
167
149
|
export {};
|
|
168
150
|
//# sourceMappingURL=stubs.d.ts.map
|
package/test/dist/stubs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../stubs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAE9E,OAAO,EAAU,KAAK,EAA0B,CAAC,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAiB,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../stubs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAE9E,OAAO,EAAU,KAAK,EAA0B,CAAC,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAiB,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAG9C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AA8C/C,eAAO,MAAM,YAAY,GAAI,WAAU,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAM,KAepG,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAClD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,WAAU,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAM,oCACpC,CAAA;AAExE,eAAO,MAAM,eAAe,GAC1B,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,CAAA;CAAE,gGASxG,CAAA;;;;;;;;AAED,qBAAa,iBAAkB,SAAQ,sBAAyB;CAAG;AACnE,eAAO,MAAuB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqC,CAAA;;;;;;;;;;;;;AACtE,qBAAa,aAAc,SAAQ,kBAEA;CAAG;;;;;;;;iBAML,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;;;;;;AAJjE,qBAAa,6BAA8B,SAAQ,kCAMjD;CAAG;AAEL,eAAO,MAAM,SAAS;;;;;;CAA+F,CAAA;AAErH,eAAO,MAAM,SAAS,GACpB,UAAU;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,CAAA;CAAE;;;;;;;;;CAaxG,CAAA"}
|