call-command.d.ts 524 B

12345678
  1. import type { CmdKey } from '@milkdown/core';
  2. import type { Ctx } from '@milkdown/ctx';
  3. type InferParams<T> = T extends CmdKey<infer U> ? U : never;
  4. export declare function callCommand<T extends CmdKey<any>>(slice: string, payload?: InferParams<T>): (ctx: Ctx) => boolean;
  5. export declare function callCommand<T>(slice: CmdKey<T>, payload?: T): (ctx: Ctx) => boolean;
  6. export declare function callCommand(slice: string | CmdKey<any>, payload?: any): (ctx: Ctx) => boolean;
  7. export {};
  8. //# sourceMappingURL=call-command.d.ts.map