lib0 0.2.115 → 0.2.117

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/coverage/tmp/{coverage-37247-1765812222123-0.json → coverage-70359-1766561372098-0.json} +1 -1
  2. package/delta/delta.d.ts.map +1 -1
  3. package/delta/delta.js +4 -1
  4. package/delta/delta.test.d.ts +1 -0
  5. package/delta/delta.test.d.ts.map +1 -1
  6. package/dist/binding.cjs +7 -7
  7. package/dist/{broadcastchannel-42bbe6e0.cjs → broadcastchannel-aca4f606.cjs} +2 -2
  8. package/dist/{broadcastchannel-42bbe6e0.cjs.map → broadcastchannel-aca4f606.cjs.map} +1 -1
  9. package/dist/broadcastchannel.cjs +5 -5
  10. package/dist/{buffer-54360f21.cjs → buffer-3e750729.cjs} +2 -2
  11. package/dist/{buffer-54360f21.cjs.map → buffer-3e750729.cjs.map} +1 -1
  12. package/dist/buffer.cjs +4 -4
  13. package/dist/cache.cjs +2 -2
  14. package/dist/component.cjs +7 -7
  15. package/dist/delta/delta.d.ts.map +1 -1
  16. package/dist/delta/delta.test.d.ts +1 -0
  17. package/dist/delta/delta.test.d.ts.map +1 -1
  18. package/dist/delta.cjs +9 -6
  19. package/dist/delta.cjs.map +1 -1
  20. package/dist/{diff-fab14ea6.cjs → diff-9d236524.cjs} +2 -2
  21. package/dist/{diff-fab14ea6.cjs.map → diff-9d236524.cjs.map} +1 -1
  22. package/dist/diff.cjs +3 -3
  23. package/dist/{dom-4c4b4c68.cjs → dom-7e625b09.cjs} +1 -1
  24. package/dist/{dom-4c4b4c68.cjs.map → dom-7e625b09.cjs.map} +1 -1
  25. package/dist/dom.cjs +6 -6
  26. package/dist/{environment-ae4f6f15.cjs → environment-1c97264d.cjs} +2 -2
  27. package/dist/{environment-ae4f6f15.cjs.map → environment-1c97264d.cjs.map} +1 -1
  28. package/dist/environment.cjs +3 -3
  29. package/dist/equality.cjs +1 -1
  30. package/dist/equality.cjs.map +1 -1
  31. package/dist/fingerprint.cjs +4 -4
  32. package/dist/{function-618aa640.cjs → function-314580f7.cjs} +2 -2
  33. package/dist/{function-618aa640.cjs.map → function-314580f7.cjs.map} +1 -1
  34. package/dist/function.cjs +2 -2
  35. package/dist/index.cjs +8 -8
  36. package/dist/indexeddbV2.cjs +1 -1
  37. package/dist/jwt.cjs +4 -4
  38. package/dist/list.cjs +2 -2
  39. package/dist/logging.cjs +6 -6
  40. package/dist/logging.common.cjs +3 -3
  41. package/dist/logging.node.cjs +3 -3
  42. package/dist/{object-dec41ef9.cjs → object-c0c9435b.cjs} +1 -1
  43. package/dist/{object-dec41ef9.cjs.map → object-c0c9435b.cjs.map} +1 -1
  44. package/dist/object.cjs +1 -1
  45. package/dist/object.test.d.ts +1 -0
  46. package/dist/object.test.d.ts.map +1 -1
  47. package/dist/performance.node.cjs +2 -2
  48. package/dist/pledge.cjs +1 -1
  49. package/dist/{prng-96eef52a.cjs → prng-37d48618.cjs} +2 -2
  50. package/dist/{prng-96eef52a.cjs.map → prng-37d48618.cjs.map} +1 -1
  51. package/dist/prng.cjs +5 -5
  52. package/dist/rabin-gf2-polynomial.cjs +4 -4
  53. package/dist/rabin-uncached.cjs +4 -4
  54. package/dist/rabin.cjs +4 -4
  55. package/dist/schema.cjs +5 -5
  56. package/dist/testing.cjs +6 -6
  57. package/dist/trait/equality.d.ts.map +1 -1
  58. package/dist/traits.cjs +4 -4
  59. package/dist/url.cjs +1 -1
  60. package/object.test.d.ts +1 -0
  61. package/object.test.d.ts.map +1 -1
  62. package/package.json +1 -1
  63. package/trait/equality.d.ts.map +1 -1
  64. package/trait/equality.js +1 -1
  65. package/types/bin/0ecdsa-generate-keypair.d.ts +3 -0
  66. package/types/bin/0ecdsa-generate-keypair.d.ts.map +1 -0
  67. package/types/bin/0serve.d.ts +3 -0
  68. package/types/bin/0serve.d.ts.map +1 -0
  69. package/types/bin/gendocs.d.ts +3 -0
  70. package/types/bin/gendocs.d.ts.map +1 -0
  71. package/types/bin/gentesthtml.d.ts +3 -0
  72. package/types/bin/gentesthtml.d.ts.map +1 -0
  73. package/types/crypto/aes-gcm.d.ts +17 -0
  74. package/types/crypto/aes-gcm.d.ts.map +1 -0
  75. package/types/crypto/common.d.ts +3 -0
  76. package/types/crypto/common.d.ts.map +1 -0
  77. package/types/crypto/ecdsa.d.ts +17 -0
  78. package/types/crypto/ecdsa.d.ts.map +1 -0
  79. package/types/crypto/jwt.d.ts +10 -0
  80. package/types/crypto/jwt.d.ts.map +1 -0
  81. package/types/crypto/rsa-oaep.d.ts +13 -0
  82. package/types/crypto/rsa-oaep.d.ts.map +1 -0
  83. package/types/delta/binding.d.ts +107 -0
  84. package/types/delta/binding.d.ts.map +1 -0
  85. package/types/delta/delta.d.ts +1074 -0
  86. package/types/delta/delta.d.ts.map +1 -0
  87. package/types/delta/t3.test.d.ts +19 -0
  88. package/types/delta/t3.test.d.ts.map +1 -0
  89. package/types/diff/patience.d.ts +16 -0
  90. package/types/diff/patience.d.ts.map +1 -0
  91. package/types/hash/rabin-gf2-polynomial.d.ts +45 -0
  92. package/types/hash/rabin-gf2-polynomial.d.ts.map +1 -0
  93. package/types/hash/rabin-uncached.d.ts +29 -0
  94. package/types/hash/rabin-uncached.d.ts.map +1 -0
  95. package/types/hash/rabin.d.ts +27 -0
  96. package/types/hash/rabin.d.ts.map +1 -0
  97. package/types/hash/sha256.d.ts +2 -0
  98. package/types/hash/sha256.d.ts.map +1 -0
  99. package/types/hash/sha256.node.d.ts +2 -0
  100. package/types/hash/sha256.node.d.ts.map +1 -0
  101. package/types/prng/Mt19937.d.ts +29 -0
  102. package/types/prng/Mt19937.d.ts.map +1 -0
  103. package/types/prng/Xoroshiro128plus.d.ts +27 -0
  104. package/types/prng/Xoroshiro128plus.d.ts.map +1 -0
  105. package/types/prng/Xorshift32.d.ts +21 -0
  106. package/types/prng/Xorshift32.d.ts.map +1 -0
  107. package/types/trait/equality.d.ts +6 -0
  108. package/types/trait/equality.d.ts.map +1 -0
  109. package/types/trait/fingerprint.d.ts +13 -0
  110. package/types/trait/fingerprint.d.ts.map +1 -0
  111. package/types/trait/traits.d.ts +3 -0
  112. package/types/trait/traits.d.ts.map +1 -0
  113. package/coverage/tmp/coverage-37246-1765812268333-0.json +0 -1
