@servant/servant
Version:
Servant builder for node modules.
42 lines (41 loc) • 1.32 kB
TypeScript
import { LinkResult, LinkThrow } from "devlink-core";
import { BuildResult } from "../module";
import { ModulesData } from "../types";
import { BuildJob, DiscoveryInstance } from "./discovery";
import { WatcherState } from "./state";
export interface WatcherInfo {
ready: boolean;
error: Error | null;
time: string;
date: Date;
discovery: WatcherDiscovery;
modulesData: ModulesData | null;
}
export interface WatcherChange {
progress: boolean;
time: string;
modules: Array<string>;
files: Array<[string, -1 | 0 | 1, number]>;
results: Array<BuildResult>;
}
export interface WatcherDiscovery {
instance: DiscoveryInstance | null;
running: {
id: string;
port: number;
entry: string;
modules: Array<string>;
job: BuildJob | null;
results: {
result: LinkResult | null;
error: LinkThrow | null;
}[];
err?: Error;
}[];
}
export interface WatcherSettings {
transpile?: boolean;
}
export type ChangeHandler = (info: WatcherInfo, change: WatcherChange) => void;
export declare function createWatcherInfo(state: WatcherState, error?: Error | null): WatcherInfo;
export declare function createWatcherChange(progress: boolean): WatcherChange;