@signalk/streams
Version:
Utilities for handling streams of Signal K data
52 lines • 1.63 kB
TypeScript
import { EventEmitter } from 'events';
import type { CreateDebug, DebugLogger, DeltaCache } from './types';
interface MockAppOptions {
selfContext?: string;
configPath?: string;
loggingDirectory?: string;
keepMostRecentLogsOnly?: boolean;
logCountToKeep?: number;
isNmea2000OutAvailable?: boolean;
}
interface MockApp extends EventEmitter {
selfContext: string;
isNmea2000OutAvailable: boolean;
deltaCache: DeltaCache;
config: {
configPath: string;
settings: {
loggingDirectory?: string;
keepMostRecentLogsOnly?: boolean;
logCountToKeep?: number;
};
getExternalHostname(): string;
getExternalPort(): number;
};
setProviderStatus(id: string, msg: string): void;
setProviderError(id: string, msg: string): void;
handleMessage(id: string, delta: object): void;
emitPropertyValue(name: string, value: unknown): void;
signalk: EventEmitter;
providerStatuses: Array<{
id: string;
msg: string;
}>;
providerErrors: Array<{
id: string;
msg: string;
}>;
handledMessages: Array<{
id: string;
delta: object;
}>;
propertyValues: Array<{
name: string;
value: unknown;
}>;
}
export declare function createMockApp(options?: MockAppOptions): MockApp;
export declare function collectStreamOutput<T = unknown>(stream: NodeJS.ReadableStream): Promise<T[]>;
export declare function noopDebug(): DebugLogger;
export declare function createDebugStub(): CreateDebug;
export {};
//# sourceMappingURL=test-helpers.d.ts.map