@platform/cell.typesystem
Version:
The 'strongly typed sheets' system of the CellOS.
46 lines (45 loc) • 1.54 kB
TypeScript
import { t } from './common';
declare type IArgs = {
sheet: t.ITypedSheet;
typename: string;
types: t.IColumnTypeDef[];
ctx: t.SheetCtx;
range?: string;
};
export declare class TypedSheetData<T> implements t.ITypedSheetData<T> {
static create: <T_1>(args: IArgs) => t.ITypedSheetData<T_1>;
static DEFAULT: {
RANGE: string;
PAGE: number;
};
static formatRange(input?: string): string;
private constructor();
private readonly _ctx;
private readonly _sheet;
private _rows;
private _range;
private _status;
private _total;
private _loading;
private _isLoaded;
readonly typename: string;
readonly types: t.IColumnTypeDef[];
get uri(): t.INsUri;
get rows(): t.ITypedSheetRow<T>[];
get range(): string;
get status(): "INIT" | "LOADING" | "LOADED";
get isLoaded(): boolean;
get total(): number;
toString(): string;
exists(index: number): boolean;
row(index: number): t.ITypedSheetRow<T>;
load(args: string | t.ITypedSheetDataOptions): Promise<t.ITypedSheetData<T>>;
filter(fn: (row: t.ITypedSheetRowProps<T>, index: number) => boolean): t.ITypedSheetRow<T>[];
find(fn: (row: t.ITypedSheetRowProps<T>, index: number) => boolean): t.ITypedSheetRow<T> | undefined;
map<U>(fn: (row: t.ITypedSheetRowProps<T>, index: number) => U): U[];
forEach(fn: (row: t.ITypedSheetRowProps<T>, index: number) => void): void;
expandRange(range: string): string;
private fire;
private createRow;
}
export {};