# HotkeyBinding

Source: /tuil/docs/reference/packages/hotkeys/api/hotkey-binding
Locale: en

interface exported by @mwillbanks/tuil-hotkeys.



{/* Generated by tooling/docs/generate-reference.ts. */}

## interface [#interface]

Public interface exported by `@mwillbanks/tuil-hotkeys`.

```ts
export interface HotkeyBinding extends HotkeyMetadata {
  readonly keys: string;
  readonly scope?: HotkeyScope;
  readonly scopeId?: string;
  readonly priority?: number;
  readonly enabled?: boolean | (() => boolean);
  readonly handler: (event: HotkeyEvent) => void | Promise<void>;
}
```

## Members [#members]

| Member          | Type                                            | Required | Description                                                                             | Related types                                                      |
| --------------- | ----------------------------------------------- | -------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `keys`          | `string`                                        | Yes      | The `keys` member uses the `string` contract.                                           | —                                                                  |
| `scope`         | `HotkeyScope \| undefined`                      | No       | The `scope` member uses the `HotkeyScope \| undefined` contract.                        | [`HotkeyScope`](/tuil/docs/reference/packages/hotkeys/api/hotkey-scope) |
| `scopeId`       | `string \| undefined`                           | No       | The `scopeId` member uses the `string \| undefined` contract.                           | —                                                                  |
| `priority`      | `number \| undefined`                           | No       | The `priority` member uses the `number \| undefined` contract.                          | —                                                                  |
| `enabled`       | `boolean \| (() => boolean) \| undefined`       | No       | The `enabled` member uses the `boolean \| (() => boolean) \| undefined` contract.       | —                                                                  |
| `handler`       | `(event: HotkeyEvent) => void \| Promise<void>` | Yes      | The `handler` member uses the `(event: HotkeyEvent) => void \| Promise<void>` contract. | [`HotkeyEvent`](/tuil/docs/reference/packages/hotkeys/api/hotkey-event) |
| `title`         | `string \| undefined`                           | No       | The `title` member uses the `string \| undefined` contract.                             | —                                                                  |
| `description`   | `string \| undefined`                           | No       | The `description` member uses the `string \| undefined` contract.                       | —                                                                  |
| `category`      | `string \| undefined`                           | No       | The `category` member uses the `string \| undefined` contract.                          | —                                                                  |
| `commandId`     | `string \| undefined`                           | No       | The `commandId` member uses the `string \| undefined` contract.                         | —                                                                  |
| `visibleInHelp` | `boolean \| undefined`                          | No       | The `visibleInHelp` member uses the `boolean \| undefined` contract.                    | —                                                                  |
| `platforms`     | `readonly NodeJS.Platform[] \| undefined`       | No       | The `platforms` member uses the `readonly NodeJS.Platform[] \| undefined` contract.     | —                                                                  |

## Parameters [#parameters]

This declaration has no public members.

## Returns [#returns]

This declaration does not return a value.

## Throws [#throws]

No thrown errors are documented for this declaration.

## Related types [#related-types]

* [`HotkeyEvent`](/tuil/docs/reference/packages/hotkeys/api/hotkey-event)
* [`HotkeyMetadata`](/tuil/docs/reference/packages/hotkeys/api/hotkey-metadata)
* [`HotkeyScope`](/tuil/docs/reference/packages/hotkeys/api/hotkey-scope)

## Source [#source]

[View the secondary source reference](https://github.com/mwillbanks/tuil/blob/main/packages/hotkeys/src/index.ts)

## Package [#package]

[@mwillbanks/tuil-hotkeys](/tuil/docs/reference/packages/hotkeys)
