import type { FontFamily, FontStyle, FontWeight, TextElementModel } from '@blocksuite/affine-model'; import type { Bound } from '@blocksuite/global/gfx'; import type * as Y from 'yjs'; export type TextDelta = { insert: string; attributes?: Record; }; export declare function measureTextInDOM(fontFamily: string, fontSize: number, fontWeight: string): { lineHeight: number; lineGap: number; }; 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, fontWeight: string): number; export declare function getFontMetrics(fontFamily: string, fontSize: number, fontWeight: string): TextMetrics; export declare function isRTL(text: string): boolean; 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 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({ yText, fontStyle, fontWeight, fontSize, fontFamily, hasMaxWidth, maxWidth, }: { yText: Y.Text; fontStyle: FontStyle; fontWeight: FontWeight; fontSize: number; fontFamily: FontFamily; hasMaxWidth?: boolean; maxWidth?: number; }, bound: Bound, dragging?: boolean): Bound; export declare function isFontWeightSupported(fontFamily: FontFamily | string, weight: FontWeight): boolean; export declare function isFontStyleSupported(fontFamily: FontFamily | string, style: FontStyle): boolean; export declare function normalizeText(text: string): string; export declare const getTextHeight: (text: string, lineHeight: number) => number; export declare function parseTokens(text: string): string[]; export declare const charWidth: { calculate: (char: string, font: string) => number; getCache: (font: string) => number[] | undefined; }; export declare function wrapText(text: string, font: string, maxWidth: number): string; //# sourceMappingURL=utils.d.ts.map