UNPKG

857 BTypeScriptView Raw
1// Type definitions for abbrev 1.1
2// Project: https://github.com/isaacs/abbrev-js#readme
3// Definitions by: BendingBender <https://github.com/BendingBender>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6export = abbrev;
7
8declare function abbrev(words: ReadonlyArray<abbrev.Abbreviable>): { [abbreviation: string]: string };
9declare function abbrev(...words: ReadonlyArray<abbrev.Abbreviable>): { [abbreviation: string]: string };
10
11declare namespace abbrev {
12 function monkeyPatch(): void;
13
14 type Abbreviable = string | { toString(): string };
15}
16
17declare global {
18 interface Array<T> {
19 abbrev(): { [abbreviation: string]: string };
20 }
21
22 interface ReadonlyArray<T> {
23 abbrev(): { [abbreviation: string]: string };
24 }
25
26 interface Object {
27 abbrev(): { [abbreviation: string]: string };
28 }
29}