import type { DocumentField, FieldApplyResult, FieldChange, RepeatCloneSpec } from '../domain/types';
|
|
export interface OnlyOfficeScope {
|
[key: string]: unknown;
|
elnRecordFillChanges?: FieldChange[];
|
elnRecordFillInspect?: Record<string, never>;
|
elnRecordFillRepeatRow?: RepeatCloneSpec;
|
}
|
|
export interface AscPlugin {
|
attachEditorEvent?: (name: string, callback: (value: unknown) => void) => void;
|
button?: (id: number) => void;
|
callCommand: (command: () => string, isClose: boolean, isCalc: boolean, callback: (result: unknown) => void) => boolean | void;
|
detachEditorEvent?: (name: string) => void;
|
executeCommand: (command: string, data: string) => unknown;
|
executeMethod: (name: string, args: unknown[], callback: (result: unknown) => void) => boolean | void;
|
info?: { options?: unknown };
|
init?: () => void;
|
onThemeChanged?: (theme: unknown) => void;
|
onThemeChangedBase: (theme: unknown) => void;
|
}
|
|
export interface AscGlobal { plugin: AscPlugin; scope: OnlyOfficeScope }
|
|
export interface InspectResult { fields: DocumentField[]; ok: boolean; error?: string }
|
export interface ApplyResult { results: FieldApplyResult[]; ok: boolean; error?: string }
|
export interface RepeatCloneResult { ok: boolean; error?: string; tags?: string[] }
|
|
declare global {
|
const Api: any;
|
const Asc: { scope: OnlyOfficeScope };
|
interface Window { Asc?: AscGlobal }
|
}
|