1 | import { RawServerBase, RawServerDefault, RawReplyDefaultExpression, RawRequestDefaultExpression } from './utils'
|
2 | import * as http from 'http'
|
3 | import * as https from 'https'
|
4 | import * as http2 from 'http2'
|
5 |
|
6 | export type FastifyServerFactoryHandler<
|
7 | RawServer extends RawServerBase = RawServerDefault,
|
8 | RawRequest extends RawRequestDefaultExpression<RawServer> = RawRequestDefaultExpression<RawServer>,
|
9 | RawReply extends RawReplyDefaultExpression<RawServer> = RawReplyDefaultExpression<RawServer>
|
10 | > =
|
11 | RawServer extends http.Server | https.Server ?
|
12 | (request: http.IncomingMessage & RawRequest, response: http.ServerResponse & RawReply) => void :
|
13 | (request: http2.Http2ServerRequest & RawRequest, response: http2.Http2ServerResponse & RawReply) => void
|
14 |
|
15 | export interface FastifyServerFactory<
|
16 | RawServer extends RawServerBase = RawServerDefault
|
17 | > {
|
18 | (handler: FastifyServerFactoryHandler<RawServer>, opts: Record<string, unknown>): RawServer;
|
19 | }
|