@gmb/bitmark-parser 6.1.3 → 6.2.0

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,1569 @@
1
+ /** @internal */
2
+ type EnumType<T> = T[keyof T];
3
+ /** Input type enumeration */
4
+ declare const Input: {
5
+ /** Input is as a string */
6
+ readonly string: "string";
7
+ /** Input is as a file path */
8
+ readonly file: "file";
9
+ };
10
+ type InputType = EnumType<typeof Input>;
11
+ /** Output type enumeration */
12
+ declare const Output: {
13
+ /** Output bitmark string */
14
+ readonly bitmark: "bitmark";
15
+ /** Output JSON as a plain JS object, or a file */
16
+ readonly json: "json";
17
+ /** Output AST as a plain JS object, or a file */
18
+ readonly ast: "ast";
19
+ /** Output plain text as a string, or a file */
20
+ readonly text: "text";
21
+ };
22
+ type OutputType = EnumType<typeof Output>;
23
+ /** Input format enumeration */
24
+ declare const InputFormat: {
25
+ readonly bitmark: "bitmark";
26
+ readonly bitmarkText: "bitmarkText";
27
+ readonly plainText: "plainText";
28
+ readonly html: "html";
29
+ };
30
+ type InputFormatType = EnumType<typeof InputFormat>;
31
+ declare const BitmarkVersion: {
32
+ readonly v2: 2;
33
+ readonly v3: 3;
34
+ };
35
+ type BitmarkVersionType = EnumType<typeof BitmarkVersion>;
36
+ declare const CardSetVersion: {
37
+ readonly v1: 1;
38
+ readonly v2: 2;
39
+ };
40
+ type CardSetVersionType = EnumType<typeof CardSetVersion>;
41
+ declare const BitmarkParserType: {
42
+ readonly peggy: "peggy";
43
+ };
44
+ type BitmarkParserTypeType = EnumType<typeof BitmarkParserType>;
45
+ declare const InfoType: {
46
+ readonly list: "list";
47
+ readonly deprecated: "deprecated";
48
+ readonly all: "all";
49
+ readonly bit: "bit";
50
+ };
51
+ type InfoTypeType = EnumType<typeof InfoType>;
52
+ declare const InfoFormat: {
53
+ readonly text: "text";
54
+ readonly json: "json";
55
+ readonly pojo: "pojo";
56
+ };
57
+ type InfoFormatType = EnumType<typeof InfoFormat>;
58
+ declare const BodyTextFormat: {
59
+ readonly plainText: "text";
60
+ readonly latex: "latex";
61
+ readonly json: "json";
62
+ readonly xml: "xml";
63
+ readonly bitmarkPlusPlus: "bitmark++";
64
+ };
65
+ type BodyTextFormatType = EnumType<typeof BodyTextFormat>;
66
+ declare const TextLocation: {
67
+ readonly tag: "tag";
68
+ readonly body: "body";
69
+ };
70
+ type TextLocationType = EnumType<typeof TextLocation>;
71
+ /** Options for the output file (Node only) */
72
+ interface FileOptions {
73
+ /** Append to a file if true, otherwise overwrite */
74
+ append?: boolean;
75
+ /** Character encoding, defaults to 'utf8' */
76
+ encoding?: string;
77
+ }
78
+ /** Options for bitmark generation */
79
+ interface BitmarkOptions {
80
+ explicitTextFormat?: boolean;
81
+ prettifyJson?: boolean | number;
82
+ cardSetVersion?: CardSetVersionType;
83
+ spacesAroundValues?: number | boolean;
84
+ debugGenerationInline?: boolean;
85
+ noBreakscaping?: boolean;
86
+ }
87
+ /** Options for JSON generation */
88
+ interface JsonOptions {
89
+ enableWarnings?: boolean | number;
90
+ prettify?: boolean | number;
91
+ stringify?: boolean;
92
+ textAsPlainText?: boolean;
93
+ excludeUnknownProperties?: boolean;
94
+ debugGenerationInline?: boolean;
95
+ }
96
+ /** Options for bitmark text JSON generation */
97
+ interface TextJsonOptions {
98
+ prettify?: boolean | number;
99
+ }
100
+ /** Info options for the parser */
101
+ interface InfoOptions {
102
+ type?: InfoTypeType;
103
+ bit?: string;
104
+ outputFormat?: InfoFormatType;
105
+ prettify?: boolean | number;
106
+ }
107
+ /** Conversion options for bitmark / JSON conversion */
108
+ interface ConvertOptions {
109
+ bitmarkVersion?: BitmarkVersionType;
110
+ bitmarkParserType?: BitmarkParserTypeType;
111
+ inputFormat?: InputType;
112
+ outputFormat?: OutputType;
113
+ outputFile?: string;
114
+ fileOptions?: FileOptions;
115
+ bitmarkOptions?: BitmarkOptions;
116
+ jsonOptions?: JsonOptions;
117
+ }
118
+ /** Prettify options for bitmark / JSON prettify / validate */
119
+ interface UpgradeOptions {
120
+ bitmarkVersion?: BitmarkVersionType;
121
+ bitmarkParserType?: BitmarkParserTypeType;
122
+ inputFormat?: InputType;
123
+ outputFile?: string;
124
+ fileOptions?: FileOptions;
125
+ bitmarkOptions?: BitmarkOptions;
126
+ jsonOptions?: JsonOptions;
127
+ }
128
+ /** Conversion options for bitmark text / JSON conversion */
129
+ interface ConvertTextOptions {
130
+ textFormat?: BodyTextFormatType;
131
+ textLocation?: TextLocationType;
132
+ inputFormat?: InputType;
133
+ outputFile?: string;
134
+ fileOptions?: FileOptions;
135
+ jsonOptions?: TextJsonOptions;
136
+ }
137
+ /** Create AST options */
138
+ interface CreateAstOptions {
139
+ inputFormat?: InputType;
140
+ }
141
+ interface ExtractPlainTextOptions {
142
+ inputFormat?: InputFormatType;
143
+ }
144
+ /** Options for convertHtmlTable */
145
+ interface ConvertHtmlTableOptions {
146
+ inputFormat?: InputFormatType;
147
+ outputFormat?: OutputType | "html";
148
+ tableFormat?: string;
149
+ keepUnknownTags?: boolean;
150
+ noBreakscaping?: boolean;
151
+ outputFile?: string;
152
+ fileOptions?: FileOptions;
153
+ bitmarkOptions?: BitmarkOptions;
154
+ jsonOptions?: JsonOptions;
155
+ }
156
+ /** Breakscape options */
157
+ interface BreakscapeOptions {
158
+ inputFormat?: InputType;
159
+ outputFile?: string;
160
+ fileOptions?: FileOptions;
161
+ textFormat?: BodyTextFormatType;
162
+ textLocation?: TextLocationType;
163
+ }
164
+ /** Unbreakscape options */
165
+ interface UnbreakscapeOptions {
166
+ inputFormat?: InputType;
167
+ outputFile?: string;
168
+ fileOptions?: FileOptions;
169
+ textFormat?: BodyTextFormatType;
170
+ textLocation?: TextLocationType;
171
+ }
172
+
173
+ interface LegacyPseudoAst {
174
+ bits: unknown[];
175
+ }
176
+ declare function isPseudoAst(v: unknown): v is LegacyPseudoAst;
177
+
178
+ /** Classified input for the convert/upgrade pipeline (PLAN-126 F-10). */
179
+ interface ResolvedInput {
180
+ /** JSON-wrapper-array string (json/ast input) or bitmark source (bitmark input). */
181
+ source: string;
182
+ isBitmark: boolean;
183
+ }
184
+ declare class BitmarkParserGenerator {
185
+ /**
186
+ * Get the version of the library.
187
+ *
188
+ * Reports the @gmb/bitmark-parser version (not a bpg version string).
189
+ */
190
+ version(): string;
191
+ /**
192
+ * Convert bitmark from bitmark to JSON, or JSON to bitmark (bpg-compatible).
193
+ *
194
+ * Input detection order matches bpg: AST → JSON → assume bitmark.
195
+ * Default output: bitmark input → json; json/ast input → bitmark.
196
+ */
197
+ convert(input: string | unknown, options?: ConvertOptions): string | unknown | void;
198
+ /**
199
+ * Upgrade (prettify / canonicalize) bitmark or JSON to the latest version
200
+ * of itself (bpg-compatible `upgrade`).
201
+ */
202
+ upgrade(input: string | unknown, options?: UpgradeOptions): string | unknown | void;
203
+ /**
204
+ * Get information about the bitmark language (bpg-compatible `info`).
205
+ */
206
+ info(options?: InfoOptions): unknown;
207
+ /** Not supported: bpg-internal development tool. */
208
+ generateConfig(_options?: unknown): void;
209
+ /**
210
+ * Convert between HTML tables and bitmark tables (bpg-compatible
211
+ * `convertHtmlTable`).
212
+ *
213
+ * Backed by the core's schema-driven html mapping: HTML input has each
214
+ * `<table>` wrapped in the core's `<bitmark-bit>` envelope and parsed;
215
+ * bits input is emitted as html and the `<table>` fragments extracted
216
+ * (the envelope stripped). The markup *inside* `<table>` follows this
217
+ * parser's html mapping, which may differ from bpg's in detail.
218
+ */
219
+ convertHtmlTable(input: string | unknown, options?: ConvertHtmlTableOptions): string | unknown | void;
220
+ /**
221
+ * Create a bit-JSON pseudo-AST from bitmark or JSON input (PLAN-126 §3.1).
222
+ *
223
+ * NOTE: the returned structure is the bit JSON (wrapper entries), not
224
+ * bpg's internal TS AST node model. It round-trips through `convert` but
225
+ * is not walkable with bpg's `Ast`/`NodeType`.
226
+ */
227
+ createAst(input: unknown, options?: CreateAstOptions): LegacyPseudoAst;
228
+ /**
229
+ * Breakscape text (bpg-compatible `breakscapeText`).
230
+ */
231
+ breakscapeText(input: string, options?: BreakscapeOptions): string | void;
232
+ /**
233
+ * Unbreakscape text (bpg-compatible `unbreakscapeText`).
234
+ */
235
+ unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void;
236
+ /**
237
+ * Convert bitmark text ↔ text AST (bpg-compatible `convertText`).
238
+ *
239
+ * Direction is auto-detected: TextAst (JSON) input generates bitmark
240
+ * text; anything else parses as bitmark text and returns the TextAst
241
+ * (plain JS object; a string when `jsonOptions.prettify` is set).
242
+ */
243
+ convertText(input: string | unknown, options?: ConvertTextOptions): string | unknown | void;
244
+ /**
245
+ * Convert a text AST to plain text (bpg-compatible `textAstToPlainText`).
246
+ */
247
+ textAstToPlainText(textAst: unknown, _options?: ExtractPlainTextOptions): string;
248
+ /**
249
+ * Extract plain text from bitmark or bitmark JSON (bpg-compatible).
250
+ */
251
+ extractPlainText(input: string | unknown, options?: ExtractPlainTextOptions): string;
252
+ /** If `s` parses as a TextAst JSON array, return it. */
253
+ private parseTextAstString;
254
+ /**
255
+ * Resolve bpg input (string | file path | JSON value | pseudo-AST) to a
256
+ * source string for the WASM core, classified per bpg's detection order:
257
+ * AST → JSON → assume bitmark (PLAN-126 F-10).
258
+ */
259
+ protected resolveInput(input: unknown, inputFormat: string | undefined): ResolvedInput;
260
+ /**
261
+ * Normalise the JSON shapes bpg accepts to a bits/entries array:
262
+ * wrapper array, `{ bits: [...] }` AST envelope, single `{ bit: ... }`
263
+ * wrapper, or a bare bit object (`{ type: ... }`).
264
+ */
265
+ private jsonEntries;
266
+ /**
267
+ * Normalise a pseudo-AST bits entry to a `{ bit, parser? }` wrapper.
268
+ * `Builder.buildBit` returns bare bit JSON (with any parser metadata
269
+ * attached under a non-enumerable symbol); parsed forward output is
270
+ * already wrapper-shaped.
271
+ */
272
+ private toWrapperEntry;
273
+ /** bpg parity: read `input` as a file when it names one (Node only). */
274
+ protected maybeReadFile(input: string, inputFormat: string | undefined): string;
275
+ /** bpg parity: writing a file is impossible in the browser. */
276
+ protected checkBrowserFileWrite(outputFile: string | undefined): void;
277
+ /** Return `data`, or write it to `outputFile` (returning void), as bpg does. */
278
+ protected deliver(data: string, outputFile?: string, fileOptions?: FileOptions): string | void;
279
+ /** The core reports failures as `error:`-prefixed strings; bpg throws. */
280
+ protected throwOnError(out: string): void;
281
+ }
282
+ /**
283
+ * Direct bitmark text parser (bpg-compatible `bitmarkTextParse`):
284
+ * bitmark text → TextAst array.
285
+ */
286
+ declare function bitmarkTextParse(text: string): unknown[];
287
+
288
+ type BitTypeType = string;
289
+ type TextFormatType = string;
290
+ type ResourceTypeType = string;
291
+ type TextMarkTypeType = string;
292
+ type TextNodeTypeType = string;
293
+ type ConfigKeyType = string;
294
+ interface ParserLocation {
295
+ offset: number;
296
+ line: number;
297
+ column: number;
298
+ }
299
+ interface ParserError {
300
+ message: string;
301
+ text?: string;
302
+ location?: {
303
+ start: ParserLocation;
304
+ end: ParserLocation;
305
+ };
306
+ original?: {
307
+ text?: string;
308
+ location?: {
309
+ start: ParserLocation;
310
+ end: ParserLocation;
311
+ };
312
+ };
313
+ }
314
+ interface ParserInfo {
315
+ version?: string;
316
+ bitmarkVersion?: string;
317
+ textParserVersion?: string;
318
+ warnings?: ParserError[];
319
+ errors?: ParserError[];
320
+ }
321
+
322
+ interface BuildBitOptions {
323
+ cardSet?: {
324
+ sideNo: number;
325
+ variantNo: number;
326
+ };
327
+ }
328
+ declare class Builder {
329
+ /**
330
+ * Build bitmark AST envelope (bpg-compatible `buildBitmark`).
331
+ */
332
+ buildBitmark(data: {
333
+ bits?: unknown[];
334
+ errors?: ParserError[];
335
+ }): LegacyPseudoAst;
336
+ /**
337
+ * Build a bit (bpg-compatible `buildBit`).
338
+ *
339
+ * Accepts the full bpg data shape (flat, ~250 optional fields, values in
340
+ * the JSON model types). Returns the normalized bit JSON. Throws
341
+ * `No config found for bit: X` for unknown bit types, as bpg does.
342
+ *
343
+ * NOTE (documented divergences from bpg):
344
+ * - the return value is bit JSON, not bpg's internal AST node model;
345
+ * - `resourceType` (an inference hint in bpg) is not carried into the
346
+ * JSON — the attached `resource` object is authoritative;
347
+ * - more than one entry in `resources` passes through under a
348
+ * `resources` key (kept visible, not silently dropped) — the canonical
349
+ * single attachment is `resource`.
350
+ */
351
+ buildBit(data: Record<string, unknown>, _options?: BuildBitOptions): Record<string, unknown>;
352
+ /**
353
+ * Build a highlight body bit (bpg-compatible `buildHighlight`).
354
+ * Shapes the HighlightJson body-bit; unset optionals are omitted.
355
+ */
356
+ buildHighlight(_context: unknown, data: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
357
+ /**
358
+ * bpg's builder parses string-valued JsonText fields as bitmark text
359
+ * (inline marks become TextAst marks); the composer would otherwise treat
360
+ * them as literal text. Converts top-level JsonText fields in place.
361
+ * Nested (card-content) strings are left literal — documented divergence.
362
+ */
363
+ private parseStringTexts;
364
+ /** Throw bpg's exact unknown-bit-type error (`Config.getBitConfig` parity). */
365
+ private assertKnownBitType;
366
+ }
367
+
368
+ type ResourceMethod = (context: unknown, data: Record<string, unknown> | undefined, __typeAlias?: string) => Record<string, unknown> | undefined;
369
+ /** bpg-compatible ResourceBuilder: 17 `<family>Resource(context, data)` methods
370
+ * plus the generic `resourceFromResourceJson` / `resourceFromResourceDataJson`. */
371
+ declare class ResourceBuilder {
372
+ /**
373
+ * Normalise existing ResourceJson wrapper(s) (bpg-compatible).
374
+ * Unknown resource types are dropped (bpg parity: it skips invalid types).
375
+ */
376
+ resourceFromResourceJson(_context: unknown, resource?: Record<string, unknown> | Record<string, unknown>[]): unknown;
377
+ /**
378
+ * Build a resource wrapper from a bare ResourceDataJson (bpg-compatible).
379
+ * `data` may also be a plain string (used as the url/src/body value).
380
+ */
381
+ resourceFromResourceDataJson(context: unknown, type: string, data?: Record<string, unknown> | string): Record<string, unknown> | undefined;
382
+ imageResource: ResourceMethod;
383
+ imageLinkResource: ResourceMethod;
384
+ audioResource: ResourceMethod;
385
+ audioEmbedResource: ResourceMethod;
386
+ audioLinkResource: ResourceMethod;
387
+ videoResource: ResourceMethod;
388
+ videoEmbedResource: ResourceMethod;
389
+ videoLinkResource: ResourceMethod;
390
+ stillImageFilmEmbedResource: ResourceMethod;
391
+ stillImageFilmLinkResource: ResourceMethod;
392
+ articleResource: ResourceMethod;
393
+ documentResource: ResourceMethod;
394
+ documentEmbedResource: ResourceMethod;
395
+ documentLinkResource: ResourceMethod;
396
+ documentDownloadResource: ResourceMethod;
397
+ appLinkResource: ResourceMethod;
398
+ websiteLinkResource: ResourceMethod;
399
+ }
400
+
401
+ /** Error thrown for bpg API members / options the legacy facade does not support. */
402
+ declare class LegacyUnsupportedError extends Error {
403
+ constructor(message: string);
404
+ }
405
+
406
+ /** Vendored from bpg v5.31.1 model/enum/TextMarkType.ts. */
407
+ declare const TextMarkType: {
408
+ readonly bold: "bold";
409
+ readonly light: "light";
410
+ readonly italic: "italic";
411
+ readonly highlight: "highlight";
412
+ readonly highlightOrange: "highlightOrange";
413
+ readonly highlightYellow: "highlightYellow";
414
+ readonly highlightGreen: "highlightGreen";
415
+ readonly highlightBlue: "highlightBlue";
416
+ readonly highlightPurple: "highlightPurple";
417
+ readonly highlightPink: "highlightPink";
418
+ readonly highlightBrown: "highlightBrown";
419
+ readonly highlightBlack: "highlightBlack";
420
+ readonly highlightWhite: "highlightWhite";
421
+ readonly highlightGray: "highlightGray";
422
+ readonly strike: "strike";
423
+ readonly subscript: "subscript";
424
+ readonly superscript: "superscript";
425
+ readonly ins: "ins";
426
+ readonly del: "del";
427
+ readonly underline: "underline";
428
+ readonly doubleUnderline: "doubleUnderline";
429
+ readonly circle: "circle";
430
+ readonly languageEmRed: "languageEmRed";
431
+ readonly languageEmOrange: "languageEmOrange";
432
+ readonly languageEmYellow: "languageEmYellow";
433
+ readonly languageEmGreen: "languageEmGreen";
434
+ readonly languageEmBlue: "languageEmBlue";
435
+ readonly languageEmPurple: "languageEmPurple";
436
+ readonly languageEmPink: "languageEmPink";
437
+ readonly languageEmBrown: "languageEmBrown";
438
+ readonly languageEmBlack: "languageEmBlack";
439
+ readonly languageEmWhite: "languageEmWhite";
440
+ readonly languageEmGray: "languageEmGray";
441
+ readonly languageEm: "languageEm";
442
+ readonly userUnderline: "userUnderline";
443
+ readonly userDoubleUnderline: "userDoubleUnderline";
444
+ readonly userStrike: "userStrike";
445
+ readonly userCircle: "userCircle";
446
+ readonly userHighlight: "userHighlight";
447
+ readonly notranslate: "notranslate";
448
+ readonly link: "link";
449
+ readonly ref: "ref";
450
+ readonly xref: "xref";
451
+ readonly extref: "extref";
452
+ readonly footnote: "footnote";
453
+ readonly footnoteStar: "footnote*";
454
+ readonly symbol: "symbol";
455
+ readonly var: "var";
456
+ readonly code: "code";
457
+ readonly timer: "timer";
458
+ readonly duration: "duration";
459
+ readonly color: "color";
460
+ readonly colorPicker: "colorPicker";
461
+ readonly comment: "comment";
462
+ };
463
+ /** Vendored from bpg v5.31.1 model/enum/TextNodeType.ts. */
464
+ declare const TextNodeType: {
465
+ readonly text: "text";
466
+ readonly hardBreak: "hardBreak";
467
+ readonly paragraph: "paragraph";
468
+ readonly heading: "heading";
469
+ readonly section: "section";
470
+ readonly noBulletList: "noBulletList";
471
+ readonly bulletList: "bulletList";
472
+ readonly orderedList: "orderedList";
473
+ readonly orderedListRoman: "orderedListRoman";
474
+ readonly orderedListRomanLower: "orderedListRomanLower";
475
+ readonly letteredList: "letteredList";
476
+ readonly letteredListLower: "letteredListLower";
477
+ readonly taskList: "taskList";
478
+ readonly listItem: "listItem";
479
+ readonly taskItem: "taskItem";
480
+ readonly image: "image";
481
+ readonly imageInline: "imageInline";
482
+ readonly codeBlock: "codeBlock";
483
+ readonly latex: "latex";
484
+ readonly gap: "gap";
485
+ readonly select: "select";
486
+ readonly highlight: "highlight";
487
+ readonly mark: "mark";
488
+ };
489
+ /**
490
+ * bpg-compatible `BitType` enum object, built lazily from the core's
491
+ * config (`info`) rather than a hardcoded list. Keys are the camelCase of
492
+ * the bit names, exactly as bpg derives them.
493
+ */
494
+ declare const BitType: Record<string, string>;
495
+ /** bpg `NodeType` — names bpg's internal AST nodes; the legacy AST is bit JSON. */
496
+ declare const NodeType: Record<string, string>;
497
+ /** bpg `BoundingBoxIndex` — bpg-internal utility. */
498
+ declare const BoundingBoxIndex: Record<string, string>;
499
+
500
+ /** bpg `Ast` walker — unsupported (PLAN-126 decision Q-7). */
501
+ declare const Ast: new (...args: unknown[]) => never;
502
+ declare const BitmarkGenerator: new (...args: unknown[]) => never;
503
+ declare const BitmarkStringGenerator: new (...args: unknown[]) => never;
504
+ declare const BitmarkFileGenerator: new (...args: unknown[]) => never;
505
+ declare const JsonGenerator: new (...args: unknown[]) => never;
506
+ declare const JsonStringGenerator: new (...args: unknown[]) => never;
507
+ declare const JsonFileGenerator: new (...args: unknown[]) => never;
508
+ declare const HtmlTableGenerator: new (...args: unknown[]) => never;
509
+ declare const HtmlTableParser: new (...args: unknown[]) => never;
510
+ declare const BitmarkParser: new (...args: unknown[]) => never;
511
+ declare const JsonParser: new (...args: unknown[]) => never;
512
+ declare const StringWriter: new (...args: unknown[]) => never;
513
+ declare const FileWriter: new (...args: unknown[]) => never;
514
+ declare const StreamWriter: new (...args: unknown[]) => never;
515
+
516
+ type JsonText = string | TextAst;
517
+ type TextAst = TextNode[];
518
+ interface TextNode {
519
+ type: TextNodeTypeType;
520
+ marks?: TextMark[];
521
+ text?: string;
522
+ content?: TextNode[];
523
+ parent?: TextNodeTypeType;
524
+ attrs?: TextNodeAttibutes;
525
+ }
526
+ interface TextMark {
527
+ type: TextMarkTypeType;
528
+ attrs?: TextMarkAttibutes;
529
+ }
530
+ interface LinkMark {
531
+ type: 'link';
532
+ attrs?: LinkMarkAttibutes;
533
+ }
534
+ interface CommentMark {
535
+ type: 'comment';
536
+ comment: string;
537
+ }
538
+ interface RefMark {
539
+ type: 'ref';
540
+ attrs?: RefMarkAttibutes;
541
+ }
542
+ interface XRefMark {
543
+ type: 'xref';
544
+ attrs?: XRefMarkAttibutes;
545
+ }
546
+ interface ExtRefMark {
547
+ type: 'extref';
548
+ attrs?: ExtRefMarkAttibutes;
549
+ }
550
+ interface FootnoteMark {
551
+ type: 'footnote';
552
+ attrs?: FootnoteAttibutes;
553
+ }
554
+ interface SymbolMark {
555
+ type: 'symbol';
556
+ attrs?: SymbolMarkAttibutes;
557
+ }
558
+ interface HeadingTextNode extends TextNode {
559
+ type: 'heading';
560
+ attrs?: HeadingTextNodeAttributes;
561
+ }
562
+ interface SectionTextNode extends TextNode {
563
+ type: 'heading';
564
+ section: string;
565
+ }
566
+ interface TaskItemTextNode extends TextNode {
567
+ type: 'taskItem';
568
+ attrs?: TaskItemTextNodeAttributes;
569
+ }
570
+ interface ImageTextNode extends TextNode {
571
+ type: 'image';
572
+ attrs?: ImageTextNodeAttributes;
573
+ }
574
+ interface ImageInlineTextNode extends TextNode {
575
+ type: 'imageInline';
576
+ attrs?: ImageTextNodeAttributes;
577
+ }
578
+ interface CodeBlockTextNode extends TextNode {
579
+ type: 'codeBlock';
580
+ attrs?: CodeBlockTextNodeAttributes;
581
+ }
582
+ interface LatexTextNode extends TextNode {
583
+ type: 'latex';
584
+ attrs?: LatexTextNodeAttributes;
585
+ }
586
+ interface ListTextNode extends TextNode {
587
+ type: 'noBulletList' | 'bulletList' | 'orderedList' | 'orderedListRoman' | 'orderedListRomanLower' | 'letteredList' | 'letteredListLower';
588
+ attrs?: ListTextNodeAttributes;
589
+ }
590
+ interface TextNodeAttibutes {
591
+ section: string;
592
+ }
593
+ interface HeadingTextNodeAttributes extends TextNodeAttibutes {
594
+ level: number;
595
+ }
596
+ interface TaskItemTextNodeAttributes extends TextNodeAttibutes {
597
+ checked: boolean;
598
+ }
599
+ interface ImageTextNodeAttributes extends TextNodeAttibutes, MediaAttributes {
600
+ }
601
+ interface CodeBlockTextNodeAttributes extends TextNodeAttibutes {
602
+ language: string;
603
+ }
604
+ interface LatexTextNodeAttributes extends TextNodeAttibutes {
605
+ formula: string;
606
+ }
607
+ interface ListTextNodeAttributes extends TextNodeAttibutes {
608
+ start: number;
609
+ }
610
+ interface TextMarkAttibutes {
611
+ }
612
+ interface LinkMarkAttibutes extends TextMarkAttibutes {
613
+ href: string;
614
+ target: string;
615
+ }
616
+ interface RefMarkAttibutes extends TextMarkAttibutes {
617
+ reference: string;
618
+ }
619
+ interface XRefMarkAttibutes extends TextMarkAttibutes {
620
+ xref: string;
621
+ reference: string;
622
+ }
623
+ interface ExtRefMarkAttibutes extends TextMarkAttibutes, MediaAttributes {
624
+ extref: string;
625
+ references: string[];
626
+ provider: string;
627
+ }
628
+ interface FootnoteAttibutes extends TextMarkAttibutes {
629
+ content: TextNode[];
630
+ }
631
+ interface SymbolMarkAttibutes extends TextMarkAttibutes, MediaAttributes {
632
+ }
633
+ interface MediaAttributes {
634
+ src: string;
635
+ alt: string | null;
636
+ title: string | null;
637
+ textAlign: string;
638
+ width: string | number | null;
639
+ height: string | number | null;
640
+ class: string;
641
+ comment: string;
642
+ }
643
+
644
+ interface BodyBitsJson {
645
+ [key: string]: BodyBitJson;
646
+ }
647
+ type BodyBitJson = TextNode | GapJson | MarkJson | SelectJson | HighlightJson;
648
+ interface BaseBodyBitJson {
649
+ type: string;
650
+ item: JsonText;
651
+ lead: JsonText;
652
+ hint: JsonText;
653
+ instruction: JsonText;
654
+ isExample: boolean;
655
+ example: ExampleJson;
656
+ __defaultExample?: ExampleJson;
657
+ attrs: Record<string, unknown>;
658
+ }
659
+ interface GapJson extends BaseBodyBitJson {
660
+ type: 'gap';
661
+ solutions: string[];
662
+ item: JsonText;
663
+ lead: JsonText;
664
+ hint: JsonText;
665
+ instruction: JsonText;
666
+ isCaseSensitive: boolean;
667
+ isExample: boolean;
668
+ example: ExampleJson;
669
+ __solutionsAst?: TextAst[];
670
+ __isDefaultExample?: boolean;
671
+ __defaultExample?: ExampleJson;
672
+ }
673
+ interface MarkJson extends BaseBodyBitJson {
674
+ type: 'mark';
675
+ solution: string;
676
+ mark: string;
677
+ isExample: boolean;
678
+ example: ExampleJson;
679
+ __isDefaultExample?: boolean;
680
+ __defaultExample?: ExampleJson;
681
+ }
682
+ interface SelectJson extends BaseBodyBitJson {
683
+ type: 'select';
684
+ options: SelectOptionJson[];
685
+ prefix: string;
686
+ postfix: string;
687
+ isExample: boolean;
688
+ __hintString?: string;
689
+ __instructionString?: string;
690
+ }
691
+ interface SelectOptionJson {
692
+ text: string;
693
+ isCorrect: boolean;
694
+ item: JsonText;
695
+ lead: JsonText;
696
+ hint: JsonText;
697
+ instruction: JsonText;
698
+ isExample: boolean;
699
+ example: ExampleJson;
700
+ __isDefaultExample?: boolean;
701
+ __defaultExample?: ExampleJson;
702
+ }
703
+ interface HighlightJson extends BaseBodyBitJson {
704
+ type: 'highlight';
705
+ texts: HighlightTextJson[];
706
+ prefix: string;
707
+ postfix: string;
708
+ }
709
+ interface HighlightTextJson {
710
+ text: string;
711
+ isHighlighted: boolean;
712
+ isCorrect: boolean;
713
+ item: JsonText;
714
+ lead: JsonText;
715
+ hint: JsonText;
716
+ instruction: JsonText;
717
+ isExample: boolean;
718
+ example: ExampleJson;
719
+ __isDefaultExample?: boolean;
720
+ __defaultExample?: ExampleJson;
721
+ }
722
+
723
+ type ResourceDataJson = ImageResourceJson & ImageResponsiveResourceJson & ImageLinkResourceJson & AudioResourceJson & AudioEmbedResourceJson & AudioLinkResourceJson & VideoResourceJson & VideoEmbedResourceJson & VideoLinkResourceJson & StillImageFilmResourceJson & StillImageFilmEmbedResourceJson & StillImageFilmLinkResourceJson & ArticleResourceJson & DocumentResourceJson & DocumentEmbedResourceJson & DocumentLinkResourceJson & DocumentDownloadResourceJson & AppLinkResourceJson & WebsiteLinkResourceJson;
724
+ type ResourceJson = ImageResourceWrapperJson | ImageResponsiveResourceWrapperJson | ImageLinkResourceWrapperJson | AudioResourceWrapperJson | AudioEmbedResourceWrapperJson | AudioLinkResourceWrapperJson | VideoResourceWrapperJson | VideoEmbedResourceWrapperJson | VideoLinkResourceWrapperJson | StillImageFilmResourceWrapperJson | StillImageFilmEmbedResourceWrapperJson | StillImageFilmLinkResourceWrapperJson | ArticleResourceWrapperJson | DocumentResourceWrapperJson | DocumentEmbedResourceWrapperJson | DocumentLinkResourceWrapperJson | DocumentDownloadResourceWrapperJson | AppLinkResourceWrapperJson | WebsiteLinkResourceWrapperJson;
725
+ interface ResourceWrapperJson {
726
+ type: ResourceTypeType;
727
+ __typeAlias: ResourceTypeType;
728
+ __configKey: ConfigKeyType;
729
+ __invalid?: boolean;
730
+ __excessResource?: boolean;
731
+ }
732
+ interface ImageResourceWrapperJson extends ResourceWrapperJson {
733
+ type: 'image';
734
+ image: ImageResourceJson;
735
+ }
736
+ interface ImageResponsiveResourceWrapperJson extends ResourceWrapperJson {
737
+ type: 'image-responsive';
738
+ imagePortrait: ImageResourceJson;
739
+ imageLandscape: ImageResourceJson;
740
+ }
741
+ interface ImageLinkResourceWrapperJson extends ResourceWrapperJson {
742
+ type: 'image-link';
743
+ imageLink: ImageLinkResourceJson;
744
+ }
745
+ interface AudioResourceWrapperJson extends ResourceWrapperJson {
746
+ type: 'audio';
747
+ audio: AudioResourceJson;
748
+ }
749
+ interface AudioEmbedResourceWrapperJson extends ResourceWrapperJson {
750
+ type: 'audio-embed';
751
+ audioEmbed: AudioEmbedResourceJson;
752
+ }
753
+ interface AudioLinkResourceWrapperJson extends ResourceWrapperJson {
754
+ type: 'audio-link';
755
+ audioLink: AudioLinkResourceJson;
756
+ }
757
+ interface VideoResourceWrapperJson extends ResourceWrapperJson {
758
+ type: 'video';
759
+ video: VideoResourceJson;
760
+ }
761
+ interface VideoEmbedResourceWrapperJson extends ResourceWrapperJson {
762
+ type: 'video-embed';
763
+ videoEmbed: VideoEmbedResourceJson;
764
+ }
765
+ interface VideoLinkResourceWrapperJson extends ResourceWrapperJson {
766
+ type: 'video-link';
767
+ videoLink: VideoLinkResourceJson;
768
+ }
769
+ interface StillImageFilmResourceWrapperJson extends ResourceWrapperJson {
770
+ type: 'still-image-film';
771
+ image: ImageResourceJson;
772
+ audio: AudioResourceJson;
773
+ }
774
+ interface StillImageFilmEmbedResourceWrapperJson extends ResourceWrapperJson {
775
+ type: 'still-image-film-embed';
776
+ stillImageFilmEmbed: StillImageFilmEmbedResourceJson;
777
+ }
778
+ interface StillImageFilmLinkResourceWrapperJson extends ResourceWrapperJson {
779
+ type: 'still-image-film-link';
780
+ stillImageFilmLink: StillImageFilmLinkResourceJson;
781
+ }
782
+ interface ArticleResourceWrapperJson extends ResourceWrapperJson {
783
+ type: 'article';
784
+ article: ArticleResourceJson;
785
+ }
786
+ interface DocumentResourceWrapperJson extends ResourceWrapperJson {
787
+ type: 'document';
788
+ document: DocumentResourceJson;
789
+ }
790
+ interface DocumentEmbedResourceWrapperJson extends ResourceWrapperJson {
791
+ type: 'document-embed';
792
+ documentEmbed: DocumentEmbedResourceJson;
793
+ }
794
+ interface DocumentLinkResourceWrapperJson extends ResourceWrapperJson {
795
+ type: 'document-link';
796
+ documentLink: DocumentLinkResourceJson;
797
+ }
798
+ interface DocumentDownloadResourceWrapperJson extends ResourceWrapperJson {
799
+ type: 'document-download';
800
+ documentDownload: DocumentDownloadResourceJson;
801
+ }
802
+ interface AppLinkResourceWrapperJson extends ResourceWrapperJson {
803
+ type: 'app-link';
804
+ appLink: AppLinkResourceJson;
805
+ }
806
+ interface WebsiteLinkResourceWrapperJson extends ResourceWrapperJson {
807
+ type: 'website-link';
808
+ websiteLink: WebsiteLinkResourceJson;
809
+ }
810
+ interface BaseResourceJson {
811
+ license: string;
812
+ copyright: string;
813
+ provider: string;
814
+ showInIndex: boolean;
815
+ caption: JsonText;
816
+ search: string;
817
+ srcAlt: string[];
818
+ selected: boolean;
819
+ }
820
+ interface ImageResourceJson extends BaseResourceJson {
821
+ format: string;
822
+ src: string;
823
+ src1x: string;
824
+ src2x: string;
825
+ src3x: string;
826
+ src4x: string;
827
+ width: string | null;
828
+ height: string | null;
829
+ alt: string;
830
+ zoomDisabled: boolean;
831
+ }
832
+ interface ImageLinkResourceJson extends BaseResourceJson {
833
+ format: string;
834
+ url: string;
835
+ src1x: string;
836
+ src2x: string;
837
+ src3x: string;
838
+ src4x: string;
839
+ width: string | null;
840
+ height: string | null;
841
+ alt: string;
842
+ zoomDisabled: boolean;
843
+ }
844
+ interface ImageResponsiveResourceJson extends BaseResourceJson {
845
+ imagePortrait: ImageResourceJson;
846
+ imageLandscape: ImageResourceJson;
847
+ }
848
+ interface AudioResourceJson extends BaseResourceJson {
849
+ format: string;
850
+ src: string;
851
+ duration: number;
852
+ mute: boolean;
853
+ autoplay: boolean;
854
+ }
855
+ interface AudioEmbedResourceJson extends BaseResourceJson {
856
+ format: string;
857
+ src: string;
858
+ duration: number;
859
+ mute: boolean;
860
+ autoplay: boolean;
861
+ }
862
+ interface AudioLinkResourceJson extends BaseResourceJson {
863
+ format: string;
864
+ url: string;
865
+ duration: number;
866
+ mute: boolean;
867
+ autoplay: boolean;
868
+ }
869
+ interface VideoResourceJson extends BaseResourceJson {
870
+ format: string;
871
+ src: string;
872
+ width: string | null;
873
+ height: string | null;
874
+ duration: number;
875
+ mute: boolean;
876
+ autoplay: boolean;
877
+ allowSubtitles: boolean;
878
+ showSubtitles: boolean;
879
+ alt: string;
880
+ posterImage: ImageResourceJson;
881
+ thumbnails: ImageResourceJson[];
882
+ }
883
+ interface VideoEmbedResourceJson extends BaseResourceJson {
884
+ format: string;
885
+ url: string;
886
+ width: string | null;
887
+ height: string | null;
888
+ duration: number;
889
+ mute: boolean;
890
+ autoplay: boolean;
891
+ allowSubtitles: boolean;
892
+ showSubtitles: boolean;
893
+ alt: string;
894
+ posterImage: ImageResourceJson;
895
+ thumbnails: ImageResourceJson[];
896
+ }
897
+ interface VideoLinkResourceJson extends BaseResourceJson {
898
+ format: string;
899
+ url: string;
900
+ width: string | null;
901
+ height: string | null;
902
+ duration: number;
903
+ mute: boolean;
904
+ autoplay: boolean;
905
+ allowSubtitles: boolean;
906
+ showSubtitles: boolean;
907
+ alt: string;
908
+ posterImage: ImageResourceJson;
909
+ thumbnails: ImageResourceJson[];
910
+ }
911
+ interface StillImageFilmResourceJson extends BaseResourceJson {
912
+ image: ImageResourceJson;
913
+ audio: AudioResourceJson;
914
+ }
915
+ interface StillImageFilmEmbedResourceJson extends BaseResourceJson {
916
+ format: string;
917
+ url: string;
918
+ width: string | null;
919
+ height: string | null;
920
+ duration: number;
921
+ mute: boolean;
922
+ autoplay: boolean;
923
+ allowSubtitles: boolean;
924
+ showSubtitles: boolean;
925
+ alt: string;
926
+ posterImage: ImageResourceJson;
927
+ thumbnails: ImageResourceJson[];
928
+ }
929
+ interface StillImageFilmLinkResourceJson extends BaseResourceJson {
930
+ format: string;
931
+ url: string;
932
+ width: string | null;
933
+ height: string | null;
934
+ duration: number;
935
+ mute: boolean;
936
+ autoplay: boolean;
937
+ allowSubtitles: boolean;
938
+ showSubtitles: boolean;
939
+ alt: string;
940
+ posterImage: ImageResourceJson;
941
+ thumbnails: ImageResourceJson[];
942
+ }
943
+ interface ArticleResourceJson extends BaseResourceJson {
944
+ format: string;
945
+ body: string;
946
+ }
947
+ interface DocumentResourceJson extends BaseResourceJson {
948
+ format: string;
949
+ url: string;
950
+ }
951
+ interface DocumentEmbedResourceJson extends BaseResourceJson {
952
+ format: string;
953
+ url: string;
954
+ }
955
+ interface DocumentLinkResourceJson extends BaseResourceJson {
956
+ format: string;
957
+ url: string;
958
+ }
959
+ interface DocumentDownloadResourceJson extends BaseResourceJson {
960
+ format: string;
961
+ url: string;
962
+ }
963
+ interface AppLinkResourceJson extends BaseResourceJson {
964
+ url: string;
965
+ }
966
+ interface WebsiteLinkResourceJson extends BaseResourceJson {
967
+ url: string;
968
+ }
969
+
970
+ interface BitJson {
971
+ type: string;
972
+ originalType: string;
973
+ bitLevel: number;
974
+ format: string;
975
+ id: string | string[];
976
+ gUri: string;
977
+ internalComment: string | string[];
978
+ customerId: string;
979
+ customerExternalId: string | string[];
980
+ externalId: string | string[];
981
+ spaceId: string | string[];
982
+ padletId: string;
983
+ jupyterId: string;
984
+ jupyterExecutionCount: number;
985
+ sourceRL: string;
986
+ isPublic: boolean;
987
+ isTemplate: boolean;
988
+ isTemplateStripTheme: boolean;
989
+ isEditable: boolean;
990
+ needsValidation: boolean;
991
+ validationDate: string;
992
+ aiGenerated: boolean;
993
+ machineTranslated: string;
994
+ translationOf: string;
995
+ spansPageBreak: boolean;
996
+ searchIndex: string | string[];
997
+ analyticsTag: string | string[];
998
+ categoryTag: string | string[];
999
+ topicTag: string | string[];
1000
+ reportTag: string | string[];
1001
+ altLangTag: string;
1002
+ feedbackEngine: string;
1003
+ feedbackType: string;
1004
+ disableFeedback: boolean;
1005
+ diffOp: string;
1006
+ diffRef: string;
1007
+ diffContext: string;
1008
+ diffTime: number;
1009
+ path: string;
1010
+ releaseVersion: string;
1011
+ releaseKind: string;
1012
+ releaseDate: string;
1013
+ iframeSrc: string;
1014
+ iframeName: string;
1015
+ ageRange: number | number[];
1016
+ lang: string;
1017
+ language: string | string[];
1018
+ computerLanguage: string;
1019
+ target: string | string[];
1020
+ slug: string;
1021
+ tag: string | string[];
1022
+ groupTag: GroupTagJson[];
1023
+ reductionTag: string | string[];
1024
+ bubbleTag: string | string[];
1025
+ extractorTag: string | string[];
1026
+ extractorInternal: string | string[];
1027
+ sourceBB?: number[] | number[][];
1028
+ bitFingerprint: string | string[];
1029
+ levelCEFRp: string;
1030
+ levelCEFR: string;
1031
+ levelILR: string;
1032
+ levelACTFL: string;
1033
+ icon: string;
1034
+ iconTag: string;
1035
+ colorTag: string | string[];
1036
+ flashcardSet: string | string[];
1037
+ subtype: string;
1038
+ bookAlias: string | string[];
1039
+ bookDiff: string;
1040
+ coverImage: string | string[];
1041
+ coverColor: string;
1042
+ backgroundImage: string | string[];
1043
+ publisher: string | string[];
1044
+ publisherName: string;
1045
+ publications: string | string[];
1046
+ relatedBook: string | string[];
1047
+ userFeedbackTranslationUrl: string;
1048
+ userFeedbackContentUrl: string;
1049
+ author: string | string[];
1050
+ subject: string | string[];
1051
+ date: string;
1052
+ dateEnd: string;
1053
+ location: string;
1054
+ theme: string | string[];
1055
+ kind: string;
1056
+ hasMarkAsDone: boolean;
1057
+ processHandIn: boolean;
1058
+ processHandInLocation: string;
1059
+ chatWithBook: boolean;
1060
+ chatWithBookBrainKey: string;
1061
+ currency: string;
1062
+ bookIsbn: string;
1063
+ bookAuthor: string;
1064
+ bookType: string;
1065
+ bookBindingType: string;
1066
+ bookNumberOfPages: string;
1067
+ bookRating: string;
1068
+ bookSeriesTitle: string;
1069
+ bookSeriesId: string;
1070
+ bookSeriesNumber: string;
1071
+ bookLanguage: string;
1072
+ bookPublishingDate: string;
1073
+ bookPublisher: string;
1074
+ bookTranslator: string;
1075
+ bookOriginalTitle: string;
1076
+ gmbExternalShop: string;
1077
+ gmbExternalShopItems: string | string[];
1078
+ action: string;
1079
+ showInIndex: boolean;
1080
+ refAuthor: string | string[];
1081
+ refBookTitle: string;
1082
+ refPublisher: string | string[];
1083
+ refPublicationYear: string;
1084
+ citationStyle: string;
1085
+ blockId: string;
1086
+ pageNo: number;
1087
+ x: number;
1088
+ y: number;
1089
+ width: string;
1090
+ height: string;
1091
+ index: number;
1092
+ classification: string;
1093
+ availableClassifications: string | string[];
1094
+ allowedBit: string | string[];
1095
+ authorFullName: string;
1096
+ authorPseudonym: string;
1097
+ authorTitle: string;
1098
+ authorJobTitle: string;
1099
+ tableFixedHeader: boolean;
1100
+ tableHeaderWhitespaceNoWrap: boolean;
1101
+ tableSearch: boolean;
1102
+ tableSort: boolean;
1103
+ tablePagination: boolean;
1104
+ tablePaginationLimit: number;
1105
+ tableHeight: number;
1106
+ tableWhitespaceNoWrap: boolean;
1107
+ tableAutoWidth: boolean;
1108
+ tableResizableColumns: boolean;
1109
+ tableColumnMinWidth: number;
1110
+ quizCountItems: boolean;
1111
+ quizStrikethroughSolutions: boolean;
1112
+ codeLineNumbers: boolean;
1113
+ codeMinimap: boolean;
1114
+ stripePricingTableId: string;
1115
+ stripePricingTableDescriptiveName: string;
1116
+ stripePublishableKey: string;
1117
+ thumbImage: string;
1118
+ scormSource: string;
1119
+ posterImage: string;
1120
+ focusX: number;
1121
+ focusY: number;
1122
+ pointerLeft: string;
1123
+ pointerTop: string;
1124
+ listItemIndent: number;
1125
+ backgroundWallpaper: ImageResourceWrapperJson;
1126
+ hasBookNavigation: boolean;
1127
+ duration: string;
1128
+ deeplink: string | string[];
1129
+ externalLink: string;
1130
+ externalLinkText: string;
1131
+ videoCallLink: string;
1132
+ vendorDashboardId: string;
1133
+ vendorSurveyId: string;
1134
+ vendorUrl: string;
1135
+ search: string;
1136
+ bot: string | string[];
1137
+ list: string | string[];
1138
+ layer: string | string[];
1139
+ layerRole: string | string[];
1140
+ textReference: string;
1141
+ isTracked: boolean;
1142
+ isInfoOnly: boolean;
1143
+ imageFirst: boolean;
1144
+ activityType: string;
1145
+ labelTrue: string;
1146
+ labelFalse: string;
1147
+ content2Buy: string;
1148
+ listPrice: string;
1149
+ customerProductId: string;
1150
+ customerProductShopLink: string;
1151
+ mailingList: string;
1152
+ buttonCaption: string;
1153
+ callToActionUrl: string;
1154
+ advertisingClickUrl: string;
1155
+ brandColor: string;
1156
+ brandColorName: string;
1157
+ caption: JsonText;
1158
+ quotedPerson: string;
1159
+ reasonableNumOfChars: number;
1160
+ resolved: boolean;
1161
+ resolvedDate: string;
1162
+ resolvedBy: string;
1163
+ handInAcceptFileType: string | string[];
1164
+ handInRequirement: string | string[];
1165
+ handInInstruction: string;
1166
+ maxCreatedBits: number;
1167
+ maxDisplayLevel: number;
1168
+ maxTocChapterLevel: number;
1169
+ allowPrint: string;
1170
+ printParentChapterLevel: number;
1171
+ printOnRequestCustomerId: string;
1172
+ printOnRequestProductId: string;
1173
+ sourceDocument: string;
1174
+ internalPrintPdf: string;
1175
+ hasPrintRestriction: boolean;
1176
+ enforceUpdateOverUserInput: boolean;
1177
+ extractorExtractionTimestamp: string[];
1178
+ tocResource: string | string[];
1179
+ tocContent: string | string[];
1180
+ page: string;
1181
+ platformBrandTarget: string;
1182
+ platformName: string;
1183
+ platformIcon: ImageResourceWrapperJson;
1184
+ platformLogo: ImageResourceWrapperJson;
1185
+ platformLogoMaxHeight: number;
1186
+ platformPrimaryColor: string;
1187
+ platformSecondaryColor: string;
1188
+ platformBackgroundColor: string;
1189
+ platformScrollbarColor: string;
1190
+ platformSelectionColor: string;
1191
+ platformSeparatorColor: string;
1192
+ platformPlaceholderColor: string;
1193
+ platformTextSelectionColor: string;
1194
+ platformButtonPrimaryColor: string;
1195
+ platformButtonBackgroundColor: string;
1196
+ platformMessageBackgroundColor: string;
1197
+ platformBackgroundImage: ImageResourceWrapperJson;
1198
+ platformBorderColor: string;
1199
+ platformSelectionTextColor: string;
1200
+ platformBaseLayerColor: string;
1201
+ platformMargin: number;
1202
+ platformBorderRadius: number;
1203
+ platformSelectionBorderRadius: number;
1204
+ platformNeedsShadow: boolean;
1205
+ productId: string | string[];
1206
+ product: string;
1207
+ productVideo: string;
1208
+ productFolder: string;
1209
+ technicalTerm: TechnicalTermJson;
1210
+ servings: ServingsJson;
1211
+ ratingLevelStart: RatingLevelStartEndJson;
1212
+ ratingLevelEnd: RatingLevelStartEndJson;
1213
+ ratingLevelSelected: number;
1214
+ book: string | BookJson[];
1215
+ title: JsonText;
1216
+ subtitle: JsonText;
1217
+ level: number;
1218
+ toc: boolean;
1219
+ progress: boolean;
1220
+ isCollapsible: boolean;
1221
+ anchor: string;
1222
+ reference: string | string[];
1223
+ referenceEnd: string;
1224
+ revealSolutions: boolean;
1225
+ item: JsonText;
1226
+ lead: JsonText;
1227
+ pageNumber: JsonText;
1228
+ marginNumber: JsonText;
1229
+ hint: JsonText;
1230
+ instruction: JsonText;
1231
+ isExample: boolean;
1232
+ example: ExampleJson;
1233
+ imageSource: ImageSourceJson;
1234
+ person: PersonJson;
1235
+ partner: PersonJson;
1236
+ marks: MarkConfigJson[];
1237
+ extraProperties: {
1238
+ [key: string]: unknown | unknown[];
1239
+ };
1240
+ imagePlaceholder: ImageResourceWrapperJson;
1241
+ previewImage: ImageResourceWrapperJson[];
1242
+ previewVideo: VideoResourceWrapperJson[];
1243
+ resource: ResourceJson;
1244
+ logos: ImageResourceWrapperJson[];
1245
+ images: ImageResourceWrapperJson[];
1246
+ body: JsonText | unknown;
1247
+ sampleSolution: string;
1248
+ additionalSolutions: string[];
1249
+ partialAnswer: string;
1250
+ elements: string[];
1251
+ statement: JsonText;
1252
+ isCorrect: boolean;
1253
+ cards: FlashcardJson[];
1254
+ definitions: DefinitionListItemJson[];
1255
+ descriptions: DefinitionListItemJson[];
1256
+ statements: StatementJson[];
1257
+ responses: ResponseJson[] | BotResponseJson[];
1258
+ feedbacks: FeedbackJson[];
1259
+ quizzes: QuizJson[];
1260
+ heading: HeadingJson;
1261
+ pairs: PairJson[];
1262
+ matrix: MatrixJson[];
1263
+ table: TableJson;
1264
+ tableExtended: TableExtendedJson;
1265
+ choices: ChoiceJson[];
1266
+ questions: QuestionJson[];
1267
+ ingredients: IngredientJson[];
1268
+ listItems: ListItemJson[];
1269
+ sections: ListItemJson[];
1270
+ bookReferences: BookReferenceJson[];
1271
+ footer: JsonText;
1272
+ placeholders: BodyBitsJson;
1273
+ }
1274
+ interface BookJson {
1275
+ book: string;
1276
+ reference: string;
1277
+ referenceEnd: string;
1278
+ }
1279
+ interface GroupTagJson {
1280
+ name: string;
1281
+ tags: string[];
1282
+ }
1283
+ interface ImageSourceJson {
1284
+ url: string;
1285
+ mockupId: string;
1286
+ size?: number;
1287
+ format?: string;
1288
+ trim?: boolean;
1289
+ }
1290
+ interface PersonJson {
1291
+ name: string;
1292
+ title: string;
1293
+ avatarImage: ImageResourceWrapperJson;
1294
+ }
1295
+ interface MarkConfigJson {
1296
+ mark: string;
1297
+ color: string;
1298
+ emphasis: string;
1299
+ }
1300
+ interface FlashcardJson {
1301
+ question: TextAndIconJson;
1302
+ answer: TextAndIconJson;
1303
+ alternativeAnswers: TextAndIconJson[];
1304
+ item: JsonText;
1305
+ lead: JsonText;
1306
+ hint: JsonText;
1307
+ instruction: JsonText;
1308
+ isExample: boolean;
1309
+ example: ExampleJson;
1310
+ __isDefaultExample?: boolean;
1311
+ __defaultExample?: ExampleJson;
1312
+ }
1313
+ interface DefinitionListItemJson {
1314
+ term: TextAndIconJson;
1315
+ definition: TextAndIconJson;
1316
+ alternativeDefinitions: TextAndIconJson[];
1317
+ item: JsonText;
1318
+ lead: JsonText;
1319
+ hint: JsonText;
1320
+ instruction: JsonText;
1321
+ isExample: boolean;
1322
+ example: ExampleJson;
1323
+ __isDefaultExample?: boolean;
1324
+ __defaultExample?: ExampleJson;
1325
+ }
1326
+ interface TextAndIconJson {
1327
+ text: JsonText;
1328
+ icon: ImageResourceWrapperJson;
1329
+ }
1330
+ interface StatementJson {
1331
+ statement: JsonText;
1332
+ isCorrect: boolean;
1333
+ item: JsonText;
1334
+ lead: JsonText;
1335
+ hint: JsonText;
1336
+ instruction: JsonText;
1337
+ isExample: boolean;
1338
+ example: ExampleJson;
1339
+ __isDefaultExample?: boolean;
1340
+ __defaultExample?: ExampleJson;
1341
+ }
1342
+ interface FeedbackChoiceJson {
1343
+ choice: string;
1344
+ requireReason: boolean;
1345
+ item: JsonText;
1346
+ lead: JsonText;
1347
+ hint: JsonText;
1348
+ instruction: JsonText;
1349
+ isExample: boolean;
1350
+ example: ExampleJson;
1351
+ __isDefaultExample?: boolean;
1352
+ __defaultExample?: ExampleJson;
1353
+ }
1354
+ interface FeedbackReasonJson {
1355
+ item: JsonText;
1356
+ lead: JsonText;
1357
+ hint: JsonText;
1358
+ instruction: JsonText;
1359
+ text: string;
1360
+ reasonableNumOfChars: number;
1361
+ isExample: boolean;
1362
+ example: ExampleJson;
1363
+ __textAst?: TextAst;
1364
+ __isDefaultExample?: boolean;
1365
+ __defaultExample?: ExampleJson;
1366
+ }
1367
+ interface ChoiceJson {
1368
+ choice: string;
1369
+ isCorrect: boolean;
1370
+ item: JsonText;
1371
+ lead: JsonText;
1372
+ hint: JsonText;
1373
+ instruction: JsonText;
1374
+ isExample: boolean;
1375
+ example: ExampleJson;
1376
+ __isDefaultExample?: boolean;
1377
+ __defaultExample?: ExampleJson;
1378
+ }
1379
+ interface ResponseJson {
1380
+ response: string;
1381
+ isCorrect: boolean;
1382
+ item: JsonText;
1383
+ lead: JsonText;
1384
+ hint: JsonText;
1385
+ instruction: JsonText;
1386
+ isExample: boolean;
1387
+ example: ExampleJson;
1388
+ __isDefaultExample?: boolean;
1389
+ __defaultExample?: ExampleJson;
1390
+ }
1391
+ interface FeedbackJson {
1392
+ item: JsonText;
1393
+ lead: JsonText;
1394
+ hint: JsonText;
1395
+ instruction: JsonText;
1396
+ choices: FeedbackChoiceJson[];
1397
+ reason: FeedbackReasonJson;
1398
+ }
1399
+ interface QuizJson {
1400
+ item: JsonText;
1401
+ lead: JsonText;
1402
+ hint: JsonText;
1403
+ instruction: JsonText;
1404
+ isExample: boolean;
1405
+ choices: ChoiceJson[];
1406
+ responses: ResponseJson[];
1407
+ __isDefaultExample?: boolean;
1408
+ __defaultExample?: ExampleJson;
1409
+ }
1410
+ interface HeadingJson {
1411
+ forKeys: string;
1412
+ forValues: string | string[];
1413
+ __forValuesDefault?: string | string[];
1414
+ }
1415
+ interface PairJson {
1416
+ key: string;
1417
+ keyAudio: AudioResourceWrapperJson;
1418
+ keyImage: ImageResourceWrapperJson;
1419
+ item: JsonText;
1420
+ lead: JsonText;
1421
+ hint: JsonText;
1422
+ instruction: JsonText;
1423
+ isCaseSensitive: boolean;
1424
+ isExample: boolean;
1425
+ example: ExampleJson;
1426
+ values: string[];
1427
+ __valuesAst?: TextAst[];
1428
+ __isDefaultExample?: boolean;
1429
+ __defaultExample?: ExampleJson;
1430
+ }
1431
+ interface MatrixJson {
1432
+ key: string;
1433
+ item: JsonText;
1434
+ lead: JsonText;
1435
+ hint: JsonText;
1436
+ instruction: JsonText;
1437
+ isExample: boolean;
1438
+ cells: MatrixCellJson[];
1439
+ __isDefaultExample?: boolean;
1440
+ }
1441
+ interface MatrixCellJson {
1442
+ values: string[];
1443
+ item: JsonText;
1444
+ lead: JsonText;
1445
+ hint: JsonText;
1446
+ instruction: JsonText;
1447
+ isCaseSensitive: boolean;
1448
+ isExample: boolean;
1449
+ example: ExampleJson;
1450
+ __valuesAst?: TextAst[];
1451
+ __isDefaultExample?: boolean;
1452
+ __defaultExample?: ExampleJson;
1453
+ }
1454
+ interface PronunciationTableCellJson {
1455
+ title: JsonText;
1456
+ body: JsonText;
1457
+ audio: AudioResourceWrapperJson;
1458
+ }
1459
+ interface PronunciationTableJson {
1460
+ data: PronunciationTableCellJson[][];
1461
+ }
1462
+ interface TableJson {
1463
+ columnWidths?: (number | null)[];
1464
+ columns: JsonText[];
1465
+ data: JsonText[][];
1466
+ }
1467
+ interface TableExtendedJson {
1468
+ header?: TableSectionJson;
1469
+ body?: TableSectionJson;
1470
+ footer?: TableSectionJson;
1471
+ }
1472
+ interface TableSectionJson {
1473
+ rows: TableRowJson[];
1474
+ }
1475
+ interface TableRowJson {
1476
+ cells: TableCellJson[];
1477
+ }
1478
+ interface TableCellJson {
1479
+ content: JsonText;
1480
+ title?: boolean;
1481
+ rowspan?: number;
1482
+ colspan?: number;
1483
+ scope?: 'row' | 'col' | 'rowgroup' | 'colgroup';
1484
+ colwidth?: number;
1485
+ }
1486
+ interface QuestionJson {
1487
+ question: JsonText;
1488
+ partialAnswer: string;
1489
+ sampleSolution: string;
1490
+ additionalSolutions: string[];
1491
+ item: JsonText;
1492
+ lead: JsonText;
1493
+ hint: JsonText;
1494
+ instruction: JsonText;
1495
+ reasonableNumOfChars: number;
1496
+ isExample: boolean;
1497
+ example: ExampleJson;
1498
+ __sampleSolutionAst?: TextAst;
1499
+ __isDefaultExample?: boolean;
1500
+ __defaultExample?: ExampleJson;
1501
+ }
1502
+ interface BotResponseJson {
1503
+ response: string;
1504
+ reaction: string;
1505
+ feedback: string;
1506
+ item: string;
1507
+ lead: JsonText;
1508
+ hint: JsonText;
1509
+ }
1510
+ interface TechnicalTermJson {
1511
+ technicalTerm: string;
1512
+ lang: string;
1513
+ }
1514
+ interface ServingsJson {
1515
+ servings: number;
1516
+ unit: string;
1517
+ unitAbbr: string;
1518
+ decimalPlaces: number;
1519
+ disableCalculation: boolean;
1520
+ hint: string;
1521
+ }
1522
+ interface IngredientJson {
1523
+ title: string;
1524
+ checked: boolean;
1525
+ ingredient: string;
1526
+ quantity: number;
1527
+ unit: string;
1528
+ unitAbbr: string;
1529
+ decimalPlaces: number;
1530
+ disableCalculation: boolean;
1531
+ item: JsonText;
1532
+ lead: JsonText;
1533
+ hint: JsonText;
1534
+ }
1535
+ interface RatingLevelStartEndJson {
1536
+ level: number;
1537
+ label?: JsonText;
1538
+ }
1539
+ interface ListItemJson {
1540
+ item: JsonText;
1541
+ lead: JsonText;
1542
+ hint: JsonText;
1543
+ instruction: JsonText;
1544
+ body: JsonText | unknown;
1545
+ }
1546
+ interface BookReferenceJson {
1547
+ lang: string;
1548
+ refAuthor: string;
1549
+ refBookTitle: string[];
1550
+ refPublisher: string;
1551
+ }
1552
+ type ExampleJson = JsonText | boolean | null;
1553
+
1554
+ interface ParserJson {
1555
+ version?: string;
1556
+ bitmarkVersion?: string;
1557
+ commentedBitType?: string;
1558
+ internalComments?: string[];
1559
+ warnings?: ParserError[];
1560
+ errors?: ParserError[];
1561
+ }
1562
+
1563
+ interface BitWrapperJson {
1564
+ bitmark?: string;
1565
+ bit: BitJson;
1566
+ parser?: ParserJson;
1567
+ }
1568
+
1569
+ export { type AppLinkResourceJson, type AppLinkResourceWrapperJson, type ArticleResourceJson, type ArticleResourceWrapperJson, Ast, type AudioEmbedResourceJson, type AudioEmbedResourceWrapperJson, type AudioLinkResourceJson, type AudioLinkResourceWrapperJson, type AudioResourceJson, type AudioResourceWrapperJson, type BaseBodyBitJson, type BaseResourceJson, type BitJson, BitType, type BitTypeType, type BitWrapperJson, BitmarkFileGenerator, BitmarkGenerator, type BitmarkOptions, BitmarkParser, BitmarkParserGenerator, BitmarkParserType, type BitmarkParserTypeType, BitmarkStringGenerator, BitmarkVersion, type BitmarkVersionType, type BodyBitJson, type BodyBitsJson, BodyTextFormat, type BodyTextFormatType, type BookJson, type BookReferenceJson, type BotResponseJson, BoundingBoxIndex, type BreakscapeOptions, type BuildBitOptions, Builder, CardSetVersion, type CardSetVersionType, type ChoiceJson, type CodeBlockTextNode, type CodeBlockTextNodeAttributes, type CommentMark, type ConvertHtmlTableOptions, type ConvertOptions, type ConvertTextOptions, type CreateAstOptions, type DefinitionListItemJson, type DocumentDownloadResourceJson, type DocumentDownloadResourceWrapperJson, type DocumentEmbedResourceJson, type DocumentEmbedResourceWrapperJson, type DocumentLinkResourceJson, type DocumentLinkResourceWrapperJson, type DocumentResourceJson, type DocumentResourceWrapperJson, type ExampleJson, type ExtRefMark, type ExtRefMarkAttibutes, type ExtractPlainTextOptions, type FeedbackChoiceJson, type FeedbackJson, type FeedbackReasonJson, type FileOptions, FileWriter, type FlashcardJson, type FootnoteAttibutes, type FootnoteMark, type GapJson, type GroupTagJson, type HeadingJson, type HeadingTextNode, type HeadingTextNodeAttributes, type HighlightJson, type HighlightTextJson, HtmlTableGenerator, HtmlTableParser, type ImageInlineTextNode, type ImageLinkResourceJson, type ImageLinkResourceWrapperJson, type ImageResourceJson, type ImageResourceWrapperJson, type ImageResponsiveResourceJson, type ImageResponsiveResourceWrapperJson, type ImageSourceJson, type ImageTextNode, type ImageTextNodeAttributes, InfoFormat, type InfoFormatType, type InfoOptions, InfoType, type InfoTypeType, type IngredientJson, Input, InputFormat, type InputFormatType, type InputType, JsonFileGenerator, JsonGenerator, type JsonOptions, JsonParser, JsonStringGenerator, type JsonText, type LatexTextNode, type LatexTextNodeAttributes, type LegacyPseudoAst, LegacyUnsupportedError, type LinkMark, type LinkMarkAttibutes, type ListItemJson, type ListTextNode, type ListTextNodeAttributes, type MarkConfigJson, type MarkJson, type MatrixCellJson, type MatrixJson, type MediaAttributes, NodeType, Output, type OutputType, type PairJson, type ParserError, type ParserInfo, type ParserJson, type ParserLocation, type PersonJson, type PronunciationTableCellJson, type PronunciationTableJson, type QuestionJson, type QuizJson, type RatingLevelStartEndJson, type RefMark, type RefMarkAttibutes, ResourceBuilder, type ResourceDataJson, type ResourceJson, type ResourceMethod, type ResourceTypeType, type ResourceWrapperJson, type ResponseJson, type SectionTextNode, type SelectJson, type SelectOptionJson, type ServingsJson, type StatementJson, type StillImageFilmEmbedResourceJson, type StillImageFilmEmbedResourceWrapperJson, type StillImageFilmLinkResourceJson, type StillImageFilmLinkResourceWrapperJson, type StillImageFilmResourceJson, type StillImageFilmResourceWrapperJson, StreamWriter, StringWriter, type SymbolMark, type SymbolMarkAttibutes, type TableCellJson, type TableExtendedJson, type TableJson, type TableRowJson, type TableSectionJson, type TaskItemTextNode, type TaskItemTextNodeAttributes, type TechnicalTermJson, type TextAndIconJson, type TextAst, type TextFormatType, type TextJsonOptions, TextLocation, type TextLocationType, type TextMark, type TextMarkAttibutes, TextMarkType, type TextMarkTypeType, type TextNode, type TextNodeAttibutes, TextNodeType, type TextNodeTypeType, type UnbreakscapeOptions, type UpgradeOptions, type VideoEmbedResourceJson, type VideoEmbedResourceWrapperJson, type VideoLinkResourceJson, type VideoLinkResourceWrapperJson, type VideoResourceJson, type VideoResourceWrapperJson, type WebsiteLinkResourceJson, type WebsiteLinkResourceWrapperJson, type XRefMark, type XRefMarkAttibutes, bitmarkTextParse, isPseudoAst };