Skip to content

Commit 5597759

Browse files
committed
feat(typings): add index.d.ts
1 parent 8084e03 commit 5597759

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

index.d.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { SecureContextOptions } from 'tls';
2+
3+
4+
export interface ClusterOptions {
5+
/** specify framework that can be absolute path or npm package */
6+
framework?: string;
7+
/** directory of application, default to `process.cwd()` */
8+
baseDir?: string;
9+
/** customized plugins, for unittest */
10+
plugins?: object | null;
11+
/** numbers of app workers, default to `os.cpus().length` */
12+
workers?: number;
13+
/** listening port, default to 7001(http) or 8443(https) */
14+
port?: number;
15+
/** Ref: https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options */
16+
https?: SecureContextOptions;
17+
[prop: string]: any;
18+
}
19+
20+
21+
22+
export function startCluster(options: ClusterOptions, callback: (...args: any[]) => any): void;

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.19.1",
44
"description": "cluster manager for egg",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"scripts": {
78
"autod": "autod",
89
"lint": "eslint .",
@@ -14,6 +15,7 @@
1415
},
1516
"files": [
1617
"index.js",
18+
"index.d.ts",
1719
"lib"
1820
],
1921
"repository": {

0 commit comments

Comments
 (0)