/** * @typedef {{ * insert?: string[] * insertAt?: number * delete?: string[] * deleteAt?: number * format?: Record * formatAt?: number * }} Attribution */ /** * @type {s.Schema} */ export const $attribution: s.Schema; /** * @typedef {s.Unwrap<$anyOp>} DeltaOps */ /** * @typedef {{ [key: string]: any }} FormattingAttributes */ /** * @typedef {{ * type: 'delta', * name?: string, * attrs?: { [Key in string|number]: DeltaAttrOpJSON }, * children?: Array * }} DeltaJSON */ /** * @typedef {{ type: 'insert', insert: string|Array, format?: { [key: string]: any }, attribution?: Attribution } | { delete: number } | { type: 'retain', retain: number, format?: { [key:string]: any }, attribution?: Attribution } | { type: 'modify', value: object }} DeltaListOpJSON */ /** * @typedef {{ type: 'insert', value: any, prevValue?: any, attribution?: Attribution } | { type: 'delete', prevValue?: any, attribution?: Attribution } | { type: 'modify', value: DeltaJSON }} DeltaAttrOpJSON */ /** * @typedef {TextOp|InsertOp|DeleteOp|RetainOp|ModifyOp} ChildrenOpAny */ /** * @typedef {AttrInsertOp|AttrDeleteOp|AttrModifyOp} AttrOpAny */ /** * @typedef {ChildrenOpAny|AttrOpAny} _OpAny */ /** * @type {s.Schema} */ export const $deltaMapChangeJson: s.Schema; export class TextOp extends list.ListNode { /** * @param {string} insert * @param {FormattingAttributes|null} format * @param {Attribution?} attribution */ constructor(insert: string, format: FormattingAttributes | null, attribution: Attribution | null); /** * @readonly * @type {string} */ readonly insert: string; /** * @readonly * @type {FormattingAttributes|null} */ readonly format: FormattingAttributes | null; attribution: Attribution | null; /** * @type {string?} */ _fingerprint: string | null; /** * @param {string} newVal */ _updateInsert(newVal: string): void; /** * @return {'insert'} */ get type(): "insert"; get length(): number; get fingerprint(): string; /** * Remove a part of the operation (similar to Array.splice) * * @param {number} offset * @param {number} len */ _splice(offset: number, len: number): this; /** * @return {DeltaListOpJSON} */ toJSON(): DeltaListOpJSON; /** * @return {TextOp} */ clone(start?: number, end?: number): TextOp; /** * @param {TextOp} other */ [equalityTrait.EqualityTraitSymbol](other: TextOp): boolean; } /** * @template {fingerprintTrait.Fingerprintable} ArrayContent */ export class InsertOp extends list.ListNode { /** * @param {Array} insert * @param {FormattingAttributes|null} format * @param {Attribution?} attribution */ constructor(insert: Array, format: FormattingAttributes | null, attribution: Attribution | null); /** * @readonly * @type {Array} */ readonly insert: Array; /** * @readonly * @type {FormattingAttributes?} */ readonly format: FormattingAttributes | null; /** * @readonly * @type {Attribution?} */ readonly attribution: Attribution | null; /** * @type {string?} */ _fingerprint: string | null; /** * @param {ArrayContent} newVal */ _updateInsert(newVal: ArrayContent): void; /** * @return {'insert'} */ get type(): "insert"; get length(): number; /** * @param {number} i * @return {Extract} */ _modValue(i: number): Extract; get fingerprint(): string; /** * Remove a part of the operation (similar to Array.splice) * * @param {number} offset * @param {number} len */ _splice(offset: number, len: number): this; /** * @return {DeltaListOpJSON} */ toJSON(): DeltaListOpJSON; /** * @return {InsertOp} */ clone(start?: number, end?: number): InsertOp; /** * @param {InsertOp} other */ [equalityTrait.EqualityTraitSymbol](other: InsertOp): boolean; } /** * @template {fingerprintTrait.Fingerprintable} [Children=never] * @template {string} [Text=never] */ export class DeleteOp extends list.ListNode { /** * @param {number} len */ constructor(len: number); delete: number; /** * @type {(Children|Text) extends never ? null : (Delta?)} */ prevValue: (Children | Text) extends never ? null : (Delta | null); /** * @type {string|null} */ _fingerprint: string | null; /** * @return {'delete'} */ get type(): "delete"; get length(): number; get fingerprint(): string; /** * Remove a part of the operation (similar to Array.splice) * * @param {number} _offset * @param {number} len */ _splice(_offset: number, len: number): this; /** * @return {DeltaListOpJSON} */ toJSON(): DeltaListOpJSON; clone(start?: number, end?: number): DeleteOp; /** * @param {DeleteOp} other */ [equalityTrait.EqualityTraitSymbol](other: DeleteOp): boolean; } export class RetainOp extends list.ListNode { /** * @param {number} retain * @param {FormattingAttributes|null} format * @param {Attribution?} attribution */ constructor(retain: number, format: FormattingAttributes | null, attribution: Attribution | null); /** * @readonly * @type {number} */ readonly retain: number; /** * @readonly * @type {FormattingAttributes?} */ readonly format: FormattingAttributes | null; /** * @readonly * @type {Attribution?} */ readonly attribution: Attribution | null; /** * @type {string|null} */ _fingerprint: string | null; /** * @return {'retain'} */ get type(): "retain"; get length(): number; get fingerprint(): string; /** * Remove a part of the operation (similar to Array.splice) * * @param {number} _offset * @param {number} len */ _splice(_offset: number, len: number): this; /** * @return {DeltaListOpJSON} */ toJSON(): DeltaListOpJSON; clone(start?: number, end?: number): RetainOp; /** * @param {RetainOp} other */ [equalityTrait.EqualityTraitSymbol](other: RetainOp): boolean; } /** * Delta that can be applied on a YType Embed * * @template {DeltaAny} [DTypes=DeltaAny] */ export class ModifyOp extends list.ListNode { /** * @param {DTypes} delta * @param {FormattingAttributes|null} format * @param {Attribution?} attribution */ constructor(delta: DTypes, format: FormattingAttributes | null, attribution: Attribution | null); /** * @readonly * @type {DTypes} */ readonly value: DTypes; /** * @readonly * @type {FormattingAttributes?} */ readonly format: FormattingAttributes | null; /** * @readonly * @type {Attribution?} */ readonly attribution: Attribution | null; /** * @type {string|null} */ _fingerprint: string | null; /** * @return {'modify'} */ get type(): "modify"; get length(): number; /** * @type {DeltaBuilderAny} */ get _modValue(): DeltaBuilderAny; get fingerprint(): string; /** * Remove a part of the operation (similar to Array.splice) * * @param {number} _offset * @param {number} _len */ _splice(_offset: number, _len: number): this; /** * @return {DeltaListOpJSON} */ toJSON(): DeltaListOpJSON; /** * @return {ModifyOp} */ clone(): ModifyOp; /** * @param {ModifyOp} other */ [equalityTrait.EqualityTraitSymbol](other: ModifyOp): boolean; } /** * @template {fingerprintTrait.Fingerprintable} V * @template {string|number} [K=any] */ export class AttrInsertOp { /** * @param {K} key * @param {V} value * @param {V|undefined} prevValue * @param {Attribution?} attribution */ constructor(key: K, value: V, prevValue: V | undefined, attribution: Attribution | null); /** * @readonly * @type {K} */ readonly key: K; /** * @readonly * @type {V} */ readonly value: V; /** * @readonly * @type {V|undefined} */ readonly prevValue: V | undefined; /** * @readonly * @type {Attribution?} */ readonly attribution: Attribution | null; /** * @type {string|null} */ _fingerprint: string | null; /** * @return {'insert'} */ get type(): "insert"; /** * @type {DeltaBuilderAny} */ get _modValue(): DeltaBuilderAny; get fingerprint(): string; toJSON(): { type: "insert"; value: V | DeltaJSON; } & (({ attribution: Attribution; } | { attribution?: undefined; }) & ({ prevValue: V & {}; } | { prevValue?: undefined; })); /** * @return {AttrInsertOp} */ clone(): AttrInsertOp; /** * @param {AttrInsertOp} other */ [equalityTrait.EqualityTraitSymbol](other: AttrInsertOp): boolean; } /** * @template V * @template {string|number} [K=string] */ export class AttrDeleteOp { /** * @param {K} key * @param {V|undefined} prevValue * @param {Attribution?} attribution */ constructor(key: K, prevValue: V | undefined, attribution: Attribution | null); /** * @type {K} */ key: K; /** * @type {V|undefined} */ prevValue: V | undefined; attribution: Attribution | null; /** * @type {string|null} */ _fingerprint: string | null; get value(): undefined; /** * @type {'delete'} */ get type(): "delete"; get fingerprint(): string; /** * @return {DeltaAttrOpJSON} */ toJSON(): DeltaAttrOpJSON; clone(): AttrDeleteOp; /** * @param {AttrDeleteOp} other */ [equalityTrait.EqualityTraitSymbol](other: AttrDeleteOp): boolean; } /** * @template {DeltaAny} [Modifier=DeltaAny] * @template {string|number} [K=string] */ export class AttrModifyOp { /** * @param {K} key * @param {Modifier} delta */ constructor(key: K, delta: Modifier); /** * @readonly * @type {K} */ readonly key: K; /** * @readonly * @type {Modifier} */ readonly value: Modifier; /** * @type {string|null} */ _fingerprint: string | null; /** * @type {'modify'} */ get type(): "modify"; get fingerprint(): string; /** * @return {DeltaBuilder} */ get _modValue(): DeltaBuilder; /** * @return {DeltaAttrOpJSON} */ toJSON(): DeltaAttrOpJSON; /** * @return {AttrModifyOp} */ clone(): AttrModifyOp; /** * @param {AttrModifyOp} other */ [equalityTrait.EqualityTraitSymbol](other: AttrModifyOp): boolean; } /** * @type {s.Schema | DeleteOp>} */ export const $deleteOp: s.Schema | DeleteOp>; /** * @type {s.Schema | InsertOp>} */ export const $insertOp: s.Schema | InsertOp>; export function $insertOpWith($content: s.Schema): s.Schema | InsertOp>; /** * @type {s.Schema} */ export const $textOp: s.Schema; /** * @type {s.Schema} */ export const $retainOp: s.Schema; /** * @type {s.Schema} */ export const $modifyOp: s.Schema; export function $modifyOpWith($content: s.Schema): s.Schema | ModifyOp>; export const $anyOp: s.Schema | InsertOp | AttrDeleteOp | DeleteOp | TextOp | AttrModifyOp | ModifyOp>; /** * @template {Array|string} C1 * @template {Array|string} C2 * @typedef {Extract> extends never * ? never * : (Array<(Extract> extends Array ? (unknown extends AC1 ? never : AC1) : never)>)} MergeListArrays */ /** * @template {{[Key in string|number]: any}} Attrs * @template {string|number} Key * @template {any} Val * @typedef {{ [K in (Key | keyof Attrs)]: (unknown extends Attrs[K] ? never : Attrs[K]) | (Key extends K ? Val : never) }} AddToAttrs */ /** * @template {{[Key in string|number|symbol]: any}} Attrs * @template {{[Key in string|number|symbol]: any}} NewAttrs * @typedef {{ [K in (keyof NewAttrs | keyof Attrs)]: (unknown extends Attrs[K] ? never : Attrs[K]) | (unknown extends NewAttrs[K] ? never : NewAttrs[K]) }} MergeAttrs */ /** * @template X * @typedef {0 extends (1 & X) ? null : X} _AnyToNull */ /** * @template {s.Schema>|null} Schema * @typedef {_AnyToNull extends null ? Delta : (Schema extends s.Schema ? D : never)} AllowedDeltaFromSchema */ /** * @typedef {Delta} DeltaAny */ /** * @typedef {DeltaBuilder} DeltaBuilderAny */ /** * @template {string} [NodeName=any] * @template {{[k:string|number]:any}} [Attrs={}] * @template {fingerprintTrait.Fingerprintable} [Children=never] * @template {string} [Text=never] * @template {s.Schema>|null} [Schema=any] */ export class Delta> | null = any> { /** * @param {NodeName} [name] * @param {Schema} [$schema] */ constructor(name?: NodeName, $schema?: Schema); name: NodeName | null; $schema: NonNullable | null; /** * @type {{ [K in keyof Attrs]?: K extends string|number ? (AttrInsertOp|AttrDeleteOp|(Delta extends Attrs[K] ? AttrModifyOp,K> : never)) : never } * & { [Symbol.iterator]: () => Iterator<{ [K in keyof Attrs]: K extends string|number ? (AttrInsertOp|AttrDeleteOp|(Delta extends Attrs[K] ? AttrModifyOp,K> : never)) : never }[keyof Attrs]> } * } */ attrs: { [K in keyof Attrs]?: K extends string | number ? (AttrInsertOp | AttrDeleteOp | (Delta extends Attrs[K] ? AttrModifyOp, K> : never)) : never; } & { [Symbol.iterator]: () => Iterator<{ [K in keyof Attrs]: K extends string | number ? (AttrInsertOp | AttrDeleteOp | (Delta extends Attrs[K] ? AttrModifyOp, K> : never)) : never; }[keyof Attrs]>; }; /** * @type {list.List< * RetainOp * | DeleteOp * | (Text extends never ? never : TextOp) * | (Children extends never ? never : InsertOp) * | (Delta extends Children ? ModifyOp>> : never) * >} */ children: list.List) | (Delta extends Children ? ModifyOp>> : never)>; childCnt: number; /** * @type {any} */ origin: any; /** * @type {string|null} */ _fingerprint: string | null; isDone: boolean; /** * @type {string} */ get fingerprint(): string; isEmpty(): boolean; /** * @return {DeltaJSON} */ toJSON(): DeltaJSON; /** * @param {Delta} other * @return {boolean} */ equals(other: Delta): boolean; /** * @return {DeltaBuilder} */ clone(): DeltaBuilder; /** * @param {number} start * @param {number} end * @return {DeltaBuilder} */ slice(start?: number, end?: number): DeltaBuilder; /** * Mark this delta as done and perform some cleanup (e.g. remove appended retains without * formats&attributions). In the future, there might be additional merge operations that can be * performed to result in smaller deltas. Set `markAsDone=false` to only perform the cleanup. * * @return {Delta} */ done(markAsDone?: boolean): Delta; [fingerprintTrait.FingerprintTraitSymbol](): string; /** * @param {any} other * @return {boolean} */ [equalityTrait.EqualityTraitSymbol](other: any): boolean; } export function clone(d: D): D extends DeltaBuilder ? DeltaBuilder : never; /** * @template {string} [NodeName=any] * @template {{[key:string|number]:any}} [Attrs={}] * @template {fingerprintTrait.Fingerprintable} [Children=never] * @template {string} [Text=never] * @template {s.Schema>|null} [Schema=any] * @extends {Delta} */ export class DeltaBuilder> | null = any> extends Delta { /** * @type {FormattingAttributes?} */ usedAttributes: FormattingAttributes | null; /** * @type {Attribution?} */ usedAttribution: Attribution | null; /** * @param {Attribution?} attribution */ useAttribution(attribution: Attribution | null): this; /** * @param {FormattingAttributes?} attributes * @return {this} */ useAttributes(attributes: FormattingAttributes | null): this; /** * @param {string} name * @param {any} value */ updateUsedAttributes(name: string, value: any): this; /** * @template {keyof Attribution} NAME * @param {NAME} name * @param {Attribution[NAME]?} value */ updateUsedAttribution(name: NAME, value: Attribution[NAME] | null): this; /** * @template {AllowedDeltaFromSchema extends Delta ? ((Children extends never ? never : Array) | Text) : never} NewContent * @param {NewContent} insert * @param {FormattingAttributes?} [formatting] * @param {Attribution?} [attribution] * @return {DeltaBuilder< * NodeName, * Attrs, * Exclude[number]|Children, * (Extract|Text) extends never ? never : string, * Schema * >} */ insert extends Delta ? ((Children_1 extends never ? never : Array) | Text_1) : never>(insert: NewContent, formatting?: FormattingAttributes | null, attribution?: Attribution | null): DeltaBuilder[number] | Children, (Extract | Text) extends never ? never : string, Schema>; /** * @template {AllowedDeltaFromSchema extends Delta ? Extract> : never} NewContent * @param {NewContent} modify * @param {FormattingAttributes?} formatting * @param {Attribution?} attribution * @return {DeltaBuilder< * NodeName, * Attrs, * Exclude[number]|Children, * (Extract|Text) extends string ? string : never, * Schema * >} */ modify extends Delta ? Extract> : never>(modify: NewContent, formatting?: FormattingAttributes | null, attribution?: Attribution | null): DeltaBuilder[number] | Children, (Extract | Text) extends string ? string : never, Schema>; /** * @param {number} len * @param {FormattingAttributes?} [format] * @param {Attribution?} [attribution] */ retain(len: number, format?: FormattingAttributes | null, attribution?: Attribution | null): this; /** * @param {number} len */ delete(len: number): this; /** * @template {AllowedDeltaFromSchema extends Delta ? (keyof Attrs) : never} Key * @template {AllowedDeltaFromSchema extends Delta ? (Attrs[Key]) : never} Val * @param {Key} key * @param {Val} val * @param {Attribution?} attribution * @param {Val|undefined} [prevValue] * @return {DeltaBuilder< * NodeName, * { [K in keyof AddToAttrs]: AddToAttrs[K] }, * Children, * Text, * Schema * >} */ set extends Delta ? (keyof Attrs_1) : never, Val extends AllowedDeltaFromSchema extends Delta ? (Attrs_1[Key]) : never>(key: Key, val: Val, attribution?: Attribution | null, prevValue?: Val | undefined): DeltaBuilder]: AddToAttrs[K]; }, Children, Text, Schema>; /** * @template {AllowedDeltaFromSchema extends Delta ? Attrs : never} NewAttrs * @param {NewAttrs} attrs * @param {Attribution?} attribution * @return {DeltaBuilder< * NodeName, * { [K in keyof MergeAttrs]: MergeAttrs[K] }, * Children, * Text, * Schema * >} */ setMany extends Delta ? Attrs_1 : never>(attrs: NewAttrs, attribution?: Attribution | null): DeltaBuilder]: MergeAttrs[K]; }, Children, Text, Schema>; /** * @template {AllowedDeltaFromSchema extends Delta ? keyof As : never} Key * @param {Key} key * @param {Attribution?} attribution * @param {any} [prevValue] * @return {DeltaBuilder< * NodeName, * { [K in keyof AddToAttrs]: AddToAttrs[K] }, * Children, * Text, * Schema * >} */ unset extends Delta ? keyof As : never>(key: Key, attribution?: Attribution | null, prevValue?: any): DeltaBuilder]: AddToAttrs[K]; }, Children, Text, Schema>; /** * @template {AllowedDeltaFromSchema extends Delta ? { [K in keyof As]: Extract> extends never ? never : K }[keyof As] : never} Key * @template {AllowedDeltaFromSchema extends Delta ? Extract> : never} D * @param {Key} key * @param {D} modify * @return {DeltaBuilder< * NodeName, * { [K in keyof AddToAttrs]: AddToAttrs[K] }, * Children, * Text, * Schema * >} */ update extends Delta ? { [K in keyof As]: Extract> extends never ? never : K; }[keyof As] : never, D extends AllowedDeltaFromSchema extends Delta ? Extract> : never>(key: Key, modify: D): DeltaBuilder]: AddToAttrs[K]; }, Children, Text, Schema>; /** * @param {Delta} other */ apply(other: Delta): this; /** * @param {DeltaAny} other * @param {boolean} priority */ rebase(other: DeltaAny, priority: boolean): this; /** * Same as doing `delta.rebase(other.inverse())`, without creating a temporary delta. * * @param {DeltaAny} other * @param {boolean} priority */ rebaseOnInverse(other: DeltaAny, priority: boolean): this; /** * Append child ops from one op to the other. * * delta.create().insert('a').append(delta.create().insert('b')) // => insert "ab" * * @template {DeltaAny} OtherDelta * @param {OtherDelta} other * @return {CastToDelta extends Delta ? DeltaBuilder : never} */ append(other: OtherDelta): CastToDelta extends Delta ? DeltaBuilder : never; } /** * @template {DeltaAny} D * @typedef {D extends DeltaBuilder ? Delta : D} CastToDelta */ /** * @template {string} NodeName * @template {{ [key: string|number]: any }} [Attrs={}] * @template {fingerprintTrait.Fingerprintable|never} [Children=never] * @template {string|never} [Text=never] * @typedef {Delta|RecursiveDelta,Text>} RecursiveDelta */ /** * @template {string} Name * @template {{[k:string|number]:any}} Attrs * @template {fingerprintTrait.Fingerprintable} Children * @template {boolean} HasText * @template {{ [k:string]:any }} Formats * @template {boolean} Recursive * @extends {s.Schema : never), * HasText extends true ? string : never, * any>>} */ export class $Delta extends s.Schema : never), HasText extends true ? string : never, any>> { /** * @param {s.Schema} $name * @param {s.Schema} $attrs * @param {s.Schema} $children * @param {HasText} hasText * @param {s.Schema} $formats * @param {Recursive} recursive */ constructor($name: s.Schema, $attrs: s.Schema, $children: s.Schema, hasText: HasText, $formats: s.Schema, recursive: Recursive); shape: { $name: s.Schema; $attrs: s.Schema | s.Schema; [key: number]: s.Schema; [key: symbol]: s.Schema; }>>>; $children: s.Schema; hasText: HasText; $formats: s.Schema; }; } export function $delta | string | Array = s.Schema, AttrsSchema extends s.Schema<{ [key: string | number]: any; }> | { [key: string | number]: any; } = s.Schema<{}>, ChildrenSchema extends unknown = s.Schema, HasText extends boolean = false, Recursive extends boolean = false, Formats extends { [k: string]: any; } = { [k: string]: any; }>({ name, attrs, children, text, formats, recursive }: { name?: NodeNameSchema | null | undefined; attrs?: AttrsSchema | null | undefined; children?: ChildrenSchema | null | undefined; text?: HasText | undefined; formats?: Formats | undefined; recursive?: Recursive | undefined; }): [s.Unwrap>, s.Unwrap>, s.Unwrap>] extends [infer NodeName_1, infer Attrs_1, infer Children_1] ? s.Schema : never), HasText extends true ? string : never>> : never; export const $$delta: s.Schema<$Delta>; export function _$delta | string | Array = s.Schema, AttrsSchema extends s.Schema<{ [key: string | number]: any; }> | { [key: string | number]: any; } = s.Schema<{}>, ChildrenSchema extends unknown = s.Schema, HasText extends boolean = false, Recursive extends boolean = false>({ name, attrs, children, text, recursive }: { name?: NodeNameSchema | null | undefined; attrs?: AttrsSchema | null | undefined; children?: ChildrenSchema | null | undefined; text?: HasText | undefined; recursive?: Recursive | undefined; }): [s.Unwrap>, s.Unwrap>, s.Unwrap>] extends [infer NodeName_1, infer Attrs_1, infer Children_1] ? s.Schema : never), HasText extends true ? string : never>> : never; /** * @type {s.Schema} */ export const $deltaAny: s.Schema; /** * @type {s.Schema} */ export const $deltaBuilderAny: s.Schema; export function mergeAttrs(a: T | null, b: T | null): T | null; export function mergeDeltas(a: D, b: D): D; export function random(gen: prng.PRNG, $d: s.Schema): D extends Delta ? DeltaBuilder : never; /** * @overload * @return {DeltaBuilder} */ export function create(): DeltaBuilder; /** * @template {string} NodeName * @overload * @param {NodeName} nodeName * @return {DeltaBuilder} */ export function create(nodeName: NodeName): DeltaBuilder; /** * @template {string} NodeName * @template {s.Schema} Schema * @overload * @param {NodeName} nodeName * @param {Schema} schema * @return {Schema extends s.Schema> ? DeltaBuilder : never} */ export function create>(nodeName: NodeName, schema: Schema): Schema extends s.Schema> ? DeltaBuilder : never; /** * @template {s.Schema} Schema * @overload * @param {Schema} schema * @return {Schema extends s.Schema> ? DeltaBuilder : never} */ export function create>(schema: Schema): Schema extends s.Schema> ? DeltaBuilder : never; /** * @template {string|null} NodeName * @template {{[k:string|number]:any}|null} Attrs * @template {Array|string} [Children=never] * @overload * @param {NodeName} nodeName * @param {Attrs} attrs * @param {Children} [children] * @return {DeltaBuilder< * NodeName extends null ? any : NodeName, * Attrs extends null ? {} : Attrs, * Extract> extends Array ? (unknown extends Ac ? never : Ac) : never, * Extract, * null * >} */ export function create | string = never>(nodeName: NodeName, attrs: Attrs, children?: Children | undefined): DeltaBuilder> extends Array ? (unknown extends Ac ? never : Ac) : never, Extract, null>; export function $text<$Embeds extends Array> = any>(...$embeds: $Embeds): s.Schema extends null ? never : ($Embeds extends Array> ? $C : never)>>; export const $textOnly: s.Schema>; export function text> = s.Schema>>($schema?: Schema_1): Schema_1 extends s.Schema> ? DeltaBuilder : never; export function $array<$Children extends unknown>($children?: $Children): s.Schema>>>; export function array<$Schema extends s.Schema> = never>($schema: $Schema): $Schema extends never ? ArrayDeltaBuilder : DeltaBuilder; export function $map<$Attrs extends { [K: string | number]: any; }>($attrs: s.Schema<$Attrs>): s.Schema>; export function map<$Schema extends s.Schema> | undefined = undefined>($schema?: $Schema): $Schema extends s.Schema> ? DeltaBuilder : MapDeltaBuilder<{}>; export function diff(d1: D, d2: NoInfer): D extends Delta ? DeltaBuilder : never; export type Attribution = { insert?: string[]; insertAt?: number; delete?: string[]; deleteAt?: number; format?: Record; formatAt?: number; }; export type DeltaOps = s.Unwrap | InsertOp | AttrDeleteOp | DeleteOp | TextOp | AttrModifyOp | ModifyOp>>; export type FormattingAttributes = { [key: string]: any; }; export type DeltaJSON = { type: "delta"; name?: string; attrs?: { [Key in string | number]: DeltaAttrOpJSON; }; children?: Array; }; export type DeltaListOpJSON = { type: "insert"; insert: string | Array; format?: { [key: string]: any; }; attribution?: Attribution; } | { delete: number; } | { type: "retain"; retain: number; format?: { [key: string]: any; }; attribution?: Attribution; } | { type: "modify"; value: object; }; export type DeltaAttrOpJSON = { type: "insert"; value: any; prevValue?: any; attribution?: Attribution; } | { type: "delete"; prevValue?: any; attribution?: Attribution; } | { type: "modify"; value: DeltaJSON; }; export type ChildrenOpAny = TextOp | InsertOp | DeleteOp | RetainOp | ModifyOp; export type AttrOpAny = AttrInsertOp | AttrDeleteOp | AttrModifyOp; export type _OpAny = ChildrenOpAny | AttrOpAny; export type MergeListArrays | string, C2 extends Array | string> = Extract> extends never ? never : (Array<(Extract> extends Array ? (unknown extends AC1 ? never : AC1) : never)>); export type AddToAttrs = { [K in (Key | keyof Attrs_1)]: (unknown extends Attrs_1[K] ? never : Attrs_1[K]) | (Key extends K ? Val : never); }; export type MergeAttrs = { [K in (keyof NewAttrs | keyof Attrs_1)]: (unknown extends Attrs_1[K] ? never : Attrs_1[K]) | (unknown extends NewAttrs[K] ? never : NewAttrs[K]); }; export type _AnyToNull = 0 extends (1 & X) ? null : X; export type AllowedDeltaFromSchema> | null> = _AnyToNull extends null ? Delta : (Schema_1 extends s.Schema ? D : never); export type DeltaAny = Delta; export type DeltaBuilderAny = DeltaBuilder; export type CastToDelta = D extends DeltaBuilder ? Delta : D; export type RecursiveDelta = Delta | RecursiveDelta, Text>; export type TextDelta = Delta; export type TextDeltaBuilder = DeltaBuilder; export type ArrayDelta = Delta; export type ArrayDeltaBuilder = DeltaBuilder; export type MapDelta = Delta; export type MapDeltaBuilder = DeltaBuilder; import * as s from '../schema.js'; import * as list from '../list.js'; import * as equalityTrait from '../trait/equality.js'; import * as fingerprintTrait from '../trait/fingerprint.js'; import * as prng from '../prng.js'; //# sourceMappingURL=delta.d.ts.map