-
Notifications
You must be signed in to change notification settings - Fork 568
/
index.d.ts
47 lines (44 loc) 路 1.05 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
import {
Application,
IMidwayKoaConfigurationOptions,
Context as KoaContext,
BodyParserOptions,
State,
} from './dist';
import { CookieSetOptions, Cookies } from '@midwayjs/cookies';
import '@midwayjs/session';
export * from './dist/index';
declare module '@midwayjs/core/dist/interface' {
interface MidwayConfig {
keys?: string | string[];
koa?: IMidwayKoaConfigurationOptions;
cookies?: CookieSetOptions;
/**
* onerror middleware options
*/
onerror?: {
text?: (err: Error, ctx: KoaContext) => void;
json?: (err: Error, ctx: KoaContext) => void;
html?: (err: Error, ctx: KoaContext) => void;
redirect?: string;
accepts?: (...args) => any;
};
bodyParser?: BodyParserOptions;
siteFile?: {
enable?: boolean;
favicon?: undefined | string | Buffer;
};
}
}
declare module 'koa' {
interface Request {
body?: unknown;
rawBody: string;
}
interface Context {
cookies: Cookies;
app: Application;
forward: (url: string) => void;
state: State;
}
}