{
  "classes": {
    "KeymapManager": {
      "name": "KeymapManager",
      "filename": "src/keymap-manager.coffee",
      "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L66",
      "sections": [
        {
          "name": "Class Methods",
          "description": ""
        },
        {
          "name": "Construction and Destruction",
          "description": ""
        },
        {
          "name": "Event Subscription",
          "description": ""
        },
        {
          "name": "Adding and Removing Bindings",
          "description": ""
        },
        {
          "name": "Accessing Bindings",
          "description": ""
        },
        {
          "name": "Managing Keymap Files",
          "description": ""
        },
        {
          "name": "Managing Keyboard Events",
          "description": ""
        }
      ],
      "classMethods": [
        {
          "name": "buildKeydownEvent",
          "sectionName": "Class Methods",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L83",
          "visibility": "Public",
          "summary": "Create a keydown DOM event for testing purposes.",
          "description": "Create a keydown DOM event for testing purposes.",
          "arguments": [
            {
              "name": "key",
              "description": "The key or keyIdentifier of the event. For example, `'a'`, `'1'`, `'escape'`, `'backspace'`, etc.",
              "type": null,
              "isOptional": false
            },
            {
              "children": [
                {
                  "name": "ctrl",
                  "description": "A {Boolean} indicating the ctrl modifier key",
                  "type": "Boolean",
                  "isOptional": false
                },
                {
                  "name": "alt",
                  "description": "A {Boolean} indicating the alt modifier key",
                  "type": "Boolean",
                  "isOptional": false
                },
                {
                  "name": "shift",
                  "description": "A {Boolean} indicating the shift modifier key",
                  "type": "Boolean",
                  "isOptional": false
                },
                {
                  "name": "cmd",
                  "description": "A {Boolean} indicating the cmd modifier key",
                  "type": "Boolean",
                  "isOptional": false
                },
                {
                  "name": "which",
                  "description": "A {Number} indicating `which` value of the event. See the docs for KeyboardEvent for more information.",
                  "type": "Number",
                  "isOptional": false
                },
                {
                  "name": "target",
                  "description": "The target element of the event. ",
                  "type": null,
                  "isOptional": false
                }
              ],
              "name": "options",
              "description": "An {Object} containing any of the following:",
              "type": "Object",
              "isOptional": true
            }
          ]
        }
      ],
      "instanceMethods": [
        {
          "name": "constructor",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L112",
          "visibility": "Public",
          "summary": "Create a new KeymapManager.",
          "description": "Create a new KeymapManager.",
          "arguments": [
            {
              "children": [
                {
                  "name": "defaultTarget",
                  "description": "This will be used as the target of events whose target is `document.body` to allow for a catch-all element when nothing is focused. ",
                  "type": null,
                  "isOptional": false
                }
              ],
              "name": "options",
              "description": "An {Object} containing properties to assign to the keymap.  You can pass custom properties to be used by extension methods. The following properties are also supported:",
              "type": "Object",
              "isOptional": false
            }
          ]
        },
        {
          "name": "clear",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L120",
          "visibility": "Public",
          "summary": "Clear all registered key bindings and enqueued keystrokes. For use\nin tests. ",
          "description": "Clear all registered key bindings and enqueued keystrokes. For use\nin tests. "
        },
        {
          "name": "destroy",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L128",
          "visibility": "Public",
          "summary": "Unwatch all watched paths. ",
          "description": "Unwatch all watched paths. "
        },
        {
          "name": "onDidMatchBinding",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L149",
          "visibility": "Public",
          "summary": "Invoke the given callback when one or more keystrokes completely\nmatch a key binding.",
          "description": "Invoke the given callback when one or more keystrokes completely\nmatch a key binding.",
          "arguments": [
            {
              "children": [
                {
                  "children": [
                    {
                      "name": "keystrokes",
                      "description": "{String} of keystrokes that matched the binding.",
                      "type": "String",
                      "isOptional": false
                    },
                    {
                      "name": "binding",
                      "description": "{KeyBinding} that the keystrokes matched.",
                      "type": "KeyBinding",
                      "isOptional": false
                    },
                    {
                      "name": "keyboardEventTarget",
                      "description": "DOM element that was the target of the most  recent keyboard event.",
                      "type": null,
                      "isOptional": false
                    }
                  ],
                  "name": "event",
                  "description": "{Object} with the following keys:",
                  "type": "Object",
                  "isOptional": false
                }
              ],
              "name": "callback",
              "description": "{Function} to be called when keystrokes match a binding.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "onDidPartiallyMatchBindings",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L165",
          "visibility": "Public",
          "summary": "Invoke the given callback when one or more keystrokes partially\nmatch a binding.",
          "description": "Invoke the given callback when one or more keystrokes partially\nmatch a binding.",
          "arguments": [
            {
              "children": [
                {
                  "children": [
                    {
                      "name": "keystrokes",
                      "description": "{String} of keystrokes that matched the binding.",
                      "type": "String",
                      "isOptional": false
                    },
                    {
                      "name": "partiallyMatchedBindings",
                      "description": "{KeyBinding}s that the keystrokes partially matched.",
                      "type": "KeyBinding",
                      "isOptional": false
                    },
                    {
                      "name": "keyboardEventTarget",
                      "description": "DOM element that was the target of the most recent keyboard event.",
                      "type": null,
                      "isOptional": false
                    }
                  ],
                  "name": "event",
                  "description": "{Object} with the following keys:",
                  "type": "Object",
                  "isOptional": false
                }
              ],
              "name": "callback",
              "description": "{Function} to be called when keystrokes partially match a binding.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "onDidFailToMatchBinding",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L179",
          "visibility": "Public",
          "summary": "Invoke the given callback when one or more keystrokes fail to match\nany bindings.",
          "description": "Invoke the given callback when one or more keystrokes fail to match\nany bindings.",
          "arguments": [
            {
              "children": [
                {
                  "children": [
                    {
                      "name": "keystrokes",
                      "description": "{String} of keystrokes that matched the binding.",
                      "type": "String",
                      "isOptional": false
                    },
                    {
                      "name": "keyboardEventTarget",
                      "description": "DOM element that was the target of the most  recent keyboard event.",
                      "type": null,
                      "isOptional": false
                    }
                  ],
                  "name": "event",
                  "description": "{Object} with the following keys:",
                  "type": "Object",
                  "isOptional": false
                }
              ],
              "name": "callback",
              "description": "{Function} to be called when keystrokes fail to match any bindings.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "onDidFailToReadFile",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L210",
          "visibility": "Public",
          "summary": "Invoke the given callback when a keymap file not able to be loaded.",
          "description": "Invoke the given callback when a keymap file not able to be loaded.",
          "arguments": [
            {
              "children": [
                {
                  "children": [
                    {
                      "name": "message",
                      "description": "{String} the error message.",
                      "type": "String",
                      "isOptional": false
                    },
                    {
                      "name": "stack",
                      "description": "{String} the error stack trace.",
                      "type": "String",
                      "isOptional": false
                    }
                  ],
                  "name": "error",
                  "description": "{Object} with the following keys:",
                  "type": "Object",
                  "isOptional": false
                }
              ],
              "name": "callback",
              "description": "{Function} to be called when a keymap file is unloaded.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "build",
          "sectionName": "Adding and Removing Bindings",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L225",
          "visibility": "Extended",
          "summary": "Construct {KeyBinding}s from an object grouping them by CSS selector.",
          "description": "Construct {KeyBinding}s from an object grouping them by CSS selector.",
          "arguments": [
            {
              "name": "source",
              "description": "A {String} (usually a path) uniquely identifying the given bindings so they can be removed later.",
              "type": "String",
              "isOptional": false
            },
            {
              "name": "bindings",
              "description": "An {Object} whose top-level keys point at sub-objects mapping keystroke patterns to commands.",
              "type": "Object",
              "isOptional": false
            },
            {
              "name": "priority",
              "description": "A {Number} used to sort keybindings which have the same specificity. Defaults to `0`. ",
              "type": "Number",
              "isOptional": false
            }
          ]
        },
        {
          "name": "add",
          "sectionName": "Adding and Removing Bindings",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L258",
          "visibility": "Public",
          "summary": "Add sets of key bindings grouped by CSS selector.",
          "description": "Add sets of key bindings grouped by CSS selector.",
          "arguments": [
            {
              "name": "source",
              "description": "A {String} (usually a path) uniquely identifying the given bindings so they can be removed later.",
              "type": "String",
              "isOptional": false
            },
            {
              "name": "bindings",
              "description": "An {Object} whose top-level keys point at sub-objects mapping keystroke patterns to commands.",
              "type": "Object",
              "isOptional": false
            },
            {
              "name": "priority",
              "description": "A {Number} used to sort keybindings which have the same specificity. Defaults to `0`. ",
              "type": "Number",
              "isOptional": false
            }
          ]
        },
        {
          "name": "getKeyBindings",
          "sectionName": "Accessing Bindings",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L278",
          "visibility": "Public",
          "summary": "Get all current key bindings.",
          "description": "Get all current key bindings.",
          "returnValues": [
            {
              "type": "Array",
              "description": "Returns an {Array} of {KeyBinding}s."
            }
          ]
        },
        {
          "name": "findKeyBindings",
          "sectionName": "Accessing Bindings",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L293",
          "visibility": "Public",
          "summary": "Get the key bindings for a given command and optional target.",
          "description": "Get the key bindings for a given command and optional target.",
          "arguments": [
            {
              "children": [
                {
                  "name": "keystrokes",
                  "description": "A {String} representing one or more keystrokes, such as 'ctrl-x ctrl-s'",
                  "type": "String",
                  "isOptional": false
                },
                {
                  "name": "command",
                  "description": "A {String} representing the name of a command, such as 'editor:backspace'",
                  "type": "String",
                  "isOptional": false
                },
                {
                  "name": "target",
                  "description": "An optional DOM element constraining the search. If this parameter is supplied, the call will only return bindings that can be invoked by a KeyboardEvent originating from the target element.",
                  "type": null,
                  "isOptional": false
                }
              ],
              "name": "params",
              "description": "An {Object} whose keys constrain the binding search:",
              "type": "Object",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Array",
              "description": "Returns an {Array} of key bindings."
            }
          ]
        },
        {
          "name": "loadKeymap",
          "sectionName": "Managing Keymap Files",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L330",
          "visibility": "Public",
          "summary": "Load the key bindings from the given path.",
          "description": "Load the key bindings from the given path.",
          "arguments": [
            {
              "name": "path",
              "description": "A {String} containing a path to a file or a directory. If the path is a directory, all files inside it will be loaded.",
              "type": "String",
              "isOptional": false
            },
            {
              "children": [
                {
                  "name": "watch",
                  "description": "If `true`, the keymap will also reload the file at the given path whenever it changes. This option cannot be used with directory paths.",
                  "type": null,
                  "isOptional": false
                },
                {
                  "name": "priority",
                  "description": "A {Number} used to sort keybindings which have the same specificity. ",
                  "type": "Number",
                  "isOptional": false
                }
              ],
              "name": "options",
              "description": "An {Object} containing the following optional keys:",
              "type": "Object",
              "isOptional": false
            }
          ]
        },
        {
          "name": "watchKeymap",
          "sectionName": "Managing Keymap Files",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L353",
          "visibility": "Public",
          "summary": "Cause the keymap to reload the key bindings file at the given path\nwhenever it changes.",
          "description": "Cause the keymap to reload the key bindings file at the given path\nwhenever it changes.\n\nThis method doesn't perform the initial load of the key bindings file. If\nthat's what you're looking for, call {::loadKeymap} with `watch: true`.",
          "arguments": [
            {
              "name": "path",
              "description": "A {String} containing a path to a file or a directory. If the path is a directory, all files inside it will be loaded.",
              "type": "String",
              "isOptional": false
            },
            {
              "children": [
                {
                  "name": "priority",
                  "description": "A {Number} used to sort keybindings which have the same specificity. ",
                  "type": "Number",
                  "isOptional": false
                }
              ],
              "name": "options",
              "description": "An {Object} containing the following optional keys:",
              "type": "Object",
              "isOptional": false
            }
          ]
        },
        {
          "name": "handleKeyboardEvent",
          "sectionName": "Managing Keyboard Events",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L425",
          "visibility": "Public",
          "summary": "Dispatch a custom event associated with the matching key binding for\nthe given `KeyboardEvent` if one can be found.",
          "description": "Dispatch a custom event associated with the matching key binding for\nthe given `KeyboardEvent` if one can be found.\n\nIf a matching binding is found on the event's target or one of its\nancestors, `.preventDefault()` is called on the keyboard event and the\nbinding's command is emitted as a custom event on the matching element.\n\nIf the matching binding's command is 'native!', the method will terminate\nwithout calling `.preventDefault()` on the keyboard event, allowing the\nbrowser to handle it as normal.\n\nIf the matching binding's command is 'unset!', the search will continue from\nthe current element's parent.\n\nIf the matching binding's command is 'abort!', the search will terminate\nwithout dispatching a command event.\n\nIf the event's target is `document.body`, it will be treated as if its\ntarget is `.defaultTarget` if that property is assigned on the keymap.",
          "arguments": [
            {
              "name": "event",
              "description": "A `KeyboardEvent` of type 'keydown' ",
              "type": null,
              "isOptional": false
            }
          ]
        },
        {
          "name": "keystrokeForKeyboardEvent",
          "sectionName": "Managing Keyboard Events",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L655",
          "visibility": "Public",
          "summary": "Translate a keydown event to a keystroke string.",
          "description": "Translate a keydown event to a keystroke string.",
          "arguments": [
            {
              "name": "event",
              "description": "A `KeyboardEvent` of type 'keydown'",
              "type": null,
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "String",
              "description": "Returns a {String} describing the keystroke."
            }
          ]
        },
        {
          "name": "addKeystrokeResolver",
          "sectionName": "Managing Keyboard Events",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L676",
          "visibility": "Public",
          "summary": "Customize translation of raw keyboard events to keystroke strings.\nThis API is useful for working around Chrome bugs or changing how Atom\nresolves certain key combinations. If multiple resolvers are installed,\nthe most recently-added resolver returning a string for a given keystroke\ntakes precedence.",
          "description": "Customize translation of raw keyboard events to keystroke strings.\nThis API is useful for working around Chrome bugs or changing how Atom\nresolves certain key combinations. If multiple resolvers are installed,\nthe most recently-added resolver returning a string for a given keystroke\ntakes precedence.",
          "arguments": [
            {
              "children": [
                {
                  "name": "keystroke",
                  "description": "The currently resolved keystroke string. If your function returns a falsy value, this is how Atom will resolve your keystroke.",
                  "type": null,
                  "isOptional": false
                },
                {
                  "name": "event",
                  "description": "The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation for more details.",
                  "type": null,
                  "isOptional": false
                },
                {
                  "name": "layoutName",
                  "description": "The OS-specific name of the current keyboard layout.",
                  "type": null,
                  "isOptional": false
                },
                {
                  "name": "keymap",
                  "description": "An object mapping DOM 3 `KeyboardEvent.code` values to objects with the typed character for that key in each modifier state, based on the current operating system layout.",
                  "type": null,
                  "isOptional": false
                }
              ],
              "name": "resolver",
              "description": "A {Function} that returns a keystroke {String} and is called  with an object containing the following keys:",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} that removes the added resolver."
            }
          ]
        },
        {
          "name": "getPartialMatchTimeout",
          "sectionName": "Managing Keyboard Events",
          "srcUrl": "https://github.com/atom/atom-keymap/blob/v8.2.15/src/keymap-manager.coffee#L686",
          "visibility": "Public",
          "summary": "Get the number of milliseconds allowed before pending states caused\nby partial matches of multi-keystroke bindings are terminated.",
          "description": "Get the number of milliseconds allowed before pending states caused\nby partial matches of multi-keystroke bindings are terminated.",
          "returnValues": [
            {
              "type": "Number",
              "description": "Returns a {Number}"
            }
          ]
        }
      ],
      "classProperties": [],
      "instanceProperties": [],
      "visibility": "Extended",
      "summary": "Allows commands to be associated with keystrokes in a\ncontext-sensitive way. In Atom, you can access a global instance of this\nobject via `atom.keymaps`.",
      "description": "Allows commands to be associated with keystrokes in a\ncontext-sensitive way. In Atom, you can access a global instance of this\nobject via `atom.keymaps`.\n\nKey bindings are plain JavaScript objects containing **CSS selectors** as\ntheir top level keys, then **keystroke patterns** mapped to commands.\n\n```cson\n'.workspace':\n  'ctrl-l': 'package:do-something'\n  'ctrl-z': 'package:do-something-else'\n'.mini.editor':\n  'enter': 'core:confirm'\n```\n\nWhen a keystroke sequence matches a binding in a given context, a custom DOM\nevent with a type based on the command is dispatched on the target of the\nkeyboard event.\n\nTo match a keystroke sequence, the keymap starts at the target element for the\nkeyboard event. It looks for key bindings associated with selectors that match\nthe target element. If multiple match, the most specific is selected. If there\nis a tie in specificity, the most recently added binding wins. If no bindings\nare found for the events target, the search is repeated again for the target's\nparent node and so on recursively until a binding is found or we traverse off\nthe top of the document.\n\nWhen a binding is found, its command event is always dispatched on the\noriginal target of the keyboard event, even if the matching element is higher\nup in the DOM. In addition, `.preventDefault()` is called on the keyboard\nevent to prevent the browser from taking action. `.preventDefault` is only\ncalled if a matching binding is found.\n\nCommand event objects have a non-standard method called `.abortKeyBinding()`.\nIf your command handler is invoked but you programmatically determine that no\naction can be taken and you want to allow other bindings to be matched, call\n`.abortKeyBinding()` on the event object. An example of where this is useful\nis binding snippet expansion to `tab`. If `snippets:expand` is invoked when\nthe cursor does not follow a valid snippet prefix, we abort the binding and\nallow `tab` to be handled by the default handler, which inserts whitespace.\n\nMulti-keystroke bindings are possible. If a sequence of one or more keystrokes\n*partially* matches a multi-keystroke binding, the keymap enters a pending\nstate. The pending state is terminated on the next keystroke, or after\n{::getPartialMatchTimeout} milliseconds has elapsed. When the pending state is\nterminated via a timeout or a keystroke that leads to no matches, the longest\nambiguous bindings that caused the pending state are temporarily disabled and\nthe previous keystrokes are replayed. If there is ambiguity again during the\nreplay, the next longest bindings are disabled and the keystrokes are replayed\nagain. "
    }
  }
}