svelte-effect-runtime 4.2.4 → 4.2.7

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.
Files changed (31) hide show
  1. package/.dist/chunks/{client-CpWfP_1f.js → client-Bi7SwVVy.js} +23 -13
  2. package/.dist/chunks/client-Bi7SwVVy.js.map +1 -0
  3. package/.dist/chunks/{compiler-Dpyu4Owd.js → compiler-B91cq_Dh.js} +29 -5
  4. package/.dist/chunks/compiler-B91cq_Dh.js.map +1 -0
  5. package/.dist/chunks/{remote-client-mkQAfP1G.js → remote-client-C_3kdug0.js} +15 -4
  6. package/.dist/chunks/remote-client-C_3kdug0.js.map +1 -0
  7. package/.dist/chunks/{server-BNxq-pUH.js → server-Dxb9zr99.js} +16 -3
  8. package/.dist/chunks/server-Dxb9zr99.js.map +1 -0
  9. package/.dist/compiler/remote-client.d.ts +1 -0
  10. package/.dist/compiler.js +1 -1
  11. package/.dist/environment.d.ts +9 -3
  12. package/.dist/environment.js.map +1 -1
  13. package/.dist/internal/remote-client.js +1 -1
  14. package/.dist/internal/remote-server.js +1 -1
  15. package/.dist/mod.js +1 -1
  16. package/.dist/remote/client/form-data.d.ts +8 -1
  17. package/.dist/remote/client/form.d.ts +2 -2
  18. package/.dist/remote/client/types.d.ts +10 -11
  19. package/.dist/remote/client.js +1 -1
  20. package/.dist/remote/native-types.d.ts +292 -0
  21. package/.dist/remote/server.js +1 -1
  22. package/.dist/server/factories.d.ts +4 -4
  23. package/.dist/server/live-snapshot.d.ts +2 -2
  24. package/.dist/server/types.d.ts +7 -7
  25. package/.dist/server.js +3 -3
  26. package/.dist/server.js.map +1 -1
  27. package/package.json +2 -2
  28. package/.dist/chunks/client-CpWfP_1f.js.map +0 -1
  29. package/.dist/chunks/compiler-Dpyu4Owd.js.map +0 -1
  30. package/.dist/chunks/remote-client-mkQAfP1G.js.map +0 -1
  31. package/.dist/chunks/server-BNxq-pUH.js.map +0 -1
@@ -1,11 +1,17 @@
1
- import type { EnvVarConfig } from "@sveltejs/kit";
1
+ import type { StandardSchemaV1 } from "@sveltejs/kit/internal/types";
2
2
  import { Schema } from "effect";
3
3
  /**
4
- * The Standard Schema validator shape SvelteKit accepts for an environment variable.
4
+ * The Standard Schema validator shape SvelteKit accepts for an environment
5
+ * variable. Mirrors `EnvVarConfig["schema"]` structurally rather than
6
+ * importing it, because SvelteKit 2 declares `EnvVarConfig` in
7
+ * `@sveltejs/kit` while SvelteKit 3 (since `3.0.0-next.20`) declares it only
8
+ * in `@sveltejs/kit/env`. SvelteKit's generated `$app/env/*` types infer each
9
+ * variable through `StandardSchemaV1.InferOutput`, so the normalized schema
10
+ * member must stay exactly this shape.
5
11
  *
6
12
  * @since 4.2.0
7
13
  */
8
- export type StandardSchema<Output = unknown> = NonNullable<EnvVarConfig<Output>["schema"]>;
14
+ export type StandardSchema<Output = unknown> = StandardSchemaV1<string | undefined, Output>;
9
15
  /**
10
16
  * A validator accepted by {@link DefineEnvVars}: an Effect Schema that decodes
11
17
  * synchronously from the raw string value, or an existing Standard Schema.
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","names":[],"sources":["../../modules/svelte-effect-runtime/src/environment.ts"],"sourcesContent":["import type { EnvVarConfig } from \"@sveltejs/kit\";\nimport { Schema } from \"effect\";\n\n/**\n * The Standard Schema validator shape SvelteKit accepts for an environment variable.\n *\n * @since 4.2.0\n */\nexport type StandardSchema<Output = unknown> = NonNullable<EnvVarConfig<Output>[\"schema\"]>;\n\n/**\n * A validator accepted by {@link DefineEnvVars}: an Effect Schema that decodes\n * synchronously from the raw string value, or an existing Standard Schema.\n *\n * @since 4.2.0\n */\nexport type EnvironmentSchema =\n\t| (Schema.ConstraintDecoder<unknown, never> & {\n\t\t\treadonly Encoded: string | undefined;\n\t })\n\t| StandardSchema<unknown>;\n\n/**\n * The decoded output type an environment schema produces.\n *\n * @since 4.2.0\n */\nexport type EnvironmentSchemaOutput<S extends EnvironmentSchema> = S extends Schema.Constraint\n\t? S[\"Type\"]\n\t: S extends StandardSchema<infer Output>\n\t\t? Output\n\t\t: never;\n\n/**\n * One environment variable declaration: SvelteKit's metadata plus an Effect\n * Schema or Standard Schema validator.\n *\n * @since 4.2.0\n */\nexport interface EnvironmentVariable<S extends EnvironmentSchema = EnvironmentSchema> {\n\treadonly public?: boolean;\n\treadonly static?: boolean;\n\treadonly description?: string;\n\treadonly schema?: S;\n}\n\n/**\n * Environment variable declarations keyed by variable name.\n *\n * @since 4.2.0\n */\nexport type EnvironmentDefinition = Record<string, EnvironmentVariable>;\n\n/**\n * The normalized declarations {@link DefineEnvVars} returns, with every Effect\n * Schema converted to a Standard Schema of the same decoded output type.\n *\n * @since 4.2.0\n */\nexport type EnvironmentVariables<Definition extends EnvironmentDefinition> = {\n\treadonly [Name in keyof Definition]: Omit<Definition[Name], \"schema\"> &\n\t\tNormalizedVariableSchema<Definition[Name][\"schema\"]>;\n};\n\n/** Keeps the schema member sound when a declaration's schema type includes undefined. */\ntype NormalizedVariableSchema<S> = [S] extends [EnvironmentSchema]\n\t? { readonly schema: StandardSchema<EnvironmentSchemaOutput<S>> }\n\t: [S] extends [undefined]\n\t\t? { readonly schema?: undefined }\n\t\t: {\n\t\t\t\treadonly schema?: StandardSchema<\n\t\t\t\t\tEnvironmentSchemaOutput<Extract<S, EnvironmentSchema>>\n\t\t\t\t>;\n\t\t\t};\n\n/**\n * Declares SvelteKit environment variables with Effect Schema validators.\n *\n * A thin wrapper over SvelteKit's `defineEnvVars` that converts Effect Schemas\n * to the Standard Schema interface SvelteKit validates at startup. Standard\n * Schema validators and schema-less declarations pass through unchanged, and\n * SvelteKit remains responsible for loading, visibility, and validation.\n * Schemas must decode synchronously from the raw string value.\n *\n * @example\n * ```ts\n * // src/env.ts\n * import { DefineEnvVars } from \"svelte-effect-runtime/environment\";\n * import { Schema } from \"effect\";\n *\n * export const variables = DefineEnvVars({\n * PORT: { schema: Schema.NumberFromString, description: \"Server port.\" },\n * PUBLIC_ORIGIN: { public: true, schema: Schema.URLFromString },\n * });\n * ```\n *\n * @since 4.2.0\n * @param definition - Environment variable declarations keyed by variable name,\n * each carrying SvelteKit's metadata plus an Effect Schema or Standard Schema.\n * @returns The same declarations with every Effect Schema converted to a\n * Standard Schema, ready to export as `variables` from `src/env.ts`.\n */\nexport function DefineEnvVars<const Definition extends EnvironmentDefinition>(\n\tdefinition: Definition,\n): EnvironmentVariables<Definition> {\n\tconst entries = Object.entries(definition).map(([name, variable]) => [\n\t\tname,\n\t\tnormalize_variable(variable),\n\t]);\n\n\treturn Object.fromEntries(entries) as EnvironmentVariables<Definition>;\n}\n\nfunction normalize_variable(variable: EnvironmentVariable): EnvironmentVariable {\n\tif (variable.schema === undefined || !Schema.isSchema(variable.schema)) {\n\t\treturn variable;\n\t}\n\n\treturn {\n\t\t...variable,\n\t\tschema: Schema.toStandardSchemaV1(\n\t\t\tvariable.schema as Schema.ConstraintDecoder<unknown, never>,\n\t\t) as StandardSchema,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGA,SAAgB,cACf,YACmC;CACnC,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,cAAc,CACpE,MACA,mBAAmB,QAAQ,CAC5B,CAAC;CAED,OAAO,OAAO,YAAY,OAAO;AAClC;AAEA,SAAS,mBAAmB,UAAoD;CAC/E,IAAI,SAAS,WAAW,KAAA,KAAa,CAAC,OAAO,SAAS,SAAS,MAAM,GACpE,OAAO;CAGR,OAAO;EACN,GAAG;EACH,QAAQ,OAAO,mBACd,SAAS,MACV;CACD;AACD"}
1
+ {"version":3,"file":"environment.js","names":[],"sources":["../../modules/svelte-effect-runtime/src/environment.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@sveltejs/kit/internal/types\";\nimport { Schema } from \"effect\";\n\n/**\n * The Standard Schema validator shape SvelteKit accepts for an environment\n * variable. Mirrors `EnvVarConfig[\"schema\"]` structurally rather than\n * importing it, because SvelteKit 2 declares `EnvVarConfig` in\n * `@sveltejs/kit` while SvelteKit 3 (since `3.0.0-next.20`) declares it only\n * in `@sveltejs/kit/env`. SvelteKit's generated `$app/env/*` types infer each\n * variable through `StandardSchemaV1.InferOutput`, so the normalized schema\n * member must stay exactly this shape.\n *\n * @since 4.2.0\n */\nexport type StandardSchema<Output = unknown> = StandardSchemaV1<string | undefined, Output>;\n\n/**\n * A validator accepted by {@link DefineEnvVars}: an Effect Schema that decodes\n * synchronously from the raw string value, or an existing Standard Schema.\n *\n * @since 4.2.0\n */\nexport type EnvironmentSchema =\n\t| (Schema.ConstraintDecoder<unknown, never> & {\n\t\t\treadonly Encoded: string | undefined;\n\t })\n\t| StandardSchema<unknown>;\n\n/**\n * The decoded output type an environment schema produces.\n *\n * @since 4.2.0\n */\nexport type EnvironmentSchemaOutput<S extends EnvironmentSchema> = S extends Schema.Constraint\n\t? S[\"Type\"]\n\t: S extends StandardSchema<infer Output>\n\t\t? Output\n\t\t: never;\n\n/**\n * One environment variable declaration: SvelteKit's metadata plus an Effect\n * Schema or Standard Schema validator.\n *\n * @since 4.2.0\n */\nexport interface EnvironmentVariable<S extends EnvironmentSchema = EnvironmentSchema> {\n\treadonly public?: boolean;\n\treadonly static?: boolean;\n\treadonly description?: string;\n\treadonly schema?: S;\n}\n\n/**\n * Environment variable declarations keyed by variable name.\n *\n * @since 4.2.0\n */\nexport type EnvironmentDefinition = Record<string, EnvironmentVariable>;\n\n/**\n * The normalized declarations {@link DefineEnvVars} returns, with every Effect\n * Schema converted to a Standard Schema of the same decoded output type.\n *\n * @since 4.2.0\n */\nexport type EnvironmentVariables<Definition extends EnvironmentDefinition> = {\n\treadonly [Name in keyof Definition]: Omit<Definition[Name], \"schema\"> &\n\t\tNormalizedVariableSchema<Definition[Name][\"schema\"]>;\n};\n\n/** Keeps the schema member sound when a declaration's schema type includes undefined. */\ntype NormalizedVariableSchema<S> = [S] extends [EnvironmentSchema]\n\t? { readonly schema: StandardSchema<EnvironmentSchemaOutput<S>> }\n\t: [S] extends [undefined]\n\t\t? { readonly schema?: undefined }\n\t\t: {\n\t\t\t\treadonly schema?: StandardSchema<\n\t\t\t\t\tEnvironmentSchemaOutput<Extract<S, EnvironmentSchema>>\n\t\t\t\t>;\n\t\t\t};\n\n/**\n * Declares SvelteKit environment variables with Effect Schema validators.\n *\n * A thin wrapper over SvelteKit's `defineEnvVars` that converts Effect Schemas\n * to the Standard Schema interface SvelteKit validates at startup. Standard\n * Schema validators and schema-less declarations pass through unchanged, and\n * SvelteKit remains responsible for loading, visibility, and validation.\n * Schemas must decode synchronously from the raw string value.\n *\n * @example\n * ```ts\n * // src/env.ts\n * import { DefineEnvVars } from \"svelte-effect-runtime/environment\";\n * import { Schema } from \"effect\";\n *\n * export const variables = DefineEnvVars({\n * PORT: { schema: Schema.NumberFromString, description: \"Server port.\" },\n * PUBLIC_ORIGIN: { public: true, schema: Schema.URLFromString },\n * });\n * ```\n *\n * @since 4.2.0\n * @param definition - Environment variable declarations keyed by variable name,\n * each carrying SvelteKit's metadata plus an Effect Schema or Standard Schema.\n * @returns The same declarations with every Effect Schema converted to a\n * Standard Schema, ready to export as `variables` from `src/env.ts`.\n */\nexport function DefineEnvVars<const Definition extends EnvironmentDefinition>(\n\tdefinition: Definition,\n): EnvironmentVariables<Definition> {\n\tconst entries = Object.entries(definition).map(([name, variable]) => [\n\t\tname,\n\t\tnormalize_variable(variable),\n\t]);\n\n\treturn Object.fromEntries(entries) as EnvironmentVariables<Definition>;\n}\n\nfunction normalize_variable(variable: EnvironmentVariable): EnvironmentVariable {\n\tif (variable.schema === undefined || !Schema.isSchema(variable.schema)) {\n\t\treturn variable;\n\t}\n\n\treturn {\n\t\t...variable,\n\t\tschema: Schema.toStandardSchemaV1(\n\t\t\tvariable.schema as Schema.ConstraintDecoder<unknown, never>,\n\t\t) as StandardSchema,\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GA,SAAgB,cACf,YACmC;CACnC,MAAM,UAAU,OAAO,QAAQ,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,cAAc,CACpE,MACA,mBAAmB,QAAQ,CAC5B,CAAC;CAED,OAAO,OAAO,YAAY,OAAO;AAClC;AAEA,SAAS,mBAAmB,UAAoD;CAC/E,IAAI,SAAS,WAAW,KAAA,KAAa,CAAC,OAAO,SAAS,SAAS,MAAM,GACpE,OAAO;CAGR,OAAO;EACN,GAAG;EACH,QAAQ,OAAO,mBACd,SAAS,MACV;CACD;AACD"}
@@ -1,2 +1,2 @@
1
- import { a as create_remote_command_adapter, i as create_remote_form_adapter, n as create_remote_query_adapter, r as create_remote_prerender_adapter, t as create_remote_live_query_adapter } from "../chunks/client-CpWfP_1f.js";
1
+ import { a as create_remote_command_adapter, i as create_remote_form_adapter, n as create_remote_query_adapter, r as create_remote_prerender_adapter, t as create_remote_live_query_adapter } from "../chunks/client-Bi7SwVVy.js";
2
2
  export { create_remote_command_adapter, create_remote_form_adapter, create_remote_live_query_adapter, create_remote_prerender_adapter, create_remote_query_adapter };
@@ -1,2 +1,2 @@
1
- import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, o as encode_remote_failure, r as throw_form_error, t as normalize_remote_helper_error } from "../chunks/server-BNxq-pUH.js";
1
+ import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, o as encode_remote_failure, r as throw_form_error, t as normalize_remote_helper_error } from "../chunks/server-Dxb9zr99.js";
2
2
  export { encode_remote_failure, normalize_remote_helper_error, run_remote_effect, throw_form_error, throw_remote_cause, to_remote_failure_context };
