-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
63 lines (49 loc) · 1.35 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Type definitions for derf 3.0.1
// Project: derf
// Definitions by: Nick Clawson <https://github.com/nickclaw>
type Namespace = string | Function;
type Wrapper<T extends Function> = (fn: T) => T;
type Decorator<T> = (...args: any[]) => T;
type Printer = (
debug: (...args: any[]) => void,
time: number,
args: any[],
retArgs: any[],
) => void;
export function sync<T extends Function>(
namespace: Namespace,
fn: T,
printer?: Printer,
): T;
export function promise<T extends Function>(
namespace: Namespace,
fn: T,
printer?: Printer,
): T;
export function callback<T extends Function>(
namespace: Namespace,
fn: T,
printer?: Printer,
): T;
export function middleware<T extends Function>(
namespace: Namespace,
fn: T,
printer?: Printer,
): T;
export function timeSync<R, T extends TypedPropertyDescriptor<R>>(
namespace: Namespace
): Decorator<T>;
export function timePromise<R, T extends TypedPropertyDescriptor<R>>(
namespace: Namespace
): Decorator<T>;
export function timeCallback<R, T extends TypedPropertyDescriptor<R>>(
namespace: Namespace
): Decorator<T>;
export function timeMiddleware<R, T extends TypedPropertyDescriptor<R>>(
namespace: Namespace
): Decorator<T>;
export function isWrapped(
val: any
): boolean;
// TODO
export function createDecorator(...args: any[]): any;