-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
63 lines (50 loc) · 1.45 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
// Created on the basis of http://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html
export as namespace eva;
export type AnyFunc = (...args: any[]) => any;
export type MapParamListFunc = (target: AnyFunc, targetIndex: number, funcList: AnyFunc[]) => any[];
export type MapContextFunc = (target: AnyFunc, targetIndex: number, funcList: AnyFunc[]) => object;
export interface CreateFunctionSettings {
debug?: boolean;
debugFunc?: string;
debugMessage?: string;
expression?: string;
paramNames?: string;
scope?: boolean;
}
export interface CreateDelegateMethodSettings {
destination?: object;
destinationMethod?: string;
}
export interface ClosureSettings {
ignoreArgs?: boolean;
prependArgs?: boolean;
}
export interface MapSettings {
funcContext?: boolean;
}
export function createFunction(
code: string,
settings?: CreateFunctionSettings
): AnyFunc;
export function evalWith(
expression: string,
context?: object,
scope?: object
): any;
export function createDelegateMethod(
delegate: object,
method: string,
settings?: CreateDelegateMethodSettings
): AnyFunc;
export function closure(
action: AnyFunc,
paramList?: any[],
context?: object,
settings?: ClosureSettings
): AnyFunc;
export function map(
funcList: AnyFunc[],
paramList?: any[] | MapParamListFunc,
context?: object | null | MapContextFunc,
settings?: MapSettings
): any[];