package/.dist/mod.js CHANGED
@@ -3,7 +3,7 @@ import { n as Dispatcher } from "./chunks/dispatcher-D3Tpa5HC.js";
3
3
  import { DefineEnvVars } from "./environment.js";
4
4
  import { is_form_error, is_remote_http_error, is_remote_transport_error, is_remote_validation_error } from "./remote/shared.js";
5
5
  import { t as Live } from "./chunks/live-BW7xZKjb.js";
6
- import { t as effect } from "./chunks/compiler-Dpyu4Owd.js";
6
+ import { t as effect } from "./chunks/compiler-B91cq_Dh.js";
7
7
  //#region src/mod.ts
8
8
  /**
9
9
  * Public API surface for `svelte-effect-runtime`.
@@ -1 +1,8 @@
1
- export declare function to_form_data(input: unknown): FormData;
1
+ /**
2
+ * Encodes a remote form input the way SvelteKit's `convert_formdata` expects.
3
+ * SvelteKit 3.0.0-next.14+ requires every field name to end with `/<form_id>`
4
+ * (the un-keyed remote action id), so callers pass the id whenever they target
5
+ * that wire format. SvelteKit 2 servers never see this encoding because they
6
+ * ship the binary form bridge, which bypasses `FormData` entirely.
7
+ */
8
+ export declare function to_form_data(input: unknown, form_id?: string): FormData;
@@ -1,10 +1,10 @@
1
1
  import { type StandardSchema } from "../../internal/schema.js";
2
2
  import type { EffectRemoteForm } from "./types.js";
3
3
  import { type RemoteFormTransport } from "./form-transport.js";
4
- import type { RemoteFormInput } from "@sveltejs/kit";
4
+ import type { NativeRemoteFormInput } from "../native-types.js";
5
5
  interface RemoteFormAdapterState {
6
6
  shared_preflight_schema?: StandardSchema;
7
7
  }
8
8
  /** Adapts a generated SvelteKit form to SER's Effect-based client ABI. */
9
- 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, remote_transport?: RemoteFormTransport, adapter_state?: RemoteFormAdapterState, keyed?: boolean): EffectRemoteForm<Input, Output, ErrorType>;
9
+ export declare function create_remote_form_adapter<Input extends NativeRemoteFormInput | void, Output, ErrorType = never>(native_factory: unknown, decode_payload: (value: unknown) => unknown, remote_base?: string, remote_transport?: RemoteFormTransport, adapter_state?: RemoteFormAdapterState, keyed?: boolean): EffectRemoteForm<Input, Output, ErrorType>;
10
10
  export {};
@@ -1,4 +1,4 @@
1
- import type { RemoteForm, RemoteFormInput, RemoteQueryUpdate } from "@sveltejs/kit";
1
+ import type { NativeRemoteForm, NativeRemoteFormInput, NativeRemoteQueryUpdate } from "../native-types.js";
2
2
  import type { RemoteFailure } from "../shared.js";
3
3
  import type { Effect, Schema, Stream } from "effect";
4
4
  import type { RemoteLiveStream } from "../../live.js";
@@ -7,13 +7,13 @@ export declare const effect_remote_query_update: unique symbol;
7
7
  export type EffectRemoteQueryUpdateBrand = {
8
8
  readonly [effect_remote_query_update]: true;
9
9
  };
