import { EditorAPI } from '../types/CommonTypes'; import { ChiliDocument, DocumentLoadOptions } from '../types/DocumentTypes'; import { LayoutPreset } from '../types/LayoutTypes'; /** * The DocumentController is responsible for all communication regarding the Document. * Methods inside this controller can be called by `window.SDK.document.{method-name}` */ export declare class DocumentController { #private; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * This method retrieves the current document state from the editor * @returns the JSON document in the form of a string */ getCurrentState: () => Promise>; /** * This method will load a provided document in the ChiliDocument format and * clean old document states. * If you set `DocumentLoadOptions.keepConnectors` to true, `load` will keep * your old connectors states e.g. options, authentication.. * By default `keepConnectors` is false and your connectors states are reset. * In this case, you would need to configure your connectors appropriately * beforehand. * * Note: This method must be called with valid authentication tokens set up (via ConfigurationController), * this method WILL NOT trigger a token refresh flow if the authentication is invalid or expired * @param doc the document to load in * @param options the options object for setting up the document load * @returns the document loaded inside of the canvas */ load: (doc: ChiliDocument | string, options?: DocumentLoadOptions) => Promise>; /** * This method will create a new document, based on a document preset * * Note: This method must be called with valid authentication tokens set up (via ConfigurationController), * this method WILL NOT trigger a token refresh flow if the authentication is invalid or expired * @param preset the preset where we will create a document of. * @returns the new document created and loaded inside of the canvas */ createAndLoad: (preset: LayoutPreset) => Promise>; }