@lvce-editor/api 8.32.0 → 8.33.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandCallback } from '../CommandCallback/CommandCallback.ts';
|
|
2
|
-
export interface Command<TArgs extends readonly
|
|
2
|
+
export interface Command<TArgs extends readonly any[] = readonly any[], TResult = unknown> {
|
|
3
3
|
readonly execute: CommandCallback<TArgs, TResult>;
|
|
4
4
|
readonly id: string;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CommandCallback<TArgs extends readonly
|
|
1
|
+
export type CommandCallback<TArgs extends readonly any[] = readonly any[], TResult = unknown> = (...args: TArgs) => TResult | Promise<TResult>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Command } from '../Command/Command.ts';
|
|
2
2
|
import type { CommandRegistrySnapshot } from '../CommandRegistrySnapshot/CommandRegistrySnapshot.ts';
|
|
3
3
|
import type { Disposable } from '../Disposable/Disposable.ts';
|
|
4
|
-
export declare const registerCommand:
|
|
4
|
+
export declare const registerCommand: (command: Command<readonly any[], unknown>) => Disposable;
|
|
5
5
|
export declare const getCommandRegistrySnapshot: () => CommandRegistrySnapshot;
|
|
6
6
|
export declare const executeCommand: (id: string, ...args: readonly unknown[]) => Promise<unknown>;
|
|
7
7
|
export declare const resetCommandRegistry: () => void;
|