scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
49 lines (46 loc) • 948 B
TypeScript
import { AbsConsole } from 'scriptable-abstract';
/**
* State interface for Console mock
*/
interface ConsoleState {
logs: Array<{
type: 'log' | 'warn' | 'error';
message: string;
timestamp: number;
}>;
}
/**
* Mock implementation of Scriptable's Console global variable
* @implements Console
*/
declare class MockConsole extends AbsConsole<ConsoleState> {
constructor();
/**
* @inheritdoc
*/
log(...values: any[]): void;
/**
* @inheritdoc
*/
warn(...values: any[]): void;
/**
* @inheritdoc
*/
error(...values: any[]): void;
/**
* @additional
* Clear all logs from the console state
*/
clear(): void;
/**
* @additional
* Get all logs from the console state
*/
getLogs(): readonly string[];
/**
* @internal
* Add a log entry to the state
*/
private addLog;
}
export { MockConsole };