import type { appdxItemTags, articleGroupTags, paragraphItemTags, supplProvisionAppdxItemTags } from "../../law/std"; import type { AttrEntries, SentencesArray, Controls, SentenceChildEL } from "./inline"; /** * Line: the unit of a CST of the parsed lawtext. * * A `Line` represents a physical line in the lawtext separated by newline characters. The `Line` object has a property named `type` with the type of `LineType`, and the different types of `Line` are distinguished by that property. */ export type Line = BlankLine | TOCHeadLine | ArticleGroupHeadLine | AppdxItemHeadLine | SupplProvisionHeadLine | SupplProvisionAppdxItemHeadLine | ArticleLine | ParagraphItemLine | TableColumnLine | OtherLine; /** * LineType: the identifiers that distinguish the different types of `Line`. */ export declare enum LineType { BNK = "BNK", TOC = "TOC", ARG = "ARG", APP = "APP", SPR = "SPR", SPA = "SPA", ART = "ART", PIT = "PIT", TBL = "TBL", OTH = "OTH" } interface BaseLineOptions { type: TType; range: [start: number, end: number] | null; lineEndText: string; } declare abstract class BaseLine { type: TType; range: [start: number, end: number] | null; lineEndText: string; constructor(options: BaseLineOptions); text(): string; abstract rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; lineEndTextRange(): [start: number, end: number] | null; } type IndentsLineOptions = BaseLineOptions & { indentTexts: string[]; }; declare abstract class IndentsLine extends BaseLine { indentTexts: string[]; constructor(options: IndentsLineOptions); indentRangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; get indentsEndPos(): number | null; } type WithControlsLineOptions = IndentsLineOptions & { controls: Controls; }; declare abstract class WithControlsLine extends IndentsLine { controls: Controls; constructor(options: WithControlsLineOptions); controlsRangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; get controlsEndPos(): number | null; } type BlankLineOptions = Omit, "type">; /** * A blank line with no printable characters. Please see the source code of {@link $blankLine} for the detailed syntax. */ export declare class BlankLine extends BaseLine { constructor(options: BlankLineOptions); rangeTexts(): ReturnType; } type TOCHeadLineOptions = Omit, "type"> & { title: string; }; /** * A head line of a TOC (Table Of Contents). Please see the source code of {@link $tocHeadLine} for the detailed syntax. */ export declare class TOCHeadLine extends WithControlsLine { title: string; constructor(options: TOCHeadLineOptions); get titleRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type ArticleGroupHeadLineOptions = Omit, "type"> & { mainTag: (typeof articleGroupTags)[number]; sentenceChildren: SentenceChildEL[]; }; /** * A head line of an article group (e.g. "Chapter"). Please see the source code of {@link $articleGroupHeadLine} for the detailed syntax. */ export declare class ArticleGroupHeadLine extends WithControlsLine { mainTag: (typeof articleGroupTags)[number]; title: SentenceChildEL[]; constructor(options: ArticleGroupHeadLineOptions); get titleRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type AppdxItemHeadLineOptions = Omit, "type"> & { mainTag: (typeof appdxItemTags)[number]; title: SentenceChildEL[]; relatedArticleNum: SentenceChildEL[]; }; /** * A head line of an appended item such as an appended table. Please see the source code of {@link $appdxItemHeadLine} for the detailed syntax. */ export declare class AppdxItemHeadLine extends WithControlsLine { mainTag: (typeof appdxItemTags)[number]; title: SentenceChildEL[]; relatedArticleNum: SentenceChildEL[]; constructor(options: AppdxItemHeadLineOptions); get titleRange(): [number, number] | null; get relatedArticleNumRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type SupplProvisionHeadLineOptions = Omit, "type"> & { title: string; titleRange: [number, number] | null; openParen: string; amendLawNum: string; closeParen: string; extractText: string; }; /** * A head line of a supplementary provision. Please see the source code of {@link $supplProvisionHeadLine} for the detailed syntax. */ export declare class SupplProvisionHeadLine extends WithControlsLine { title: string; titleRange: [number, number] | null; openParen: string; amendLawNum: string; closeParen: string; extractText: string; constructor(options: SupplProvisionHeadLineOptions); get openParenRange(): [number, number] | null; get amendLawNumRange(): [number, number] | null; get closeParenRange(): [number, number] | null; get extractTextRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type SupplProvisionAppdxItemHeadLineOptions = Omit, "type"> & { mainTag: (typeof supplProvisionAppdxItemTags)[number]; title: SentenceChildEL[]; relatedArticleNum: SentenceChildEL[]; }; /** * A head line of an appended item in a supplementary provision. Please see the source code of {@link $supplProvisionAppdxItemHeadLine} for the detailed syntax. */ export declare class SupplProvisionAppdxItemHeadLine extends WithControlsLine { mainTag: (typeof supplProvisionAppdxItemTags)[number]; title: SentenceChildEL[]; relatedArticleNum: SentenceChildEL[]; constructor(options: SupplProvisionAppdxItemHeadLineOptions); get titleRange(): [number, number] | null; get relatedArticleNumRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type ArticleLineOptions = Omit, "type"> & { title: string; midSpace: string; sentencesArray: SentencesArray; }; /** * A first line of an article. Please see the source code of {@link $articleLine} for the detailed syntax. */ export declare class ArticleLine extends IndentsLine { title: string; midSpace: string; sentencesArray: SentencesArray; constructor(options: ArticleLineOptions); get titleRange(): [number, number] | null; get midSpaceRange(): [number, number] | null; get sentencesArrayRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type ParagraphItemLineOptions = Omit, "type"> & { mainTag: TTag; controls: Controls; title: string; midSpace: string; sentencesArray: SentencesArray; }; /** * A first line of a paragraph, item, and subitem. Please see the source code of {@link $paragraphItemLine} for the detailed syntax. */ export declare class ParagraphItemLine extends WithControlsLine { mainTag: TTag; controls: Controls; title: string; midSpace: string; sentencesArray: SentencesArray; constructor(options: ParagraphItemLineOptions); get titleRange(): [number, number] | null; get midSpaceRange(): [number, number] | null; get sentencesArrayRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; withTag(tag: TNewTag): ParagraphItemLine; } type TableColumnLineOptions = Omit, "type"> & { firstColumnIndicator: "*" | ""; midIndicatorsSpace: string; columnIndicator: "-" | "*"; midSpace: string; attrEntries: AttrEntries; multilineIndicator: "|" | ""; sentencesArray: SentencesArray; }; /** * A line of table column. Please see the source code of {@link $tableColumnLine} for the detailed syntax. */ export declare class TableColumnLine extends IndentsLine { firstColumnIndicator: "*" | ""; midIndicatorsSpace: string; columnIndicator: "-" | "*"; midSpace: string; attrEntries: AttrEntries; multilineIndicator: "|" | ""; sentencesArray: SentencesArray; constructor(options: TableColumnLineOptions); get firstColumnIndicatorRange(): [number, number] | null; get midIndicatorsSpaceRange(): [number, number] | null; get columnIndicatorRange(): [number, number] | null; get midSpaceRange(): [number, number] | null; attrEntriesRangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; get multilineIndicatorRange(): [number, number] | null; get sentencesArrayRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } type OtherLineOptions = Omit, "type"> & { sentencesArray: SentencesArray; }; /** * A line of other types. Please see the source code of {@link $otherLine} for the detailed syntax. */ export declare class OtherLine extends WithControlsLine { sentencesArray: SentencesArray; constructor(options: OtherLineOptions); get sentencesArrayRange(): [number, number] | null; rangeTexts(): [range: [start: number, end: number] | null, text: string, description: string][]; } export {};