import { EditorAPI, EditorResponse, Id } from '../types/CommonTypes'; import { Page, SnapshotSettings } from '../types/PageTypes'; /** * The PageController is responsible for all communication regarding Pages. * Methods inside this controller can be called by `window.SDK.page.{method-name}` */ export declare class PageController { #private; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * @experimental * This method adds a new page. * @returns the id of the new page */ add: () => Promise>; /** * @experimental * This method removes a certain page. * @param pageId the id of the page * @returns the id of the current active page */ remove: (pageId: Id) => Promise>; /** * @experimental * This method selects a certain page to be the active page. * @param pageId the id of the page * @returns */ select: (pageId: Id) => Promise>; /** * @experimental * This method sets the page's visibility. * @param pageId the id of the page * @param isVisible the visibility of the page * @returns */ setVisibility: (pageId: Id, isVisible: boolean) => Promise>; /** * @experimental * This method duplicates a certain page. * @param pageId the id of the page * @returns */ duplicate: (pageId: Id) => Promise>; /** * This method returns the list of pages * @returns list of all pages */ getAll: () => Promise>; /** * This method returns a page by its id * @param pageId the id of a specific page * @returns page properties */ getById: (pageId: Id) => Promise>; /** * This method returns a UInt8Array containing a PNG encoded image of the page. * @param pageId The id of a specific page. * If not specified, selected page snapshot will be provided * @param settings an object to specify desired snapshot properties, e.g., resolution. * If it's not provided, default settings will be applied, e.g., page resolution. * Limit for `largestAxisSize` is 1000 px * @returns UInt8Array snapshot of the given page */ getSnapshot: (pageId?: Id, settings?: SnapshotSettings | null) => Promise>; /** * This method will set the width of the page to a specific value. * This only works if the document is a project. * @param _pageId the id of a specific page. * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in) */ setWidth: (_pageId: Id | undefined, width: string) => Promise>; /** * This method will set the height of the page to a specific value. * This only works if the document is a project. * @param _pageId the id of a specific page. * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in) * @returns */ setHeight: (_pageId: Id | undefined, height: string) => Promise>; /** * Sets the width and height of the page to a specific value simultaneously. * This only works if the document is a project. * @param width the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in) * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in) */ setSize: (width: string, height: string) => Promise>; /** * This method changes the order of pages. * @param order the index in the list to move to * @param ids An array of all IDs you want to move to the given index * @returns */ move: (order: number, ids: Id[]) => Promise>; }