scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
121 lines (118 loc) • 2.86 kB
TypeScript
import { AbsUITableCell } from 'scriptable-abstract';
interface UITableCellState {
title: string;
subtitle: string | null;
titleColor: Color | null;
subtitleColor: Color | null;
titleFont: Font | null;
subtitleFont: Font | null;
widthWeight: number;
image: Image | null;
dismissOnTap: boolean;
onTap: () => void;
alignment: 'left' | 'center' | 'right';
}
/**
* Mock implementation of Scriptable's UITableCell
* Represents a cell in a UITableRow
*/
declare class MockUITableCell extends AbsUITableCell<UITableCellState> {
constructor();
/**
* Title text of the cell
*/
get title(): string;
/**
* Sets the title text of the cell
*/
set title(value: string);
/**
* Subtitle text of the cell
*/
get subtitle(): string | null;
/**
* Sets the subtitle text of the cell
*/
set subtitle(value: string | null);
/**
* Color of the title text
*/
get titleColor(): Color;
/**
* Sets the color of the title text
*/
set titleColor(value: Color);
/**
* Color of the subtitle text
*/
get subtitleColor(): Color;
/**
* Sets the color of the subtitle text
*/
set subtitleColor(value: Color);
/**
* Font of the title text
*/
get titleFont(): Font;
/**
* Sets the font of the title text
*/
set titleFont(value: Font);
/**
* Font of the subtitle text
*/
get subtitleFont(): Font;
/**
* Sets the font of the subtitle text
*/
set subtitleFont(value: Font);
/**
* Width weight of the cell
*/
get widthWeight(): number;
/**
* Sets the width weight of the cell
*/
set widthWeight(value: number);
/**
* Image of the cell
*/
get image(): Image;
/**
* Sets the image of the cell
*/
set image(value: Image);
/**
* Whether to dismiss the table when the cell is tapped
*/
get dismissOnTap(): boolean;
/**
* Sets whether to dismiss the table when the cell is tapped
*/
set dismissOnTap(value: boolean);
/**
* Function to call when the cell is tapped
*/
get onTap(): () => void;
/**
* Sets the function to call when the cell is tapped
*/
set onTap(value: () => void);
/**
* Left aligns the content of the cell
*/
leftAligned(): void;
/**
* Right aligns the content of the cell
*/
rightAligned(): void;
/**
* Center aligns the content of the cell
*/
centerAligned(): void;
static text(title?: string, subtitle?: string): MockUITableCell;
static image(image: Image): MockUITableCell;
static imageAtURL(url: string): MockUITableCell;
static button(title: string): MockUITableCell;
}
export { MockUITableCell };