10
- type EffectRemoteFormCallable<Input extends RemoteFormInput | void, Output, ErrorType> = [
10
+ type EffectRemoteFormCallable<Input extends NativeRemoteFormInput | void, Output, ErrorType> = [
11
11
  Input
12
12
  ] extends [void] ? () => Effect.Effect<Output, RemoteFailure<ErrorType>> : undefined extends Input ? (input?: Input) => Effect.Effect<Output, RemoteFailure<ErrorType>> : (input: Input) => Effect.Effect<Output, RemoteFailure<ErrorType>>;
13
- type NativeRemoteFormPreflightSchema<Input extends RemoteFormInput | void, Output> = Parameters<RemoteForm<Input, Output>["preflight"]>[0];
14
- type NativeRemoteFormValidateOptions<Input extends RemoteFormInput | void, Output> = NonNullable<Parameters<RemoteForm<Input, Output>["validate"]>[0]>;
15
- export type EffectRemoteFormPreflightSchema<Input extends RemoteFormInput | void, Output = unknown> = NativeRemoteFormPreflightSchema<Input, Output> | Schema.Codec<unknown, Input, never, unknown>;
16
- export type EffectRemoteFormValidateOptions<Input extends RemoteFormInput | void, Output = unknown> = Omit<NativeRemoteFormValidateOptions<Input, Output>, "all" | "includeUntouched" | "preflightOnly"> & {
13
+ type NativeRemoteFormPreflightSchema<Input extends NativeRemoteFormInput | void, Output> = Parameters<NativeRemoteForm<Input, Output>["preflight"]>[0];
14
+ type NativeRemoteFormValidateOptions<Input extends NativeRemoteFormInput | void, Output> = NonNullable<Parameters<NativeRemoteForm<Input, Output>["validate"]>[0]>;
15
+ export type EffectRemoteFormPreflightSchema<Input extends NativeRemoteFormInput | void, Output = unknown> = NativeRemoteFormPreflightSchema<Input, Output> | Schema.Codec<unknown, Input, never, unknown>;
16
+ export type EffectRemoteFormValidateOptions<Input extends NativeRemoteFormInput | void, Output = unknown> = Omit<NativeRemoteFormValidateOptions<Input, Output>, "all" | "includeUntouched" | "preflightOnly"> & {
17
17
  readonly all?: boolean;
18
18
  readonly includeUntouched?: boolean;
19
19
  readonly preflightOnly?: boolean;
@@ -26,7 +26,6 @@ type EffectRemoteQueryUpdateInput<Update> = Update extends EffectRemoteCommandUp
26
26
  type EffectRemoteQueryUpdates<Updates extends readonly unknown[]> = Updates & {
27
27
  [Index in keyof Updates]: EffectRemoteQueryUpdateInput<Updates[Index]>;
28
28
  };
29
- type NativeRemoteQueryUpdate = RemoteQueryUpdate;
30
29
  type EffectRemoteQueryUpdateFunction = (input: never) => EffectRemoteQueryUpdateResource;
31
30
  type EffectRemoteLiveQueryUpdateFunction = (input: never) => Stream.Stream<unknown, unknown, unknown>;
32
31
  type EffectRemoteQueryUpdateResource = EffectRemoteQueryUpdateBrand & Effect.Effect<unknown, unknown>;
@@ -41,12 +40,12 @@ export type EffectRemoteCommandCall<Output, ErrorType = never> = Effect.Effect<O
41
40
  export type EffectRemoteFormSubmit<Output = unknown, ErrorType = never> = Effect.Effect<Output | undefined, RemoteFailure<ErrorType>> & {
42
41
  updates: <const Updates extends readonly unknown[]>(...updates: EffectRemoteQueryUpdates<Updates>) => Effect.Effect<Output | undefined, RemoteFailure<ErrorType>>;
43
42
  };
44
- 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"> & {
43
+ export type EffectRemoteFormEnhanceOptions<Input extends NativeRemoteFormInput | void, Output, ErrorType = never> = Omit<Parameters<NativeRemoteForm<Input, Output>["enhance"]>[0] extends (options: infer Options) => unknown ? Options : never, "submit"> & {
45
44
  submit: () => EffectRemoteFormSubmit<Output, ErrorType>;
46
45
  };
47
- export type EffectRemoteForm<Input extends RemoteFormInput | void, Output, ErrorType = never> = EffectRemoteFormCallable<Input, Output, ErrorType> & Omit<RemoteForm<Input, Output>, "enhance" | "for" | "preflight" | "submit" | "validate"> & {
48
- enhance(callback?: (options: EffectRemoteFormEnhanceOptions<Input, Output, ErrorType>) => void | Promise<void> | Effect.Effect<void, unknown, unknown>): ReturnType<RemoteForm<Input, Output>["enhance"]>;
49
- for(id: Parameters<RemoteForm<Input, Output>["for"]>[0]): EffectRemoteFormCallable<Input, Output, ErrorType> & Omit<EffectRemoteForm<Input, Output, ErrorType>, "for">;
46
+ export type EffectRemoteForm<Input extends NativeRemoteFormInput | void, Output, ErrorType = never> = EffectRemoteFormCallable<Input, Output, ErrorType> & Omit<NativeRemoteForm<Input, Output>, "enhance" | "for" | "preflight" | "submit" | "validate"> & {
47
+ enhance(callback?: (options: EffectRemoteFormEnhanceOptions<Input, Output, ErrorType>) => void | Promise<void> | Effect.Effect<void, unknown, unknown>): ReturnType<NativeRemoteForm<Input, Output>["enhance"]>;
48
+ for(id: Parameters<NativeRemoteForm<Input, Output>["for"]>[0]): EffectRemoteFormCallable<Input, Output, ErrorType> & Omit<EffectRemoteForm<Input, Output, ErrorType>, "for">;
50
49
  preflight(schema: EffectRemoteFormPreflightSchema<Input, Output>): EffectRemoteForm<Input, Output, ErrorType>;
51
50
  submit: EffectRemoteFormCallable<Input, Output, ErrorType>;
52
51
  validate(options?: EffectRemoteFormValidateOptions<Input, Output>): Effect.Effect<void, RemoteFailure<ErrorType>>;
@@ -1,2 +1,2 @@
1
- import { a as create_remote_command_adapter, i as create_remote_form_adapter, n as create_remote_query_adapter, r as create_remote_prerender_adapter, t as create_remote_live_query_adapter } from "../chunks/client-CpWfP_1f.js";
1
+ import { a as create_remote_command_adapter, i as create_remote_form_adapter, n as create_remote_query_adapter, r as create_remote_prerender_adapter, t as create_remote_live_query_adapter } from "../chunks/client-Bi7SwVVy.js";
2
2
  export { create_remote_command_adapter, create_remote_form_adapter, create_remote_live_query_adapter, create_remote_prerender_adapter, create_remote_query_adapter };
@@ -0,0 +1,292 @@
1
+ import type { StandardSchemaV1 } from "@sveltejs/kit/internal/types";
2
+ /**
3
+ * SvelteKit moved its remote-function types between majors: SvelteKit 2
4
+ * declares them in `@sveltejs/kit`, while SvelteKit 3 (since `3.0.0-next.20`)
5
+ * declares them only in the `$app/server` ambient module, which SvelteKit 2
6
+ * does not re-export types from. Importing from either location therefore
7
+ * breaks the other major, and the shapes cannot be derived from the
8
+ * `$app/server` value exports because their overload sets share a type-arity
9
+ * with incompatible constraints. This module vendors the surface SER needs.
10
+ * The shapes are identical in SvelteKit 2.69+ and 3.0.0-next.25 except
11
+ * `validate`, whose options here form the superset of both majors.
12
+ */
13
+ type MaybeArray<T> = T | T[];
14
+ type MaybePromise<T> = T | Promise<T>;
15
+ type IsAny<T> = 0 extends 1 & T ? true : false;
16
+ type DeepPartial<T> = T extends Record<PropertyKey, unknown> | unknown[] ? {
17
+ [K in keyof T]?: T[K] extends Record<PropertyKey, unknown> | unknown[] ? DeepPartial<T[K]> : T[K];
18
+ } : T | undefined;
19
+ type WillRecurseIndefinitely<T> = unknown extends T ? true : string extends keyof T ? true : false;
20
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
21
+ type ValueOfUnionKey<T, K extends PropertyKey> = T extends unknown ? K extends keyof T ? T[K] : never : never;
22
+ /**
23
+ * Data shape SvelteKit accepts for a remote form submission. Mirrors
24
+ * SvelteKit's `RemoteFormInput`.
25
+ *
26
+ * @since 4.2.6
27
+ */
28
+ export interface NativeRemoteFormInput {
29
+ [key: string]: MaybeArray<string | number | boolean | File | NativeRemoteFormInput> | undefined;
30
+ }
31
+ /**
32
+ * A single validation issue reported for a remote form field. Mirrors
33
+ * SvelteKit's `RemoteFormIssue`.
34
+ *
35
+ * @since 4.2.6
36
+ */
37
+ export interface NativeRemoteFormIssue {
38
+ message: string;
39
+ path: Array<string | number>;
40
+ }
41
+ type InputTypeMap = {
42
+ text: string;
43
+ email: string;
44
+ password: string;
45
+ url: string;
46
+ tel: string;
47
+ search: string;
48
+ number: number;
49
+ range: number;
50
+ date: string;
51
+ "datetime-local": string;
52
+ time: string;
53
+ month: string;
54
+ week: string;
55
+ color: string;
56
+ checkbox: boolean | string[];
57
+ radio: string;
58
+ file: File;
59
+ hidden: string | number | boolean;
60
+ submit: string | number | boolean;
61
+ button: string;
62
+ reset: string;
63
+ image: string;
64
+ select: string;
65
+ "select multiple": string[];
66
+ "file multiple": File[];
67
+ };
68
+ type NativeRemoteFormFieldType<T> = {
69
+ [K in keyof InputTypeMap]: T extends InputTypeMap[K] ? K : never;
70
+ }[keyof InputTypeMap];
71
+ type InputElementProps<T extends keyof InputTypeMap> = T extends "checkbox" | "radio" ? {
72
+ name: string;
73
+ type: T;
74
+ value?: string;
75
+ "aria-invalid": boolean | "false" | "true" | undefined;
76
+ get checked(): boolean;
77
+ set checked(value: boolean);
78
+ readonly defaultChecked?: boolean;
79
+ } : T extends "file" ? {
80
+ name: string;
81
+ type: "file";
82
+ "aria-invalid": boolean | "false" | "true" | undefined;
83
+ get files(): FileList | null;
84
+ set files(v: FileList | null);
85
+ } : T extends "select" ? {
86
+ name: string;
87
+ "aria-invalid": boolean | "false" | "true" | undefined;
88
+ get value(): string;
89
+ set value(v: string);
90
+ } : T extends "select multiple" ? {
91
+ name: string;
92
+ multiple: true;
93
+ "aria-invalid": boolean | "false" | "true" | undefined;
94
+ get value(): string[];
95
+ set value(v: string[]);
96
+ } : T extends "text" ? {
97
+ name: string;
98
+ "aria-invalid": boolean | "false" | "true" | undefined;
99
+ get value(): string | number;
100
+ set value(v: string | number);
101
+ readonly defaultValue?: string | number;
102
+ } : {
103
+ name: string;
104
+ type: T;
105
+ "aria-invalid": boolean | "false" | "true" | undefined;
106
+ get value(): string | number;
107
+ set value(v: string | number);
108
+ readonly defaultValue?: string | number;
109
+ };
110
+ type NativeRemoteFormFieldMethods<T> = {
111
+ /** The values that will be submitted. */
112
+ value(): DeepPartial<T>;
113
+ /** Set the values that will be submitted. */
114
+ set(input: DeepPartial<T>): DeepPartial<T>;
115
+ /** Whether the field or any nested field has been interacted with since the form was mounted. */
116
+ touched(): boolean;
117
+ /** Whether the field or any nested field has been edited since the form was mounted. */
118
+ dirty(): boolean;
119
+ /** Validation issues, if any. */
120
+ issues(): NativeRemoteFormIssue[] | undefined;
121
+ };
122
+ type AsArgs<Type extends keyof InputTypeMap, Value> = Type extends "checkbox" ? Value extends string[] ? [type: Type, value: Value[number] | (string & {})] : Value extends boolean ? [type: Type] | [type: Type, value: boolean] : [type: Type] | [type: Type, value: Value | (string & {})] : Type extends "submit" | "hidden" ? Value extends string ? [type: Type, value: Value | (string & {})] : [type: Type, value: Value] : Type extends "radio" ? [type: Type, value: Value | (string & {})] : Type extends "file" | "file multiple" ? [type: Type] : [type: Type] | [type: Type, value: Value | undefined];
123
+ type NativeRemoteFormFieldValue = string | string[] | number | boolean | File | File[];
124
+ type NativeRemoteFormField<Value extends NativeRemoteFormFieldValue> = NativeRemoteFormFieldMethods<Value> & {
125
+ /** Returns spreadable input-element props for the given input type. */
126
+ as<T extends NativeRemoteFormFieldType<Value>>(...args: AsArgs<T, Value>): InputElementProps<T>;
127
+ };
128
+ type NativeRemoteFormFieldContainer<Value> = NativeRemoteFormFieldMethods<Value> & {
129
+ /** Validation issues belonging to this or any of the fields that belong to it, if any. */
130
+ allIssues(): NativeRemoteFormIssue[] | undefined;
131
+ };
132
+ type UnknownField<Value> = NativeRemoteFormFieldMethods<Value> & {
133
+ /** Validation issues belonging to this or any of the fields that belong to it, if any. */
134
+ allIssues(): NativeRemoteFormIssue[] | undefined;
135
+ /** Returns spreadable input-element props for the given input type. */
136
+ as<T extends NativeRemoteFormFieldType<Value>>(...args: AsArgs<T, Value>): InputElementProps<T>;
137
+ } & {
138
+ [key: string | number]: UnknownField<any>;
139
+ };
140
+ type RecursiveFormFields = NativeRemoteFormFieldContainer<any> & {
141
+ [key: string | number]: UnknownField<any>;
142
+ };
143
+ type NativeRemoteFormFields<T> = WillRecurseIndefinitely<T> extends true ? RecursiveFormFields : NonNullable<T> extends string | number | boolean | File ? NativeRemoteFormField<Extract<NonNullable<T>, NativeRemoteFormFieldValue>> : [NonNullable<T>] extends [string[] | File[]] ? NativeRemoteFormField<Extract<NonNullable<T>, NativeRemoteFormFieldValue>> & {
144
+ [K in number]: NativeRemoteFormField<Extract<NonNullable<T>[number], NativeRemoteFormFieldValue>>;
145
+ } : [NonNullable<T>] extends [Array<infer U>] ? NativeRemoteFormFieldContainer<NonNullable<T>> & {
146
+ [K in number]: NativeRemoteFormFields<U>;
147
+ } : NativeRemoteFormFieldContainer<T> & {
148
+ [K in KeysOfUnion<T>]-?: NativeRemoteFormFields<ValueOfUnionKey<T, K>>;
149
+ };
150
+ type NativeRemoteFormFieldsRoot<Input extends NativeRemoteFormInput | void> = IsAny<Input> extends true ? RecursiveFormFields : Input extends void ? {
151
+ /** Validation issues, if any. */
152
+ issues(): NativeRemoteFormIssue[] | undefined;
153
+ /** Validation issues belonging to this or any of the fields that belong to it, if any. */
154
+ allIssues(): NativeRemoteFormIssue[] | undefined;
155
+ } : NativeRemoteFormFields<Input>;
156
+ type ExtractId<Input> = Input extends {
157
+ id: infer Id;
158
+ } ? Id extends string | number ? Id : string | number : string | number;
159
+ /**
160
+ * The form instance received inside an `enhance` callback. Mirrors SvelteKit's
161
+ * `RemoteFormEnhanceInstance`.
162
+ *
163
+ * @since 4.2.6
164
+ */
165
+ export type NativeRemoteFormEnhanceInstance<Input extends NativeRemoteFormInput | void = NativeRemoteFormInput | void, Output = unknown> = Omit<NativeRemoteForm<Input, Output>, "enhance" | "element"> & {
166
+ readonly element: HTMLFormElement;
167
+ };
168
+ /**
169
+ * The callback passed to a remote form's `enhance` method. Mirrors SvelteKit's
170
+ * `RemoteFormEnhanceCallback`.
171
+ *
172
+ * @since 4.2.6
173
+ */
174
+ export type NativeRemoteFormEnhanceCallback<Input extends NativeRemoteFormInput | void = NativeRemoteFormInput | void, Output = unknown> = (form: NativeRemoteFormEnhanceInstance<Input, Output>) => MaybePromise<void>;
175
+ /**
176
+ * SvelteKit's `RemoteForm` surface. `validate` accepts the superset of the
177
+ * SvelteKit 2 (`includeUntouched`) and SvelteKit 3 (`all`) options.
178
+ *
179
+ * @since 4.2.6
180
+ */
181
+ export type NativeRemoteForm<Input extends NativeRemoteFormInput | void, Output> = {
182
+ /** Attachment that intercepts the form submission on the client to prevent a full page reload. */
183
+ [attachment: symbol]: (node: HTMLFormElement) => void;
184
+ method: "POST";
185
+ /** The URL to send the form to. */
186
+ action: string;
187
+ /** The `<form>` element this instance is currently attached to, if any. */
188
+ get element(): HTMLFormElement | null;
189
+ /** Submit the currently attached form programmatically. */
190
+ submit(): Promise<boolean> & {
191
+ updates: (...updates: NativeRemoteQueryUpdate[]) => Promise<boolean>;
192
+ };
193
+ /** Influences what happens when the form is submitted. */
194
+ enhance(callback: NativeRemoteFormEnhanceCallback<Input, Output>): {
195
+ method: "POST";
196
+ action: string;
197
+ [attachment: symbol]: (node: HTMLFormElement) => void;
198
+ };
199
+ /** Create an instance of the form for the given `id`. */
200
+ for(id: ExtractId<Input>): Omit<NativeRemoteForm<Input, Output>, "for">;
201
+ /** Preflight checks. */
202
+ preflight(schema: StandardSchemaV1<Input, unknown>): NativeRemoteForm<Input, Output>;
203
+ /** Validate the form contents programmatically. */
204
+ validate(options?: {
205
+ /** SvelteKit 3: also show validation issues of fields that have not been edited and blurred yet. */
206
+ all?: boolean;
207
+ /** SvelteKit 2: also show validation issues of fields that have not been touched yet. */
208
+ includeUntouched?: boolean;
209
+ /** Only run the `preflight` validation. */
210
+ preflightOnly?: boolean;
211
+ }): Promise<void>;
212
+ /** The result of the form submission. */
213
+ get result(): Output | undefined;
214
+ /** The number of pending submissions. */
215
+ get pending(): number;
216
+ /** True if the form has been submitted at least once. */
217
+ get submitted(): boolean;
218
+ /** Access form fields using object notation. */
219
+ fields: NativeRemoteFormFieldsRoot<Input>;
220
+ };
221
+ /**
222
+ * SvelteKit's `RemoteResource` shape shared by query, live query, and
223
+ * prerender resources.
224
+ *
225
+ * @since 4.2.6
226
+ */
227
+ export type NativeRemoteResource<T> = Promise<T> & {
228
+ /** The error in case the query fails. */
229
+ get error(): unknown;
230
+ /** `true` before the first result is available and during refreshes. */
231
+ get loading(): boolean;
232
+ } & ({
233
+ /** The current value of the query. Undefined until `ready` is `true`. */
234
+ get current(): undefined;
235
+ ready: false;
236
+ } | {
237
+ /** The current value of the query. Undefined until `ready` is `true`. */
238
+ get current(): T;
239
+ ready: true;
240
+ });
241
+ /**
242
+ * SvelteKit's `RemoteQuery` resource surface.
243
+ *
244
+ * @since 4.2.6
245
+ */
246
+ export type NativeRemoteQuery<T> = NativeRemoteResource<T> & {
247
+ /** Update the value of the query without re-fetching it. */
248
+ set(value: T): void;
249
+ /** Re-fetch the query from the server. */
250
+ refresh(): Promise<void>;
251
+ /** Temporarily override a query's value during a single-flight mutation. */
252
+ withOverride(update: (current: T) => T): NativeRemoteQueryOverride;
253
+ };
254
+ /**
255
+ * SvelteKit's `RemoteLiveQuery` resource surface.
256
+ *
257
+ * @since 4.2.6
258
+ */
259
+ export type NativeRemoteLiveQuery<T> = NativeRemoteResource<T> & AsyncIterable<T> & {
260
+ /** `true` if the live stream is currently connected. */
261
+ readonly connected: boolean;
262
+ /** `true` once the current live stream iterator is done. */
263
+ readonly done: boolean;
264
+ /** Reconnects the live stream immediately. */
265
+ reconnect(): Promise<void>;
266
+ };
267
+ /**
268
+ * SvelteKit's `RemoteQueryFunction`.
269
+ *
270
+ * @since 4.2.6
271
+ */
272
+ export type NativeRemoteQueryFunction<Input, Output, _Validated = Input> = (arg: undefined extends Input ? Input | void : Input) => NativeRemoteQuery<Output>;
273
+ /**
274
+ * SvelteKit's `RemoteLiveQueryFunction`.
275
+ *
276
+ * @since 4.2.6
277
+ */
278
+ export type NativeRemoteLiveQueryFunction<Input, Output, _Validated = Input> = (arg: undefined extends Input ? Input | void : Input) => NativeRemoteLiveQuery<Output>;
279
+ /**
280
+ * SvelteKit's `RemoteQueryOverride`.
281
+ *
282
+ * @since 4.2.6
283
+ */
284
+ export type NativeRemoteQueryOverride = () => void;
285
+ /**
286
+ * Update selection accepted by SvelteKit's command and form `updates(...)`
287
+ * methods. Mirrors SvelteKit's `RemoteQueryUpdate`.
288
+ *
289
+ * @since 4.2.6
290
+ */
291
+ export type NativeRemoteQueryUpdate = NativeRemoteQuery<any> | NativeRemoteLiveQuery<any> | NativeRemoteQueryFunction<any, any> | NativeRemoteLiveQueryFunction<any, any> | NativeRemoteQueryOverride;
292
+ export {};
@@ -1,2 +1,2 @@
1
- import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, o as encode_remote_failure, r as throw_form_error, t as normalize_remote_helper_error } from "../chunks/server-BNxq-pUH.js";
1
+ import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, o as encode_remote_failure, r as throw_form_error, t as normalize_remote_helper_error } from "../chunks/server-Dxb9zr99.js";
2
2
  export { encode_remote_failure, normalize_remote_helper_error, run_remote_effect, throw_form_error, throw_remote_cause, to_remote_failure_context };
@@ -1,9 +1,9 @@
1
1
  import type { EffectLike, EffectRemoteCommand, EffectRemoteForm, EffectRemotePrerenderFunction, PrerenderOptions, QueryFactory, RemoteFormHandler, RemoteHandler, SchemaEncodedInput, SchemaInput, StandardSchema, StandardSchemaInput, StandardSchemaOutput } from "./types.js";
2
- import type { RemoteFormInput } from "@sveltejs/kit";
2
+ import type { NativeRemoteFormInput } from "../remote/native-types.js";
3
3
  import { type Schema } from "effect";
4
4
  type FormSchemaEncodedInput<S> = S extends Schema.Top ? FormRemoteInput<S["Encoded"]> : never;
5
- type FormRemoteInput<Input> = NormalizeFormEncoded<Input> extends RemoteFormInput ? NormalizeFormEncoded<Input> : never;
6
- type FormStandardSchemaInput<S> = StandardSchemaInput<S> extends RemoteFormInput ? StandardSchemaInput<S> : RemoteFormInput;
5
+ type FormRemoteInput<Input> = NormalizeFormEncoded<Input> extends NativeRemoteFormInput ? NormalizeFormEncoded<Input> : never;
6
+ type FormStandardSchemaInput<S> = StandardSchemaInput<S> extends NativeRemoteFormInput ? StandardSchemaInput<S> : NativeRemoteFormInput;
7
7
  type FormScalar = string | number | boolean | File;
8
8
  type NormalizeFormEncoded<Value> = Value extends FormScalar ? Value : Value extends ReadonlyArray<infer Item> ? Array<NormalizeFormEncoded<Item>> : Value extends object ? NormalizeFormObject<Value> : Value;
9
9
  type NormalizeFormObject<Value> = {
@@ -116,7 +116,7 @@ export declare function Command<S extends StandardSchema, A, E = never, R = neve
116
116
  * @returns A SvelteKit form function.
117
117
  */
118
118
  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>;
119
- 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>;
119
+ export declare function Form<Input extends NativeRemoteFormInput, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteFormHandler<Input, A, E, R>): EffectRemoteForm<Input, A, E>;
120
120
  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>;
121
121
  export declare function Form<S extends StandardSchema, A, E = never, R = never>(validate_or_handler: S, maybe_handler: RemoteFormHandler<StandardSchemaOutput<S>, A, E, R>): EffectRemoteForm<FormStandardSchemaInput<S>, A, E>;
122
122
  /**
@@ -1,5 +1,5 @@
1
1
  export type NativeTransport = Readonly<Record<string, {
2
2
  readonly encode: (value: unknown) => false | unknown;
3
3
  }>>;
4
- /** Converts SvelteKit transport hooks into a devalue live snapshot encoder. */
5
- export declare function make_remote_live_snapshot_encoder(transport: NativeTransport): (value: unknown) => string;
4
+ /** Converts available SvelteKit transport hooks into a devalue live snapshot encoder. */
5
+ export declare function make_remote_live_snapshot_encoder(transport: NativeTransport | undefined): (value: unknown) => string;
@@ -1,4 +1,4 @@
1
- import type { RemoteFormInput, RemoteQuery, RemoteQueryOverride } from "@sveltejs/kit";
1
+ import type { NativeRemoteFormInput, NativeRemoteQuery, NativeRemoteQueryOverride } from "../remote/native-types.js";
2
2
  import type { EffectRemoteCommandCall as ClientEffectRemoteCommandCall, EffectRemoteForm as ClientEffectRemoteForm, EffectRemoteQueryUpdateBrand as ClientEffectRemoteQueryUpdateBrand } from "../remote/client.js";
3
3
  import type { Effect, Layer, ManagedRuntime, Schema, Stream } from "effect";
4
4
  import type { create_form_error, RemoteFailure } from "../remote/shared.js";
@@ -339,7 +339,7 @@ export interface CommandFactory {
339
339
  */
340
340
  export interface FormFactory {
341
341
  <A, E = never, R = never>(validate_or_handler: EffectLike<A, E, R> | RemoteFormHandler<void, A, E, R>): EffectRemoteForm<void, A, E>;
342
- <Input extends RemoteFormInput, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteFormHandler<Input, A, E, R>): EffectRemoteForm<Input, A, E>;
342
+ <Input extends NativeRemoteFormInput, A, E = never, R = never>(validate_or_handler: "unchecked", maybe_handler: RemoteFormHandler<Input, A, E, R>): EffectRemoteForm<Input, A, E>;
343
343
  <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>;
344
344
  <S extends StandardSchema, A, E = never, R = never>(validate_or_handler: S, maybe_handler: RemoteFormHandler<StandardSchemaOutput<S>, A, E, R>): EffectRemoteForm<FormStandardSchemaInput<S>, A, E>;
345
345
  }
@@ -401,13 +401,13 @@ export type EffectRemotePrerenderFunction<Input, A, E = never> = [Input] extends
401
401
  *
402
402
  * @since 2.0.0
403
403
  */
404
- export type EffectRemoteQuery<A, E = never> = ClientEffectRemoteQueryUpdateBrand & Effect.Effect<A, RemoteFailure<E>, never> & Pick<RemoteQuery<A>, "set"> & {
404
+ export type EffectRemoteQuery<A, E = never> = ClientEffectRemoteQueryUpdateBrand & Effect.Effect<A, RemoteFailure<E>, never> & Pick<NativeRemoteQuery<A>, "set"> & {
405
405
  readonly current: A | undefined;
406
406
  readonly error: unknown;
407
407
  readonly loading: boolean;
408
408
  readonly ready: boolean;
409
409
  readonly refresh: () => Effect.Effect<void, unknown, never>;
410
- readonly withOverride: (update: (current: A) => A) => RemoteQueryOverride;
410
+ readonly withOverride: (update: (current: A) => A) => NativeRemoteQueryOverride;
411
411
  };
412
412
  /**
413
413
  * Effect-returning remote query function with SvelteKit query resource methods
@@ -477,10 +477,10 @@ export type EffectRemoteCommand<Input, A, E = never> = ([Input] extends [void] ?
477
477
  * @template Input - Data shape submitted by the remote form.
478
478
  * @template A - Successful value produced by the form handler.
479
479
  */
480
- export type EffectRemoteForm<Input extends RemoteFormInput | void, A, E = never> = ClientEffectRemoteForm<Input, A, E>;
480
+ export type EffectRemoteForm<Input extends NativeRemoteFormInput | void, A, E = never> = ClientEffectRemoteForm<Input, A, E>;
481
481
  type FormSchemaEncodedInput<S> = S extends Schema.Top ? FormRemoteInput<S["Encoded"]> : never;
482
- type FormRemoteInput<Input> = NormalizeFormEncoded<Input> extends RemoteFormInput ? NormalizeFormEncoded<Input> : never;
483
- type FormStandardSchemaInput<S> = StandardSchemaInput<S> extends RemoteFormInput ? StandardSchemaInput<S> : RemoteFormInput;
482
+ type FormRemoteInput<Input> = NormalizeFormEncoded<Input> extends NativeRemoteFormInput ? NormalizeFormEncoded<Input> : never;
483
+ type FormStandardSchemaInput<S> = StandardSchemaInput<S> extends NativeRemoteFormInput ? StandardSchemaInput<S> : NativeRemoteFormInput;
484
484
  type FormScalar = string | number | boolean | File;
485
485
  type NormalizeFormEncoded<Value> = Value extends FormScalar ? Value : Value extends ReadonlyArray<infer Item> ? Array<NormalizeFormEncoded<Item>> : Value extends object ? NormalizeFormObject<Value> : Value;
486
486
  type NormalizeFormObject<Value> = {
package/.dist/server.js CHANGED
@@ -2,7 +2,7 @@ import { D as UncheckedLiveQueryHandlerMissingError, E as UncheckedFormHandlerMi
2
2
  import { create_form_error, create_remote_transport_error } from "./remote/shared.js";
3
3
  import { i as make_remote_live_stream, r as make_failed_remote_live_stream, t as Live } from "./chunks/live-BW7xZKjb.js";
4
4
  import { a as normalize_validator, c as attach_remote_resource_getters, d as MakeEffectFromPromise, f as MakeEffectFromSync, l as is_remote_resource, n as attach_native_remote_query_update, o as attach_failed_remote_query_resource, r as resolve_native_remote_query_updates, s as attach_failed_remote_resource_getters, t as copy_property_descriptors, u as FailWithRemoteError } from "./chunks/descriptors-q909VWyR.js";
5
- import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, t as normalize_remote_helper_error } from "./chunks/server-BNxq-pUH.js";
5
+ import { a as to_remote_failure_context, i as throw_remote_cause, n as run_remote_effect, t as normalize_remote_helper_error } from "./chunks/server-Dxb9zr99.js";
6
6
  import { i as get_server_runtime_or_throw, n as ServerRuntime, t as RequestEvent } from "./chunks/runtime-CmiEHnSw.js";
7
7
  import { Effect, Result, Stream } from "effect";
8
8
  import { error, invalid, redirect } from "@sveltejs/kit";
@@ -180,9 +180,9 @@ function make_remote_form_wrapper(handler, helper_name) {
180
180
  }
181
181
  //#endregion
182
182
  //#region src/server/live-snapshot.ts
183
- /** Converts SvelteKit transport hooks into a devalue live snapshot encoder. */
183
+ /** Converts available SvelteKit transport hooks into a devalue live snapshot encoder. */
184
184
  function make_remote_live_snapshot_encoder(transport) {
185
- const encoders = Object.fromEntries(Object.entries(transport).map(([key, transformer]) => [key, transformer.encode]));
185
+ const encoders = Object.fromEntries(Object.entries(transport ?? {}).map(([key, transformer]) => [key, transformer.encode]));
186
186
  return (value) => stringify(value, encoders);
187
187
  }
188
188
  //#endregion