@bcts/provenance-mark 1.0.0-alpha.5

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.
@@ -0,0 +1,711 @@
1
+ import { Cbor } from "@bcts/dcbor";
2
+ import { BytewordsStyle, UR } from "@bcts/uniform-resources";
3
+
4
+ //#region src/error.d.ts
5
+ /**
6
+ * Error types for Provenance Mark operations.
7
+ */
8
+ declare enum ProvenanceMarkErrorType {
9
+ /** Invalid Seed length */
10
+ InvalidSeedLength = "InvalidSeedLength",
11
+ /** Duplicate key */
12
+ DuplicateKey = "DuplicateKey",
13
+ /** Missing key */
14
+ MissingKey = "MissingKey",
15
+ /** Invalid key */
16
+ InvalidKey = "InvalidKey",
17
+ /** Extra keys */
18
+ ExtraKeys = "ExtraKeys",
19
+ /** Invalid key length for the given resolution */
20
+ InvalidKeyLength = "InvalidKeyLength",
21
+ /** Invalid next key length for the given resolution */
22
+ InvalidNextKeyLength = "InvalidNextKeyLength",
23
+ /** Invalid chain ID length for the given resolution */
24
+ InvalidChainIdLength = "InvalidChainIdLength",
25
+ /** Invalid message length for the given resolution */
26
+ InvalidMessageLength = "InvalidMessageLength",
27
+ /** Invalid CBOR data in info field */
28
+ InvalidInfoCbor = "InvalidInfoCbor",
29
+ /** Date out of range for serialization */
30
+ DateOutOfRange = "DateOutOfRange",
31
+ /** Invalid date components */
32
+ InvalidDate = "InvalidDate",
33
+ /** Missing required URL parameter */
34
+ MissingUrlParameter = "MissingUrlParameter",
35
+ /** Year out of range for 2-byte serialization */
36
+ YearOutOfRange = "YearOutOfRange",
37
+ /** Invalid month or day */
38
+ InvalidMonthOrDay = "InvalidMonthOrDay",
39
+ /** Resolution serialization error */
40
+ ResolutionError = "ResolutionError",
41
+ /** Bytewords encoding/decoding error */
42
+ BytewordsError = "BytewordsError",
43
+ /** CBOR encoding/decoding error */
44
+ CborError = "CborError",
45
+ /** URL parsing error */
46
+ UrlError = "UrlError",
47
+ /** Base64 decoding error */
48
+ Base64Error = "Base64Error",
49
+ /** JSON serialization error */
50
+ JsonError = "JsonError",
51
+ /** Integer conversion error */
52
+ IntegerConversionError = "IntegerConversionError",
53
+ /** Validation error */
54
+ ValidationError = "ValidationError",
55
+ }
56
+ /**
57
+ * Error class for Provenance Mark operations.
58
+ */
59
+ declare class ProvenanceMarkError extends Error {
60
+ readonly type: ProvenanceMarkErrorType;
61
+ readonly details?: Record<string, unknown> | undefined;
62
+ constructor(type: ProvenanceMarkErrorType, message?: string, details?: Record<string, unknown>);
63
+ private static defaultMessage;
64
+ }
65
+ /**
66
+ * Result type for Provenance Mark operations.
67
+ */
68
+ type ProvenanceMarkResult<T> = T;
69
+ //#endregion
70
+ //#region src/resolution.d.ts
71
+ /**
72
+ * Resolution levels for provenance marks.
73
+ * Higher resolution provides more security but larger mark sizes.
74
+ */
75
+ declare enum ProvenanceMarkResolution {
76
+ Low = 0,
77
+ Medium = 1,
78
+ Quartile = 2,
79
+ High = 3,
80
+ }
81
+ /**
82
+ * Convert a resolution to its numeric value.
83
+ */
84
+ declare function resolutionToNumber(res: ProvenanceMarkResolution): number;
85
+ /**
86
+ * Create a resolution from a numeric value.
87
+ */
88
+ declare function resolutionFromNumber(value: number): ProvenanceMarkResolution;
89
+ /**
90
+ * Get the link length (key/hash/chainID length) for a resolution.
91
+ */
92
+ declare function linkLength(res: ProvenanceMarkResolution): number;
93
+ /**
94
+ * Get the sequence bytes length for a resolution.
95
+ */
96
+ declare function seqBytesLength(res: ProvenanceMarkResolution): number;
97
+ /**
98
+ * Get the date bytes length for a resolution.
99
+ */
100
+ declare function dateBytesLength(res: ProvenanceMarkResolution): number;
101
+ /**
102
+ * Get the fixed-length portion size for a resolution.
103
+ */
104
+ declare function fixedLength(res: ProvenanceMarkResolution): number;
105
+ /**
106
+ * Get the key range for a resolution.
107
+ */
108
+ declare function keyRange(res: ProvenanceMarkResolution): {
109
+ start: number;
110
+ end: number;
111
+ };
112
+ /**
113
+ * Get the chain ID range for a resolution.
114
+ */
115
+ declare function chainIdRange(res: ProvenanceMarkResolution): {
116
+ start: number;
117
+ end: number;
118
+ };
119
+ /**
120
+ * Get the hash range for a resolution.
121
+ */
122
+ declare function hashRange(res: ProvenanceMarkResolution): {
123
+ start: number;
124
+ end: number;
125
+ };
126
+ /**
127
+ * Get the sequence bytes range for a resolution.
128
+ */
129
+ declare function seqBytesRange(res: ProvenanceMarkResolution): {
130
+ start: number;
131
+ end: number;
132
+ };
133
+ /**
134
+ * Get the date bytes range for a resolution.
135
+ */
136
+ declare function dateBytesRange(res: ProvenanceMarkResolution): {
137
+ start: number;
138
+ end: number;
139
+ };
140
+ /**
141
+ * Get the info range start for a resolution.
142
+ */
143
+ declare function infoRangeStart(res: ProvenanceMarkResolution): number;
144
+ /**
145
+ * Serialize a Date into bytes based on the resolution.
146
+ */
147
+ declare function serializeDate(res: ProvenanceMarkResolution, date: Date): Uint8Array;
148
+ /**
149
+ * Deserialize bytes into a Date based on the resolution.
150
+ */
151
+ declare function deserializeDate(res: ProvenanceMarkResolution, data: Uint8Array): Date;
152
+ /**
153
+ * Serialize a sequence number into bytes based on the resolution.
154
+ */
155
+ declare function serializeSeq(res: ProvenanceMarkResolution, seq: number): Uint8Array;
156
+ /**
157
+ * Deserialize bytes into a sequence number based on the resolution.
158
+ */
159
+ declare function deserializeSeq(res: ProvenanceMarkResolution, data: Uint8Array): number;
160
+ /**
161
+ * Get the string representation of a resolution.
162
+ */
163
+ declare function resolutionToString(res: ProvenanceMarkResolution): string;
164
+ /**
165
+ * Convert a resolution to CBOR.
166
+ */
167
+ declare function resolutionToCbor(res: ProvenanceMarkResolution): Cbor;
168
+ /**
169
+ * Create a resolution from CBOR.
170
+ */
171
+ declare function resolutionFromCbor(cborValue: Cbor): ProvenanceMarkResolution;
172
+ //#endregion
173
+ //#region src/date.d.ts
174
+ /**
175
+ * Interface for serializable date operations.
176
+ */
177
+ interface SerializableDate {
178
+ serialize2Bytes(): Uint8Array;
179
+ serialize4Bytes(): Uint8Array;
180
+ serialize6Bytes(): Uint8Array;
181
+ }
182
+ /**
183
+ * Serialize a date to 2 bytes (year + month + day only, day precision).
184
+ * Year range: 2023-2150 (128 years)
185
+ * Format: YYYYYYY MMMM DDDDD (7 bits year offset, 4 bits month, 5 bits day)
186
+ */
187
+ declare function serialize2Bytes(date: Date): Uint8Array;
188
+ /**
189
+ * Deserialize 2 bytes to a date.
190
+ */
191
+ declare function deserialize2Bytes(bytes: Uint8Array): Date;
192
+ /**
193
+ * Serialize a date to 4 bytes (seconds since 2001-01-01).
194
+ */
195
+ declare function serialize4Bytes(date: Date): Uint8Array;
196
+ /**
197
+ * Deserialize 4 bytes to a date.
198
+ */
199
+ declare function deserialize4Bytes(bytes: Uint8Array): Date;
200
+ /**
201
+ * Serialize a date to 6 bytes (milliseconds since 2001-01-01).
202
+ */
203
+ declare function serialize6Bytes(date: Date): Uint8Array;
204
+ /**
205
+ * Deserialize 6 bytes to a date.
206
+ */
207
+ declare function deserialize6Bytes(bytes: Uint8Array): Date;
208
+ /**
209
+ * Get the range of valid days in a month.
210
+ */
211
+ declare function rangeOfDaysInMonth(year: number, month: number): {
212
+ min: number;
213
+ max: number;
214
+ };
215
+ /**
216
+ * Format a date as ISO8601 string.
217
+ */
218
+ declare function dateToIso8601(date: Date): string;
219
+ /**
220
+ * Parse an ISO8601 string to a Date.
221
+ */
222
+ declare function dateFromIso8601(str: string): Date;
223
+ /**
224
+ * Format a date as a simple date string (YYYY-MM-DD).
225
+ */
226
+ declare function dateToDateString(date: Date): string;
227
+ //#endregion
228
+ //#region src/crypto-utils.d.ts
229
+ declare const SHA256_SIZE = 32;
230
+ /**
231
+ * Compute SHA-256 hash of data.
232
+ */
233
+ declare function sha256(data: Uint8Array): Uint8Array;
234
+ /**
235
+ * Compute SHA-256 hash and return a prefix of the given length.
236
+ */
237
+ declare function sha256Prefix(data: Uint8Array, prefix: number): Uint8Array;
238
+ /**
239
+ * Extend a key to 32 bytes using HKDF-HMAC-SHA-256.
240
+ */
241
+ declare function extendKey(data: Uint8Array): Uint8Array;
242
+ /**
243
+ * Compute HKDF-HMAC-SHA-256 for the given key material.
244
+ */
245
+ declare function hkdfHmacSha256(keyMaterial: Uint8Array, salt: Uint8Array, keyLen: number): Uint8Array;
246
+ /**
247
+ * Obfuscate (or deobfuscate) a message using ChaCha20.
248
+ * The function is symmetric - applying it twice returns the original message.
249
+ */
250
+ declare function obfuscate(key: Uint8Array, message: Uint8Array): Uint8Array;
251
+ //#endregion
252
+ //#region src/xoshiro256starstar.d.ts
253
+ /**
254
+ * Xoshiro256** PRNG implementation.
255
+ * A fast, high-quality pseudorandom number generator.
256
+ */
257
+ declare class Xoshiro256StarStar {
258
+ private s;
259
+ private constructor();
260
+ /**
261
+ * Get the internal state as an array of 4 u64 values.
262
+ */
263
+ toState(): [bigint, bigint, bigint, bigint];
264
+ /**
265
+ * Create a new PRNG from a state array.
266
+ */
267
+ static fromState(state: [bigint, bigint, bigint, bigint]): Xoshiro256StarStar;
268
+ /**
269
+ * Serialize the state to 32 bytes (little-endian).
270
+ */
271
+ toData(): Uint8Array;
272
+ /**
273
+ * Create a new PRNG from 32 bytes of seed data (little-endian).
274
+ */
275
+ static fromData(data: Uint8Array): Xoshiro256StarStar;
276
+ /**
277
+ * Generate the next u64 value.
278
+ */
279
+ nextU64(): bigint;
280
+ /**
281
+ * Generate the next u32 value (upper bits of u64 for better quality).
282
+ */
283
+ nextU32(): number;
284
+ /**
285
+ * Generate the next byte.
286
+ */
287
+ nextByte(): number;
288
+ /**
289
+ * Generate the next n bytes.
290
+ */
291
+ nextBytes(len: number): Uint8Array;
292
+ /**
293
+ * Fill a buffer with random bytes.
294
+ */
295
+ fillBytes(dest: Uint8Array): void;
296
+ /**
297
+ * The starstar transformation: x * 5, rotate left 7, * 9
298
+ */
299
+ private starstarU64;
300
+ /**
301
+ * Rotate a 64-bit value left by n bits.
302
+ */
303
+ private rotateLeft64;
304
+ /**
305
+ * Advance the PRNG state.
306
+ */
307
+ private advance;
308
+ }
309
+ //#endregion
310
+ //#region src/rng-state.d.ts
311
+ declare const RNG_STATE_LENGTH = 32;
312
+ /**
313
+ * RNG state for provenance marks (32 bytes).
314
+ */
315
+ declare class RngState {
316
+ private readonly data;
317
+ private constructor();
318
+ /**
319
+ * Get the raw bytes.
320
+ */
321
+ toBytes(): Uint8Array;
322
+ /**
323
+ * Create from a 32-byte array.
324
+ */
325
+ static fromBytes(bytes: Uint8Array): RngState;
326
+ /**
327
+ * Create from a slice (validates length).
328
+ */
329
+ static fromSlice(bytes: Uint8Array): RngState;
330
+ /**
331
+ * Get the hex representation.
332
+ */
333
+ hex(): string;
334
+ /**
335
+ * Convert to CBOR (byte string).
336
+ */
337
+ toCbor(): Cbor;
338
+ /**
339
+ * Create from CBOR (byte string).
340
+ */
341
+ static fromCbor(cborValue: Cbor): RngState;
342
+ }
343
+ //#endregion
344
+ //#region src/seed.d.ts
345
+ declare const PROVENANCE_SEED_LENGTH = 32;
346
+ /**
347
+ * A seed for generating provenance marks.
348
+ */
349
+ declare class ProvenanceSeed {
350
+ private readonly data;
351
+ private constructor();
352
+ /**
353
+ * Create a new random seed using secure random number generation.
354
+ */
355
+ static new(): ProvenanceSeed;
356
+ /**
357
+ * Create a new seed using custom random data.
358
+ */
359
+ static newUsing(randomData: Uint8Array): ProvenanceSeed;
360
+ /**
361
+ * Create a new seed from a passphrase.
362
+ */
363
+ static newWithPassphrase(passphrase: string): ProvenanceSeed;
364
+ /**
365
+ * Get the raw bytes.
366
+ */
367
+ toBytes(): Uint8Array;
368
+ /**
369
+ * Create from a 32-byte array.
370
+ */
371
+ static fromBytes(bytes: Uint8Array): ProvenanceSeed;
372
+ /**
373
+ * Create from a slice (validates length).
374
+ */
375
+ static fromSlice(bytes: Uint8Array): ProvenanceSeed;
376
+ /**
377
+ * Get the hex representation.
378
+ */
379
+ hex(): string;
380
+ /**
381
+ * Convert to CBOR (byte string).
382
+ */
383
+ toCbor(): Cbor;
384
+ /**
385
+ * Create from CBOR (byte string).
386
+ */
387
+ static fromCbor(cborValue: Cbor): ProvenanceSeed;
388
+ }
389
+ //#endregion
390
+ //#region src/mark.d.ts
391
+ /**
392
+ * A cryptographically-secured provenance mark.
393
+ */
394
+ declare class ProvenanceMark {
395
+ private readonly _res;
396
+ private readonly _key;
397
+ private readonly _hash;
398
+ private readonly _chainId;
399
+ private readonly _seqBytes;
400
+ private readonly _dateBytes;
401
+ private readonly _infoBytes;
402
+ private readonly _seq;
403
+ private readonly _date;
404
+ private constructor();
405
+ res(): ProvenanceMarkResolution;
406
+ key(): Uint8Array;
407
+ hash(): Uint8Array;
408
+ chainId(): Uint8Array;
409
+ seqBytes(): Uint8Array;
410
+ dateBytes(): Uint8Array;
411
+ seq(): number;
412
+ date(): Date;
413
+ /**
414
+ * Get the message (serialized bytes) of this mark.
415
+ */
416
+ message(): Uint8Array;
417
+ /**
418
+ * Get the info field as CBOR, if present.
419
+ */
420
+ info(): Cbor | undefined;
421
+ /**
422
+ * Create a new provenance mark.
423
+ */
424
+ static new(res: ProvenanceMarkResolution, key: Uint8Array, nextKey: Uint8Array, chainId: Uint8Array, seq: number, date: Date, info?: Cbor): ProvenanceMark;
425
+ /**
426
+ * Create a provenance mark from a serialized message.
427
+ */
428
+ static fromMessage(res: ProvenanceMarkResolution, message: Uint8Array): ProvenanceMark;
429
+ private static makeHash;
430
+ /**
431
+ * Get the first four bytes of the hash as a hex string identifier.
432
+ */
433
+ identifier(): string;
434
+ /**
435
+ * Get the first four bytes of the hash as upper-case ByteWords.
436
+ */
437
+ bytewordsIdentifier(prefix: boolean): string;
438
+ /**
439
+ * Get the first four bytes of the hash as Bytemoji.
440
+ */
441
+ bytemojiIdentifier(prefix: boolean): string;
442
+ /**
443
+ * Check if this mark precedes another mark in the chain.
444
+ */
445
+ precedes(next: ProvenanceMark): boolean;
446
+ /**
447
+ * Check if this mark precedes another mark, throwing on validation errors.
448
+ */
449
+ precedesOpt(next: ProvenanceMark): void;
450
+ /**
451
+ * Check if a sequence of marks is valid.
452
+ */
453
+ static isSequenceValid(marks: ProvenanceMark[]): boolean;
454
+ /**
455
+ * Check if this is a genesis mark (seq 0 and key equals chain_id).
456
+ */
457
+ isGenesis(): boolean;
458
+ /**
459
+ * Encode as bytewords with the given style.
460
+ */
461
+ toBytewordsWithStyle(style: BytewordsStyle): string;
462
+ /**
463
+ * Encode as standard bytewords.
464
+ */
465
+ toBytewords(): string;
466
+ /**
467
+ * Decode from bytewords.
468
+ */
469
+ static fromBytewords(res: ProvenanceMarkResolution, bytewords: string): ProvenanceMark;
470
+ /**
471
+ * Encode for URL (minimal bytewords of CBOR).
472
+ */
473
+ toUrlEncoding(): string;
474
+ /**
475
+ * Decode from URL encoding.
476
+ */
477
+ static fromUrlEncoding(urlEncoding: string): ProvenanceMark;
478
+ /**
479
+ * Build a URL with this mark as a query parameter.
480
+ */
481
+ toUrl(base: string): URL;
482
+ /**
483
+ * Parse a provenance mark from a URL.
484
+ */
485
+ static fromUrl(url: URL): ProvenanceMark;
486
+ /**
487
+ * Get the untagged CBOR representation.
488
+ */
489
+ untaggedCbor(): Cbor;
490
+ /**
491
+ * Get the tagged CBOR representation.
492
+ */
493
+ taggedCbor(): Cbor;
494
+ /**
495
+ * Serialize to CBOR bytes (tagged).
496
+ */
497
+ toCborData(): Uint8Array;
498
+ /**
499
+ * Create from untagged CBOR.
500
+ */
501
+ static fromUntaggedCbor(cborValue: Cbor): ProvenanceMark;
502
+ /**
503
+ * Create from tagged CBOR.
504
+ */
505
+ static fromTaggedCbor(cborValue: Cbor): ProvenanceMark;
506
+ /**
507
+ * Create from CBOR bytes.
508
+ */
509
+ static fromCborData(data: Uint8Array): ProvenanceMark;
510
+ /**
511
+ * Get the fingerprint (SHA-256 of CBOR data).
512
+ */
513
+ fingerprint(): Uint8Array;
514
+ /**
515
+ * Debug string representation.
516
+ */
517
+ toString(): string;
518
+ /**
519
+ * Detailed debug representation.
520
+ */
521
+ toDebugString(): string;
522
+ /**
523
+ * Check equality with another mark.
524
+ */
525
+ equals(other: ProvenanceMark): boolean;
526
+ /**
527
+ * JSON serialization.
528
+ */
529
+ toJSON(): Record<string, unknown>;
530
+ /**
531
+ * Create from JSON object.
532
+ */
533
+ static fromJSON(json: Record<string, unknown>): ProvenanceMark;
534
+ }
535
+ //#endregion
536
+ //#region src/generator.d.ts
537
+ /**
538
+ * Generator for creating provenance mark chains.
539
+ */
540
+ declare class ProvenanceMarkGenerator {
541
+ private readonly _res;
542
+ private readonly _seed;
543
+ private readonly _chainId;
544
+ private _nextSeq;
545
+ private _rngState;
546
+ private constructor();
547
+ res(): ProvenanceMarkResolution;
548
+ seed(): ProvenanceSeed;
549
+ chainId(): Uint8Array;
550
+ nextSeq(): number;
551
+ rngState(): RngState;
552
+ /**
553
+ * Create a new generator with a seed.
554
+ */
555
+ static newWithSeed(res: ProvenanceMarkResolution, seed: ProvenanceSeed): ProvenanceMarkGenerator;
556
+ /**
557
+ * Create a new generator with a passphrase.
558
+ */
559
+ static newWithPassphrase(res: ProvenanceMarkResolution, passphrase: string): ProvenanceMarkGenerator;
560
+ /**
561
+ * Create a new generator with custom random data.
562
+ */
563
+ static newUsing(res: ProvenanceMarkResolution, randomData: Uint8Array): ProvenanceMarkGenerator;
564
+ /**
565
+ * Create a new generator with random seed.
566
+ */
567
+ static newRandom(res: ProvenanceMarkResolution): ProvenanceMarkGenerator;
568
+ /**
569
+ * Create a new generator with all parameters.
570
+ */
571
+ static new(res: ProvenanceMarkResolution, seed: ProvenanceSeed, chainId: Uint8Array, nextSeq: number, rngState: RngState): ProvenanceMarkGenerator;
572
+ /**
573
+ * Generate the next provenance mark in the chain.
574
+ */
575
+ next(date: Date, info?: Cbor): ProvenanceMark;
576
+ /**
577
+ * String representation.
578
+ */
579
+ toString(): string;
580
+ /**
581
+ * JSON serialization.
582
+ */
583
+ toJSON(): Record<string, unknown>;
584
+ /**
585
+ * Create from JSON object.
586
+ */
587
+ static fromJSON(json: Record<string, unknown>): ProvenanceMarkGenerator;
588
+ }
589
+ //#endregion
590
+ //#region src/validate.d.ts
591
+ /**
592
+ * Format for validation report output.
593
+ */
594
+ declare enum ValidationReportFormat {
595
+ /** Human-readable text format */
596
+ Text = "text",
597
+ /** Compact JSON format (no whitespace) */
598
+ JsonCompact = "json-compact",
599
+ /** Pretty-printed JSON format (with indentation) */
600
+ JsonPretty = "json-pretty",
601
+ }
602
+ /**
603
+ * Issue flagged during validation.
604
+ */
605
+ type ValidationIssue = {
606
+ type: "HashMismatch";
607
+ expected: string;
608
+ actual: string;
609
+ } | {
610
+ type: "KeyMismatch";
611
+ } | {
612
+ type: "SequenceGap";
613
+ expected: number;
614
+ actual: number;
615
+ } | {
616
+ type: "DateOrdering";
617
+ previous: string;
618
+ next: string;
619
+ } | {
620
+ type: "NonGenesisAtZero";
621
+ } | {
622
+ type: "InvalidGenesisKey";
623
+ };
624
+ /**
625
+ * Format a validation issue as a string.
626
+ */
627
+ declare function formatValidationIssue(issue: ValidationIssue): string;
628
+ /**
629
+ * A mark with any issues flagged during validation.
630
+ */
631
+ interface FlaggedMark {
632
+ mark: ProvenanceMark;
633
+ issues: ValidationIssue[];
634
+ }
635
+ /**
636
+ * Report for a contiguous sequence of marks within a chain.
637
+ */
638
+ interface SequenceReport {
639
+ startSeq: number;
640
+ endSeq: number;
641
+ marks: FlaggedMark[];
642
+ }
643
+ /**
644
+ * Report for a chain of marks with the same chain ID.
645
+ */
646
+ interface ChainReport {
647
+ chainId: Uint8Array;
648
+ hasGenesis: boolean;
649
+ marks: ProvenanceMark[];
650
+ sequences: SequenceReport[];
651
+ }
652
+ /**
653
+ * Get the chain ID as a hex string for display.
654
+ */
655
+ declare function chainIdHex(report: ChainReport): string;
656
+ /**
657
+ * Complete validation report.
658
+ */
659
+ interface ValidationReport {
660
+ marks: ProvenanceMark[];
661
+ chains: ChainReport[];
662
+ }
663
+ /**
664
+ * Check if the validation report has any issues.
665
+ */
666
+ declare function hasIssues(report: ValidationReport): boolean;
667
+ /**
668
+ * Format the validation report.
669
+ */
670
+ declare function formatReport(report: ValidationReport, format: ValidationReportFormat): string;
671
+ /**
672
+ * Validate a collection of provenance marks.
673
+ */
674
+ declare function validate(marks: ProvenanceMark[]): ValidationReport;
675
+ //#endregion
676
+ //#region src/mark-info.d.ts
677
+ /**
678
+ * Wrapper for a provenance mark with additional display information.
679
+ */
680
+ declare class ProvenanceMarkInfo {
681
+ private readonly _mark;
682
+ private readonly _ur;
683
+ private readonly _bytewords;
684
+ private readonly _bytemoji;
685
+ private readonly _comment;
686
+ private constructor();
687
+ /**
688
+ * Create a new ProvenanceMarkInfo from a mark.
689
+ */
690
+ static new(mark: ProvenanceMark, comment?: string): ProvenanceMarkInfo;
691
+ mark(): ProvenanceMark;
692
+ ur(): UR;
693
+ bytewords(): string;
694
+ bytemoji(): string;
695
+ comment(): string;
696
+ /**
697
+ * Generate a markdown summary of the mark.
698
+ */
699
+ markdownSummary(): string;
700
+ /**
701
+ * JSON serialization.
702
+ */
703
+ toJSON(): Record<string, unknown>;
704
+ /**
705
+ * Create from JSON object.
706
+ */
707
+ static fromJSON(json: Record<string, unknown>): ProvenanceMarkInfo;
708
+ }
709
+ //#endregion
710
+ export { type ChainReport, type FlaggedMark, PROVENANCE_SEED_LENGTH, ProvenanceMark, ProvenanceMarkError, ProvenanceMarkErrorType, ProvenanceMarkGenerator, ProvenanceMarkInfo, ProvenanceMarkResolution, type ProvenanceMarkResult, ProvenanceSeed, RNG_STATE_LENGTH, RngState, SHA256_SIZE, type SequenceReport, type SerializableDate, type ValidationIssue, type ValidationReport, ValidationReportFormat, Xoshiro256StarStar, chainIdHex, chainIdRange, dateBytesLength, dateBytesRange, dateFromIso8601, dateToDateString, dateToIso8601, deserialize2Bytes, deserialize4Bytes, deserialize6Bytes, deserializeDate, deserializeSeq, extendKey, fixedLength, formatReport, formatValidationIssue, hasIssues, hashRange, hkdfHmacSha256, infoRangeStart, keyRange, linkLength, obfuscate, rangeOfDaysInMonth, resolutionFromCbor, resolutionFromNumber, resolutionToCbor, resolutionToNumber, resolutionToString, seqBytesLength, seqBytesRange, serialize2Bytes, serialize4Bytes, serialize6Bytes, serializeDate, serializeSeq, sha256, sha256Prefix, validate };
711
+ //# sourceMappingURL=index.d.mts.map