UNPKG

office-addin-mock

Version:
47 lines (46 loc) 1.63 kB
import { OfficeApp } from "office-addin-manifest"; import { ObjectData } from "./objectData"; /** * Creates an office-js mockable object * @param object Object structure to provide initial values for the mock object (Optional) * @param host Host tested by the object (Optional) */ export declare class OfficeMockObject { constructor(object?: ObjectData, host?: OfficeApp | undefined); /** * Mock replacement of the load method in the Office.js API * @param propertyArgument Argument of the load call. Will load any properties in the argument */ load(propertyArgument: string | string[] | ObjectData): this | undefined; /** * Mock replacement for the sync method in the Office.js API */ sync(): Promise<void>; /** * addMock(name) will add a property named “name”, with a new OfficeMockObject as its value, to the object * @param objectName Object name of the object to be added */ private addMock; private loadAllProperties; private loadCalled; private loadMultipleProperties; private loadNavigational; private loadScalar; private parseObjectPropertyIntoArray; private populate; private resetValue; /** * Sets a property of any type or function to the object * @param propertyName Property name to the property to be added * @param value Value this added property will have */ private setValue; private updatePropertyCall; private _properties; private _loaded; private _value; private _valueBeforeLoaded; private _isObject; private _host; [key: string]: any; }