@@ -0,0 +1,1074 @@
1
+ /**
2
+ * @typedef {{
3
+ * insert?: string[]
4
+ * insertAt?: number
5
+ * delete?: string[]
6
+ * deleteAt?: number
7
+ * format?: Record<string,string[]>
8
+ * formatAt?: number
9
+ * }} Attribution
10
+ */
11
+ /**
12
+ * @type {s.Schema<Attribution>}
13
+ */
14
+ export const $attribution: s.Schema<Attribution>;
15
+ /**
16
+ * @typedef {{ [key: string]: any }} FormattingAttributes
17
+ */
18
+ /**
19
+ * @typedef {{
20
+ * type: 'delta',
21
+ * name?: string,
22
+ * attrs?: { [Key in string|number]: DeltaAttrOpJSON },
23
+ * children?: Array<DeltaListOpJSON>
24
+ * }} DeltaJSON
25
+ */
26
+ /**
27
+ * @typedef {{ type: 'insert', insert: string|Array<any>, format?: { [key: string]: any }, attribution?: Attribution } | { delete: number } | { type: 'retain', retain: number, format?: { [key:string]: any }, attribution?: Attribution } | { type: 'modify', value: object }} DeltaListOpJSON
28
+ */
29
+ /**
30
+ * @typedef {{ type: 'insert', value: any, prevValue?: any, attribution?: Attribution } | { type: 'delete', prevValue?: any, attribution?: Attribution } | { type: 'modify', value: DeltaJSON }} DeltaAttrOpJSON
31
+ */
32
+ /**
33
+ * @typedef {TextOp|InsertOp<any>|DeleteOp|RetainOp|ModifyOp<any>} ChildrenOpAny
34
+ */
35
+ /**
36
+ * @typedef {SetAttrOp<any>|DeleteAttrOp<any>|ModifyAttrOp} AttrOpAny
37
+ */
38
+ /**
39
+ * @typedef {ChildrenOpAny|AttrOpAny} _OpAny
40
+ */
41
+ /**
42
+ * @type {s.Schema<DeltaAttrOpJSON>}
43
+ */
44
+ export const $deltaMapChangeJson: s.Schema<DeltaAttrOpJSON>;
45
+ export class TextOp extends list.ListNode {
46
+ /**
47
+ * @param {string} insert
48
+ * @param {FormattingAttributes|null} format
49
+ * @param {Attribution?} attribution
50
+ */
51
+ constructor(insert: string, format: FormattingAttributes | null, attribution: Attribution | null);
52
+ /**
53
+ * @readonly
54
+ * @type {string}
55
+ */
56
+ readonly insert: string;
57
+ /**
58
+ * @readonly
59
+ * @type {FormattingAttributes|null}
60
+ */
61
+ readonly format: FormattingAttributes | null;
62
+ attribution: Attribution | null;
63
+ /**
64
+ * @type {string?}
65
+ */
66
+ _fingerprint: string | null;
67
+ get $type(): s.Schema<TextOp>;
68
+ /**
69
+ * @param {string} newVal
70
+ */
71
+ _updateInsert(newVal: string): void;
72
+ /**
73
+ * @return {'insert'}
74
+ */
75
+ get type(): "insert";
76
+ get length(): number;
77
+ get fingerprint(): string;
78
+ /**
79
+ * Remove a part of the operation (similar to Array.splice)
80
+ *
81
+ * @param {number} offset
82
+ * @param {number} len
83
+ */
84
+ _splice(offset: number, len: number): this;
85
+ /**
86
+ * @return {DeltaListOpJSON}
87
+ */
88
+ toJSON(): DeltaListOpJSON;
89
+ /**
90
+ * @return {TextOp}
91
+ */
92
+ clone(start?: number, end?: number): TextOp;
93
+ /**
94
+ * @param {TextOp} other
95
+ */
96
+ [equalityTrait.EqualityTraitSymbol](other: TextOp): boolean;
97
+ }
98
+ /**
99
+ * @template {any} ArrayContent
100
+ */
101
+ export class InsertOp<ArrayContent extends unknown> extends list.ListNode {
102
+ /**
103
+ * @param {Array<ArrayContent>} insert
104
+ * @param {FormattingAttributes|null} format
105
+ * @param {Attribution?} attribution
106
+ */
107
+ constructor(insert: Array<ArrayContent>, format: FormattingAttributes | null, attribution: Attribution | null);
108
+ /**
109
+ * @readonly
110
+ * @type {Array<ArrayContent>}
111
+ */
112
+ readonly insert: Array<ArrayContent>;
113
+ /**
114
+ * @readonly
115
+ * @type {FormattingAttributes?}
116
+ */
117
+ readonly format: FormattingAttributes | null;
118
+ /**
119
+ * @readonly
120
+ * @type {Attribution?}
121
+ */
122
+ readonly attribution: Attribution | null;
123
+ /**
124
+ * @type {string?}
125
+ */
126
+ _fingerprint: string | null;
127
+ get $type(): s.Schema<InsertOp<any>>;
128
+ /**
129
+ * @param {ArrayContent} newVal
130
+ */
131
+ _updateInsert(newVal: ArrayContent): void;
132
+ /**
133
+ * @return {'insert'}
134
+ */
135
+ get type(): "insert";
136
+ get length(): number;
137
+ /**
138
+ * @param {number} i
139
+ * @return {Extract<ArrayContent,DeltaAny>}
140
+ */
141
+ _modValue(i: number): Extract<ArrayContent, DeltaAny>;
142
+ get fingerprint(): string;
143
+ /**
144
+ * Remove a part of the operation (similar to Array.splice)
145
+ *
146
+ * @param {number} offset
147
+ * @param {number} len
148
+ */
149
+ _splice(offset: number, len: number): this;
150
+ /**
151
+ * @return {DeltaListOpJSON}
152
+ */
153
+ toJSON(): DeltaListOpJSON;
154
+ /**
155
+ * @return {InsertOp<ArrayContent>}
156
+ */
157
+ clone(start?: number, end?: number): InsertOp<ArrayContent>;
158
+ /**
159
+ * @param {InsertOp<ArrayContent>} other
160
+ */
161
+ [equalityTrait.EqualityTraitSymbol](other: InsertOp<ArrayContent>): boolean;
162
+ }
163
+ /**
164
+ * @template {DeltaConf} [DConf={}]
165
+ */
166
+ export class DeleteOp<DConf extends DeltaConf = {}> extends list.ListNode {
167
+ /**
168
+ * @param {number} len
169
+ */
170
+ constructor(len: number);
171
+ delete: number;
172
+ /**
173
+ * @type {Delta<DConf>?}
174
+ */
175
+ prevValue: Delta<DConf> | null;
176
+ /**
177
+ * @type {string|null}
178
+ */
179
+ _fingerprint: string | null;
180
+ get $type(): s.Schema<DeleteOp<any>>;
181
+ /**
182
+ * @return {'delete'}
183
+ */
184
+ get type(): "delete";
185
+ get length(): number;
186
+ get fingerprint(): string;
187
+ /**
188
+ * Remove a part of the operation (similar to Array.splice)
189
+ *
190
+ * @param {number} _offset
191
+ * @param {number} len
192
+ */
193
+ _splice(_offset: number, len: number): this;
194
+ /**
195
+ * @return {DeltaListOpJSON}
196
+ */
197
+ toJSON(): DeltaListOpJSON;
198
+ /**
199
+ * @param {number} start
200
+ * @param {number} end
201
+ * @return {DeleteOp}
202
+ */
203
+ clone(start?: number, end?: number): DeleteOp;
204
+ /**
205
+ * @param {DeleteOp} other
206
+ */
207
+ [equalityTrait.EqualityTraitSymbol](other: DeleteOp): boolean;
208
+ }
209
+ export class RetainOp extends list.ListNode {
210
+ /**
211
+ * @param {number} retain
212
+ * @param {FormattingAttributes|null} format
213
+ * @param {Attribution?} attribution
214
+ */
215
+ constructor(retain: number, format: FormattingAttributes | null, attribution: Attribution | null);
216
+ /**
217
+ * @readonly
218
+ * @type {number}
219
+ */
220
+ readonly retain: number;
221
+ /**
222
+ * @readonly
223
+ * @type {FormattingAttributes?}
224
+ */
225
+ readonly format: FormattingAttributes | null;
226
+ /**
227
+ * @readonly
228
+ * @type {Attribution?}
229
+ */
230
+ readonly attribution: Attribution | null;
231
+ /**
232
+ * @type {string|null}
233
+ */
234
+ _fingerprint: string | null;
235
+ get $type(): s.Schema<RetainOp>;
236
+ /**
237
+ * @return {'retain'}
238
+ */
239
+ get type(): "retain";
240
+ get length(): number;
241
+ get fingerprint(): string;
242
+ /**
243
+ * Remove a part of the operation (similar to Array.splice)
244
+ *
245
+ * @param {number} _offset
246
+ * @param {number} len
247
+ */
248
+ _splice(_offset: number, len: number): this;
249
+ /**
250
+ * @return {DeltaListOpJSON}
251
+ */
252
+ toJSON(): DeltaListOpJSON;
253
+ clone(start?: number, end?: number): RetainOp;
254
+ /**
255
+ * @param {RetainOp} other
256
+ */
257
+ [equalityTrait.EqualityTraitSymbol](other: RetainOp): boolean;
258
+ }
259
+ /**
260
+ * Delta that can be applied on a YType Embed
261
+ *
262
+ * @template {Delta} [DTypes=DeltaAny]
263
+ */
264
+ export class ModifyOp<DTypes extends Delta = DeltaAny> extends list.ListNode {
265
+ /**
266
+ * @param {DTypes} delta
267
+ * @param {FormattingAttributes|null} format
268
+ * @param {Attribution?} attribution
269
+ */
270
+ constructor(delta: DTypes, format: FormattingAttributes | null, attribution: Attribution | null);
271
+ /**
272
+ * @readonly
273
+ * @type {DTypes}
274
+ */
275
+ readonly value: DTypes;
276
+ /**
277
+ * @readonly
278
+ * @type {FormattingAttributes?}
279
+ */
280
+ readonly format: FormattingAttributes | null;
281
+ /**
282
+ * @readonly
283
+ * @type {Attribution?}
284
+ */
285
+ readonly attribution: Attribution | null;
286
+ /**
287
+ * @type {string|null}
288
+ */
289
+ _fingerprint: string | null;
290
+ get $type(): s.Schema<ModifyOp<DeltaAny>>;
291
+ /**
292
+ * @return {'modify'}
293
+ */
294
+ get type(): "modify";
295
+ get length(): number;
296
+ /**
297
+ * @type {DeltaBuilderAny}
298
+ */
299
+ get _modValue(): DeltaBuilderAny;
300
+ get fingerprint(): string;
301
+ /**
302
+ * Remove a part of the operation (similar to Array.splice)
303
+ *
304
+ * @param {number} _offset
305
+ * @param {number} _len
306
+ */
307
+ _splice(_offset: number, _len: number): this;
308
+ /**
309
+ * @return {DeltaListOpJSON}
310
+ */
311
+ toJSON(): DeltaListOpJSON;
312
+ /**
313
+ * @return {ModifyOp<DTypes>}
314
+ */
315
+ clone(): ModifyOp<DTypes>;
316
+ /**
317
+ * @param {ModifyOp<any>} other
318
+ */
319
+ [equalityTrait.EqualityTraitSymbol](other: ModifyOp<any>): boolean;
320
+ }
321
+ /**
322
+ * @template {any} [V=any]
323
+ * @template {string|number} [K=any]
324
+ */
325
+ export class SetAttrOp<V extends unknown = any, K extends string | number = any> {
326
+ /**
327
+ * @param {K} key
328
+ * @param {V} value
329
+ * @param {V|undefined} prevValue
330
+ * @param {Attribution?} attribution
331
+ */
332
+ constructor(key: K, value: V, prevValue: V | undefined, attribution: Attribution | null);
333
+ /**
334
+ * @readonly
335
+ * @type {K}
336
+ */
337
+ readonly key: K;
338
+ /**
339
+ * @readonly
340
+ * @type {V}
341
+ */
342
+ readonly value: V;
343
+ /**
344
+ * @readonly
345
+ * @type {V|undefined}
346
+ */
347
+ readonly prevValue: V | undefined;
348
+ /**
349
+ * @readonly
350
+ * @type {Attribution?}
351
+ */
352
+ readonly attribution: Attribution | null;
353
+ /**
354
+ * @type {string|null}
355
+ */
356
+ _fingerprint: string | null;
357
+ get $type(): s.Schema<SetAttrOp<any, any>>;
358
+ /**
359
+ * @return {'insert'}
360
+ */
361
+ get type(): "insert";
362
+ /**
363
+ * @type {DeltaBuilderAny}
364
+ */
365
+ get _modValue(): DeltaBuilderAny;
366
+ get fingerprint(): string;
367
+ toJSON(): {
368
+ type: "insert";
369
+ value: DeltaJSON | V;
370
+ } & (({
371
+ attribution: Attribution;
372
+ } | {
373
+ attribution?: undefined;
374
+ }) & ({
375
+ prevValue: V & ({} | null);
376
+ } | {
377
+ prevValue?: undefined;
378
+ }));
379
+ /**
380
+ * @return {SetAttrOp<V,K>}
381
+ */
382
+ clone(): SetAttrOp<V, K>;
383
+ /**
384
+ * @param {SetAttrOp<V>} other
385
+ */
386
+ [equalityTrait.EqualityTraitSymbol](other: SetAttrOp<V>): boolean;
387
+ }
388
+ /**
389
+ * @template [V=any]
390
+ * @template {string|number} [K=string|number]
391
+ */
392
+ export class DeleteAttrOp<V = any, K extends string | number = string | number> {
393
+ /**
394
+ * @param {K} key
395
+ * @param {V|undefined} prevValue
396
+ * @param {Attribution?} attribution
397
+ */
398
+ constructor(key: K, prevValue: V | undefined, attribution: Attribution | null);
399
+ /**
400
+ * @type {K}
401
+ */
402
+ key: K;
403
+ /**
404
+ * @type {V|undefined}
405
+ */
406
+ prevValue: V | undefined;
407
+ attribution: Attribution | null;
408
+ /**
409
+ * @type {string|null}
410
+ */
411
+ _fingerprint: string | null;
412
+ get $type(): s.Schema<DeleteAttrOp<any, string | number>>;
413
+ /**
414
+ * @type {'delete'}
415
+ */
416
+ get type(): "delete";
417
+ get value(): undefined;
418
+ get fingerprint(): string;
419
+ /**
420
+ * @return {DeltaAttrOpJSON}
421
+ */
422
+ toJSON(): DeltaAttrOpJSON;
423
+ clone(): DeleteAttrOp<V, K>;
424
+ /**
425
+ * @param {DeleteAttrOp<V>} other
426
+ */
427
+ [equalityTrait.EqualityTraitSymbol](other: DeleteAttrOp<V>): boolean;
428
+ }
429
+ /**
430
+ * @template {DeltaAny} [Modifier=DeltaAny]
431
+ * @template {string|number} [K=string]
432
+ */
433
+ export class ModifyAttrOp<Modifier extends DeltaAny = DeltaAny, K extends string | number = string> {
434
+ /**
435
+ * @param {K} key
436
+ * @param {Modifier} delta
437
+ */
438
+ constructor(key: K, delta: Modifier);
439
+ /**
440
+ * @readonly
441
+ * @type {K}
442
+ */
443
+ readonly key: K;
444
+ /**
445
+ * @readonly
446
+ * @type {Modifier}
447
+ */
448
+ readonly value: Modifier;
449
+ /**
450
+ * @type {string|null}
451
+ */
452
+ _fingerprint: string | null;
453
+ get $type(): s.Schema<ModifyAttrOp<any, string | number>>;
454
+ /**
455
+ * @type {'modify'}
456
+ */
457
+ get type(): "modify";
458
+ get fingerprint(): string;
459
+ /**
460
+ * @return {DeltaBuilder}
461
+ */
462
+ get _modValue(): DeltaBuilder;
463
+ /**
464
+ * @return {DeltaAttrOpJSON}
465
+ */
466
+ toJSON(): DeltaAttrOpJSON;
467
+ /**
468
+ * @return {ModifyAttrOp<Modifier,K>}
469
+ */
470
+ clone(): ModifyAttrOp<Modifier, K>;
471
+ /**
472
+ * @param {ModifyAttrOp<Modifier>} other
473
+ */
474
+ [equalityTrait.EqualityTraitSymbol](other: ModifyAttrOp<Modifier>): boolean;
475
+ }
476
+ export const $insertOp: s.Schema<InsertOp<any>>;
477
+ export const $modifyOp: s.Schema<ModifyOp>;
478
+ export const $textOp: s.Schema<TextOp>;
479
+ export const $deleteOp: s.Schema<DeleteOp<any>>;
480
+ export const $retainOp: s.Schema<RetainOp>;
481
+ export const $anyOp: s.Schema<TextOp | InsertOp<any> | DeleteOp<any> | ModifyOp<DeltaAny>>;
482
+ export const $setAttrOp: s.Schema<SetAttrOp<any>>;
483
+ export const $modifyAttrOp: s.Schema<ModifyAttrOp<any, string | number>>;
484
+ export const $deleteAttrOp: s.Schema<DeleteAttrOp<any, string | number>>;
485
+ export const $anyAttrOp: s.Schema<SetAttrOp<any, any> | DeleteAttrOp<any, string | number> | ModifyAttrOp<any, string | number>>;
486
+ export function $setAttrOpWith<Content extends fingerprintTrait.Fingerprintable>($content: s.Schema<Content>): s.Schema<SetAttrOp<Content>>;
487
+ export function $insertOpWith<Content extends fingerprintTrait.Fingerprintable>($content: s.Schema<Content>): s.Schema<InsertOp<Content>>;
488
+ export function $modifyOpWith<Modify extends DeltaAny>($content: s.Schema<Modify>): s.Schema<ModifyOp<Modify>>;
489
+ export function $modifyAttrOpWith<Modify extends DeltaAny>($content: s.Schema<Modify>): s.Schema<ModifyAttrOp<Modify>>;
490
+ /**
491
+ * @template {DeltaConf} [DConf={}]
492
+ * @extends {DeltaData<
493
+ * DeltaConfGetName<DConf>,
494
+ * DeltaConfGetAttrs<DConf>,
495
+ * DeltaConfGetChildren<DConf>,
496
+ * DConf extends {text:true} ? true : false
497
+ * >}
498
+ */
499
+ export class Delta<DConf extends DeltaConf = {}> extends DeltaData<DeltaConfGetName<DConf>, import("../ts.js").TypeIsAny<DConf, {
500
+ [K: string]: any;
501
+ [K: number]: any;
502
+ }, DConf extends {
503
+ attrs: infer Attrs_1;
504
+ } ? Attrs_1 extends undefined ? {} : Attrs_1 : {}>, DeltaConfGetChildren<DConf>, DConf extends {
505
+ text: true;
506
+ } ? true : false> {
507
+ /**
508
+ * @param {string?} name
509
+ * @param {s.Schema<Delta<any>>?} $schema
510
+ */
511
+ constructor(name: string | null, $schema: s.Schema<Delta<any>> | null);
512
+ get $type(): s.Schema<DeltaAny>;
513
+ /**
514
+ * @type {string}
515
+ */
516
+ get fingerprint(): string;
517
+ isEmpty(): boolean;
518
+ /**
519
+ * @return {DeltaJSON}
520
+ */
521
+ toJSON(): DeltaJSON;
522
+ /**
523
+ * @param {Delta<any>} other
524
+ * @return {boolean}
525
+ */
526
+ equals(other: Delta<any>): boolean;
527
+ /**
528
+ * Mark this delta as done and perform some cleanup (e.g. remove appended retains without
529
+ * formats&attributions). In the future, there might be additional merge operations that can be
530
+ * performed to result in smaller deltas. Set `markAsDone=false` to only perform the cleanup.
531
+ *
532
+ * @return {Delta<DConf>}
533
+ */
534
+ done(markAsDone?: boolean): Delta<DConf>;
535
+ [fingerprintTrait.FingerprintTraitSymbol](): string;
536
+ /**
537
+ * @param {any} other
538
+ * @return {boolean}
539
+ */
540
+ [equalityTrait.EqualityTraitSymbol](other: any): boolean;
541
+ }
542
+ export function slice<DConf extends DeltaConf>(d: Delta<DConf>, start?: number, end?: number, currNode?: ChildrenOpAny | null): DeltaBuilder<DConf>;
543
+ export function clone<D extends DeltaAny>(d: D): D extends Delta<infer DConf> ? DeltaBuilder<DConf> : never;
544
+ /**
545
+ * @template {DeltaConf} [DConf={}]
546
+ * @extends {Delta<DConf>}
547
+ */
548
+ export class DeltaBuilder<DConf extends DeltaConf = {}> extends Delta<DConf> {
549
+ /**
550
+ * @param {string?} name
551
+ * @param {s.Schema<Delta<DConf>>?} $schema
552
+ */
553
+ constructor(name: string | null, $schema: s.Schema<Delta<DConf>> | null);
554
+ /**
555
+ * @type {FormattingAttributes?}
556
+ */
557
+ usedAttributes: FormattingAttributes | null;
558
+ /**
559
+ * @type {Attribution?}
560
+ */
561
+ usedAttribution: Attribution | null;
562
+ /**
563
+ * @param {Attribution?} attribution
564
+ */
565
+ useAttribution(attribution: Attribution | null): this;
566
+ /**
567
+ * @param {FormattingAttributes?} attributes
568
+ * @return {this}
569
+ */
570
+ useAttributes(attributes: FormattingAttributes | null): this;
571
+ /**
572
+ * @param {string} name
573
+ * @param {any} value
574
+ */
575
+ updateUsedAttributes(name: string, value: any): this;
576
+ /**
577
+ * @template {keyof Attribution} NAME
578
+ * @param {NAME} name
579
+ * @param {Attribution[NAME]?} value
580
+ */
581
+ updateUsedAttribution<NAME extends keyof Attribution>(name: NAME, value: Attribution[NAME] | null): this;
582
+ /**
583
+ * @template {(DConf extends {fixed:true} ? never : (Array<any>|string)) | (DeltaConfGetChildren<DConf> extends infer Children ? (Children extends never ? never : Array<Children>) : never) | DeltaConfGetText<DConf>} NewContent
584
+ * @param {NewContent} insert
585
+ * @param {FormattingAttributes?} [formatting]
586
+ * @param {Attribution?} [attribution]
587
+ * @return {DeltaBuilder<DConf extends {fixed: true} ? DConf : DeltaConfOverwrite<DConf,
588
+ * (Exclude<NewContent,string> extends never ? {} : {
589
+ * children: Exclude<NewContent,string>[number]|DeltaConfGetChildren<DConf>
590
+ * }) & (Extract<NewContent,string> extends never ? {} : { text: true })>>}
591
+ */
592
+ insert<NewContent extends (DConf extends {
593
+ fixed: true;
594
+ } ? never : (Array<any> | string)) | (DeltaConfGetChildren<DConf> extends infer Children_1 ? (Children_1 extends never ? never : Array<Children_1>) : never) | DeltaConfGetText<DConf>>(insert: NewContent, formatting?: FormattingAttributes | null, attribution?: Attribution | null): DeltaBuilder<DConf extends {
595
+ fixed: true;
596
+ } ? DConf : DeltaConfOverwrite<DConf, (Exclude<NewContent, string> extends never ? {} : {
597
+ children: Exclude<NewContent, string>[number] | DeltaConfGetChildren<DConf>;
598
+ }) & (Extract<NewContent, string> extends never ? {} : {
599
+ text: true;
600
+ })>>;
601
+ /**
602
+ * @template {Extract<DeltaConfGetAllowedChildren<DConf>,Delta>} NewContent
603
+ * @param {NewContent} modify
604
+ * @param {FormattingAttributes?} formatting
605
+ * @param {Attribution?} attribution
606
+ * @return {DeltaBuilder<DeltaConfOverwrite<DConf, {children: DeltaConfGetChildren<DConf>|NewContent}>>}
607
+ */
608
+ modify<NewContent extends Extract<DeltaConfGetAllowedChildren<DConf>, Delta>>(modify: NewContent, formatting?: FormattingAttributes | null, attribution?: Attribution | null): DeltaBuilder<DeltaConfOverwrite<DConf, {
609
+ children: DeltaConfGetChildren<DConf> | NewContent;
610
+ }>>;
611
+ /**
612
+ * @param {number} len
613
+ * @param {FormattingAttributes?} [format]
614
+ * @param {Attribution?} [attribution]
615
+ */
616
+ retain(len: number, format?: FormattingAttributes | null, attribution?: Attribution | null): this;
617
+ /**
618
+ * @param {number} len
619
+ */
620
+ delete(len: number): this;
621
+ /**
622
+ * @template {keyof DeltaConfGetAllowedAttrs<DConf>} Key
623
+ * @template {DeltaConfGetAllowedAttrs<DConf>[Key]} Val
624
+ * @param {Key} key
625
+ * @param {Val} val
626
+ * @param {Attribution?} attribution
627
+ * @param {Val|undefined} [prevValue]
628
+ * @return {DeltaBuilder<DeltaConfOverwrite<DConf,{attrs:AddToAttrs<DeltaConfGetAttrs<DConf>,Key,Val>}>>}
629
+ */
630
+ setAttr<Key extends keyof DeltaConfGetAllowedAttrs<DConf>, Val extends DeltaConfGetAllowedAttrs<DConf>[Key]>(key: Key, val: Val, attribution?: Attribution | null, prevValue?: Val | undefined): DeltaBuilder<DeltaConfOverwrite<DConf, {
631
+ attrs: AddToAttrs<DeltaConfGetAttrs<DConf>, Key, Val>;
632
+ }>>;
633
+ /**
634
+ * @template {DeltaConfGetAllowedAttrs<DConf>} NewAttrs
635
+ * @param {NewAttrs} attrs
636
+ * @param {Attribution?} attribution
637
+ * @return {DeltaBuilder<DeltaConfOverwrite<
638
+ * DConf,
639
+ * { attrs: MergeAttrs<DeltaConfGetAttrs<DConf>,NewAttrs> }
640
+ * >>
641
+ * }
642
+ */
643
+ setAttrs<NewAttrs extends DeltaConfGetAllowedAttrs<DConf>>(attrs: NewAttrs, attribution?: Attribution | null): DeltaBuilder<DeltaConfOverwrite<DConf, {
644
+ attrs: MergeAttrs<DeltaConfGetAttrs<DConf>, NewAttrs>;
645
+ }>>;
646
+ /**
647
+ * @template {keyof DeltaConfGetAllowedAttrs<DConf>} Key
648
+ * @param {Key} key
649
+ * @param {Attribution?} attribution
650
+ * @param {any} [prevValue]
651
+ * @return {DeltaBuilder<DeltaConfOverwrite<DConf, {
652
+ * attrs: AddToAttrs<DeltaConfGetAttrs<DConf>,Key,never>
653
+ * }>>}
654
+ */
655
+ deleteAttr<Key extends keyof DeltaConfGetAllowedAttrs<DConf>>(key: Key, attribution?: Attribution | null, prevValue?: any): DeltaBuilder<DeltaConfOverwrite<DConf, {
656
+ attrs: AddToAttrs<DeltaConfGetAttrs<DConf>, Key, never>;
657
+ }>>;
658
+ /**
659
+ * @template {DeltaConfGetAllowedAttrs<DConf> extends infer As ? { [K in keyof As]: Extract<As[K],DeltaAny> extends never ? never : K }[keyof As] : never} Key
660
+ * @template {Extract<DeltaConfGetAllowedAttrs<DConf>[Key],DeltaAny>} D
661
+ * @param {Key} key
662
+ * @param {D} modify
663
+ * @return {DeltaBuilder<DeltaConfOverwrite<DConf,{attrs:AddToAttrs<DeltaConfGetAttrs<DConf>,Key,D>}>>}
664
+ */
665
+ modifyAttr<Key extends DeltaConfGetAllowedAttrs<DConf> extends infer As ? { [K in keyof As]: Extract<As[K], DeltaAny> extends never ? never : K; }[keyof As] : never, D extends Extract<DeltaConfGetAllowedAttrs<DConf>[Key], DeltaAny>>(key: Key, modify: D): DeltaBuilder<DeltaConfOverwrite<DConf, {
666
+ attrs: AddToAttrs<DeltaConfGetAttrs<DConf>, Key, D>;
667
+ }>>;
668
+ /**
669
+ * @param {Delta<DConf>} other
670
+ */
671
+ apply(other: Delta<DConf>): this;
672
+ /**
673
+ * @param {DeltaAny} other
674
+ * @param {boolean} priority
675
+ */
676
+ rebase(other: DeltaAny, priority: boolean): this;
677
+ /**
678
+ * Same as doing `delta.rebase(other.inverse())`, without creating a temporary delta.
679
+ *
680
+ * @param {DeltaAny} other
681
+ * @param {boolean} priority
682
+ */
683
+ rebaseOnInverse(other: DeltaAny, priority: boolean): this;
684
+ /**
685
+ * Append child ops from one op to the other.
686
+ *
687
+ * delta.create().insert('a').append(delta.create().insert('b')) // => insert "ab"
688
+ *
689
+ * @todo on fixed deltas this should not extend
690
+ *
691
+ * @template {DeltaConf} OtherDeltaConf
692
+ * @param {Delta<OtherDeltaConf>} other
693
+ * @return {DeltaBuilder<DeltaConfOverwrite<
694
+ * DConf,
695
+ * (DeltaConfGetChildren<OtherDeltaConf> extends never ? {} : { children: DeltaConfGetChildren<DConf> | DeltaConfGetChildren<OtherDeltaConf> })
696
+ * & (DeltaConfGetText<OtherDeltaConf> extends string ? { text: true } : never)
697
+ * >>}
698
+ */
699
+ append<OtherDeltaConf extends DeltaConf>(other: Delta<OtherDeltaConf>): DeltaBuilder<DeltaConfOverwrite<DConf, (DeltaConfGetChildren<OtherDeltaConf> extends never ? {} : {
700
+ children: DeltaConfGetChildren<DConf> | DeltaConfGetChildren<OtherDeltaConf>;
701
+ }) & (DeltaConfGetText<OtherDeltaConf> extends string ? {
702
+ text: true;
703
+ } : never)>>;
704
+ }
705
+ /**
706
+ * @template {DeltaConf} DConf
707
+ * @extends {s.Schema<Delta<DConf>>}
708
+ */
709
+ export class $Delta<DConf extends DeltaConf> extends s.Schema<Delta<DConf>> {
710
+ /**
711
+ * @param {s.Schema<any>} $name
712
+ * @param {s.Schema<any>} $attrs
713
+ * @param {s.Schema<any>} $children
714
+ * @param {any} hasText
715
+ * @param {any} recursiveChildren
716
+ * @param {s.Schema<{[K:string]:any}>} $formats
717
+ */
718
+ constructor($name: s.Schema<any>, $attrs: s.Schema<any>, $children: s.Schema<any>, hasText: any, recursiveChildren: any, $formats: s.Schema<{
719
+ [K: string]: any;
720
+ }>);
721
+ /**
722
+ * @type {{
723
+ * $name: s.Schema<DeltaConfGetName<DConf>>,
724
+ * $attrs: s.Schema<DeltaConfGetAttrs<DConf>>,
725
+ * $children: s.Schema<DeltaConfGetChildren<DConf>>,
726
+ * hasText: DeltaConfGetText<DConf>
727
+ * recursiveChildren: DeltaConfGetRecursiveChildren<DConf>,
728
+ * $formats: s.Schema<{[K:string]:any}>
729
+ * }}
730
+ */
731
+ shape: {
732
+ $name: s.Schema<DeltaConfGetName<DConf>>;
733
+ $attrs: s.Schema<DeltaConfGetAttrs<DConf>>;
734
+ $children: s.Schema<DeltaConfGetChildren<DConf>>;
735
+ hasText: DeltaConfGetText<DConf>;
736
+ recursiveChildren: DeltaConfGetRecursiveChildren<DConf>;
737
+ $formats: s.Schema<{
738
+ [K: string]: any;
739
+ }>;
740
+ };
741
+ }
742
+ export function $delta<NodeNameSchema extends s.Schema<string> | string | Array<string> = s.Schema<any>, AttrsSchema extends s.Schema<{
743
+ [key: string | number]: any;
744
+ }> | {
745
+ [key: string | number]: any;
746
+ } = s.Schema<{}>, ChildrenSchema extends unknown = s.Schema<never>, HasText extends boolean = false, RecursiveChildren extends boolean = false, Formats extends {
747
+ [k: string]: any;
748
+ } = {
749
+ [k: string]: any;
750
+ }>({ name, attrs, children, text, formats, recursiveChildren: recursive }: {
751
+ name?: NodeNameSchema | null | undefined;
752
+ attrs?: AttrsSchema | null | undefined;
753
+ children?: ChildrenSchema | null | undefined;
754
+ text?: HasText | undefined;
755
+ formats?: Formats | undefined;
756
+ recursiveChildren?: RecursiveChildren | undefined;
757
+ }): [s.Unwrap<s.ReadSchema<NodeNameSchema>>, s.Unwrap<s.ReadSchema<AttrsSchema>>, s.Unwrap<s.ReadSchema<ChildrenSchema>>] extends [infer NodeName_1, infer Attrs_1, infer Children_1] ? s.Schema<Delta<{
758
+ name: NodeName_1;
759
+ attrs: Attrs_1;
760
+ children: Children_1;
761
+ text: HasText;
762
+ recursiveChildren: RecursiveChildren;
763
+ }>> : never;
764
+ export const $$delta: s.Schema<$Delta<DeltaConf>>;
765
+ export function _$delta<NodeNameSchema extends s.Schema<string> | string | Array<string> = s.Schema<any>, AttrsSchema extends s.Schema<{
766
+ [key: string | number]: any;
767
+ }> | {
768
+ [key: string | number]: any;
769
+ } = s.Schema<{}>, ChildrenSchema extends unknown = s.Schema<never>, HasText extends boolean = false, Recursive extends boolean = false>({ name, attrs, children, text, recursive }: {
770
+ name?: NodeNameSchema | null | undefined;
771
+ attrs?: AttrsSchema | null | undefined;
772
+ children?: ChildrenSchema | null | undefined;
773
+ text?: HasText | undefined;
774
+ recursive?: Recursive | undefined;
775
+ }): [s.Unwrap<s.ReadSchema<NodeNameSchema>>, s.Unwrap<s.ReadSchema<AttrsSchema>>, s.Unwrap<s.ReadSchema<ChildrenSchema>>] extends [infer NodeName_1, infer Attrs_1, infer Children_1] ? s.Schema<Delta<NodeName_1, Attrs_1, Children_1 | (Recursive extends true ? RecursiveDelta<NodeName_1, Attrs_1, Children_1, HasText extends true ? string : never> : never), HasText extends true ? string : never>> : never;
776
+ export const $deltaAny: s.Schema<DeltaAny>;
777
+ export const $deltaBuilderAny: s.Schema<DeltaBuilderAny>;
778
+ export function mergeAttrs<T extends {
779
+ [key: string]: any;
780
+ }>(a: T | null, b: T | null): T | null;
781
+ export function mergeDeltas<D extends DeltaAny | null>(a: D, b: D): D;
782
+ export function random<DConf extends DeltaConf>(gen: prng.PRNG, $d: s.Schema<Delta<DConf>>): DeltaBuilder<DConf>;
783
+ /**
784
+ * @overload
785
+ * @return {DeltaBuilder<{}>}
786
+ */
787
+ export function create(): DeltaBuilder<{}>;
788
+ /**
789
+ * @template {string} NodeName
790
+ * @overload
791
+ * @param {NodeName} nodeName
792
+ * @return {DeltaBuilder<{ name: NodeName }>}
793
+ */
794
+ export function create<NodeName extends string>(nodeName: NodeName): DeltaBuilder<{
795
+ name: NodeName;
796
+ }>;
797
+ /**
798
+ * @template {string} NodeName
799
+ * @template {s.Schema<DeltaAny>} Schema
800
+ * @overload
801
+ * @param {NodeName} nodeName
802
+ * @param {Schema} schema
803
+ * @return {Schema extends s.Schema<Delta<infer DConf>> ? DeltaBuilder<DeltaConfOverwrite<DConf, {fixed:true}>> : never}
804
+ */
805
+ export function create<NodeName extends string, Schema extends s.Schema<DeltaAny>>(nodeName: NodeName, schema: Schema): Schema extends s.Schema<Delta<infer DConf>> ? DeltaBuilder<DeltaConfOverwrite<DConf, {
806
+ fixed: true;
807
+ }>> : never;
808
+ /**
809
+ * @template {s.Schema<DeltaAny>} Schema
810
+ * @overload
811
+ * @param {Schema} schema
812
+ * @return {Schema extends s.Schema<Delta<infer DConf>> ? DeltaBuilder<DeltaConfOverwrite<DConf, {fixed:true}>> : never}
813
+ */
814
+ export function create<Schema extends s.Schema<DeltaAny>>(schema: Schema): Schema extends s.Schema<Delta<infer DConf>> ? DeltaBuilder<DeltaConfOverwrite<DConf, {
815
+ fixed: true;
816
+ }>> : never;
817
+ /**
818
+ * @template {string|null} NodeName
819
+ * @template {{[k:string|number]:any}|null} Attrs
820
+ * @template {Array<any>|string} [Children=never]
821
+ * @overload
822
+ * @param {NodeName} nodeName
823
+ * @param {Attrs} attrs
824
+ * @param {Children} [children]
825
+ * @return {DeltaBuilder<{
826
+ * name: NodeName,
827
+ * attrs: Attrs extends null ? {} : Attrs,
828
+ * children: Extract<Children,Array<any>> extends Array<infer Ac> ? (unknown extends Ac ? never : Ac) : never,
829
+ * text: Extract<Children,string> extends never ? false : true
830
+ * }>}
831
+ */
832
+ export function create<NodeName extends string, Attrs extends {
833
+ [k: string | number]: any;
834
+ } | null, Children extends Array<any> | string = never>(nodeName: NodeName, attrs: Attrs, children?: Children | undefined): DeltaBuilder<{
835
+ name: NodeName;
836
+ attrs: Attrs extends null ? {} : Attrs;
837
+ children: Extract<Children, Array<any>> extends Array<infer Ac> ? (unknown extends Ac ? never : Ac) : never;
838
+ text: Extract<Children, string> extends never ? false : true;
839
+ }>;
840
+ export function diff<DConf extends DeltaConf>(d1: Delta<DConf>, d2: NoInfer<Delta<DConf>>): DeltaBuilder<DConf>;
841
+ export type Attribution = {
842
+ insert?: string[];
843
+ insertAt?: number;
844
+ delete?: string[];
845
+ deleteAt?: number;
846
+ format?: Record<string, string[]>;
847
+ formatAt?: number;
848
+ };
849
+ export type FormattingAttributes = {
850
+ [key: string]: any;
851
+ };
852
+ export type DeltaJSON = {
853
+ type: "delta";
854
+ name?: string;
855
+ attrs?: { [Key in string | number]: DeltaAttrOpJSON; };
856
+ children?: Array<DeltaListOpJSON>;
857
+ };
858
+ export type DeltaListOpJSON = {
859
+ type: "insert";
860
+ insert: string | Array<any>;
861
+ format?: {
862
+ [key: string]: any;
863
+ };
864
+ attribution?: Attribution;
865
+ } | {
866
+ delete: number;
867
+ } | {
868
+ type: "retain";
869
+ retain: number;
870
+ format?: {
871
+ [key: string]: any;
872
+ };
873
+ attribution?: Attribution;
874
+ } | {
875
+ type: "modify";
876
+ value: object;
877
+ };
878
+ export type DeltaAttrOpJSON = {
879
+ type: "insert";
880
+ value: any;
881
+ prevValue?: any;
882
+ attribution?: Attribution;
883
+ } | {
884
+ type: "delete";
885
+ prevValue?: any;
886
+ attribution?: Attribution;
887
+ } | {
888
+ type: "modify";
889
+ value: DeltaJSON;
890
+ };
891
+ export type ChildrenOpAny = TextOp | InsertOp<any> | DeleteOp | RetainOp | ModifyOp<any>;
892
+ export type AttrOpAny = SetAttrOp<any> | DeleteAttrOp<any> | ModifyAttrOp;
893
+ export type _OpAny = ChildrenOpAny | AttrOpAny;
894
+ export type AddToAttrs<Attrs_1 extends { [Key in string | number]: any; }, Key extends string | number, Val extends unknown> = { [K in (Key | keyof Attrs_1)]: (unknown extends Attrs_1[K] ? never : Attrs_1[K]) | (Key extends K ? Val : never); };
895
+ export type MergeAttrs<Attrs_1 extends { [Key in string | number | symbol]: any; }, NewAttrs extends { [Key in string | number | symbol]: any; }> = { [K in (keyof NewAttrs | keyof Attrs_1)]: (unknown extends Attrs_1[K] ? never : Attrs_1[K]) | (unknown extends NewAttrs[K] ? never : NewAttrs[K]); };
896
+ export type DeltaAny = Delta<any>;
897
+ export type DeltaBuilderAny = DeltaBuilder<any>;
898
+ export type DeltaConf = {
899
+ name?: string | undefined;
900
+ children?: fingerprintTrait.Fingerprintable;
901
+ text?: boolean | undefined;
902
+ attrs?: {
903
+ [K: string]: fingerprintTrait.Fingerprintable;
904
+ [K: number]: fingerprintTrait.Fingerprintable;
905
+ } | undefined;
906
+ fixed?: boolean | undefined;
907
+ recursiveChildren?: boolean | undefined;
908
+ recursiveAttrs?: boolean | undefined;
909
+ };
910
+ export type DeltaConfGetName<DConf extends DeltaConf> = DConf extends {
911
+ name: infer Name;
912
+ } ? (unknown extends Name ? any : (Exclude<Name, undefined>)) : any;
913
+ export type DeltaConfGetChildren<DConf extends DeltaConf> = (DConf extends {
914
+ children: infer Children_1;
915
+ } ? (unknown extends Children_1 ? any : Children_1) : never) | (DConf extends {
916
+ recursiveChildren: true;
917
+ } ? Delta<DConf> : never);
918
+ export type DeltaConfGetAllowedChildren<DConf extends DeltaConf> = DConf extends {
919
+ fixed: true;
920
+ } ? DeltaConfGetChildren<DConf> : any;
921
+ export type DeltaConfGetText<DConf extends DeltaConf> = 0 extends (1 & DConf) ? string : (DConf extends {
922
+ text: true;
923
+ } ? string : never);
924
+ export type DeltaConfGetAttrs<DConf extends DeltaConf> = import("../ts.js").TypeIsAny<DConf, {
925
+ [K: string | number]: any;
926
+ }, (DConf extends {
927
+ attrs: infer Attrs_1;
928
+ } ? (Attrs_1 extends undefined ? {} : Attrs_1) : {})>;
929
+ export type DeltaConfGetAllowedAttrs<DConf extends DeltaConf> = DConf extends {
930
+ fixed: true;
931
+ } ? DeltaConfGetAttrs<DConf> : {
932
+ [K: string | number]: any;
933
+ };
934
+ export type DeltaConfGetFixed<DConf extends DeltaConf> = 0 extends (1 & DConf) ? true : (DConf extends {
935
+ fixed: true;
936
+ } ? true : false);
937
+ export type DeltaConfGetRecursiveChildren<DConf extends DeltaConf> = DConf extends {
938
+ recursiveChildren: true;
939
+ } ? true : false;
940
+ export type DeltaConfigGetRecursiveAttrs<DConf extends DeltaConf> = DConf extends {
941
+ recursiveAttrs: true;
942
+ } ? true : false;
943
+ /**
944
+ * Transform Delta(Builder) to a normal delta.
945
+ */
946
+ export type _SanifyDelta<V> = V extends never ? never : (import("../ts.js").TypeIsAny<V, any, V extends Delta<infer DConf> ? Delta<DConf> : V>);
947
+ export type PrettifyDeltaConf<DConf extends DeltaConf> = import("../ts.js").Prettify<{ [K in keyof DConf]: K extends "attrs" ? import("../ts.js").Prettify<{ [KA in keyof DConf[K]]: _SanifyDelta<DConf[K][KA]>; }, 1> : (K extends "children" ? _SanifyDelta<DConf[K]> : DConf[K]); }, 1>;
948
+ export type DeltaConfOverwrite<D1 extends DeltaConf, D2 extends DeltaConf> = import("../ts.js").TypeIsAny<D1, any, PrettifyDeltaConf<{ [K in (keyof D1 | keyof D2)]: K extends keyof D2 ? D2[K] : (K extends keyof D1 ? D1[K] : never); }>>;
949
+ export type qq = string extends never ? true : false;
950
+ import * as s from '../schema.js';
951
+ import * as list from '../list.js';
952
+ import * as equalityTrait from '../trait/equality.js';
953
+ import * as fingerprintTrait from '../trait/fingerprint.js';
954
+ /**
955
+ * @template {{[Key in string|number]: any}} Attrs
956
+ * @template {string|number} Key
957
+ * @template {any} Val
958
+ * @typedef {{ [K in (Key | keyof Attrs)]: (unknown extends Attrs[K] ? never : Attrs[K]) | (Key extends K ? Val : never) }} AddToAttrs
959
+ */
960
+ /**
961
+ * @template {{[Key in string|number|symbol]: any}} Attrs
962
+ * @template {{[Key in string|number|symbol]: any}} NewAttrs
963
+ * @typedef {{ [K in (keyof NewAttrs | keyof Attrs)]: (unknown extends Attrs[K] ? never : Attrs[K]) | (unknown extends NewAttrs[K] ? never : NewAttrs[K]) }} MergeAttrs
964
+ */
965
+ /**
966
+ * @typedef {Delta<any>} DeltaAny
967
+ */
968
+ /**
969
+ * @typedef {DeltaBuilder<any>} DeltaBuilderAny
970
+ */
971
+ /**
972
+ * @typedef {object} DeltaConf
973
+ * @property {string} [DeltaConf.name]
974
+ * @property {fingerprintTrait.Fingerprintable} [DeltaConf.children=never]
975
+ * @property {boolean} [DeltaConf.text=never]
976
+ * @property {{[K:string|number]:fingerprintTrait.Fingerprintable}} [DeltaConf.attrs={}]
977
+ * @property {boolean} [DeltaConf.fixed=never]
978
+ * @property {boolean} [DeltaConf.recursiveChildren=false]
979
+ * @property {boolean} [DeltaConf.recursiveAttrs=false]
980
+ */
981
+ /**
982
+ * @template {DeltaConf} DConf
983
+ * @typedef {DConf extends {name:infer Name} ? (unknown extends Name ? any : (Exclude<Name,undefined>)) : any} DeltaConfGetName
984
+ */
985
+ /**
986
+ * @template {DeltaConf} DConf
987
+ * @typedef {(DConf extends {children:infer Children} ? (unknown extends Children ? any : Children) : never) | (DConf extends {recursiveChildren:true} ? Delta<DConf> : never)} DeltaConfGetChildren
988
+ */
989
+ /**
990
+ * @template {DeltaConf} DConf
991
+ * @typedef {DConf extends {fixed:true} ? DeltaConfGetChildren<DConf> : any } DeltaConfGetAllowedChildren
992
+ */
993
+ /**
994
+ * @template {DeltaConf} DConf
995
+ * @typedef {0 extends (1 & DConf) ? string : (DConf extends {text:true} ? string : never)} DeltaConfGetText
996
+ */
997
+ /**
998
+ * @template {DeltaConf} DConf
999
+ * @typedef {import('../ts.js').TypeIsAny<DConf, {[K:string|number]:any}, (DConf extends {attrs:infer Attrs} ? (Attrs extends undefined ? {} : Attrs) : {})>} DeltaConfGetAttrs
1000
+ */
1001
+ /**
1002
+ * @template {DeltaConf} DConf
1003
+ * @typedef {DConf extends {fixed:true} ? DeltaConfGetAttrs<DConf> : {[K:string|number]:any}} DeltaConfGetAllowedAttrs
1004
+ */
1005
+ /**
1006
+ * @template {DeltaConf} DConf
1007
+ * @typedef {0 extends (1 & DConf) ? true : (DConf extends { fixed: true } ? true : false)} DeltaConfGetFixed
1008
+ */
1009
+ /**
1010
+ * @template {DeltaConf} DConf
1011
+ * @typedef {DConf extends {recursiveChildren:true} ? true : false} DeltaConfGetRecursiveChildren
1012
+ */
1013
+ /**
1014
+ * @template {DeltaConf} DConf
1015
+ * @typedef {DConf extends {recursiveAttrs:true} ? true : false} DeltaConfigGetRecursiveAttrs
1016
+ */
1017
+ /**
1018
+ * Transform Delta(Builder) to a normal delta.
1019
+ *
1020
+ * @template V
1021
+ * @typedef {V extends never ? never : (import('../ts.js').TypeIsAny<V,any,V extends Delta<infer DConf> ? Delta<DConf> : V>)} _SanifyDelta
1022
+ */
1023
+ /**
1024
+ * @template {DeltaConf} DConf
1025
+ * @typedef {import('../ts.js').Prettify<{[K in keyof DConf]: K extends 'attrs' ? import('../ts.js').Prettify<{ [KA in keyof DConf[K]]: _SanifyDelta<DConf[K][KA]> },1> : (K extends 'children' ? _SanifyDelta<DConf[K]> : DConf[K]) }, 1>} PrettifyDeltaConf
1026
+ */
1027
+ /**
1028
+ * @template {DeltaConf} D1
1029
+ * @template {DeltaConf} D2
1030
+ * @typedef {import('../ts.js').TypeIsAny<D1, any, PrettifyDeltaConf<{[K in (keyof D1|keyof D2)]: K extends keyof D2 ? D2[K] : (K extends keyof D1 ? D1[K] : never)}>>} DeltaConfOverwrite
1031
+ */
1032
+ /**
1033
+ * @template {string} Name
1034
+ * @template {{[K in string|number]:any}} Attrs
1035
+ * @template Children
1036
+ * @template {boolean} Text
1037
+ */
1038
+ declare class DeltaData<Name extends string, Attrs extends { [K in string | number]: any; }, Children, Text extends boolean> {
1039
+ /**
1040
+ * @param {string?} name
1041
+ * @param {s.Schema<Delta<any>>?} $schema
1042
+ */
1043
+ constructor(name: string | null, $schema: s.Schema<Delta<any>> | null);
1044
+ name: Name;
1045
+ $schema: s.Schema<Delta<any>> | null;
1046
+ /**
1047
+ * @type {{ [K in keyof Attrs]?: K extends string|number ? (SetAttrOp<Attrs[K],K>|DeleteAttrOp<Attrs[K],K>|(Attrs[K] extends never ? never : (Attrs[K] extends Delta ? ModifyAttrOp<Extract<Attrs[K],Delta>,K> : never))) : never }
1048
+ * & { [Symbol.iterator]: () => Iterator<{ [K in keyof Attrs]: K extends string|number ? (SetAttrOp<Attrs[K],K>|DeleteAttrOp<Attrs[K],K>|(Attrs[K] extends never ? never : (Delta extends Attrs[K] ? ModifyAttrOp<Extract<Attrs[K],Delta>,K> : never))) : never }[keyof Attrs]> }
1049
+ * }
1050
+ */
1051
+ attrs: { [K in keyof Attrs]?: K extends string | number ? (SetAttrOp<Attrs[K], K> | DeleteAttrOp<Attrs[K], K> | (Attrs[K] extends never ? never : (Attrs[K] extends Delta ? ModifyAttrOp<Extract<Attrs[K], Delta>, K> : never))) : never; } & {
1052
+ [Symbol.iterator]: () => Iterator<{ [K in keyof Attrs]: K extends string | number ? (SetAttrOp<Attrs[K], K> | DeleteAttrOp<Attrs[K], K> | (Attrs[K] extends never ? never : (Delta extends Attrs[K] ? ModifyAttrOp<Extract<Attrs[K], Delta>, K> : never))) : never; }[keyof Attrs]>;
1053
+ };
1054
+ /**
1055
+ * @type {list.List<
1056
+ * | (Text extends true ? (RetainOp|TextOp|DeleteOp<any>) : never)
1057
+ * | (RetainOp|InsertOp<Children>|DeleteOp<any>|(Delta extends Children ? ModifyOp<Extract<Children,Delta>> : never))
1058
+ * >}
1059
+ */
1060
+ children: list.List<(Text extends true ? (RetainOp | TextOp | DeleteOp<any>) : never) | (RetainOp | InsertOp<Children> | DeleteOp<any> | (Delta extends Children ? ModifyOp<Extract<Children, Delta>> : never))>;
1061
+ childCnt: number;
1062
+ /**
1063
+ * @type {any}
1064
+ */
1065
+ origin: any;
1066
+ /**
1067
+ * @type {string|null}
1068
+ */
1069
+ _fingerprint: string | null;
1070
+ isDone: boolean;
1071
+ }
1072
+ import * as prng from '../prng.js';
1073
+ export {};
1074
+ //# sourceMappingURL=delta.d.ts.map