UNPKG

1.51 kBTypeScriptView Raw
1// Type definitions for d 1.0
2// Project: https://github.com/medikoo/d#readme
3// Definitions by: BendingBender <https://github.com/BendingBender>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 2.4
6
7export = d;
8
9declare function d(value: any, options?: PropertyDescriptor): PropertyDescriptor;
10declare function d(flags: d.Flags, value: any, options?: PropertyDescriptor): PropertyDescriptor;
11
12declare namespace d {
13 function gs(flags: GetSetFlags, options: PropertyDescriptor): PropertyDescriptor;
14 function gs(flags: GetSetFlags, get: (...args: any[]) => any, options: PropertyDescriptor): PropertyDescriptor;
15 function gs(
16 get: (...args: any[]) => any,
17 set?: ((...args: any[]) => any) | null,
18 options?: PropertyDescriptor
19 ): PropertyDescriptor;
20 function gs(
21 get: ((...args: any[]) => any) | null | undefined,
22 set: (...args: any[]) => any,
23 options?: PropertyDescriptor
24 ): PropertyDescriptor;
25 function gs(
26 flags: GetSetFlags,
27 get: (...args: any[]) => any,
28 set?: ((...args: any[]) => any) | null,
29 options?: PropertyDescriptor
30 ): PropertyDescriptor;
31 function gs(
32 flags: GetSetFlags,
33 get: ((...args: any[]) => any) | null | undefined,
34 set: (...args: any[]) => any,
35 options?: PropertyDescriptor
36 ): PropertyDescriptor;
37
38 type GetSetFlags = 'c' | 'e' | 'ce';
39 type Flags = GetSetFlags | 'w' | 'cw' | 'ew' | 'cew';
40}