import type { DeltaInsert } from '../types.js'; import type { DeltaEntry, VRange } from '../types.js'; import type { BaseTextAttributes } from '../utils/index.js'; import type { VEditor } from '../virgo.js'; export declare class VirgoDeltaService { readonly editor: VEditor; constructor(editor: VEditor); get deltas(): DeltaInsert[]; get normalizedDeltas(): DeltaInsert[]; mapDeltasInVRange: (vRange: VRange, callback: (delta: DeltaInsert, rangeIndex: number, deltaIndex: number) => Result, normalize?: boolean) => Result[]; isNormalizedDeltaSelected(normalizedDeltaIndex: number, vRange: VRange): boolean; /** * Here are examples of how this function computes and gets the delta. * * We have such a text: * ``` * [ * { * insert: 'aaa', * attributes: { bold: true }, * }, * { * insert: 'bbb', * attributes: { italic: true }, * }, * ] * ``` * * `getDeltaByRangeIndex(0)` returns `{ insert: 'aaa', attributes: { bold: true } }`. * * `getDeltaByRangeIndex(1)` returns `{ insert: 'aaa', attributes: { bold: true } }`. * * `getDeltaByRangeIndex(3)` returns `{ insert: 'aaa', attributes: { bold: true } }`. * * `getDeltaByRangeIndex(4)` returns `{ insert: 'bbb', attributes: { italic: true } }`. */ getDeltaByRangeIndex: (rangeIndex: number) => DeltaInsert | null; /** * Here are examples of how this function computes and gets the deltas. * * We have such a text: * ``` * [ * { * insert: 'aaa', * attributes: { bold: true }, * }, * { * insert: 'bbb', * attributes: { italic: true }, * }, * { * insert: 'ccc', * attributes: { underline: true }, * }, * ] * ``` * * `getDeltasByVRange({ index: 0, length: 0 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }]] * ``` * * `getDeltasByVRange({ index: 0, length: 1 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }]] * ``` * * `getDeltasByVRange({ index: 0, length: 4 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }], * [{ insert: 'bbb', attributes: { italic: true }, }, { index: 3, length: 3, }]] * ``` * * `getDeltasByVRange({ index: 3, length: 1 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }], * [{ insert: 'bbb', attributes: { italic: true }, }, { index: 3, length: 3, }]] * ``` * * `getDeltasByVRange({ index: 3, length: 3 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }], * [{ insert: 'bbb', attributes: { italic: true }, }, { index: 3, length: 3, }]] * ``` * * `getDeltasByVRange({ index: 3, length: 4 })` returns * ``` * [{ insert: 'aaa', attributes: { bold: true }, }, { index: 0, length: 3, }], * [{ insert: 'bbb', attributes: { italic: true }, }, { index: 3, length: 3, }], * [{ insert: 'ccc', attributes: { underline: true }, }, { index: 6, length: 3, }]] * ``` */ getDeltasByVRange: (vRange: VRange) => DeltaEntry[]; render: (syncVRange?: boolean) => Promise; } //# sourceMappingURL=delta.d.ts.map