UNPKG

@platform/cell.typesystem

Version:

The 'strongly typed sheets' system of the CellOS.

48 lines (47 loc) 1.75 kB
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, K extends keyof T> implements t.ITypedSheetData<T, K> { static create: <T_1, K_1 extends keyof T_1>(args: IArgs) => t.ITypedSheetData<T_1, K_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, K>[]; 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, K>; load(args: string | t.ITypedSheetDataOptions): Promise<t.ITypedSheetData<T, K>>; forEach(fn: (row: t.ITypedSheetRowProps<T[K]>, index: number) => void): void; filter(fn: (row: t.ITypedSheetRowProps<T[K]>, index: number) => boolean): t.ITypedSheetRow<T, K>[]; find(fn: (row: t.ITypedSheetRowProps<T[K]>, index: number) => boolean): t.ITypedSheetRow<T, K> | undefined; map<U>(fn: (row: t.ITypedSheetRowProps<T[K]>, index: number) => U): U[]; reduce<U>(fn: (prev: U, next: t.ITypedSheetRowProps<T[K]>, index: number) => U, initial: U): U; expandRange(range: string): string; private fire; private createRow; private isThisSheet; } export {};