fuma 0.3.40 → 0.3.42
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.
|
@@ -6,7 +6,7 @@ export declare function formAction<E extends RequestEvent, Shape extends z.ZodRa
|
|
|
6
6
|
formData: FormData;
|
|
7
7
|
}) => Promise<ReturnType>, options?: {
|
|
8
8
|
validation?: z.SuperRefinement<z.objectOutputType<Shape, z.ZodTypeAny>>;
|
|
9
|
-
redirectTo?: string | ((res: ReturnType) => string);
|
|
9
|
+
redirectTo?: string | URL | ((res: ReturnType) => string | URL | undefined);
|
|
10
10
|
}): (event: E) => Promise<import("@sveltejs/kit").ActionFailure<{
|
|
11
11
|
message: string;
|
|
12
12
|
} | {
|
package/dist/server/try.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type ActionFailure } from '@sveltejs/kit';
|
|
|
2
2
|
import type { Issue } from './parseFormData.js';
|
|
3
3
|
export declare function tryOrFail<T = unknown>(func: () => Promise<T>,
|
|
4
4
|
/** You can redirect on success */
|
|
5
|
-
redirectTo?: string | ((res: T) => string | undefined)): Promise<T | ActionFailure<{
|
|
5
|
+
redirectTo?: string | URL | ((res: T) => string | URL | undefined)): Promise<T | ActionFailure<{
|
|
6
6
|
message: string;
|
|
7
7
|
} | {
|
|
8
8
|
issues: Issue[];
|
package/dist/server/try.js
CHANGED
|
@@ -2,7 +2,8 @@ export declare function createEventEmitter<EventMap extends Record<string, any>>
|
|
|
2
2
|
on<K extends keyof EventMap>(eventKey: K, callback: Callback<EventMap[K]>): () => void;
|
|
3
3
|
once<K_1 extends keyof EventMap>(eventKey: K_1, callback: Callback<EventMap[K_1]>): () => void;
|
|
4
4
|
off<K_2 extends keyof EventMap>(eventKey: K_2, callback: Callback<EventMap[K_2]>): void;
|
|
5
|
-
|
|
5
|
+
clean<K_3 extends keyof EventMap>(eventKey: K_3): void;
|
|
6
|
+
emit<K_4 extends keyof EventMap>(...args: EventEmitterArgs<EventMap, K_4>): void;
|
|
6
7
|
};
|
|
7
8
|
type Callback<Arg> = (arg: Arg) => unknown;
|
|
8
9
|
type EventEmitterArgs<EventMap extends Record<string, any>, K extends keyof EventMap> = undefined extends EventMap[K] ? [type: K, parameter?: EventMap[K]] : [type: K, parameter: EventMap[K]];
|