mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[express-cluster]: Add types
This commit is contained in:
parent
68cd19ffcf
commit
f8d259f70b
6
types/express-cluster/express-cluster-tests.ts
Normal file
6
types/express-cluster/express-cluster-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import * as cluster from 'express-cluster';
|
||||
|
||||
() => {
|
||||
cluster(worker => {}, {count: 5});
|
||||
cluster({count: 5}, worker => {});
|
||||
};
|
||||
26
types/express-cluster/index.d.ts
vendored
Normal file
26
types/express-cluster/index.d.ts
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// Type definitions for express-cluster 0.0
|
||||
// Project: https://github.com/Flipboard/express-cluster
|
||||
// Definitions by: Miloslav Nenadál <https://github.com/nenadalm>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as cluster from 'cluster';
|
||||
|
||||
interface Config {
|
||||
count?: number;
|
||||
respawn?: boolean;
|
||||
verbose?: boolean;
|
||||
workerListener?(): void;
|
||||
outputStream?: NodeJS.WritableStream;
|
||||
}
|
||||
|
||||
type WorkerFunction = (worker: cluster.Worker) => void;
|
||||
|
||||
interface Cluster {
|
||||
(fn: WorkerFunction, config: Config): void;
|
||||
(config: Config, fn: WorkerFunction): void;
|
||||
}
|
||||
|
||||
declare const c: Cluster;
|
||||
export = c;
|
||||
22
types/express-cluster/tsconfig.json
Normal file
22
types/express-cluster/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-cluster-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/express-cluster/tslint.json
Normal file
1
types/express-cluster/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user