Skip to content

Commit

Permalink
Autogenerated docs and setup for keycodes
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 6, 2019
1 parent 52355c4 commit eb35ffb
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 0 deletions.
157 changes: 157 additions & 0 deletions packages/keycodes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,161 @@ onKeyDown( event ) {
}
```

## API

<!-- START TOKEN(Autogenerated API docs) -->

### ALT

[src/index.js#L40-L40](src/index.js#L40-L40)

Undocumented declaration.

### BACKSPACE

[src/index.js#L27-L27](src/index.js#L27-L27)

Undocumented declaration.

### COMMAND

[src/index.js#L42-L42](src/index.js#L42-L42)

Undocumented declaration.

### CTRL

[src/index.js#L41-L41](src/index.js#L41-L41)

Undocumented declaration.

### DELETE

[src/index.js#L36-L36](src/index.js#L36-L36)

Undocumented declaration.

### displayShortcut

[src/index.js#L108-L110](src/index.js#L108-L110)

An object that contains functions to display shortcuts.
E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.

**Type**

`Object` Keyed map of functions to display shortcuts.

### displayShortcutList

[src/index.js#L77-L100](src/index.js#L77-L100)

Return an array of the parts of a keyboard shortcut chord for display
E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.

**Type**

`Object` keyed map of functions to shortcut sequences

### DOWN

[src/index.js#L35-L35](src/index.js#L35-L35)

Undocumented declaration.

### ENTER

[src/index.js#L29-L29](src/index.js#L29-L29)

Undocumented declaration.

### ESCAPE

[src/index.js#L30-L30](src/index.js#L30-L30)

Undocumented declaration.

### F10

[src/index.js#L38-L38](src/index.js#L38-L38)

Undocumented declaration.

### isKeyboardEvent

[src/index.js#L146-L160](src/index.js#L146-L160)

An object that contains functions to check if a keyboard event matches a
predefined shortcut combination.
E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
signals pressing ⌘M.

**Type**

`Object` Keyed map of functions to match events.

### LEFT

[src/index.js#L32-L32](src/index.js#L32-L32)

Undocumented declaration.

### modifiers

[src/index.js#L45-L56](src/index.js#L45-L56)

Undocumented declaration.

### rawShortcut

[src/index.js#L65-L69](src/index.js#L65-L69)

An object that contains functions to get raw shortcuts.
E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
These are intended for user with the KeyboardShortcuts component or TinyMCE.

**Type**

`Object` Keyed map of functions to raw shortcuts.

### RIGHT

[src/index.js#L34-L34](src/index.js#L34-L34)

Undocumented declaration.

### SHIFT

[src/index.js#L43-L43](src/index.js#L43-L43)

Undocumented declaration.

### shortcutAriaLabel

[src/index.js#L116-L136](src/index.js#L116-L136)

An object that contains functions to return an aria label for a keyboard shortcut.
E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.

### SPACE

[src/index.js#L31-L31](src/index.js#L31-L31)

Undocumented declaration.

### TAB

[src/index.js#L28-L28](src/index.js#L28-L28)

Undocumented declaration.

### UP

[src/index.js#L33-L33](src/index.js#L33-L33)

Undocumented declaration.


<!-- END TOKEN(Autogenerated API docs) -->

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
6 changes: 6 additions & 0 deletions packages/keycodes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@
"@wordpress/i18n": "file:../i18n",
"lodash": "^4.17.11"
},
"devDependencies": {
"@wordpress/docgen": "file:../docgen"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"docs:generate": "docgen ./src/index.js --output ./README.md --to-token"
}
}

0 comments on commit eb35ffb

Please sign in to comment.