@webamoki/web-svelte 2.5.2 → 2.5.3
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.
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
1
|
import type { RemoteCommand } from '@sveltejs/kit';
|
|
3
2
|
import type { CommandResult, CommandSuccess, ResponseError } from './remote.js';
|
|
4
|
-
type RC<
|
|
5
|
-
type RCInput<Schema extends StandardSchemaV1> = StandardSchemaV1.InferInput<Schema>;
|
|
3
|
+
type RC<S, O extends CommandSuccess> = RemoteCommand<S, Promise<CommandResult<O>>>;
|
|
6
4
|
/**
|
|
7
5
|
* Command Remote function handler for Client
|
|
8
6
|
* - state for dynamic input
|
|
9
7
|
* - execute function, which handles toast and callbacks
|
|
10
8
|
* - submitting state for tracking pending executions
|
|
11
9
|
*/
|
|
12
|
-
export declare class CommandAction<
|
|
10
|
+
export declare class CommandAction<S, O extends CommandSuccess> {
|
|
13
11
|
#private;
|
|
14
|
-
input:
|
|
12
|
+
input: S;
|
|
15
13
|
get submitting(): boolean;
|
|
16
|
-
constructor(remote: RC<
|
|
14
|
+
constructor(remote: RC<S, O>, defaultInput: S, config?: {
|
|
17
15
|
onError?: (error: ResponseError) => void;
|
|
18
16
|
onSuccess?: (state: {
|
|
19
|
-
input:
|
|
17
|
+
input: S;
|
|
20
18
|
result: O;
|
|
21
19
|
}) => void;
|
|
22
20
|
toastError?: boolean;
|