import type { StatusInfo, StatusStarting, StatusLive, StatusStopping, StatusDead } from './types.js'; import type { FileSystem, FileHandle } from '../types.js'; import type { PromiseCancellable } from '@matrixai/async-cancellable'; import type { ContextTimedInput } from '@matrixai/contexts'; import Logger from '@matrixai/logger'; import { startStop } from '@matrixai/async-init'; interface Status extends startStop.StartStop { } declare class Status { readonly statusPath: string; readonly statusLockPath: string; protected logger: Logger; protected fs: FileSystem; protected statusLockFile: FileHandle; constructor({ statusPath, statusLockPath, fs, logger, }: { statusPath: string; statusLockPath: string; fs: FileSystem; logger?: Logger; }); start(data: StatusStarting['data']): Promise; finishStart(data: StatusLive['data']): Promise; beginStop(data: StatusStopping['data']): Promise; stop(data: StatusDead['data']): Promise; /** * Read the status data * This can be used without running Status */ readStatus(): Promise; protected writeStatus(statusInfo: StatusInfo): Promise; updateStatusLive(data: Partial): Promise; waitFor(status: StatusInfo['status'], ctx?: Partial): PromiseCancellable; /** * Replacer used during encoding to JSON * This is a function expression and not an arrow function expression * because it needs to access the `this` inside the JSON.stringify * in order to encode the `NodeId` before the `toJSON` of IdInternal is called */ protected statusReplacer: (key: string, value: any) => any; /** * Reviver used during decoding from JSON */ protected statusReviver: (key: string, value: any) => any; } export default Status;