svelte-effect-runtime 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/chunks/{client-CfkB_G4o.js → client-Cj2X9lY-.js} +11 -24
- package/.dist/chunks/client-Cj2X9lY-.js.map +1 -0
- package/.dist/chunks/{dispatcher-8B6Ol80H.js → dispatcher-BVkm8qbG.js} +33 -13
- package/.dist/chunks/dispatcher-BVkm8qbG.js.map +1 -0
- package/.dist/chunks/{preprocess-Cn4JH9OO.js → preprocess-DseI9Doo.js} +206 -73
- package/.dist/chunks/preprocess-DseI9Doo.js.map +1 -0
- package/.dist/chunks/transform-BDfspL1K.js +59 -0
- package/.dist/chunks/transform-BDfspL1K.js.map +1 -0
- package/.dist/chunks/{transform-s9gKPYu5.js → transform-Cx5bjmP6.js} +267 -48
- package/.dist/chunks/transform-Cx5bjmP6.js.map +1 -0
- package/.dist/dispatcher.js +1 -1
- package/.dist/error.d.ts +23 -0
- package/.dist/internal/generators.js +1 -1
- package/.dist/internal/remote-client.js +1 -1
- package/.dist/markup/promise.js +1 -1
- package/.dist/markup/run.js +1 -1
- package/.dist/markup/transform/apply.d.ts +8 -2
- package/.dist/markup/transform/emit.d.ts +2 -2
- package/.dist/markup/transform/types.d.ts +9 -1
- package/.dist/markup/transform.js +1 -1
- package/.dist/markup/value.d.ts +1 -1
- package/.dist/markup/value.js +1 -1
- package/.dist/markup/value.js.map +1 -1
- package/.dist/mod.d.ts +1 -1
- package/.dist/mod.js +1 -1
- package/.dist/mod.js.map +1 -1
- package/.dist/preprocess/imports.d.ts +20 -1
- package/.dist/preprocess/index.d.ts +5 -1
- package/.dist/preprocess/runtime-block.d.ts +11 -1
- package/.dist/preprocess/types.d.ts +27 -0
- package/.dist/preprocess.js +2 -2
- package/.dist/remote/client/command.d.ts +5 -1
- package/.dist/remote/client/effect.d.ts +1 -1
- package/.dist/remote/client/failures.d.ts +3 -3
- package/.dist/remote/client/form-enhance.d.ts +1 -1
- package/.dist/remote/client/form.d.ts +1 -1
- package/.dist/remote/client/query.d.ts +12 -5
- package/.dist/remote/client/responses.d.ts +2 -2
- package/.dist/remote/client/types.d.ts +57 -13
- package/.dist/remote/client.js +1 -1
- package/.dist/runtime/preprocess.d.ts +1 -0
- package/.dist/runtime/preprocess.js +5 -29
- package/.dist/runtime/preprocess.js.map +1 -1
- package/.dist/runtime/transform.d.ts +35 -0
- package/.dist/server/effects.d.ts +3 -3
- package/.dist/server/factories.d.ts +10 -38
- package/.dist/server/index.d.ts +1 -1
- package/.dist/server/invalid.d.ts +1 -1
- package/.dist/server/schema.d.ts +1 -1
- package/.dist/server/types.d.ts +51 -31
- package/.dist/server/wrappers.d.ts +4 -6
- package/.dist/server.d.ts +1 -1
- package/.dist/server.js +8 -15
- package/.dist/server.js.map +1 -1
- package/.dist/vite.js +32 -1
- package/.dist/vite.js.map +1 -1
- package/package.json +1 -1
- package/.dist/chunks/client-CfkB_G4o.js.map +0 -1
- package/.dist/chunks/dispatcher-8B6Ol80H.js.map +0 -1
- package/.dist/chunks/preprocess-Cn4JH9OO.js.map +0 -1
- package/.dist/chunks/transform-s9gKPYu5.js.map +0 -1
|
@@ -31,6 +31,7 @@ export interface ScriptTransformResult {
|
|
|
31
31
|
*/
|
|
32
32
|
export interface TempBinding {
|
|
33
33
|
name: string;
|
|
34
|
+
type?: string;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* Describes how a single statement was lowered.
|
|
@@ -40,6 +41,8 @@ export interface TempBinding {
|
|
|
40
41
|
export interface LoweredStatement {
|
|
41
42
|
/** `$state` bindings to emit at component scope. */
|
|
42
43
|
temps: TempBinding[];
|
|
44
|
+
/** Helper declarations used only for generated temp types. */
|
|
45
|
+
type_helpers?: string[];
|
|
43
46
|
/** The rewritten statement text with yield* replaced by temp refs. */
|
|
44
47
|
rewritten_text: string;
|
|
45
48
|
/** Effect bodies to emit in dependency-tracked runtime blocks. */
|
|
@@ -69,6 +72,7 @@ export interface EffectBlock {
|
|
|
69
72
|
*/
|
|
70
73
|
export interface LoweredExpression {
|
|
71
74
|
temps: TempBinding[];
|
|
75
|
+
type_helpers?: string[];
|
|
72
76
|
rewritten_expr: string;
|
|
73
77
|
effect_blocks: EffectBlock[];
|
|
74
78
|
}
|
|
@@ -78,5 +82,28 @@ export interface LoweredExpression {
|
|
|
78
82
|
* @since 2.0.0
|
|
79
83
|
*/
|
|
80
84
|
export interface ScriptLoweringContext {
|
|
85
|
+
effect_name: string;
|
|
86
|
+
/** Whether generated state placeholders should carry TypeScript types. */
|
|
87
|
+
emit_types: boolean;
|
|
81
88
|
next_temp_name(hint?: string): string;
|
|
89
|
+
next_type_helper_name(hint?: string): string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Runtime import bindings selected for generated script effect code.
|
|
93
|
+
*
|
|
94
|
+
* @since 2.4.2
|
|
95
|
+
*/
|
|
96
|
+
export interface RuntimeImportBindings {
|
|
97
|
+
/** Binding name used for the Effect namespace in generated code. */
|
|
98
|
+
effect: string;
|
|
99
|
+
/** Binding name used for the dispatcher factory in generated code. */
|
|
100
|
+
dispatcher: string;
|
|
101
|
+
/** Binding name used for the active dispatcher local. */
|
|
102
|
+
dispatcher_value: string;
|
|
103
|
+
/** Binding name used for the generated Effect program local. */
|
|
104
|
+
program: string;
|
|
105
|
+
/** Binding name used for the generated cancel function local. */
|
|
106
|
+
cancel: string;
|
|
107
|
+
/** Binding name used for Svelte's untrack helper. */
|
|
108
|
+
untrack: string;
|
|
82
109
|
}
|
package/.dist/preprocess.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as transform_markup_effect } from "./chunks/transform-
|
|
2
|
-
import { t as transform_script_effect } from "./chunks/preprocess-
|
|
1
|
+
import { t as transform_markup_effect } from "./chunks/transform-Cx5bjmP6.js";
|
|
2
|
+
import { t as transform_script_effect } from "./chunks/preprocess-DseI9Doo.js";
|
|
3
3
|
export { transform_markup_effect, transform_script_effect };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { RemoteFailure } from "../shared.js";
|
|
2
2
|
import type { Effect } from "effect";
|
|
3
3
|
import type { Pending } from "./types.js";
|
|
4
|
+
type EffectRemoteCommandAdapter<Input, Output, ErrorType = never> = ((input: undefined extends Input ? Input | void : Input) => Effect.Effect<Output, RemoteFailure<ErrorType>>) & {
|
|
5
|
+
readonly pending: number;
|
|
6
|
+
};
|
|
4
7
|
/**
|
|
5
8
|
* Creates a remote command adapter. The adapter preserves the native
|
|
6
9
|
* pending getter and turns each invocation into an Effect.
|
|
@@ -14,4 +17,5 @@ import type { Pending } from "./types.js";
|
|
|
14
17
|
* @returns A function returning an Effect of the response.
|
|
15
18
|
* @internal
|
|
16
19
|
*/
|
|
17
|
-
export declare function create_remote_command_adapter<Input, Output>(native_factory: unknown, decode_payload: (value: unknown) => unknown, _base?: string, pending?: Pending):
|
|
20
|
+
export declare function create_remote_command_adapter<Input, Output, ErrorType = never>(native_factory: unknown, decode_payload: (value: unknown) => unknown, _base?: string, pending?: Pending): EffectRemoteCommandAdapter<Input, Output, ErrorType>;
|
|
21
|
+
export {};
|
|
@@ -12,4 +12,4 @@ import { Effect } from "effect";
|
|
|
12
12
|
* @param run - Promise-producing operation that invokes a native remote helper.
|
|
13
13
|
* @returns Effect that maps thrown values into remote failures.
|
|
14
14
|
*/
|
|
15
|
-
export declare function make_effect_from_promise<Output>(run: () => Promise<Output>): Effect.Effect<Output, RemoteFailure<
|
|
15
|
+
export declare function make_effect_from_promise<Output, ErrorType = never>(run: () => Promise<Output>): Effect.Effect<Output, RemoteFailure<ErrorType>>;
|
|
@@ -13,7 +13,7 @@ import type { FormIssue, RemoteFailure } from "../shared.js";
|
|
|
13
13
|
* @param decode - Optional devalue decoder for custom error payloads.
|
|
14
14
|
* @returns The decoded failure/value, or a transport error when decoding fails.
|
|
15
15
|
*/
|
|
16
|
-
export declare function decode_remote_error(raw: unknown, decode?: (encoded: string) => unknown): RemoteFailure<
|
|
16
|
+
export declare function decode_remote_error<ErrorType = never>(raw: unknown, decode?: (encoded: string) => unknown): RemoteFailure<ErrorType> | unknown;
|
|
17
17
|
/**
|
|
18
18
|
* Checks whether a decoded value is a tagged remote failure.
|
|
19
19
|
*
|
|
@@ -26,7 +26,7 @@ export declare function decode_remote_error(raw: unknown, decode?: (encoded: str
|
|
|
26
26
|
* @param value - Value to inspect.
|
|
27
27
|
* @returns Whether the value carries a `_tag` discriminator.
|
|
28
28
|
*/
|
|
29
|
-
export declare function is_decoded_remote_failure(value: unknown): value is RemoteFailure<
|
|
29
|
+
export declare function is_decoded_remote_failure(value: unknown): value is RemoteFailure<never>;
|
|
30
30
|
/**
|
|
31
31
|
* Checks whether a response body represents SvelteKit validation issues.
|
|
32
32
|
*
|
|
@@ -54,4 +54,4 @@ export declare function is_validation_body(value: unknown): value is {
|
|
|
54
54
|
* @param error - Unknown value thrown by a native remote helper.
|
|
55
55
|
* @returns A typed remote failure.
|
|
56
56
|
*/
|
|
57
|
-
export declare function normalize_native_error(error: unknown): RemoteFailure<
|
|
57
|
+
export declare function normalize_native_error<ErrorType = never>(error: unknown): RemoteFailure<ErrorType>;
|
|
@@ -6,4 +6,4 @@ import type { NativeMethod } from "./types.js";
|
|
|
6
6
|
* @param callback - Native enhance callback to wrap.
|
|
7
7
|
* @returns Wrapped callback or undefined.
|
|
8
8
|
*/
|
|
9
|
-
export declare function wrap_enhance_callback(callback: NativeMethod | undefined): NativeMethod | undefined;
|
|
9
|
+
export declare function wrap_enhance_callback<Output, ErrorType = never>(callback: NativeMethod | undefined): NativeMethod | undefined;
|
|
@@ -18,4 +18,4 @@ import type { EffectRemoteForm } from "./types.js";
|
|
|
18
18
|
* @returns A callable form function whose properties mirror the native form.
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
|
-
export declare function create_remote_form_adapter<Input extends RemoteFormInput | void, Output>(native_factory: unknown, decode_payload: (value: unknown) => unknown, remote_base?: string): EffectRemoteForm<Input, Output>;
|
|
21
|
+
export declare function create_remote_form_adapter<Input extends RemoteFormInput | void, Output, ErrorType = never>(native_factory: unknown, decode_payload: (value: unknown) => unknown, remote_base?: string): EffectRemoteForm<Input, Output, ErrorType>;
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
+
import type { EffectRemoteQueryUpdateBrand } from "./types.js";
|
|
1
2
|
import type { RemoteFailure } from "../shared.js";
|
|
2
3
|
import { Effect } from "effect";
|
|
3
|
-
type
|
|
4
|
+
type RemoteInput<Input> = undefined extends Input ? Input | void : Input;
|
|
5
|
+
type DecodePayload<Output> = (value: unknown) => Output;
|
|
6
|
+
type NativeQueryFactory<Input> = ((input: RemoteInput<Input>) => unknown) | {
|
|
7
|
+
readonly load: (input: RemoteInput<Input>) => unknown;
|
|
8
|
+
};
|
|
9
|
+
type RemoteResourceEffect<Output, ErrorType = never> = Effect.Effect<Output, RemoteFailure<ErrorType>> & {
|
|
4
10
|
readonly current: Output | undefined;
|
|
5
11
|
readonly error: unknown;
|
|
6
12
|
readonly loading: boolean;
|
|
7
13
|
readonly ready: boolean;
|
|
8
14
|
};
|
|
9
|
-
type RemoteQueryEffect<Output> = RemoteResourceEffect<Output> & {
|
|
15
|
+
type RemoteQueryEffect<Output, ErrorType = never> = RemoteResourceEffect<Output, ErrorType> & {
|
|
10
16
|
readonly refresh: () => Effect.Effect<void, unknown, never>;
|
|
11
17
|
readonly set: (value: Output) => void;
|
|
12
18
|
readonly withOverride: (update: (current: Output) => Output) => unknown;
|
|
13
19
|
};
|
|
14
|
-
type RemoteLiveQueryEffect<Output> = Effect.Effect<RemoteLiveQueryResource<Output>, RemoteFailure<
|
|
20
|
+
type RemoteLiveQueryEffect<Output, ErrorType = never> = Effect.Effect<RemoteLiveQueryResource<Output>, RemoteFailure<ErrorType>>;
|
|
15
21
|
type RemoteLiveQueryResource<Output> = {
|
|
16
22
|
readonly connected: boolean;
|
|
17
23
|
readonly current: Output | undefined;
|
|
@@ -39,7 +45,8 @@ type RemoteLiveQueryResource<Output> = {
|
|
|
39
45
|
* @returns A function returning an Effect of the response.
|
|
40
46
|
* @internal
|
|
41
47
|
*/
|
|
42
|
-
export declare function create_remote_query_adapter<Input, Output>(native_factory:
|
|
48
|
+
export declare function create_remote_query_adapter<Input, Output, ErrorType = never>(native_factory: NativeQueryFactory<Input>, decode_payload: DecodePayload<Output>, _base?: string): EffectRemoteQueryUpdateBrand & ((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);
|
|
49
|
+
export declare function create_remote_query_adapter<Input, Output, ErrorType = never>(native_factory: NativeQueryFactory<Input>, decode_payload: (value: unknown) => unknown, _base?: string): EffectRemoteQueryUpdateBrand & ((input: RemoteInput<Input>) => RemoteQueryEffect<Output, ErrorType>);
|
|
43
50
|
/**
|
|
44
51
|
* Creates a remote live query adapter. The returned function takes input and
|
|
45
52
|
* returns an `Effect` that resolves to a live query resource with stream state
|
|
@@ -60,5 +67,5 @@ export declare function create_remote_query_adapter<Input, Output>(native_factor
|
|
|
60
67
|
* @returns A function returning an Effect-backed live query resource.
|
|
61
68
|
* @internal
|
|
62
69
|
*/
|
|
63
|
-
export declare function create_remote_live_query_adapter<Input, Output>(native_factory: unknown, _decode_payload: (value: unknown) => unknown, _base?: string): (input: Input) => RemoteLiveQueryEffect<Output
|
|
70
|
+
export declare function create_remote_live_query_adapter<Input, Output, ErrorType = never>(native_factory: unknown, _decode_payload: (value: unknown) => unknown, _base?: string): EffectRemoteQueryUpdateBrand & ((input: RemoteInput<Input>) => RemoteLiveQueryEffect<Output, ErrorType>);
|
|
64
71
|
export {};
|
|
@@ -11,7 +11,7 @@ import type { RemoteFailure } from "../shared.js";
|
|
|
11
11
|
* @param response - Failed fetch response returned by the remote endpoint.
|
|
12
12
|
* @returns Remote failure represented by the response.
|
|
13
13
|
*/
|
|
14
|
-
export declare function decode_response_failure(response: Response): Promise<RemoteFailure<
|
|
14
|
+
export declare function decode_response_failure<ErrorType = never>(response: Response): Promise<RemoteFailure<ErrorType>>;
|
|
15
15
|
/**
|
|
16
16
|
* Decodes either a raw value or `Response` returned by a native remote helper.
|
|
17
17
|
*
|
|
@@ -25,4 +25,4 @@ export declare function decode_response_failure(response: Response): Promise<Rem
|
|
|
25
25
|
* @param decode_payload - Function used to decode successful payloads.
|
|
26
26
|
* @returns Decoded successful output.
|
|
27
27
|
*/
|
|
28
|
-
export declare function decode_response_or_value<Output>(value: unknown, decode_payload: (value: unknown) => unknown): Promise<Output>;
|
|
28
|
+
export declare function decode_response_or_value<Output, ErrorType = never>(value: unknown, decode_payload: (value: unknown) => unknown): Promise<Output>;
|
|
@@ -1,6 +1,49 @@
|
|
|
1
|
-
import type { RemoteForm, RemoteFormInput } from "@sveltejs/kit";
|
|
1
|
+
import type { RemoteForm, RemoteFormInput, RemoteLiveQuery, RemoteQuery, RemoteQueryOverride } from "@sveltejs/kit";
|
|
2
2
|
import type { RemoteFailure } from "../shared.js";
|
|
3
3
|
import type { Effect } from "effect";
|
|
4
|
+
/**
|
|
5
|
+
* Type-only marker attached to SER query and live-query adapter functions so
|
|
6
|
+
* form updates can distinguish them from command adapters.
|
|
7
|
+
*
|
|
8
|
+
* @since 2.4.2
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const EFFECT_REMOTE_QUERY_UPDATE: unique symbol;
|
|
12
|
+
/**
|
|
13
|
+
* Type-only brand carried by SER query and live-query adapter functions.
|
|
14
|
+
*
|
|
15
|
+
* @since 2.4.2
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export type EffectRemoteQueryUpdateBrand = {
|
|
19
|
+
readonly [EFFECT_REMOTE_QUERY_UPDATE]: true;
|
|
20
|
+
};
|
|
21
|
+
type EffectRemoteFormCallable<Input extends RemoteFormInput | void, Output, ErrorType> = [Input] extends [void] ? () => Effect.Effect<Output, RemoteFailure<ErrorType>> : undefined extends Input ? (input?: Input) => Effect.Effect<Output, RemoteFailure<ErrorType>> : (input: Input) => Effect.Effect<Output, RemoteFailure<ErrorType>>;
|
|
22
|
+
type EffectRemoteQueryUpdate = NativeRemoteQueryUpdate | EffectRemoteQueryUpdateFunction | EffectRemoteLiveQueryUpdateFunction;
|
|
23
|
+
type EffectRemoteCommandUpdate = {
|
|
24
|
+
readonly pending: number;
|
|
25
|
+
};
|
|
26
|
+
type EffectRemoteQueryUpdateInput<Update> = Update extends EffectRemoteCommandUpdate ? never : Update extends EffectRemoteQueryUpdate ? Update : never;
|
|
27
|
+
type EffectRemoteQueryUpdates<Updates extends readonly unknown[]> = Updates & {
|
|
28
|
+
[Index in keyof Updates]: EffectRemoteQueryUpdateInput<Updates[Index]>;
|
|
29
|
+
};
|
|
30
|
+
type NativeRemoteQueryUpdate = RemoteQuery<unknown> | RemoteLiveQuery<unknown> | RemoteQueryOverride;
|
|
31
|
+
type EffectRemoteQueryUpdateFunction = EffectRemoteQueryUpdateBrand & ((input: never) => EffectRemoteQueryUpdateResource);
|
|
32
|
+
type EffectRemoteLiveQueryUpdateFunction = EffectRemoteQueryUpdateBrand & ((input: never) => Effect.Effect<EffectRemoteLiveQueryUpdateResource, unknown>);
|
|
33
|
+
type EffectRemoteQueryUpdateResource = Effect.Effect<unknown, unknown> & {
|
|
34
|
+
readonly refresh: () => Effect.Effect<void, unknown, never>;
|
|
35
|
+
readonly set: (value: never) => void;
|
|
36
|
+
readonly withOverride: (update: (current: never) => unknown) => unknown;
|
|
37
|
+
};
|
|
38
|
+
type EffectRemoteLiveQueryUpdateResource = {
|
|
39
|
+
readonly connected: boolean;
|
|
40
|
+
readonly current: unknown;
|
|
41
|
+
readonly done: boolean;
|
|
42
|
+
readonly error: unknown;
|
|
43
|
+
readonly loading: boolean;
|
|
44
|
+
readonly ready: boolean;
|
|
45
|
+
readonly reconnect: () => Effect.Effect<void, unknown, never>;
|
|
46
|
+
} & AsyncIterable<unknown>;
|
|
4
47
|
/**
|
|
5
48
|
* Represents a pending operation counter that remote command adapters
|
|
6
49
|
* use to track in-flight requests.
|
|
@@ -25,8 +68,8 @@ export type NativeMethod = (...args: unknown[]) => unknown;
|
|
|
25
68
|
*/
|
|
26
69
|
export type NativeFormRecord = Record<PropertyKey, unknown>;
|
|
27
70
|
/**
|
|
28
|
-
* Represents the form submit handle passed into an Effect-aware
|
|
29
|
-
* remote form callback.
|
|
71
|
+
* Represents the native form submit handle passed into an Effect-aware
|
|
72
|
+
* enhanced remote form callback.
|
|
30
73
|
*
|
|
31
74
|
* @example
|
|
32
75
|
* ```ts
|
|
@@ -39,8 +82,8 @@ export type NativeFormRecord = Record<PropertyKey, unknown>;
|
|
|
39
82
|
*
|
|
40
83
|
* @since 2.0.0
|
|
41
84
|
*/
|
|
42
|
-
export type EffectRemoteFormSubmit = Effect.Effect<
|
|
43
|
-
updates: (...updates:
|
|
85
|
+
export type EffectRemoteFormSubmit<Output = unknown, ErrorType = never> = Effect.Effect<Output | undefined, RemoteFailure<ErrorType>> & {
|
|
86
|
+
updates: <const Updates extends readonly unknown[]>(...updates: EffectRemoteQueryUpdates<Updates>) => Effect.Effect<Output | undefined, RemoteFailure<ErrorType>>;
|
|
44
87
|
};
|
|
45
88
|
/**
|
|
46
89
|
* Represents the callback payload passed to an Effect-aware remote form
|
|
@@ -58,8 +101,8 @@ export type EffectRemoteFormSubmit = Effect.Effect<unknown, RemoteFailure<unknow
|
|
|
58
101
|
*
|
|
59
102
|
* @since 2.0.0
|
|
60
103
|
*/
|
|
61
|
-
export type EffectRemoteFormEnhanceOptions<Input extends RemoteFormInput | void> = Omit<Parameters<RemoteForm<Input,
|
|
62
|
-
submit: () => EffectRemoteFormSubmit
|
|
104
|
+
export type EffectRemoteFormEnhanceOptions<Input extends RemoteFormInput | void, Output, ErrorType = never> = Omit<Parameters<RemoteForm<Input, Output>["enhance"]>[0] extends (options: infer Options) => unknown ? Options : never, "submit"> & {
|
|
105
|
+
submit: () => EffectRemoteFormSubmit<Output, ErrorType>;
|
|
63
106
|
};
|
|
64
107
|
/**
|
|
65
108
|
* Represents a SvelteKit remote form whose submission, validation, and
|
|
@@ -74,10 +117,11 @@ export type EffectRemoteFormEnhanceOptions<Input extends RemoteFormInput | void>
|
|
|
74
117
|
*
|
|
75
118
|
* @since 2.0.0
|
|
76
119
|
*/
|
|
77
|
-
export type EffectRemoteForm<Input extends RemoteFormInput | void, Output> =
|
|
78
|
-
enhance(callback?: (options: EffectRemoteFormEnhanceOptions<Input>) => void | Promise<void> | Effect.Effect<void, unknown, unknown>): ReturnType<RemoteForm<Input, Output>["enhance"]>;
|
|
79
|
-
for(id: Parameters<RemoteForm<Input, Output>["for"]>[0]): Omit<EffectRemoteForm<Input, Output>, "for">;
|
|
80
|
-
preflight(schema:
|
|
81
|
-
submit
|
|
82
|
-
validate(options?: Parameters<RemoteForm<Input, Output>["validate"]>[0]): Effect.Effect<void, RemoteFailure<
|
|
120
|
+
export type EffectRemoteForm<Input extends RemoteFormInput | void, Output, ErrorType = never> = EffectRemoteFormCallable<Input, Output, ErrorType> & Omit<RemoteForm<Input, Output>, "enhance" | "for" | "preflight" | "submit" | "validate"> & {
|
|
121
|
+
enhance(callback?: (options: EffectRemoteFormEnhanceOptions<Input, Output, ErrorType>) => void | Promise<void> | Effect.Effect<void, unknown, unknown>): ReturnType<RemoteForm<Input, Output>["enhance"]>;
|
|
122
|
+
for(id: Parameters<RemoteForm<Input, Output>["for"]>[0]): Omit<EffectRemoteForm<Input, Output, ErrorType>, "for">;
|
|
123
|
+
preflight(schema: Parameters<RemoteForm<Input, Output>["preflight"]>[0]): EffectRemoteForm<Input, Output, ErrorType>;
|
|
124
|
+
submit: EffectRemoteFormCallable<Input, Output, ErrorType>;
|
|
125
|
+
validate(options?: Parameters<RemoteForm<Input, Output>["validate"]>[0]): Effect.Effect<void, RemoteFailure<ErrorType>>;
|
|
83
126
|
};
|
|
127
|
+
export {};
|
package/.dist/remote/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as create_remote_command_adapter, n as create_remote_query_adapter, r as create_remote_form_adapter, t as create_remote_live_query_adapter } from "../chunks/client-
|
|
1
|
+
import { i as create_remote_command_adapter, n as create_remote_query_adapter, r as create_remote_form_adapter, t as create_remote_live_query_adapter } from "../chunks/client-Cj2X9lY-.js";
|
|
2
2
|
export { create_remote_command_adapter, create_remote_form_adapter, create_remote_live_query_adapter, create_remote_query_adapter };
|
|
@@ -36,3 +36,4 @@ interface PreprocessGroup {
|
|
|
36
36
|
export declare function preprocess(): PreprocessGroup;
|
|
37
37
|
export { type BlockRef, type ScriptTransformResult, transform_script_effect, } from "../preprocess.js";
|
|
38
38
|
export { type MarkupTransformResult, transform_markup_effect, } from "../markup/transform.js";
|
|
39
|
+
export { type SvelteTransformResult, transform_svelte_effect, } from "./transform.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as transform_markup_effect } from "../chunks/transform-
|
|
2
|
-
import { t as transform_script_effect } from "../chunks/preprocess-
|
|
1
|
+
import { t as transform_markup_effect } from "../chunks/transform-Cx5bjmP6.js";
|
|
2
|
+
import { t as transform_script_effect } from "../chunks/preprocess-DseI9Doo.js";
|
|
3
|
+
import { t as transform_svelte_effect } from "../chunks/transform-BDfspL1K.js";
|
|
3
4
|
//#region src/runtime/preprocess.ts
|
|
4
5
|
/**
|
|
5
6
|
* Svelte preprocessor that lowers `yield*` in script and markup blocks.
|
|
@@ -20,36 +21,11 @@ function preprocess() {
|
|
|
20
21
|
return {
|
|
21
22
|
name: "svelte-effect-runtime",
|
|
22
23
|
markup({ content, filename }) {
|
|
23
|
-
|
|
24
|
-
const script = find_script(content);
|
|
25
|
-
let combined = content;
|
|
26
|
-
if (script?.has_effect) {
|
|
27
|
-
const result = transform_script_effect(script.text, resolved_filename);
|
|
28
|
-
combined = content.slice(0, script.effect_attr_start) + content.slice(script.effect_attr_end, script.open_end) + result.code + content.slice(script.close_start);
|
|
29
|
-
}
|
|
30
|
-
return { code: transform_markup_effect(combined, resolved_filename).code };
|
|
24
|
+
return { code: transform_svelte_effect(content, filename ?? "unknown.svelte").code };
|
|
31
25
|
}
|
|
32
26
|
};
|
|
33
27
|
}
|
|
34
|
-
function find_script(content) {
|
|
35
|
-
for (const match of content.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)) {
|
|
36
|
-
if (match.index === void 0 || /\bmodule\b/.test(match[1] ?? "")) continue;
|
|
37
|
-
const attrs = match[1] ?? "";
|
|
38
|
-
const effect_match = /\s+effect(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?/.exec(attrs);
|
|
39
|
-
const open_end = match.index + match[0].indexOf(">") + 1;
|
|
40
|
-
const attr_start = effect_match?.index ?? attrs.length;
|
|
41
|
-
const attr_end = attr_start + (effect_match?.[0].length ?? 0);
|
|
42
|
-
return {
|
|
43
|
-
text: match[2],
|
|
44
|
-
open_end,
|
|
45
|
-
close_start: match.index + match[0].lastIndexOf("<"),
|
|
46
|
-
has_effect: effect_match !== null,
|
|
47
|
-
effect_attr_start: match.index + 7 + attr_start,
|
|
48
|
-
effect_attr_end: match.index + 7 + attr_end
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
28
|
//#endregion
|
|
53
|
-
export { preprocess, transform_markup_effect, transform_script_effect };
|
|
29
|
+
export { preprocess, transform_markup_effect, transform_script_effect, transform_svelte_effect };
|
|
54
30
|
|
|
55
31
|
//# sourceMappingURL=preprocess.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocess.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/runtime/preprocess.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"preprocess.js","names":[],"sources":["../../../modules/svelte-effect-runtime/src/runtime/preprocess.ts"],"sourcesContent":["import { transform_script_effect } from \"$/preprocess.ts\";\nimport { transform_svelte_effect } from \"./transform.ts\";\n\n/**\n * Result returned by the Svelte markup preprocessor hook.\n *\n * @since 2.0.0\n */\ninterface MarkupResult {\n code: string;\n}\n\n/**\n * Minimal Svelte preprocessor group shape used by the runtime.\n *\n * @since 2.0.0\n */\ninterface PreprocessGroup {\n name: string;\n markup(options: { content: string; filename?: string }): MarkupResult;\n}\n\n/**\n * Svelte preprocessor that lowers `yield*` in script and markup blocks.\n *\n * @example\n * ```js\n * import { preprocess } from \"svelte-effect-runtime\";\n *\n * export default {\n * preprocess: [preprocess()],\n * };\n * ```\n *\n * @since 2.0.0\n * @returns A Svelte preprocessor group with a `markup` hook.\n */\nexport function preprocess(): PreprocessGroup {\n return {\n name: \"svelte-effect-runtime\",\n\n markup({ content, filename }: { content: string; filename?: string }) {\n const resolved_filename = filename ?? \"unknown.svelte\";\n const result = transform_svelte_effect(content, resolved_filename);\n\n return { code: result.code };\n },\n };\n}\n\nexport {\n type BlockRef,\n type ScriptTransformResult,\n transform_script_effect,\n} from \"$/preprocess.ts\";\n\nexport {\n type MarkupTransformResult,\n transform_markup_effect,\n} from \"$/markup/transform.ts\";\n\nexport {\n type SvelteTransformResult,\n transform_svelte_effect,\n} from \"./transform.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,aAA8B;CAC5C,OAAO;EACL,MAAM;EAEN,OAAO,EAAE,SAAS,YAAoD;GAIpE,OAAO,EAAE,MAFM,wBAAwB,SADb,YAAY,gBAGlB,EAAE,KAAK;EAC7B;CACF;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result returned by the direct whole-file Svelte transform.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const result = transform_svelte_effect("<p>{yield* load()}</p>", "App.svelte");
|
|
7
|
+
* result.code;
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @since 2.5.0
|
|
11
|
+
*/
|
|
12
|
+
export interface SvelteTransformResult {
|
|
13
|
+
/** Transformed Svelte source. */
|
|
14
|
+
code: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Lowers SER syntax in a complete Svelte component without using Svelte's
|
|
18
|
+
* preprocessor adapter API.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const result = transform_svelte_effect(
|
|
23
|
+
* "<script effect>const value = yield* load()</script>",
|
|
24
|
+
* "App.svelte",
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @since 2.5.0
|
|
29
|
+
* @param content - Full Svelte component source to lower before Svelte parses
|
|
30
|
+
* it.
|
|
31
|
+
* @param filename - Component filename used in generated cache identifiers and
|
|
32
|
+
* diagnostics.
|
|
33
|
+
* @returns The transformed component source.
|
|
34
|
+
*/
|
|
35
|
+
export declare function transform_svelte_effect(content: string, filename?: string): SvelteTransformResult;
|
|
@@ -2,7 +2,7 @@ import { Effect } from "effect";
|
|
|
2
2
|
import type { RequestEvent as RequestEventShape } from "./runtime.js";
|
|
3
3
|
import type { EffectLike, EffectRemoteLiveSource } from "./types.js";
|
|
4
4
|
type ResolvedLiveSource<A> = AsyncIterable<A> | AsyncIterator<A> | Iterable<A> | Iterator<A>;
|
|
5
|
-
type LiveHandlerResult<A> = EffectLike<EffectRemoteLiveSource<A
|
|
5
|
+
type LiveHandlerResult<A> = EffectLike<EffectRemoteLiveSource<A>, unknown, unknown> | EffectRemoteLiveSource<A>;
|
|
6
6
|
/**
|
|
7
7
|
* Checks whether a value is an Effect generator return object.
|
|
8
8
|
*
|
|
@@ -18,7 +18,7 @@ export declare function is_generator_result<A>(value: unknown): value is Effect.
|
|
|
18
18
|
* @param value - Effect or generator return value.
|
|
19
19
|
* @returns Normalized Effect.
|
|
20
20
|
*/
|
|
21
|
-
export declare function to_effect<A>(value: EffectLike<A>): Effect.Effect<A,
|
|
21
|
+
export declare function to_effect<A, E, R>(value: EffectLike<A, E, R>): Effect.Effect<A, E, R>;
|
|
22
22
|
/**
|
|
23
23
|
* Checks whether a value is a live query source SvelteKit can consume.
|
|
24
24
|
*
|
|
@@ -45,5 +45,5 @@ export declare function run_live_handler_source<A>(value: LiveHandlerResult<A>,
|
|
|
45
45
|
* @param event - SvelteKit request event for this remote call.
|
|
46
46
|
* @returns Promise resolving with the handler output.
|
|
47
47
|
*/
|
|
48
|
-
export declare function run_handler_effect<A>(value: EffectLike<A>, event: RequestEventShape): Promise<A>;
|
|
48
|
+
export declare function run_handler_effect<A>(value: EffectLike<A, unknown, unknown>, event: RequestEventShape): Promise<A>;
|
|
49
49
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { prerender as native_prerender } from "$app/server";
|
|
2
1
|
import type { RemoteFormInput } from "@sveltejs/kit";
|
|
3
2
|
import { type Schema } from "effect";
|
|
4
|
-
import type { EffectLike,
|
|
3
|
+
import type { EffectLike, EffectRemoteCommand, EffectRemoteForm, EffectRemoteFunction, PrerenderOptions, QueryFactory, RemoteFormHandler, RemoteHandler, SchemaEncodedInput, SchemaInput } from "./types.js";
|
|
5
4
|
type FormSchemaEncodedInput<S> = S extends Schema.Top ? FormRemoteInput<S["Encoded"]> : never;
|
|
6
5
|
type FormRemoteInput<Input> = NormalizeFormEncoded<Input> extends RemoteFormInput ? NormalizeFormEncoded<Input> : never;
|
|
7
6
|
type FormScalar = string | number | boolean | File;
|
|
@@ -12,35 +11,6 @@ type NormalizeFormObject<Value> = {
|
|
|
12
11
|
type OptionalFormKeys<Value> = {
|
|
13
12
|
[Key in keyof Value]-?: Record<PropertyKey, never> extends Pick<Value, Key> ? Key : never;
|
|
14
13
|
}[keyof Value];
|
|
15
|
-
type RemoteLiveHandler<Input = unknown, A = unknown> = EffectLike<EffectRemoteLiveSource<A>> | EffectRemoteLiveSource<A> | ((input: Input) => EffectLike<EffectRemoteLiveSource<A>> | EffectRemoteLiveSource<A>);
|
|
16
|
-
interface QueryFactory {
|
|
17
|
-
<A>(validate_or_handler: EffectLike<A> | RemoteHandler<void, A>): EffectRemoteQueryFunction<void, A>;
|
|
18
|
-
<Input, A>(validate_or_handler: "unchecked", maybe_handler: RemoteHandler<Input, A>): EffectRemoteQueryFunction<Input, A>;
|
|
19
|
-
<S extends Schema.Schema<unknown>, A>(validate_or_handler: S, maybe_handler: RemoteHandler<SchemaInput<S>, A>): EffectRemoteQueryFunction<SchemaInput<S>, A>;
|
|
20
|
-
readonly batch: typeof QueryBatch;
|
|
21
|
-
readonly live: typeof QueryLive;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Factory for a batched read-only remote query function.
|
|
25
|
-
*
|
|
26
|
-
* @since 2.0.0
|
|
27
|
-
* @param validate_or_handler - A schema or `"unchecked"` sentinel.
|
|
28
|
-
* @param maybe_handler - Handler receiving validated inputs as one batch.
|
|
29
|
-
* @returns A SvelteKit batch query function.
|
|
30
|
-
*/
|
|
31
|
-
declare function QueryBatch<Input, A>(validate_or_handler: "unchecked", maybe_handler: EffectRemoteBatchHandler<Input, A>): EffectRemoteQueryFunction<Input, A>;
|
|
32
|
-
declare function QueryBatch<S extends Schema.Schema<unknown>, A>(validate_or_handler: S, maybe_handler: EffectRemoteBatchHandler<SchemaInput<S>, A>): EffectRemoteQueryFunction<SchemaInput<S>, A>;
|
|
33
|
-
/**
|
|
34
|
-
* Factory for a live remote query function.
|
|
35
|
-
*
|
|
36
|
-
* @since 2.0.0
|
|
37
|
-
* @param validate_or_handler - A schema, `"unchecked"`, or no-arg live handler.
|
|
38
|
-
* @param maybe_handler - Handler used when a validator is supplied.
|
|
39
|
-
* @returns A SvelteKit live query function.
|
|
40
|
-
*/
|
|
41
|
-
declare function QueryLive<A>(validate_or_handler: RemoteLiveHandler<void, A>): EffectRemoteLiveQueryFunction<void, A>;
|
|
42
|
-
declare function QueryLive<Input, A>(validate_or_handler: "unchecked", maybe_handler: RemoteLiveHandler<Input, A>): EffectRemoteLiveQueryFunction<Input, A>;
|
|
43
|
-
declare function QueryLive<S extends Schema.Schema<unknown>, A>(validate_or_handler: S, maybe_handler: RemoteLiveHandler<SchemaInput<S>, A>): EffectRemoteLiveQueryFunction<SchemaInput<S>, A>;
|
|
44
14
|
/**
|
|
45
15
|
* Factory for read-only remote query functions.
|
|
46
16
|
*
|
|
@@ -66,9 +36,9 @@ export declare const Query: QueryFactory;
|
|
|
66
36
|
* @param maybe_handler - Handler used when a validator is supplied.
|
|
67
37
|
* @returns A SvelteKit command function.
|
|
68
38
|
*/
|
|
69
|
-
export declare function Command<A>(validate_or_handler: EffectLike<A> | RemoteHandler<void, A>): EffectRemoteCommand<void, A>;
|
|
70
|
-
export declare function Command<Input, A>(validate_or_handler: "unchecked", maybe_handler: RemoteHandler<Input, A>): EffectRemoteCommand<Input, A>;
|
|
71
|
-
export declare function Command<S extends Schema.Schema<unknown>, A>(validate_or_handler: S, maybe_handler: RemoteHandler<SchemaInput<S>, A>): EffectRemoteCommand<
|
|
39
|
+
export declare function Command<A, E = never, R = never>(validate_or_handler: EffectLike<A, E, R> | RemoteHandler<void, A, E, R>): EffectRemoteCommand<void, A, E>;
|
|
40
|
+
export declare function Command<Input, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteHandler<Input, A, E, R>): EffectRemoteCommand<Input, A, E>;
|
|
41
|
+
export declare function Command<S extends Schema.Schema<unknown>, A, E = never, R = never>(validate_or_handler: S, maybe_handler: RemoteHandler<SchemaInput<S>, A, E, R>): EffectRemoteCommand<SchemaEncodedInput<S>, A, E>;
|
|
72
42
|
/**
|
|
73
43
|
* Factory for a remote form handler.
|
|
74
44
|
*
|
|
@@ -90,9 +60,9 @@ export declare function Command<S extends Schema.Schema<unknown>, A>(validate_or
|
|
|
90
60
|
* @param maybe_handler - Handler used when a validator is supplied.
|
|
91
61
|
* @returns A SvelteKit form function.
|
|
92
62
|
*/
|
|
93
|
-
export declare function Form<A>(validate_or_handler: EffectLike<A> | RemoteFormHandler<void, A>): EffectRemoteForm<void, A>;
|
|
94
|
-
export declare function Form<Input extends RemoteFormInput, A>(validate_or_handler: "unchecked", maybe_handler: RemoteFormHandler<Input, A>): EffectRemoteForm<Input, A>;
|
|
95
|
-
export declare function Form<S extends Schema.Top, A>(validate_or_handler: S, maybe_handler: RemoteFormHandler<SchemaInput<S>, A>): EffectRemoteForm<FormSchemaEncodedInput<S>, A>;
|
|
63
|
+
export declare function Form<A, E = never, R = never>(validate_or_handler: EffectLike<A, E, R> | RemoteFormHandler<void, A, E, R>): EffectRemoteForm<void, A, E>;
|
|
64
|
+
export declare function Form<Input extends RemoteFormInput, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteFormHandler<Input, A, E, R>): EffectRemoteForm<Input, A, E>;
|
|
65
|
+
export declare function Form<S extends Schema.Top, A, E = never, R = never>(validate_or_handler: S, maybe_handler: RemoteFormHandler<SchemaInput<S>, A, E, R>): EffectRemoteForm<FormSchemaEncodedInput<S>, A, E>;
|
|
96
66
|
/**
|
|
97
67
|
* Factory for a prerenderable remote function.
|
|
98
68
|
*
|
|
@@ -102,5 +72,7 @@ export declare function Form<S extends Schema.Top, A>(validate_or_handler: S, ma
|
|
|
102
72
|
* @param maybe_options - Prerender options used with a validator.
|
|
103
73
|
* @returns A SvelteKit prerender function.
|
|
104
74
|
*/
|
|
105
|
-
export declare function Prerender(validate_or_handler:
|
|
75
|
+
export declare function Prerender<A, E = never, R = never>(validate_or_handler: EffectLike<A, E, R> | RemoteHandler<void, A, E, R>, maybe_options?: PrerenderOptions): EffectRemoteFunction<void, A, E>;
|
|
76
|
+
export declare function Prerender<Input, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteHandler<Input, A, E, R>, maybe_options?: PrerenderOptions): EffectRemoteFunction<Input, A, E>;
|
|
77
|
+
export declare function Prerender<S extends Schema.Schema<unknown>, A, E = never, R = never>(validate_or_handler: S, maybe_handler: RemoteHandler<SchemaInput<S>, A, E, R>, maybe_options?: PrerenderOptions): EffectRemoteFunction<SchemaEncodedInput<S>, A, E>;
|
|
106
78
|
export {};
|
package/.dist/server/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { Command, Form, Prerender, Query } from "./factories.js";
|
|
|
2
2
|
export { Error, Redirect } from "./control-flow.js";
|
|
3
3
|
export { get_server_runtime_or_throw, RequestEvent, ServerRuntime, } from "./runtime.js";
|
|
4
4
|
export type { ErrorEffectFactory, ErrorStatus, ErrorStatusName, RedirectEffectFactory, RedirectStatus, RedirectStatusName, } from "./control-flow.js";
|
|
5
|
-
export type { CommandFactory, EffectLike, EffectRemoteBatchHandler, EffectRemoteCommand, EffectRemoteForm, EffectRemoteFunction, EffectRemoteLiveQuery, EffectRemoteLiveQueryFunction, EffectRemoteLiveQueryResource, EffectRemoteLiveSource, EffectRemoteQuery, EffectRemoteQueryFunction, FormFactory, FormInvalid, PrerenderFactory, PrerenderOptions, QueryBatchFactory, QueryFactory, QueryLiveFactory, RemoteFormHandler, RemoteHandler, RemoteLiveHandler, SchemaInput, ServerRuntimeFactory, StandardSchema, } from "./types.js";
|
|
5
|
+
export type { CommandFactory, EffectLike, EffectRemoteBatchHandler, EffectRemoteCommand, EffectRemoteForm, EffectRemoteFunction, EffectRemoteLiveQuery, EffectRemoteLiveQueryFunction, EffectRemoteLiveQueryResource, EffectRemoteLiveSource, EffectRemoteQuery, EffectRemoteQueryFunction, FormFactory, FormInvalid, PrerenderFactory, PrerenderOptions, QueryBatchFactory, QueryFactory, QueryLiveFactory, RemoteFormHandler, RemoteHandler, RemoteLiveHandler, SchemaEncodedInput, SchemaInput, ServerRuntimeFactory, StandardSchema, } from "./types.js";
|
|
@@ -6,4 +6,4 @@ import type { FormInvalid } from "./types.js";
|
|
|
6
6
|
* @param path - Current nested form path.
|
|
7
7
|
* @returns Callable invalid proxy for this path.
|
|
8
8
|
*/
|
|
9
|
-
export declare function make_invalid_proxy(path?: readonly (string | number)[]): FormInvalid
|
|
9
|
+
export declare function make_invalid_proxy<Input = unknown>(path?: readonly (string | number)[]): FormInvalid<Input>;
|
package/.dist/server/schema.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function is_unchecked(value: unknown): value is "unchecked";
|
|
|
15
15
|
* @param value - Value to inspect.
|
|
16
16
|
* @returns Whether the value is callable as a handler.
|
|
17
17
|
*/
|
|
18
|
-
export declare function is_handler(value: unknown): value is RemoteHandler
|
|
18
|
+
export declare function is_handler(value: unknown): value is RemoteHandler<unknown, unknown, unknown, unknown>;
|
|
19
19
|
/**
|
|
20
20
|
* Checks whether a value implements the Standard Schema contract.
|
|
21
21
|
*
|