UNPKG

trc-sheet

Version:
100 lines (99 loc) 3.14 kB
import * as XC from 'trc-httpshim/xclient'; import { ISheetContents } from './sheetContents'; import { IUserDetails } from 'trc-core/core'; export interface ISegment2<T> { ContinuationToken?: string; Results: T[]; } export interface IComputeSpecSummary { SpecId: string; Name?: string; Tags?: string; Status?: string; } export interface IComputeSpec { Name?: string; Tags?: string; Ops: any[]; } export interface IComputeSpecHandle { SpecId: string; ResultId: string; } export interface IComputeSpecContents { Contents: string; } export interface IComputeSpecResultsOutput_Save extends IFileSummaryInfoEntry { Handle: string; } export interface IComputeSpecResults { Error: string; Outputs: {}; CompleteTime?: Date; StartTime?: Date; QueueTime?: Date; } export interface IFileSummaryInfoEntry { Name: string; Sample: string; NonBlank: number; Sum: number; Unique?: number; UniqueCaseInsensitive?: number; } export interface IFileSummaryInfo { Columns: IFileSummaryInfoEntry[]; NumberRows: number; } export interface IListResults { Values: string[]; } export interface ISemanticSummary { TotalRows: number; NonBlank: number; Sum?: number; Average?: number; UniqueVal: number; Histogram: any; } export interface ISemanticDescr { Name: string; Description: string; UrlSource?: string; SourceSheetId?: string; SourceExpression?: string; } export interface ISemanticDescrFull extends ISemanticDescr { Own?: boolean; NumberRows: number; Summary?: ISemanticSummary; LastRefresh: string; LastRefreshError: string; StatusCode: number; } export declare class SemanticClient { private _http; constructor(http: XC.XClient); getListAsync(): Promise<ISegment2<ISemanticDescrFull>>; getAsync(name: string): Promise<ISemanticDescrFull>; getAllUsersWithAccessAsync(name: string): Promise<IUserDetails[]>; postShareAsync(name: string, newEmail: string): Promise<void>; deleteShareAsync(name: string, newEmail: string): Promise<void>; deleteAsync(name: string): Promise<void>; postCreateAsync(descr: ISemanticDescr): Promise<ISemanticDescrFull>; postRefreshAsync(name: string): Promise<ISemanticDescrFull>; } export declare class ComputeClient { private _http; constructor(http: XC.XClient); getSemanticAsync(name: string): Promise<ISheetContents>; getSemanticsAsync(folder: string): Promise<string[]>; getSemanticSummaryAsync(semantic: string): Promise<IFileSummaryInfo>; listAsync(): Promise<IComputeSpecSummary[]>; newSpecAsync(name: string): Promise<string>; getSpecContentsAsync(specId: string): Promise<string>; putSpecContentsAsync(specId: string, content: string): Promise<void>; runSpecAsync(specId: string): Promise<IComputeSpecHandle>; getRunResultsAsync(handle: IComputeSpecHandle): Promise<IComputeSpecResults>; getOutputAsync(contentsHandle: string): Promise<ISheetContents>; }