Skip to content
Next Next commit
feat: Refactor keycodes package to use TS
  • Loading branch information
im3dabasia committed Jun 18, 2025
commit 8efd77746e1f396bad2c09a5279ed24b637eef94
24 changes: 7 additions & 17 deletions packages/keycodes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ displayShortcut.primary( 'm' );
// "⌘M"
```

_Type_

- `WPModifierHandler<WPKeyHandler<string>>`Keyed map of functions to display shortcuts.
Keyed map of functions to display shortcuts.

### displayShortcutList

Expand All @@ -86,9 +84,7 @@ displayShortcutList.primary( 'm' );
// [ "⌘", "M" ]
```

_Type_

- `WPModifierHandler<WPKeyHandler<string[]>>`Keyed map of functions to shortcut sequences.
Keyed map of functions to shortcut sequences.

### DOWN

Expand Down Expand Up @@ -120,7 +116,7 @@ Return true if platform is MacOS.

_Parameters_

- _\_window_ `Window?`: window object by default; used for DI testing.
- _\_window_ `Window`: window object by default; used for DI testing.

_Returns_

Expand All @@ -138,9 +134,7 @@ isKeyboardEvent.primary( event, 'm' );
// true
```

_Type_

- `WPModifierHandler<WPEventKeyHandler>`Keyed map of functions to match events.
Keyed map of functions to match events.

### LEFT

Expand All @@ -152,7 +146,7 @@ Object that contains functions that return the available modifier depending on p

_Type_

- `WPModifierHandler< ( isApple: () => boolean ) => WPModifierPart[]>`
- `WPModifierHandler< WPModifier >`

### PAGEDOWN

Expand All @@ -176,9 +170,7 @@ rawShortcut.primary( 'm' );
// "meta+m""
```

_Type_

- `WPModifierHandler<WPKeyHandler<string>>`Keyed map of functions to raw shortcuts.
Keyed map of functions to raw shortcuts.

### RIGHT

Expand All @@ -200,9 +192,7 @@ shortcutAriaLabel.primary( '.' );
// "Command + Period"
```

_Type_

- `WPModifierHandler<WPKeyHandler<string>>`Keyed map of functions to shortcut ARIA labels.
Keyed map of functions to shortcut ARIA labels.

### SPACE

Expand Down
Loading