@e-mc/watch
TypeScript icon, indicating that this package has built-in type declarations

0.8.7 • Public • Published

@e-mc/watch

  • NodeJS 14
  • ES2020

General Usage

Interface

import type { IFileManager, ModuleConstructor } from "./index";
import type { ExternalAsset } from "./asset";
import type { IClient, IPermission } from "./core";
import type { FinalizeResult, PostFinalizeCallback } from "./filemanager";
import type { WatchModule } from "./settings";
import type { IFileGroup, ModifiedPostFinalizeListener, SecureOptions } from "./watch";

import type * as ws from "ws";

interface IWatch extends IClient<IFileManager, WatchModule, ModifiedPostFinalizeListener> {
    connectTimeout: number;
    start(assets: ExternalAsset[], permission?: IPermission | null): void;
    modified(watch: IFileGroup<ExternalAsset>): Promise<FinalizeResult | void>;
    configureServer(options: SecureOptions): boolean;
    setCA(value: string): boolean;
    setSSLKey(value: string): boolean;
    setSSLCert(value: string): boolean;
    hasSecureProtocol(): boolean;
    whenModified?(assets: ExternalAsset[], postFinalize: PostFinalizeCallback): IFileManager;
    whenModified?(assets: ExternalAsset[], sanitize?: boolean | PostFinalizeCallback, postFinalize?: PostFinalizeCallback): IFileManager;
    set assets(value: ExternalAsset[]);
    get assets(): ExternalAsset[];
    set interval(value);
    get interval(): number;
    set port(value);
    get port(): number;
    set securePort(value);
    get securePort(): number;
}

interface WatchConstructor extends ModuleConstructor {
    createServer(port: number, active: boolean): ws.Server | null;
    createServer(port: number, secure?: SecureOptions | null, active?: boolean): ws.Server | null;
    shutdown(): void;
    setTimeout(value: number | string): void;
    checkTimeout(client: ws): boolean;
    readonly prototype: IWatch;
    new(module?: WatchModule): IWatch;
    /* @deprecated */
    new(interval?: number, port?: number, securePort?: number, extensions?: unknown[]): IWatch;
}

References

LICENSE

BSD 3-Clause

Package Sidebar

Install

npm i @e-mc/watch

Weekly Downloads

2

Version

0.8.7

License

BSD 3-Clause

Unpacked Size

49 kB

Total Files

7

Last publish

Collaborators

  • anpham6