scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
59 lines (56 loc) • 1.35 kB
text/typescript
import { AbsDocumentPicker } from 'scriptable-abstract';
interface DocumentPickerState {
selectedFiles: string[];
exportedFiles: string[];
lastExportedFile: string | null;
}
/**
* Mock implementation of Scriptable's DocumentPicker global variable
* @implements DocumentPicker
*/
declare class MockDocumentPicker extends AbsDocumentPicker<DocumentPickerState> {
private fileManager;
static get instance(): MockDocumentPicker;
constructor();
/**
* @inheritdoc
*/
open(): Promise<string[]>;
/**
* @inheritdoc
*/
openFile(): Promise<string>;
/**
* @inheritdoc
*/
export(filePath: string): Promise<string[]>;
/**
* @inheritdoc
*/
exportString(content: string, name?: string): Promise<string[]>;
/**
* @inheritdoc
*/
exportData(data: Data, name?: string): Promise<string[]>;
/**
* @additional
* Mock file selection for testing
*/
mockSelectFiles(files: string[]): void;
/**
* @additional
* Get list of exported files
*/
getExportedFiles(): string[];
/**
* @additional
* Get last exported file
*/
getLastExportedFile(): string | null;
/**
* @additional
* Clear all selected and exported files
*/
clear(): void;
}
export { MockDocumentPicker };