@tricoteuses/tisseuse 0.14.2 → 0.14.4

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.
@@ -52,6 +52,8 @@ export type ActionOperation = (ActionOperationTarget & {
52
52
  targetText: string;
53
53
  replacementText: string;
54
54
  replacement: ActionReplacement;
55
+ occurrenceIndex?: number;
56
+ targetOccurrenceCount?: number;
55
57
  targetScope?: ActionTargetScope;
56
58
  tableTarget?: ActionTableTarget;
57
59
  }) | (ActionOperationTarget & {
@@ -59,6 +61,7 @@ export type ActionOperation = (ActionOperationTarget & {
59
61
  targetText: string;
60
62
  targetScope?: ActionTargetScope;
61
63
  occurrenceIndex?: number;
64
+ targetOccurrenceCount?: number;
62
65
  tableTarget?: ActionTableTarget;
63
66
  }) | (ActionOperationTarget & {
64
67
  kind: "delete_portion";
@@ -94,6 +97,8 @@ export type ResolvedActionDirective = (ActionDirectiveCommon & {
94
97
  targetText: string;
95
98
  replacementText: string;
96
99
  replacement: ActionReplacement;
100
+ occurrenceIndex?: number;
101
+ targetOccurrenceCount?: number;
97
102
  targetScope?: ActionTargetScope;
98
103
  tableTarget?: ActionTableTarget;
99
104
  }) | (ActionDirectiveCommon & {
@@ -104,6 +109,7 @@ export type ResolvedActionDirective = (ActionDirectiveCommon & {
104
109
  targetText: string;
105
110
  targetScope?: ActionTargetScope;
106
111
  occurrenceIndex?: number;
112
+ targetOccurrenceCount?: number;
107
113
  tableTarget?: ActionTableTarget;
108
114
  }) | (ActionDirectiveCommon & {
109
115
  kind: "delete_portion";
@@ -6,7 +6,7 @@ export { hashSenatSearchItem, parseSenatDocumentSearchContent, type SenatSearchI
6
6
  export { isAkomaNtosoXml, resolveSenatAkomaNtosoSource, type SenatAkomaNtosoSource, } from './senat_document_sources.js';
7
7
  export { simplifyWordHtml, simplifyWordHtmlToDocument, type SimplifyHtmlOptions, } from './html_simplifier.js';
8
8
  export { addLinksOrReferencesToHtmlFile } from './linkers/html.js';
9
- export { linkAkomaNtosoBillRaw, linkAssembleeBillRaw, parseAkomaNtosoBillRaw, parseAssembleeBillRaw, renderAkomaNtosoBillRaw, type LinkedBillDocument, type ParsedBillArticle, type ParsedBillBlock, type ParsedBillBlockKind, type ParsedBillDiagnostic, type ParsedBillDirective, type ParsedBillDocument, type ParsedBillLink, type ParsedBillSourceFormat, type ParsedBillToc, type ParseBillRawOptions, } from './parsed_bills.js';
9
+ export { linkAkomaNtosoBillRaw, linkAssembleeBillRaw, parseAkomaNtosoBillRaw, parseAssembleeBillRaw, renderAkomaNtosoBillRaw, type LinkedBillDocument, type ParsedBillAnnotation, type ParsedBillAnnotationRange, type ParsedBillAnnotationSeverity, type ParsedBillArticle, type ParsedBillBlock, type ParsedBillBlockKind, type ParsedBillDiagnostic, type ParsedBillDirective, type ParsedBillDocument, type ParsedBillLink, type ParsedBillSourceFormat, type ParsedBillToc, type ParseBillRawOptions, } from './parsed_bills.js';
10
10
  export { type LegiArticleInfo, LegiResolver, type LegiSectionInfo, type PreloadActiveArticlesByTextIdsOptions, type PreloadTextTitlesInfosOptions, type PreloadTextTitlesInfosProgress, } from '../legi/resolver.js';
11
11
  export { buildAndInstallTextTitlesInfos, buildTextTitlesInfos, type BuildTextTitlesInfosProgress, type TextTitlesInfoRow, type TextTitlesInfos, } from '../legi/text_titles_infos.js';
12
12
  export { addPositionsToTableOfContentsFile, simplifiedHtmlBillFileToTableOfContentsFile, } from './tables_of_contents.js';
@@ -11,6 +11,21 @@ export type ParsedBillDiagnostic = {
11
11
  message: string;
12
12
  details?: unknown;
13
13
  };
14
+ export type ParsedBillAnnotationSeverity = "warning";
15
+ export type ParsedBillAnnotationRange = {
16
+ blockId: string;
17
+ start: number;
18
+ stop: number;
19
+ text: string;
20
+ };
21
+ export type ParsedBillAnnotation = {
22
+ articleId: string;
23
+ code: string;
24
+ details?: unknown;
25
+ message: string;
26
+ ranges: ParsedBillAnnotationRange[];
27
+ severity: ParsedBillAnnotationSeverity;
28
+ };
14
29
  export type ParsedBillBlock = {
15
30
  id: string;
16
31
  articleId: string;
@@ -100,6 +115,7 @@ export type ParsedBillDocument = {
100
115
  globalApplicabilityDate?: string;
101
116
  internalArticleDefinitions?: ParsedBillInternalArticleDefinition[];
102
117
  directives: ParsedBillDirective[];
118
+ annotations?: ParsedBillAnnotation[];
103
119
  diagnostics?: ParsedBillDiagnostic[];
104
120
  };
105
121
  export declare function parseAssembleeBillRaw(input: string, options: ParseBillRawOptions): Promise<ParsedBillDocument>;
@@ -19,6 +19,7 @@ export interface TextAstAction {
19
19
  export type TextAstActionDirectiveOperation = {
20
20
  kind: "delete";
21
21
  occurrenceIndex?: number;
22
+ targetOccurrenceCount?: number;
22
23
  targetCitation: TextAstCitation;
23
24
  targetScope?: TextAstActionTargetScope;
24
25
  } | {
@@ -27,7 +28,9 @@ export type TextAstActionDirectiveOperation = {
27
28
  targetCitation?: TextAstCitation;
28
29
  } | {
29
30
  kind: "replace";
31
+ occurrenceIndex?: number;
30
32
  replacementCitation: TextAstCitation;
33
+ targetOccurrenceCount?: number;
31
34
  targetCitation: TextAstCitation;
32
35
  targetScope?: TextAstActionTargetScope;
33
36
  } | {
@@ -1,11 +1,11 @@
1
1
  import { TextAst, TextAstCitation } from './ast.js';
2
- import { TextParserContext } from './parsers.js';
2
+ import { TextParserContext, TextParser } from './parsers.js';
3
3
  import { TransformationLeaf } from './transformers.js';
4
4
  type TextAstPositionRange = TextAstCitation["position"];
5
5
  export declare function createTextAstCitation(contentPosition: TextAstPositionRange, position?: TextAstPositionRange): TextAstCitation;
6
- export declare const citationLigne: import('./parsers.js').TextParser<TextAst>;
7
- export declare const citationSimple: import('./parsers.js').TextParser<TextAst>;
8
- export declare const citation: import('./parsers.js').TextParser<TextAst>;
6
+ export declare const citationLigne: TextParser<TextAst>;
7
+ export declare const citationSimple: TextParser<TextAst>;
8
+ export declare const citation: TextParser<TextAst>;
9
9
  export declare function convertCitationToText(context: TextParserContext, citation: TextAstCitation): TransformationLeaf;
10
10
  export declare function citationToText(sourceText: string, citation: TextAstCitation): string;
11
11
  export {};
@@ -1,4 +1,5 @@
1
1
  import { TextParser } from './parsers.js';
2
2
  export declare const repeatedActionQualifier: TextParser<number>;
3
3
  export declare function findRepeatedActionCount(text: string): number | null;
4
+ export declare function findRepeatedTargetOccurrenceCount(text: string, position: number): number | null;
4
5
  export declare function stripRepeatedActionQualifiers(text: string): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tricoteuses/tisseuse",
3
3
  "description": "Find links in/to French legislative documents",
4
- "version": "0.14.2",
4
+ "version": "0.14.4",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",