$command.d.ts 519 B

123456789
  1. import type { Cmd, CmdKey } from '@milkdown/core';
  2. import type { Ctx, MilkdownPlugin } from '@milkdown/ctx';
  3. export type $Command<T> = MilkdownPlugin & {
  4. run: (payload?: T) => boolean;
  5. key: CmdKey<T>;
  6. };
  7. export declare function $command<T, K extends string>(key: K, cmd: (ctx: Ctx) => Cmd<T>): $Command<T>;
  8. export declare function $commandAsync<T, K extends string>(key: K, cmd: (ctx: Ctx) => Promise<Cmd<T>>, timerName?: string): import("./utils").WithTimer<$Command<T>>;
  9. //# sourceMappingURL=$command.d.ts.map