import { FragmentPosition, FragmentReverseTransformation } from './fragments.js'; export type CompoundReferencesSeparator = (typeof compoundReferencesSeparators)[number]; export type ActionTarget = (typeof actionTargets)[number]; export declare const actionTargets: readonly ["article", "portion", "division", "texte", "unknown"]; export type DivisionType = (typeof divisionTypes)[number]; export type EuropeanLawNature = (typeof europeanLawNatures)[number]; export type FrenchLawNature = (typeof frenchLawNatures)[number]; export type InternationalLawNature = (typeof internationalLawNatures)[number]; export type LawNature = (typeof lawNatures)[number]; export type LocalizationAdverb = (typeof localizationAdverbs)[number]; export type PortionType = (typeof portionTypes)[number]; export type TextAst = boolean | null | number | string | TextAstAction | TextAstActionDirective | TextAstApplicabilityClause | TextAstArticle | TextAstBoundedInterval | TextAstCitation | TextAstLocalization | TextAstModificationBlock | TextAstModificationItem | TextAstNumber | TextAstPosition | TextAstReference | TextAstText | TextAstTextIdentification | TextAstTextInfos | Array; export interface TextAstAction { action: "abroger" | "ajouter" | "application" | "compléter" | "dérogation" | "devenir" | "insérer" | "mention" | "modifier" | "précision" | "prévision" | "remplacer" | "renuméroter" | "rédiger" | "référence_définition" | "rétablir" | "supprimer"; actionInContent?: boolean; originalCitations?: TextAstCitation[]; target?: ActionTarget; } export type TextAstActionDirectiveOperation = { kind: "delete"; occurrenceIndex?: number; targetCitation: TextAstCitation; targetScope?: TextAstActionTargetScope; } | { insertCitation: TextAstCitation; kind: "insert_after" | "insert_before"; targetCitation?: TextAstCitation; } | { kind: "replace"; replacementCitation: TextAstCitation; targetCitation: TextAstCitation; targetScope?: TextAstActionTargetScope; } | { kind: "replace_portion"; replacementCitation?: TextAstCitation; replacementKind: "following_table" | "text"; } | { kind: "delete_portion"; } | { kind: "delete_article"; }; export type TextAstActionTargetScope = { type: "tail_after_target"; unit?: "phrase" | "alinéa" | "article"; }; export type TextAstActionDirective = { action: TextAstAction; operations: TextAstActionDirectiveOperation[]; reference: TextAstReference; type: "action_directive"; } & TextAstPosition; export type TextAstApplicabilityClause = { date: string; itemPaths: string[][]; type: "applicability_clause"; } & TextAstPosition; export type TextAstModificationItem = { actionDirectives: TextAstActionDirective[]; applicabilityClauses: TextAstApplicabilityClause[]; children: TextAstModificationItem[]; marker: string; path: string[]; type: "modification_item"; } & TextAstPosition; export type TextAstModificationBlock = { actionDirectives: TextAstActionDirective[]; applicabilityClauses: TextAstApplicabilityClause[]; items: TextAstModificationItem[]; type: "modification_block"; } & TextAstPosition; export type TextAstArticle = { definition?: boolean; definitionSuffix?: string; implicitText?: TextAstText | undefined; localizationAdverb?: LocalizationAdverb; newOrOld?: "new" | "old"; ofTheSaid?: boolean; type: "article"; } & TextAstLocalization & TextAstPosition; export type TextAstAtomicReference = TextAstArticle | TextAstDivision | TextAstIncompleteHeader | TextAstPortion | (TextAstText & TextAstPosition); export type TextAstBoundedInterval = { first: TextAstReference; last: TextAstReference; type: "bounded-interval"; } & TextAstPosition; export type TextAstCitation = { content: TextAstPosition[]; references?: TextAstReference[]; type: "citation"; } & TextAstPosition; export type TextAstCompoundReference = TextAstBoundedInterval | TextAstCountedInterval | TextAstEnumeration | TextAstExclusion; export type TextAstConseilConstitutionnelDecision = { num: string; type: "décision du Conseil constitutionnel"; } & TextAstPosition; export type TextAstCountedInterval = { count: number; first: TextAstReference; type: "counted-interval"; } & TextAstPosition; export type TextAstDivision = { definition?: boolean; definitionSuffix?: string; ofTheSaid?: boolean; type: DivisionType; } & TextAstLocalization & TextAstPosition; export type TextAstEnumeration = { coordinator: "," | "et" | "ou"; left: TextAstReference; right: TextAstReference; type: "enumeration"; } & TextAstPosition; export type TextAstExclusion = { left: TextAstReference; right: TextAstReference; type: "exclusion"; } & TextAstPosition; export interface TextAstTextIdentification { date?: string; dateCalendrierRepublicain?: string; /** * For the texts found in the Légifrance datasets, this is * Légifrance NUM of the text (for example the number of the law). */ num?: string; } export type TextAstIncompleteHeader = { localizationAdverb?: LocalizationAdverb; ofTheSaid?: boolean; type: "incomplete-header"; } & TextAstLocalization & TextAstPosition; export interface TextAstLocalization { index?: number; num?: string; present?: boolean; relative?: number | "+∞"; } export type TextAstNumber = { text: string; value: number; } & TextAstPosition; export type TextAstParentChild = { child: TextAstReference; parent: TextAstAtomicReference; type: "parent-enfant"; } & TextAstPosition; export type TextAstPortion = { ofTheSaid?: boolean; type: PortionType; } & TextAstLocalization & TextAstPosition; export interface TextAstPosition { originalTransformation?: FragmentReverseTransformation; position: FragmentPosition; } export type TextAstReference = TextAstAtomicReference | TextAstCompoundReference | TextAstParentChild | TextAstReferenceAndAction; export type TextAstReferenceAndAction = { action: TextAstAction; reference: TextAstReference; type: "reference_et_action"; } & TextAstPosition; export type TextAstText = { /** * For the texts found in the Légifrance datasets, this is * Légifrance CID of the text. */ cid?: string; nature: LawNature; legislation?: "international" | "UE"; ofTheSaid?: boolean; /** * For the texts found in the Légifrance datasets, the title * is the Légifrance one ⇒ it may differ from the title given in * input. */ title?: string; titleRest?: string; type: "texte"; } & TextAstTextIdentification & TextAstLocalization; export interface TextAstTextInfos { cid: string | string[]; } export type TextInfosByWordsTree = TextAstTextInfos | TextInfosByWordsTreeNode; export type TextInfosByWordsTreeNode = { cid?: string | string[]; } & { [word: string]: TextInfosByWordsTree; }; export declare const compoundReferencesSeparators: readonly [",", "à", "et", "ou", "sauf"]; export declare const europeanLawNatures: readonly ["ARRETEEURO", "ARRETEURO", "AVISEURO", "DECISION_EURO", "DECLARATIONEURO", "DELIBERATIONEURO", "DIRECTIVE_EURO", "INFORMATIONEURO", "INSTRUCTIONEURO", "LETTREEURO", "REGLEMENTEUROPEEN"]; export declare const frenchLawNatures: readonly ["ARRETE", "CIRCULAIRE", "CODE", "CONSTITUTION", "DECRET", "DECRET_LOI", "LOI", "LOI_CONSTIT", "LOI_ORGANIQUE", "ORDONNANCE"]; export declare const internationalLawNatures: readonly ["CONVENTION"]; export declare const divisionTypes: readonly ["partie", "livre", "titre", "sous-titre", "chapitre", "section", "sous-section", "paragraphe", "sous-paragraphe", "sous-sous-paragraphe"]; export declare const lawNatures: readonly ["ARRETEEURO", "ARRETEURO", "AVISEURO", "DECISION_EURO", "DECLARATIONEURO", "DELIBERATIONEURO", "DIRECTIVE_EURO", "INFORMATIONEURO", "INSTRUCTIONEURO", "LETTREEURO", "REGLEMENTEUROPEEN", "ARRETE", "CIRCULAIRE", "CODE", "CONSTITUTION", "DECRET", "DECRET_LOI", "LOI", "LOI_CONSTIT", "LOI_ORGANIQUE", "ORDONNANCE", "CONVENTION"]; /** * Portions are elements of an article. * "items" is a generic term for lines preceded with a number. */ export declare const portionTypes: readonly ["item", "alinéa", "phrase"]; export declare const localizationAdverbs: readonly ["après", "avant", "dessous", "dessus"]; export declare function isTextAstAtomicReference(reference: TextAstReference): reference is TextAstAtomicReference; export declare function isTextAstDivision(reference: TextAstReference): reference is TextAstDivision; export declare function isTextAstPortion(reference: TextAstReference): reference is TextAstPortion;