UNPKG

scriptable-testlab

Version:

A lightweight, efficient tool designed to manage and update scripts for Scriptable.

122 lines (119 loc) 2.85 kB
import { AbsPasteboard } from 'scriptable-abstract'; /** * Interface representing the state of the pasteboard */ interface PasteboardState { text: string; items: Array<{ text?: string; image?: Image; url?: string; }>; } /** * Mock implementation of Scriptable's Pasteboard * * Note: This class extends AbsPasteboard which already provides: * - Singleton pattern implementation * - State management * - Basic property getters/setters * * Inherited methods from AbsPasteboard: * - copy(string) * - paste() * - copyString(string) * - pasteString() * - copyImage(image) * - pasteImage() */ declare class MockPasteboard extends AbsPasteboard<PasteboardState> { /** * @inheritdoc * Inherited from ScriptableVariable, just adding type casting */ static get instance(): MockPasteboard; /** * @implements Scriptable.Pasteboard.copy * Copies text to the pasteboard */ copy(text: string): void; /** * @implements Scriptable.Pasteboard.paste * Gets text from the pasteboard */ paste(): string; /** * @implements Scriptable.Pasteboard.copyString * Copies string to the pasteboard */ copyString(text: string): void; /** * @implements Scriptable.Pasteboard.pasteString * Gets string from the pasteboard */ pasteString(): string; /** * @implements Scriptable.Pasteboard.copyImage * Copies image to the pasteboard */ copyImage(image: Image): void; /** * @implements Scriptable.Pasteboard.pasteImage * Gets image from the pasteboard */ pasteImage(): Image; /** * @additional * Additional helper method for getting text */ getText(): string; /** * @additional * Additional helper method for setting text */ setText(text: string): void; /** * @additional * Additional helper method for getting all items */ getItems(): Array<{ text?: string; image?: Image; url?: string; }>; /** * @additional * Additional helper method for setting items */ setItems(items: Array<{ text?: string; image?: Image; url?: string; }>): void; /** * @additional * Additional helper method for checking URLs */ hasURLs(): boolean; /** * @additional * Additional helper method for getting URLs */ getURLs(): string[]; /** * @additional * Additional helper method for checking images */ hasImages(): boolean; /** * @additional * Additional helper method for getting images */ getImages(): Image[]; /** * @additional * Additional helper method for clearing pasteboard */ clear(): void; } export { MockPasteboard };