DefinitelyTyped/types/atom-keymap
2017-12-04 22:42:14 -05:00
..
atom-keymap-tests.ts Remove global namespaces: EventKit, FirstMate, and PathWatcher. 2017-11-06 00:31:13 -05:00
index.d.ts atom: fix issues raised by lierdakil 2017-12-04 22:42:14 -05:00
README.md Revamp services. Improve consistency. Add *Compatible types. (#20726) 2017-10-23 07:46:49 -07:00
tsconfig.json atom: clean out tslint.json files, fix lint errors. 2017-11-06 00:31:02 -05:00
tslint.json atom: clean out tslint.json files, fix lint errors. 2017-11-06 00:31:02 -05:00

Atom Keymap Type Definitions

TypeScript type definitions for Atom Keymap, which is published as "atom-keymap" on NPM.

Usage Notes

Exports

This module has a single entity as its export: the KeymapManager class. The require syntax is typically used to import modules like this.

import KeymapManager = require("atom-keymap");

The AtomKeymap Namespace

Many of the types used by Atom Keymap can be referenced from the AtomKeymap namespace.

function example(keybind: AtomKeymap.KeyBinding) {}

Exposing Private Methods and Properties

Declaration Merging can be used to augment any of the types used within Atom Keymap. As an example, if we wanted to reveal the private partialMatchTimeout property within the KeymapManager class, then we would create a file with the following contents:

// <<filename>>.d.ts

declare namespace AtomKeymap {
  interface KeymapManager {
    partialMatchTimeout: number;
  }
}

Once this file is either referenced or included within your project, then this new property would be freely usable on instances of the KeymapManager class without TypeScript reporting errors.