UNPKG

1.54 kBTypeScriptView Raw
1// Type definitions for es-abstract 1.17
2// Project: https://github.com/ljharb/es-abstract
3// Definitions by: Jordan Harband <https://github.com/ljharb>
4// ExE Boss <https://github.com/ExE-Boss>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6// TypeScript Version: 3.8
7
8import ES5 = require('./es5');
9import ES6 = require('./es6');
10import ES7 = require('./es7');
11
12import ES2015 = require('./es2015');
13import ES2016 = require('./es2016');
14import ES2017 = require('./es2017');
15import ES2018 = require('./es2018');
16import ES2019 = require('./es2019');
17
18declare namespace ESAbstract {
19 // ES2015 types:
20 type PropertyKey = string | symbol;
21
22 // ES5 types:
23 interface GenericDescriptor {
24 '[[Configurable]]'?: boolean;
25 '[[Enumerable]]'?: boolean;
26 }
27
28 interface AccessorDescriptor<T = unknown> extends GenericDescriptor {
29 '[[Get]]'?(): T;
30 '[[Set]]'?(value: T): void;
31 }
32
33 interface DataDescriptor<T = unknown> extends GenericDescriptor {
34 '[[Writable]]'?: boolean;
35 '[[Value]]'?: T;
36 }
37
38 type PropertyDescriptor<T = unknown> = AccessorDescriptor<T> | DataDescriptor<T>;
39}
40
41interface ESAbstract extends ES6 {
42 readonly ES5: ES5;
43 /** @deprecated */
44 readonly ES6: ES6;
45 /** @deprecated */
46 readonly ES7: ES7;
47
48 readonly ES2015: ES2015;
49 readonly ES2016: ES2016;
50 readonly ES2017: ES2017;
51 readonly ES2018: ES2018;
52 readonly ES2019: ES2019;
53}
54
55declare const ESAbstract: ESAbstract;
56export = ESAbstract;