import { UnsubscribeFunction } from "callback-registry"; import { Glue42Office } from "../../glue4office"; import { Glue42Core } from "@glue42/core"; export interface Config { agm: Glue42Core.AGM.API; } export interface Excel { all: Glue42Office.Excel.Sheet[]; addinStatus: boolean; openSheet(sheetData: Glue42Office.Excel.OpenSheetConfig): Promise; onAddinStatusChanged(callback: (connected: boolean) => void): UnsubscribeFunction; } export interface SheetOptions { cookie: string; columnConfig: Glue42Office.Excel.ColumnConfig[]; data: any; } export interface ValidateShowGridInvocationArgs { columnsAsJSON: string; cookie: string; dataAsJSON: string; updateType: string; validateType: boolean; workbook: string; worksheet: string; chunkIndex?: number; totalChunks?: number; } export interface ValidationObject { type?: "WholeNumber" | "Decimal" | "Date" | "Time" | "TextLength" | "List"; alert?: "Stop" | "Warning" | "Information"; list?: string[]; } export interface ColumnsAsJson { foregroundColor: string; backgroundColor: string; text: string; name: string; width?: number; validation?: ValidationObject; forceText?: boolean; preserveEmptyString?: boolean; } export interface DataAsJson { row?: number; data: string; } export interface ShowGridParams { columnsAsJSON: string; dataAsJSON: string; cookie: string; clearGrid?: boolean; workbook?: string; dataWorksheet?: string; templateWorkbook?: string; viewWorksheet?: string; inhibitLocalSave?: boolean; glueMethod?: string; buttonText?: string; buttonRange?: string; topLeft?: string; triggers?: ["row" | "button" | "save"]; dataRangeName?: string; window?: "hide" | "show" | "normal" | "restore" | "max" | "min" | "top" | "bottom"; chunkSize?: number; disableErrorViewer?: boolean; autostart?: boolean; displayName?: string; timeoutMs?: number; g4oVersion?: string; response: "image" | "row"; sendBeforeAndAfter?: boolean; } export interface ValidationResponse { isValid?: boolean; message?: string; errorsAsJSON?: string; } export interface ShowGridInvocationResult { result: string; } export interface InternalSheetAPI { asSheetAPI: Glue42Office.Excel.Sheet; _onUpdate(grid: ValidateShowGridInvocationArgs): any; }