我正在使用文档中的示例
const keyMap = {
CONTRACT: "alt+down",
COMMAND_DOWN: { sequence: "command", action: "keydown" }
};
我收到这个错误。
No overload matches this call.
Overload 1 of 2, '(props: Readonly<GlobalHotKeysProps>): GlobalHotKeys', gave the following error.
Type '{ CONTRACT: string; COMMAND_DOWN: { sequence: string; action: string; }; }' is not assignable to type 'KeyMap'.
Property 'COMMAND_DOWN' is incompatible with index signature.
Type '{ sequence: string; action: string; }' is not assignable to type 'KeySequence'.
Property 'sequences' is missing in type '{ sequence: string; action: string; }' but required in type 'ExtendedKeyMapOptions'.
Overload 2 of 2, '(props: GlobalHotKeysProps, context?: any): GlobalHotKeys', gave the following error.
Type '{ CONTRACT: string; COMMAND_DOWN: { sequence: string; action: string; }; }' is not assignable to type 'KeyMap'. TS2769