1 |
|
2 | import { INestApplication } from '@nestjs/common';
|
3 | import { FastifyBodyParser, FastifyInstance, FastifyPluginAsync, FastifyPluginCallback, FastifyPluginOptions, FastifyRegisterOptions, RawServerBase } from 'fastify';
|
4 | import { Chain as LightMyRequestChain, InjectOptions, Response as LightMyRequestResponse } from 'light-my-request';
|
5 | import { FastifyStaticOptions, FastifyViewOptions } from './external';
|
6 | import { NestFastifyBodyParserOptions } from './nest-fastify-body-parser-options.interface';
|
7 |
|
8 |
|
9 |
|
10 | export interface NestFastifyApplication extends INestApplication {
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 | register<Options extends FastifyPluginOptions = any>(plugin: FastifyPluginCallback<Options> | FastifyPluginAsync<Options> | Promise<{
|
17 | default: FastifyPluginCallback<Options>;
|
18 | }> | Promise<{
|
19 | default: FastifyPluginAsync<Options>;
|
20 | }>, opts?: FastifyRegisterOptions<Options>): Promise<FastifyInstance>;
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | useBodyParser<TServer extends RawServerBase = RawServerBase>(type: string | string[] | RegExp, options?: NestFastifyBodyParserOptions, parser?: FastifyBodyParser<Buffer, TServer>): this;
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | useStaticAssets(options: FastifyStaticOptions): this;
|
43 | |
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | setViewEngine(options: FastifyViewOptions | string): this;
|
50 | |
51 |
|
52 |
|
53 |
|
54 | inject(): LightMyRequestChain;
|
55 | inject(opts: InjectOptions | string): Promise<LightMyRequestResponse>;
|
56 | |
57 |
|
58 |
|
59 |
|
60 | listen(port: number | string, callback?: (err: Error, address: string) => void): Promise<any>;
|
61 | listen(port: number | string, address: string, callback?: (err: Error, address: string) => void): Promise<any>;
|
62 | listen(port: number | string, address: string, backlog: number, callback?: (err: Error, address: string) => void): Promise<any>;
|
63 | }
|