scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
55 lines (52 loc) • 1.53 kB
text/typescript
import { AbsUITable } from 'scriptable-abstract';
import { MockUITableRow } from './ui-table-row.mjs';
import '../../media/image.mjs';
import '../color.mjs';
import './ui-table-cell.mjs';
interface UITableState {
showSeparators: boolean;
rows: MockUITableRow[];
isPresented: boolean;
isFullscreen: boolean;
}
/**
* Mock implementation of Scriptable's UITable
* Used to display data in a table view
*/
declare class MockUITable extends AbsUITable<UITableState> {
constructor();
/**
* Whether to show separators between rows
*/
get showSeparators(): boolean;
/**
* Sets whether to show separators between rows
*/
set showSeparators(value: boolean);
/**
* Adds a row to the table
* @param row Row to add to the table. If not provided, a new row will be created.
* @returns The added row
*/
addRow(row?: MockUITableRow): MockUITableRow;
/**
* Removes a specific row from the table
* @param row Row to remove from the table
*/
removeRow(row: MockUITableRow): void;
/**
* Removes all rows from the table
*/
removeAllRows(): void;
/**
* Reloads the table view
* Must be called after modifying rows while the table is being presented
*/
reload(): void;
/**
* Presents the table modally
* @param fullscreen Whether to present in fullscreen mode. Only has effect when used within the app.
*/
present(fullscreen?: boolean): Promise<void>;
}
export { MockUITable };