import { EditorAPI, Id } from '../types/CommonTypes'; import { AddDocumentFontFamily, AddDocumentFontStyle, CharacterPreview, CharacterPreviewStyle, DocumentFontFamily, DocumentFontStyle } from '../types/FontTypes'; /** * The FontController is responsible for all communication regarding font styles. * Methods inside this controller can be called by `window.SDK.font.{method-name}` */ export declare class FontController { #private; /** * @ignore */ constructor(editorAPI: EditorAPI); /** * This method adds a font family * @param connectorId unique id of the font connector * @param fontFamily the font family object * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID` */ addFontFamily: (connectorId: Id, fontFamily: AddDocumentFontFamily) => Promise>; /** * This method removes a font family * @param id the id of a specific font family * @returns */ removeFontFamily: (id: Id) => Promise>; /** * This method adds a font style * @param connectorId unique id of the font connector * @param fontStyle the font object * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID::FONT_STYLE_ID` */ addFontStyle: (connectorId: Id, fontStyle: AddDocumentFontStyle) => Promise>; /** * This method removes a font style * @param id the id of a specific font style * @returns */ removeFontStyle: (id: Id) => Promise>; /** * This method returns the list of font families * @returns DocumentFontFamily[] */ getFontFamilies: () => Promise>; /** * This method returns the list of font styles for a specific family * @param id the id of a specific font style * @returns DocumentFontStyle[] */ getFontStyles: (id: Id) => Promise>; /** * This method returns a font family by id * @param id the id of a specific font family * @returns DocumentFontFamily properties */ getFontFamilyById: (id: Id) => Promise>; /** * This method returns a font style by id * @param id the id of a specific font style * @returns DocumentFontStyle properties */ getFontStyleById: (id: Id) => Promise>; /** * This method returns the default font. * Be aware that the default font will not change during the entire lifetime of the SDK session. * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session. * @returns a default DocumentFontStyle */ getDefaultFontStyle: () => Promise>; /** * This method returns the default font family. * Be aware that the default font family will not change during the entire lifetime of the SDK session. * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session. * @returns a default DocumentFontFamily */ getDefaultFontFamily: () => Promise>; /** * Check if the font family is used anywhere in the document * @param id the id of the font family to check * @returns boolean */ isFontFamilyUsed: (id: Id) => Promise>; /** * Check if the font style is used anywhere in the document * @param id the id of the font style to check * @returns boolean */ isFontStyleUsed: (id: Id) => Promise>; /** * This method changes positions of font families * @param order the position of the font family * @param ids the list of font family IDs * @returns */ moveFontFamilies: (order: number, ids: string[]) => Promise>; /** * @experimental This method is experimental and may be changed in the future. * This method returns SVG graphics for requested characters used as bullets * @param characters the list of characters to render as SVG * @param characterPreviewStyle style to generate characters preview * @returns An object with the characters as keys and the SVG graphics as values */ getPreviewsOfCharacterStrings: (characters: string[], characterPreviewStyle: CharacterPreviewStyle) => Promise>; }