Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp(index.d.ts): correct server type #340

Merged
merged 2 commits into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading