trclib
Version:
Client and utility wrappers for TRC rest APIs
21 lines (20 loc) • 1 kB
TypeScript
export interface ISheetContents {
[colName: string]: string[];
}
export declare class SheetContentsIndex {
private _map;
private _source;
constructor(source: ISheetContents);
lookupRecId(recId: string): number;
set(recId: string, columnName: string, newValue: string): void;
getContents(): ISheetContents;
}
export declare class SheetContents {
static getSheetContentsIndex(source: ISheetContents): SheetContentsIndex;
static toCsv(data: ISheetContents): string;
static ForEach(source: ISheetContents, callback: (recId: string, columnName: string, newValue: string) => void): void;
static FromSingleCell(recId: string, columnName: string, newValue: string): ISheetContents;
static FromRow(recId: string, columnNames: string[], newValues: string[]): ISheetContents;
static KeepRows(source: ISheetContents, fpInclude: (idx: number) => boolean): ISheetContents;
static TakeN(sheet: ISheetContents, topN: number): ISheetContents;
}