@gmb/bitmark-parser-generator 5.14.0 → 5.16.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.
@@ -737,6 +737,7 @@ declare const ConfigKey: {
737
737
  readonly property_availableClassifications: "@availableClassifications";
738
738
  readonly property_brandColor: "@brandColor";
739
739
  readonly property_brandColorName: "@brandColorName";
740
+ readonly property_backgroundImage: "@backgroundImage";
740
741
  readonly property_blockId: "@blockId";
741
742
  readonly property_book: "@book";
742
743
  readonly property_bookAlias: "@bookAlias";
@@ -1027,6 +1028,7 @@ declare const ConfigKey: {
1027
1028
  readonly resource_previewImage: "&previewImage";
1028
1029
  readonly resource_previewVideo: "&previewVideo";
1029
1030
  readonly resource_coverImage: "&coverImage";
1031
+ readonly resource_backgroundImage: "&backgroundImage";
1030
1032
  readonly tag_title: "#";
1031
1033
  readonly tag_anchor: "▼";
1032
1034
  readonly tag_reference: "►";
@@ -1079,6 +1081,7 @@ declare const ResourceType: {
1079
1081
  readonly previewImage: "previewImage";
1080
1082
  readonly previewVideo: "previewVideo";
1081
1083
  readonly coverImage: "coverImage";
1084
+ readonly backgroundImage: "backgroundImage";
1082
1085
  };
1083
1086
  type ResourceTypeType = EnumType<typeof ResourceType>;
1084
1087
 
@@ -1688,6 +1691,7 @@ interface BitJson {
1688
1691
  bookDiff: string;
1689
1692
  coverImage: string | string[];
1690
1693
  coverColor: string;
1694
+ backgroundImage: string | string[];
1691
1695
  publisher: string | string[];
1692
1696
  publisherName: string;
1693
1697
  publications: string | string[];
@@ -2300,6 +2304,7 @@ interface Bit {
2300
2304
  bookDiff?: Property;
2301
2305
  coverImage?: Property | ImageResourceWrapperJson;
2302
2306
  coverColor?: Property;
2307
+ backgroundImage?: Property | ImageResourceWrapperJson;
2303
2308
  publications?: Property;
2304
2309
  relatedBook?: Property;
2305
2310
  translationOfBook?: Property;
@@ -2619,6 +2624,8 @@ declare const NodeType: {
2619
2624
  readonly avatarImage: "avatarImage";
2620
2625
  readonly backgroundWallpaper: "backgroundWallpaper";
2621
2626
  readonly backgroundWallpaperValue: "backgroundWallpaperValue";
2627
+ readonly backgroundImage: "backgroundImage";
2628
+ readonly backgroundImageValue: "backgroundImageValue";
2622
2629
  readonly bitLevel: "bitLevel";
2623
2630
  readonly bitmarkAst: "bitmarkAst";
2624
2631
  readonly bitmarkVersion: "bitmarkVersion";
@@ -3516,6 +3523,7 @@ type GenerateOptions = {
3516
3523
  plainTextDividerAllowed?: boolean;
3517
3524
  noBreakscaping?: boolean;
3518
3525
  forceInline?: boolean;
3526
+ noMarkup?: boolean;
3519
3527
  };
3520
3528
  declare const Stage: {
3521
3529
  enter: string;
@@ -4165,6 +4173,7 @@ declare class Builder extends BaseBuilder {
4165
4173
  bookDiff?: string;
4166
4174
  coverImage?: string | string[] | Partial<ImageResourceWrapperJson>;
4167
4175
  coverColor?: string;
4176
+ backgroundImage?: string | string[] | Partial<ImageResourceWrapperJson>;
4168
4177
  publications?: string | string[];
4169
4178
  relatedBook?: string | string[];
4170
4179
  translationOfBook?: string;
@@ -5591,6 +5600,8 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5591
5600
  protected enter_platformBackgroundImage(node: NodeInfo, _route: NodeInfo[]): boolean;
5592
5601
  protected enter_coverImage(node: NodeInfo, route: NodeInfo[]): boolean;
5593
5602
  protected leaf_coverImage(node: NodeInfo, route: NodeInfo[]): void;
5603
+ protected enter_backgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5604
+ protected leaf_backgroundImage(node: NodeInfo, route: NodeInfo[]): void;
5594
5605
  protected exit_imagePlaceholder(_node: NodeInfo, _route: NodeInfo[]): void;
5595
5606
  protected enter_posterImage(node: NodeInfo, route: NodeInfo[]): boolean;
5596
5607
  protected enter_thumbnails(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -5973,6 +5984,7 @@ declare class JsonGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5973
5984
  protected enter_platformLogo(node: NodeInfo, route: NodeInfo[]): boolean;
5974
5985
  protected enter_platformBackgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5975
5986
  protected enter_coverImage(node: NodeInfo, route: NodeInfo[]): boolean;
5987
+ protected enter_backgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5976
5988
  protected enter_resources(node: NodeInfo, route: NodeInfo[]): boolean;
5977
5989
  protected leaf_level(node: NodeInfo, route: NodeInfo[]): boolean;
5978
5990
  protected enter_book(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -6464,6 +6476,13 @@ interface CreateAstOptions {
6464
6476
  */
6465
6477
  inputFormat?: InputType;
6466
6478
  }
6479
+ interface ExtractPlainTextOptions {
6480
+ /**
6481
+ * Set to force input to be interpreted as a particular format, overriding the auto-detection
6482
+ * Auto-detection can fail for certain inputs as the input formats can overlap
6483
+ */
6484
+ inputFormat?: InputFormatType;
6485
+ }
6467
6486
  /**
6468
6487
  * Breakscape options
6469
6488
  */
@@ -6546,8 +6565,30 @@ declare const Output: {
6546
6565
  * Output AST as a plain JS object, or a file
6547
6566
  */
6548
6567
  readonly ast: "ast";
6568
+ /**
6569
+ * Output plain text as a string, or a file
6570
+ */
6571
+ readonly text: "text";
6549
6572
  };
6550
6573
  type OutputType = EnumType<typeof Output>;
6574
+ /**
6575
+ * Input format enumeration
6576
+ */
6577
+ declare const InputFormat: {
6578
+ /**
6579
+ * Input is bitmark
6580
+ */
6581
+ readonly bitmark: "bitmark";
6582
+ /**
6583
+ * Input is bitmarkText
6584
+ */
6585
+ readonly bitmarkText: "bitmarkText";
6586
+ /**
6587
+ * Input is plain text
6588
+ */
6589
+ readonly plainText: "plainText";
6590
+ };
6591
+ type InputFormatType = EnumType<typeof InputFormat>;
6551
6592
  /**
6552
6593
  * Options for bitmark text JSON generation
6553
6594
  */
@@ -6611,6 +6652,12 @@ declare class BitmarkParserGenerator {
6611
6652
  * - input(JSON/AST) ==> output(bitmark)
6612
6653
  * - input(bitmark) ==> output(JSON)
6613
6654
  *
6655
+ * Output type can be overridden to one of the following:
6656
+ * - bitmark: output bitmark string
6657
+ * - json: output JSON as a plain JS object, or a file
6658
+ * - ast: output AST as a plain JS object, or a file
6659
+ * - text: output plain text as a string, or a file
6660
+ *
6614
6661
  * By default, the result is returned as a string for bitmark, or a plain JS object for JSON/AST.
6615
6662
  *
6616
6663
  * The options can be used to write the output to a file and to set conversion options or override defaults.
@@ -6664,7 +6711,7 @@ declare class BitmarkParserGenerator {
6664
6711
  */
6665
6712
  createAst(input: unknown, options?: CreateAstOptions): BitmarkAst;
6666
6713
  /**
6667
- * Convert bitmark text from JSON, or JSON to bitmark text.
6714
+ * Convert bitmark text to JSON, or JSON to bitmark text.
6668
6715
  *
6669
6716
  * Input type is detected automatically and may be:
6670
6717
  * - string: bitmark text or JSON
@@ -6687,6 +6734,7 @@ declare class BitmarkParserGenerator {
6687
6734
  * @throws Error if any error occurs
6688
6735
  */
6689
6736
  convertText(input: string | unknown, options?: ConvertTextOptions): string | unknown | void;
6737
+ extractPlainText(input: string | unknown, options?: ExtractPlainTextOptions): string;
6690
6738
  /**
6691
6739
  * Breakscape bitmark text.
6692
6740
  *
@@ -6725,6 +6773,7 @@ declare class BitmarkParserGenerator {
6725
6773
  * @throws Error if any error occurs
6726
6774
  */
6727
6775
  unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void;
6776
+ textAstToPlainText(textAst: TextAst, _options?: ExtractPlainTextOptions): string;
6728
6777
  /**
6729
6778
  * Stringify / prettify a plain JS object to a JSON string, depending on the JSON options
6730
6779
  *
@@ -6891,4 +6940,4 @@ declare class JsonFileGenerator implements Generator<BitmarkAst> {
6891
6940
  generateSync(_ast: BitmarkAst): void;
6892
6941
  }
6893
6942
 
6894
- export { type AppLinkResourceJson, type AppLinkResourceWrapperJson, type ArticleResourceJson, type ArticleResourceWrapperJson, Ast, type AstWalkCallbacks, type AudioEmbedResourceJson, type AudioEmbedResourceWrapperJson, type AudioLinkResourceJson, type AudioLinkResourceWrapperJson, type AudioResourceJson, type AudioResourceWrapperJson, type Bit, type BitJson, BitType, type BitTypeType, type BitWrapperJson, type BitmarkAst, BitmarkFileGenerator, BitmarkGenerator, type BitmarkOptions, BitmarkParser, BitmarkParserGenerator, BitmarkParserType, type BitmarkParserTypeType, BitmarkStringGenerator, BitmarkVersion, type BitmarkVersionType, type Body, type BodyBitJson, type BodyBitsJson, type BodyPart, BodyTextFormat, type BodyTextFormatType, type BookJson, type BookReferenceJson, type BotResponseJson, type BreakscapeOptions, type BreakscapedString, Builder, type CardBit, type CardNode, CardSetVersion, type CardSetVersionType, type ChoiceJson, type CodeBlockTextNode, type CodeBlockTextNodeAttributes, type CommentMark, 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 Example, type ExampleJson, type ExtRefMark, type ExtRefMarkAttibutes, type ExtraProperties, type FeedbackChoiceJson, type FeedbackJson, type FeedbackReasonJson, type FileOptions, FileWriter, type FlashcardJson, type Footer, type FootnoteAttibutes, type FootnoteMark, type GapJson, type Generator, type GroupTagJson, type HeadingJson, type HeadingTextNode, type HeadingTextNodeAttributes, type HighlightJson, type HighlightTextJson, type ImageInlineTextNode, type ImageLinkResourceJson, type ImageLinkResourceWrapperJson, type ImageResourceJson, type ImageResourceWrapperJson, type ImageSourceJson, type ImageTextNode, type ImageTextNodeAttributes, InfoFormat, type InfoFormatType, type InfoOptions, InfoType, type InfoTypeType, type IngredientJson, Input, type InputType, JsonFileGenerator, JsonGenerator, type JsonOptions, JsonParser, JsonStringGenerator, type LatexTextNode, type LatexTextNodeAttributes, type LinkMark, type LinkMarkAttibutes, type ListItemJson, type ListTextNode, type ListTextNodeAttributes, type MarkConfigJson, type MarkJson, type MatrixCellJson, type MatrixJson, type MediaAttributes, type Node, type NodeInfo, NodeType, type NodeTypeType, Output, type OutputType, type PairJson, type ParserJson, type PersonJson, type UpgradeOptions as PrettifyOptions, type PronunciationTableCellJson, type PronunciationTableJson, type Property, type QuestionJson, type QuizJson, type RatingLevelStartEndJson, type RefMark, type RefMarkAttibutes, ResourceBuilder, type ResourceDataJson, type ResourceJson, 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 TableCellJson, type TableExtendedJson, type TableJson, type TableRowJson, type TableSectionJson, type TaskItemTextNode, type TaskItemTextNodeAttributes, type TechnicalTermJson, type JsonText as Text, type TextAndIconJson, type TextAst, type TextJsonOptions, 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 Writer, type XRefMark, type XRefMarkAttibutes, parse as bitmarkTextParse };
6943
+ export { type AppLinkResourceJson, type AppLinkResourceWrapperJson, type ArticleResourceJson, type ArticleResourceWrapperJson, Ast, type AstWalkCallbacks, type AudioEmbedResourceJson, type AudioEmbedResourceWrapperJson, type AudioLinkResourceJson, type AudioLinkResourceWrapperJson, type AudioResourceJson, type AudioResourceWrapperJson, type Bit, type BitJson, BitType, type BitTypeType, type BitWrapperJson, type BitmarkAst, BitmarkFileGenerator, BitmarkGenerator, type BitmarkOptions, BitmarkParser, BitmarkParserGenerator, BitmarkParserType, type BitmarkParserTypeType, BitmarkStringGenerator, BitmarkVersion, type BitmarkVersionType, type Body, type BodyBitJson, type BodyBitsJson, type BodyPart, BodyTextFormat, type BodyTextFormatType, type BookJson, type BookReferenceJson, type BotResponseJson, type BreakscapeOptions, type BreakscapedString, Builder, type CardBit, type CardNode, CardSetVersion, type CardSetVersionType, type ChoiceJson, type CodeBlockTextNode, type CodeBlockTextNodeAttributes, type CommentMark, 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 Example, type ExampleJson, type ExtRefMark, type ExtRefMarkAttibutes, type ExtraProperties, type FeedbackChoiceJson, type FeedbackJson, type FeedbackReasonJson, type FileOptions, FileWriter, type FlashcardJson, type Footer, type FootnoteAttibutes, type FootnoteMark, type GapJson, type Generator, type GroupTagJson, type HeadingJson, type HeadingTextNode, type HeadingTextNodeAttributes, type HighlightJson, type HighlightTextJson, type ImageInlineTextNode, type ImageLinkResourceJson, type ImageLinkResourceWrapperJson, type ImageResourceJson, type ImageResourceWrapperJson, 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 LatexTextNode, type LatexTextNodeAttributes, type LinkMark, type LinkMarkAttibutes, type ListItemJson, type ListTextNode, type ListTextNodeAttributes, type MarkConfigJson, type MarkJson, type MatrixCellJson, type MatrixJson, type MediaAttributes, type Node, type NodeInfo, NodeType, type NodeTypeType, Output, type OutputType, type PairJson, type ParserJson, type PersonJson, type UpgradeOptions as PrettifyOptions, type PronunciationTableCellJson, type PronunciationTableJson, type Property, type QuestionJson, type QuizJson, type RatingLevelStartEndJson, type RefMark, type RefMarkAttibutes, ResourceBuilder, type ResourceDataJson, type ResourceJson, 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 TableCellJson, type TableExtendedJson, type TableJson, type TableRowJson, type TableSectionJson, type TaskItemTextNode, type TaskItemTextNodeAttributes, type TechnicalTermJson, type JsonText as Text, type TextAndIconJson, type TextAst, type TextJsonOptions, 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 Writer, type XRefMark, type XRefMarkAttibutes, parse as bitmarkTextParse };
@@ -737,6 +737,7 @@ declare const ConfigKey: {
737
737
  readonly property_availableClassifications: "@availableClassifications";
738
738
  readonly property_brandColor: "@brandColor";
739
739
  readonly property_brandColorName: "@brandColorName";
740
+ readonly property_backgroundImage: "@backgroundImage";
740
741
  readonly property_blockId: "@blockId";
741
742
  readonly property_book: "@book";
742
743
  readonly property_bookAlias: "@bookAlias";
@@ -1027,6 +1028,7 @@ declare const ConfigKey: {
1027
1028
  readonly resource_previewImage: "&previewImage";
1028
1029
  readonly resource_previewVideo: "&previewVideo";
1029
1030
  readonly resource_coverImage: "&coverImage";
1031
+ readonly resource_backgroundImage: "&backgroundImage";
1030
1032
  readonly tag_title: "#";
1031
1033
  readonly tag_anchor: "▼";
1032
1034
  readonly tag_reference: "►";
@@ -1079,6 +1081,7 @@ declare const ResourceType: {
1079
1081
  readonly previewImage: "previewImage";
1080
1082
  readonly previewVideo: "previewVideo";
1081
1083
  readonly coverImage: "coverImage";
1084
+ readonly backgroundImage: "backgroundImage";
1082
1085
  };
1083
1086
  type ResourceTypeType = EnumType<typeof ResourceType>;
1084
1087
 
@@ -1688,6 +1691,7 @@ interface BitJson {
1688
1691
  bookDiff: string;
1689
1692
  coverImage: string | string[];
1690
1693
  coverColor: string;
1694
+ backgroundImage: string | string[];
1691
1695
  publisher: string | string[];
1692
1696
  publisherName: string;
1693
1697
  publications: string | string[];
@@ -2300,6 +2304,7 @@ interface Bit {
2300
2304
  bookDiff?: Property;
2301
2305
  coverImage?: Property | ImageResourceWrapperJson;
2302
2306
  coverColor?: Property;
2307
+ backgroundImage?: Property | ImageResourceWrapperJson;
2303
2308
  publications?: Property;
2304
2309
  relatedBook?: Property;
2305
2310
  translationOfBook?: Property;
@@ -2619,6 +2624,8 @@ declare const NodeType: {
2619
2624
  readonly avatarImage: "avatarImage";
2620
2625
  readonly backgroundWallpaper: "backgroundWallpaper";
2621
2626
  readonly backgroundWallpaperValue: "backgroundWallpaperValue";
2627
+ readonly backgroundImage: "backgroundImage";
2628
+ readonly backgroundImageValue: "backgroundImageValue";
2622
2629
  readonly bitLevel: "bitLevel";
2623
2630
  readonly bitmarkAst: "bitmarkAst";
2624
2631
  readonly bitmarkVersion: "bitmarkVersion";
@@ -3516,6 +3523,7 @@ type GenerateOptions = {
3516
3523
  plainTextDividerAllowed?: boolean;
3517
3524
  noBreakscaping?: boolean;
3518
3525
  forceInline?: boolean;
3526
+ noMarkup?: boolean;
3519
3527
  };
3520
3528
  declare const Stage: {
3521
3529
  enter: string;
@@ -4165,6 +4173,7 @@ declare class Builder extends BaseBuilder {
4165
4173
  bookDiff?: string;
4166
4174
  coverImage?: string | string[] | Partial<ImageResourceWrapperJson>;
4167
4175
  coverColor?: string;
4176
+ backgroundImage?: string | string[] | Partial<ImageResourceWrapperJson>;
4168
4177
  publications?: string | string[];
4169
4178
  relatedBook?: string | string[];
4170
4179
  translationOfBook?: string;
@@ -5591,6 +5600,8 @@ declare class BitmarkGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5591
5600
  protected enter_platformBackgroundImage(node: NodeInfo, _route: NodeInfo[]): boolean;
5592
5601
  protected enter_coverImage(node: NodeInfo, route: NodeInfo[]): boolean;
5593
5602
  protected leaf_coverImage(node: NodeInfo, route: NodeInfo[]): void;
5603
+ protected enter_backgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5604
+ protected leaf_backgroundImage(node: NodeInfo, route: NodeInfo[]): void;
5594
5605
  protected exit_imagePlaceholder(_node: NodeInfo, _route: NodeInfo[]): void;
5595
5606
  protected enter_posterImage(node: NodeInfo, route: NodeInfo[]): boolean;
5596
5607
  protected enter_thumbnails(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -5973,6 +5984,7 @@ declare class JsonGenerator extends AstWalkerGenerator<BitmarkAst, void> {
5973
5984
  protected enter_platformLogo(node: NodeInfo, route: NodeInfo[]): boolean;
5974
5985
  protected enter_platformBackgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5975
5986
  protected enter_coverImage(node: NodeInfo, route: NodeInfo[]): boolean;
5987
+ protected enter_backgroundImage(node: NodeInfo, route: NodeInfo[]): boolean;
5976
5988
  protected enter_resources(node: NodeInfo, route: NodeInfo[]): boolean;
5977
5989
  protected leaf_level(node: NodeInfo, route: NodeInfo[]): boolean;
5978
5990
  protected enter_book(node: NodeInfo, route: NodeInfo[]): boolean;
@@ -6464,6 +6476,13 @@ interface CreateAstOptions {
6464
6476
  */
6465
6477
  inputFormat?: InputType;
6466
6478
  }
6479
+ interface ExtractPlainTextOptions {
6480
+ /**
6481
+ * Set to force input to be interpreted as a particular format, overriding the auto-detection
6482
+ * Auto-detection can fail for certain inputs as the input formats can overlap
6483
+ */
6484
+ inputFormat?: InputFormatType;
6485
+ }
6467
6486
  /**
6468
6487
  * Breakscape options
6469
6488
  */
@@ -6546,8 +6565,30 @@ declare const Output: {
6546
6565
  * Output AST as a plain JS object, or a file
6547
6566
  */
6548
6567
  readonly ast: "ast";
6568
+ /**
6569
+ * Output plain text as a string, or a file
6570
+ */
6571
+ readonly text: "text";
6549
6572
  };
6550
6573
  type OutputType = EnumType<typeof Output>;
6574
+ /**
6575
+ * Input format enumeration
6576
+ */
6577
+ declare const InputFormat: {
6578
+ /**
6579
+ * Input is bitmark
6580
+ */
6581
+ readonly bitmark: "bitmark";
6582
+ /**
6583
+ * Input is bitmarkText
6584
+ */
6585
+ readonly bitmarkText: "bitmarkText";
6586
+ /**
6587
+ * Input is plain text
6588
+ */
6589
+ readonly plainText: "plainText";
6590
+ };
6591
+ type InputFormatType = EnumType<typeof InputFormat>;
6551
6592
  /**
6552
6593
  * Options for bitmark text JSON generation
6553
6594
  */
@@ -6611,6 +6652,12 @@ declare class BitmarkParserGenerator {
6611
6652
  * - input(JSON/AST) ==> output(bitmark)
6612
6653
  * - input(bitmark) ==> output(JSON)
6613
6654
  *
6655
+ * Output type can be overridden to one of the following:
6656
+ * - bitmark: output bitmark string
6657
+ * - json: output JSON as a plain JS object, or a file
6658
+ * - ast: output AST as a plain JS object, or a file
6659
+ * - text: output plain text as a string, or a file
6660
+ *
6614
6661
  * By default, the result is returned as a string for bitmark, or a plain JS object for JSON/AST.
6615
6662
  *
6616
6663
  * The options can be used to write the output to a file and to set conversion options or override defaults.
@@ -6664,7 +6711,7 @@ declare class BitmarkParserGenerator {
6664
6711
  */
6665
6712
  createAst(input: unknown, options?: CreateAstOptions): BitmarkAst;
6666
6713
  /**
6667
- * Convert bitmark text from JSON, or JSON to bitmark text.
6714
+ * Convert bitmark text to JSON, or JSON to bitmark text.
6668
6715
  *
6669
6716
  * Input type is detected automatically and may be:
6670
6717
  * - string: bitmark text or JSON
@@ -6687,6 +6734,7 @@ declare class BitmarkParserGenerator {
6687
6734
  * @throws Error if any error occurs
6688
6735
  */
6689
6736
  convertText(input: string | unknown, options?: ConvertTextOptions): string | unknown | void;
6737
+ extractPlainText(input: string | unknown, options?: ExtractPlainTextOptions): string;
6690
6738
  /**
6691
6739
  * Breakscape bitmark text.
6692
6740
  *
@@ -6725,6 +6773,7 @@ declare class BitmarkParserGenerator {
6725
6773
  * @throws Error if any error occurs
6726
6774
  */
6727
6775
  unbreakscapeText(input: string, options?: UnbreakscapeOptions): string | void;
6776
+ textAstToPlainText(textAst: TextAst, _options?: ExtractPlainTextOptions): string;
6728
6777
  /**
6729
6778
  * Stringify / prettify a plain JS object to a JSON string, depending on the JSON options
6730
6779
  *
@@ -6891,4 +6940,4 @@ declare class JsonFileGenerator implements Generator<BitmarkAst> {
6891
6940
  generateSync(_ast: BitmarkAst): void;
6892
6941
  }
6893
6942
 
6894
- export { type AppLinkResourceJson, type AppLinkResourceWrapperJson, type ArticleResourceJson, type ArticleResourceWrapperJson, Ast, type AstWalkCallbacks, type AudioEmbedResourceJson, type AudioEmbedResourceWrapperJson, type AudioLinkResourceJson, type AudioLinkResourceWrapperJson, type AudioResourceJson, type AudioResourceWrapperJson, type Bit, type BitJson, BitType, type BitTypeType, type BitWrapperJson, type BitmarkAst, BitmarkFileGenerator, BitmarkGenerator, type BitmarkOptions, BitmarkParser, BitmarkParserGenerator, BitmarkParserType, type BitmarkParserTypeType, BitmarkStringGenerator, BitmarkVersion, type BitmarkVersionType, type Body, type BodyBitJson, type BodyBitsJson, type BodyPart, BodyTextFormat, type BodyTextFormatType, type BookJson, type BookReferenceJson, type BotResponseJson, type BreakscapeOptions, type BreakscapedString, Builder, type CardBit, type CardNode, CardSetVersion, type CardSetVersionType, type ChoiceJson, type CodeBlockTextNode, type CodeBlockTextNodeAttributes, type CommentMark, 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 Example, type ExampleJson, type ExtRefMark, type ExtRefMarkAttibutes, type ExtraProperties, type FeedbackChoiceJson, type FeedbackJson, type FeedbackReasonJson, type FileOptions, FileWriter, type FlashcardJson, type Footer, type FootnoteAttibutes, type FootnoteMark, type GapJson, type Generator, type GroupTagJson, type HeadingJson, type HeadingTextNode, type HeadingTextNodeAttributes, type HighlightJson, type HighlightTextJson, type ImageInlineTextNode, type ImageLinkResourceJson, type ImageLinkResourceWrapperJson, type ImageResourceJson, type ImageResourceWrapperJson, type ImageSourceJson, type ImageTextNode, type ImageTextNodeAttributes, InfoFormat, type InfoFormatType, type InfoOptions, InfoType, type InfoTypeType, type IngredientJson, Input, type InputType, JsonFileGenerator, JsonGenerator, type JsonOptions, JsonParser, JsonStringGenerator, type LatexTextNode, type LatexTextNodeAttributes, type LinkMark, type LinkMarkAttibutes, type ListItemJson, type ListTextNode, type ListTextNodeAttributes, type MarkConfigJson, type MarkJson, type MatrixCellJson, type MatrixJson, type MediaAttributes, type Node, type NodeInfo, NodeType, type NodeTypeType, Output, type OutputType, type PairJson, type ParserJson, type PersonJson, type UpgradeOptions as PrettifyOptions, type PronunciationTableCellJson, type PronunciationTableJson, type Property, type QuestionJson, type QuizJson, type RatingLevelStartEndJson, type RefMark, type RefMarkAttibutes, ResourceBuilder, type ResourceDataJson, type ResourceJson, 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 TableCellJson, type TableExtendedJson, type TableJson, type TableRowJson, type TableSectionJson, type TaskItemTextNode, type TaskItemTextNodeAttributes, type TechnicalTermJson, type JsonText as Text, type TextAndIconJson, type TextAst, type TextJsonOptions, 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 Writer, type XRefMark, type XRefMarkAttibutes, parse as bitmarkTextParse };
6943
+ export { type AppLinkResourceJson, type AppLinkResourceWrapperJson, type ArticleResourceJson, type ArticleResourceWrapperJson, Ast, type AstWalkCallbacks, type AudioEmbedResourceJson, type AudioEmbedResourceWrapperJson, type AudioLinkResourceJson, type AudioLinkResourceWrapperJson, type AudioResourceJson, type AudioResourceWrapperJson, type Bit, type BitJson, BitType, type BitTypeType, type BitWrapperJson, type BitmarkAst, BitmarkFileGenerator, BitmarkGenerator, type BitmarkOptions, BitmarkParser, BitmarkParserGenerator, BitmarkParserType, type BitmarkParserTypeType, BitmarkStringGenerator, BitmarkVersion, type BitmarkVersionType, type Body, type BodyBitJson, type BodyBitsJson, type BodyPart, BodyTextFormat, type BodyTextFormatType, type BookJson, type BookReferenceJson, type BotResponseJson, type BreakscapeOptions, type BreakscapedString, Builder, type CardBit, type CardNode, CardSetVersion, type CardSetVersionType, type ChoiceJson, type CodeBlockTextNode, type CodeBlockTextNodeAttributes, type CommentMark, 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 Example, type ExampleJson, type ExtRefMark, type ExtRefMarkAttibutes, type ExtraProperties, type FeedbackChoiceJson, type FeedbackJson, type FeedbackReasonJson, type FileOptions, FileWriter, type FlashcardJson, type Footer, type FootnoteAttibutes, type FootnoteMark, type GapJson, type Generator, type GroupTagJson, type HeadingJson, type HeadingTextNode, type HeadingTextNodeAttributes, type HighlightJson, type HighlightTextJson, type ImageInlineTextNode, type ImageLinkResourceJson, type ImageLinkResourceWrapperJson, type ImageResourceJson, type ImageResourceWrapperJson, 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 LatexTextNode, type LatexTextNodeAttributes, type LinkMark, type LinkMarkAttibutes, type ListItemJson, type ListTextNode, type ListTextNodeAttributes, type MarkConfigJson, type MarkJson, type MatrixCellJson, type MatrixJson, type MediaAttributes, type Node, type NodeInfo, NodeType, type NodeTypeType, Output, type OutputType, type PairJson, type ParserJson, type PersonJson, type UpgradeOptions as PrettifyOptions, type PronunciationTableCellJson, type PronunciationTableJson, type Property, type QuestionJson, type QuizJson, type RatingLevelStartEndJson, type RefMark, type RefMarkAttibutes, ResourceBuilder, type ResourceDataJson, type ResourceJson, 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 TableCellJson, type TableExtendedJson, type TableJson, type TableRowJson, type TableSectionJson, type TaskItemTextNode, type TaskItemTextNodeAttributes, type TechnicalTermJson, type JsonText as Text, type TextAndIconJson, type TextAst, type TextJsonOptions, 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 Writer, type XRefMark, type XRefMarkAttibutes, parse as bitmarkTextParse };