-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
28 lines (28 loc) · 891 Bytes
/
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
export interface ObjectStrings {
[params: string]: string[];
}
export interface ObjectString {
[params: string]: string;
}
export type MethodsRule = 'startsWith' | 'endsWith' | 'includes';
export interface Response {
get: Function;
post: Function;
put: Function;
delete: Function;
[params: string]: any;
}
export interface Options {
methods?: ObjectStrings;
mergeMethods?: ObjectStrings;
config?: object;
methodsRule?: MethodsRule;
rule?: string;
}
export interface BoxCat {
[params: string]: apiFunction
}
export type id = number | string | object
export type apiFunction = (id?: id , data?: object, config?: object, ...rest: any[]) => Function
export function createApis(apis: ObjectString, response: Response, options?: Options): BoxCat;
export function createProxy(apis: ObjectString, response: Response, options?: Options): BoxCat;