Skip to content

Commit

Permalink
Merge pull request #340 from 0x0a0d/d-ts-server
Browse files Browse the repository at this point in the history
imp(index.d.ts): correct server type
  • Loading branch information
icebob authored Oct 22, 2023
2 parents 835189f + e303eee commit f9b25ee
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ declare module "moleculer-web" {
} from "moleculer";
import { Errors } from "moleculer";
import { IParseOptions } from 'qs';
import type { Server as NetServer } from 'net';
import type { Server as TLSServer } from 'tls';
import type { Server as HttpServer } from 'http';
import type { Server as HttpsServer } from 'https';
import type { Http2SecureServer, Http2Server } from 'http2';


// RateLimit
export type generateRateLimitKey = (req: IncomingMessage) => string;
Expand Down Expand Up @@ -593,6 +599,15 @@ declare module "moleculer-web" {
whitelist?: (string | RegExp)[];
}

type APISettingServer =
| boolean
| HttpServer
| HttpsServer
| Http2Server
| Http2SecureServer
| NetServer
| TLSServer;

export interface ApiSettingsSchema extends CommonSettingSchema {
/**
* It serves assets with the [serve-static](https://github.com/expressjs/serve-static) module like ExpressJS.
Expand Down Expand Up @@ -695,7 +710,7 @@ declare module "moleculer-web" {
* If false, it will start without server in middleware mode
* @default true
*/
server?: boolean;
server?: APISettingServer;

/**
* Options passed on to qs
Expand Down

0 comments on commit f9b25ee

Please sign in to comment.