1 | import { APIConfig } from "./lib/APIConfig";
|
2 | import { APIUtils } from "./lib/APIUtils";
|
3 | import "reflect-metadata";
|
4 | import { APIResponse } from "./lib/APIResponse";
|
5 | import { APIError } from "./lib/APIError";
|
6 | import { KVService } from "./lib/Services/KeyValue/KVService";
|
7 | import { FileService } from "./lib/Services/File/FileService";
|
8 | import { EnvVarSync } from "./lib/Services/Config";
|
9 | import { APIAuthUtils } from "./lib/APIAuthUtils";
|
10 | export interface APILoaderDefinition {
|
11 | apiPath?: string;
|
12 | require: string;
|
13 | moduleName?: string;
|
14 | }
|
15 | export interface APILoveOptions {
|
16 | apis?: APILoaderDefinition[];
|
17 | loadStandardMiddleware?: boolean;
|
18 | middleware?: any[];
|
19 | defaultErrorHandler?: (error: any, req: any, res: any, next: any) => void;
|
20 | defaultRouteHandler?: (req: any, res: any) => void;
|
21 | callbackWaitsForEmptyEventLoop?: boolean;
|
22 | }
|
23 | export declare class APILove {
|
24 | static app: any;
|
25 | static start(options: APILoveOptions): any;
|
26 | }
|
27 | export interface APIParameterOptions {
|
28 | |
29 |
|
30 |
|
31 | optional?: boolean;
|
32 | |
33 |
|
34 |
|
35 | defaultValue?: any;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | processor?: (value: any, req?: any) => any;
|
41 | |
42 |
|
43 |
|
44 |
|
45 | sources?: string[] | string;
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | includeFullSource?: boolean;
|
60 | |
61 |
|
62 |
|
63 |
|
64 | rawName?: string;
|
65 | }
|
66 | export declare function APIParameter(options: APIParameterOptions): (target: any, key: any, parameterIndex: number) => void;
|
67 | export interface APIEndpointOptions {
|
68 | method?: string;
|
69 | path?: string;
|
70 | middleware?: ((req: any, res: any, next?: any) => void)[] | ((req: any, res: any, next: any) => void);
|
71 | disableFriendlyResponse?: boolean;
|
72 | successResponse?: (responseData: any, res: any) => void;
|
73 | requireAuthentication?: boolean;
|
74 | }
|
75 | export declare function APIEndpoint(options?: APIEndpointOptions): (target: any, key: any, descriptor: any) => void;
|
76 | export { APIConfig, APIAuthUtils, APIError, APIResponse, APIUtils, KVService as APIKVService, FileService as APIFileService, EnvVarSync };
|