import type { Y } from '@blockeditor/store'; import type { FontFamily, FontStyle, FontWeight } from '../../../element-model/common.js'; import type { TextElementModel } from '../../../element-model/text.js'; import type { Bound } from '../../../utils/bound.js'; export type TextDelta = { insert: string; attributes?: { [k: string]: unknown; }; }; export declare function getFontString({ fontStyle, fontWeight, fontSize, fontFamily, }: { fontStyle: string; fontWeight: string; fontSize: number; fontFamily: string; }): string; export declare function getLineHeight(fontFamily: string, fontSize: number): number; export declare function wrapFontFamily(fontFamily: string): string; /** * convert a delta insert array to chunks, each chunk is a line */ export declare function deltaInsertsToChunks(delta: TextDelta[]): TextDelta[][]; export declare function isRTL(text: string): boolean; export declare function normalizeText(text: string): string; export declare function splitIntoLines(text: string): string[]; export declare function getLineWidth(text: string, font: string): number; export declare function getTextWidth(text: string, font: string): number; export declare function wrapTextDeltas(text: Y.Text, font: string, w: number): TextDelta[]; export declare const charWidth: { calculate: (char: string, font: string) => number; getCache: (font: string) => number[]; }; export declare function parseTokens(text: string): string[]; export declare function wrapText(text: string, font: string, maxWidth: number): string; export declare const truncateTextByWidth: (text: string, font: string, width: number) => string; export declare function getTextCursorPosition(model: TextElementModel, coord: { x: number; y: number; }): number[]; export declare function getCursorByCoord(model: TextElementModel, coord: { x: number; y: number; }): number; export declare function normalizeTextBound(text: TextElementModel, bound: Bound, dragging?: boolean): Bound; export declare function getFontFacesByFontFamily(fontFamily: FontFamily | string): FontFace[]; export declare function isFontWeightSupported(fontFamily: FontFamily | string, weight: FontWeight): boolean; export declare function isFontStyleSupported(fontFamily: FontFamily | string, style: FontStyle): boolean; //# sourceMappingURL=utils.d.ts.map