export nssm types

This commit is contained in:
Joram van den Boezem
2019-02-14 21:18:26 +01:00
parent 5a4b78c53f
commit 7e59eca6a6
2 changed files with 13 additions and 11 deletions

22
types/nssm/index.d.ts vendored
View File

@@ -44,14 +44,16 @@ type NssmCommandFn =
& TwoArgCommandFn
& PromiseCommandFn;
type Nssm = {
[key in Command]: NssmCommandFn
};
interface NssmOptions {
nssmExe?: string;
}
declare function nssm(serviceName: string, options?: NssmOptions): Nssm;
export = nssm;
declare function nssm(serviceName: string, options?: nssm.NssmOptions): nssm.Nssm;
declare namespace nssm {
type Nssm = {
[key in Command]: NssmCommandFn
};
interface NssmOptions {
nssmExe?: string;
}
}

View File

@@ -3,7 +3,7 @@
import nssm = require('nssm');
const svcName = 'test';
const options = { nssmExe: 'nssm.exe' };
const options: nssm.NssmOptions = { nssmExe: 'nssm.exe' };
const testService = nssm(svcName, options);
const propertyName = 'Start';