0.1.5 • Published 6 months ago

@types/nssm v0.1.5

Weekly downloads
21
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/nssm

Summary

This package contains type definitions for nssm (https://github.com/alykoshin/nssm).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nssm.

index.d.ts

// Type definitions for nssm 0.1
// Project: https://github.com/alykoshin/nssm
// Definitions by: Joram van den Boezem <https://github.com/hongaar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

type Command =
    | 'install'
    | 'remove'
    | 'start'
    | 'stop'
    | 'restart'
    | 'status'
    | 'pause'
    | 'continue'
    | 'rotate'
    | 'get'
    | 'set'
    | 'reset';

type NssmThen<T> = <TResult1 = T, TResult2 = never>(
    onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
    onrejected?: ((reason: Error, stderr: string) => TResult2 | PromiseLike<TResult2>) | null
) => NssmPromise<TResult1 | TResult2>;

type NssmCatch<T> = <TResult = never>(
    onrejected?: ((reason: Error, stderr: string) => TResult | PromiseLike<TResult>) | null
) => NssmPromise<T | TResult>;

interface NssmPromise<T> extends Promise<T> {
    then: NssmThen<T>;
    catch: NssmCatch<T>;
}

type CallbackFn = (error?: string, result?: string) => void;
type ZeroArgCommandFn = (callback: CallbackFn) => void;
type OneArgCommandFn = (arg1: string, callback: CallbackFn) => void;
type TwoArgCommandFn = (arg1: string, arg2: string, callback: CallbackFn) => void;
type PromiseCommandFn = (arg1?: string, arg2?: string) => NssmPromise<string>;

type NssmCommandFn =
    & ZeroArgCommandFn
    & OneArgCommandFn
    & TwoArgCommandFn
    & PromiseCommandFn;

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 | undefined;
    }
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 18:51:40 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Joram van den Boezem.

0.1.4

7 months ago

0.1.3

8 months ago

0.1.5

6 months ago

0.1.2

3 years ago

0.1.1

5 years ago

0.1.0

5 years ago