@pubid/pubid 0.1.3 → 0.1.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.
Files changed (183) hide show
  1. package/artifact/corpus.json.gz +0 -0
  2. package/dist/conformance/cli.js +5 -1
  3. package/dist/flavors/amca/grammar.d.ts +4 -0
  4. package/dist/flavors/amca/grammar.js +87 -0
  5. package/dist/flavors/amca/index.d.ts +4 -0
  6. package/dist/flavors/amca/index.js +76 -0
  7. package/dist/flavors/amca/model.d.ts +29 -0
  8. package/dist/flavors/amca/model.js +146 -0
  9. package/dist/flavors/ansi/index.d.ts +24 -0
  10. package/dist/flavors/ansi/index.js +147 -0
  11. package/dist/flavors/api/grammar.d.ts +4 -0
  12. package/dist/flavors/api/grammar.js +79 -0
  13. package/dist/flavors/api/index.d.ts +4 -0
  14. package/dist/flavors/api/index.js +71 -0
  15. package/dist/flavors/api/model.d.ts +27 -0
  16. package/dist/flavors/api/model.js +114 -0
  17. package/dist/flavors/ashrae/grammar.d.ts +2 -0
  18. package/dist/flavors/ashrae/grammar.js +667 -0
  19. package/dist/flavors/ashrae/index.d.ts +4 -0
  20. package/dist/flavors/ashrae/index.js +306 -0
  21. package/dist/flavors/ashrae/model.d.ts +87 -0
  22. package/dist/flavors/ashrae/model.js +335 -0
  23. package/dist/flavors/ashrae/preprocessor.d.ts +7 -0
  24. package/dist/flavors/ashrae/preprocessor.js +44 -0
  25. package/dist/flavors/asme/grammar.d.ts +2 -0
  26. package/dist/flavors/asme/grammar.js +200 -0
  27. package/dist/flavors/asme/index.d.ts +4 -0
  28. package/dist/flavors/asme/index.js +138 -0
  29. package/dist/flavors/asme/model.d.ts +34 -0
  30. package/dist/flavors/asme/model.js +123 -0
  31. package/dist/flavors/astm/grammar.d.ts +2 -0
  32. package/dist/flavors/astm/grammar.js +110 -0
  33. package/dist/flavors/astm/index.d.ts +2 -0
  34. package/dist/flavors/astm/index.js +127 -0
  35. package/dist/flavors/astm/model.d.ts +42 -0
  36. package/dist/flavors/astm/model.js +263 -0
  37. package/dist/flavors/bipm/index.d.ts +30 -0
  38. package/dist/flavors/bipm/index.js +434 -0
  39. package/dist/flavors/bsi/grammar.d.ts +4 -0
  40. package/dist/flavors/bsi/grammar.js +535 -0
  41. package/dist/flavors/bsi/index.d.ts +4 -0
  42. package/dist/flavors/bsi/index.js +941 -0
  43. package/dist/flavors/bsi/model.d.ts +127 -0
  44. package/dist/flavors/bsi/model.js +863 -0
  45. package/dist/flavors/calconnect/index.d.ts +21 -0
  46. package/dist/flavors/calconnect/index.js +113 -0
  47. package/dist/flavors/cen_cenelec/grammar.d.ts +4 -0
  48. package/dist/flavors/cen_cenelec/grammar.js +107 -0
  49. package/dist/flavors/cen_cenelec/index.d.ts +5 -0
  50. package/dist/flavors/cen_cenelec/index.js +263 -0
  51. package/dist/flavors/cen_cenelec/model.d.ts +45 -0
  52. package/dist/flavors/cen_cenelec/model.js +490 -0
  53. package/dist/flavors/cie/grammar.d.ts +5 -0
  54. package/dist/flavors/cie/grammar.js +127 -0
  55. package/dist/flavors/cie/index.d.ts +2 -0
  56. package/dist/flavors/cie/index.js +311 -0
  57. package/dist/flavors/cie/model.d.ts +122 -0
  58. package/dist/flavors/cie/model.js +464 -0
  59. package/dist/flavors/csa/grammar.d.ts +6 -0
  60. package/dist/flavors/csa/grammar.js +239 -0
  61. package/dist/flavors/csa/index.d.ts +2 -0
  62. package/dist/flavors/csa/index.js +634 -0
  63. package/dist/flavors/csa/model.d.ts +33 -0
  64. package/dist/flavors/csa/model.js +505 -0
  65. package/dist/flavors/doi/index.d.ts +13 -0
  66. package/dist/flavors/doi/index.js +65 -0
  67. package/dist/flavors/easc/index.d.ts +4 -0
  68. package/dist/flavors/easc/index.js +107 -0
  69. package/dist/flavors/ecma/index.d.ts +4 -0
  70. package/dist/flavors/ecma/index.js +117 -0
  71. package/dist/flavors/etsi/index.d.ts +14 -0
  72. package/dist/flavors/etsi/index.js +307 -0
  73. package/dist/flavors/evs/grammar.d.ts +2 -0
  74. package/dist/flavors/evs/grammar.js +22 -0
  75. package/dist/flavors/evs/index.d.ts +2 -0
  76. package/dist/flavors/evs/index.js +24 -0
  77. package/dist/flavors/evs/model.d.ts +19 -0
  78. package/dist/flavors/evs/model.js +36 -0
  79. package/dist/flavors/gb/index.d.ts +24 -0
  80. package/dist/flavors/gb/index.js +111 -0
  81. package/dist/flavors/gost/grammar.d.ts +2 -0
  82. package/dist/flavors/gost/grammar.js +46 -0
  83. package/dist/flavors/gost/index.d.ts +2 -0
  84. package/dist/flavors/gost/index.js +165 -0
  85. package/dist/flavors/gost/model.d.ts +61 -0
  86. package/dist/flavors/gost/model.js +147 -0
  87. package/dist/flavors/gost/prefix_routes.d.ts +15 -0
  88. package/dist/flavors/gost/prefix_routes.js +192 -0
  89. package/dist/flavors/iala/index.d.ts +32 -0
  90. package/dist/flavors/iala/index.js +300 -0
  91. package/dist/flavors/iana/index.d.ts +19 -0
  92. package/dist/flavors/iana/index.js +71 -0
  93. package/dist/flavors/idf/grammar.d.ts +2 -0
  94. package/dist/flavors/idf/grammar.js +71 -0
  95. package/dist/flavors/idf/index.d.ts +2 -0
  96. package/dist/flavors/idf/index.js +100 -0
  97. package/dist/flavors/idf/model.d.ts +54 -0
  98. package/dist/flavors/idf/model.js +359 -0
  99. package/dist/flavors/iec/grammar.d.ts +3 -0
  100. package/dist/flavors/iec/grammar.js +187 -0
  101. package/dist/flavors/iec/index.d.ts +4 -0
  102. package/dist/flavors/iec/index.js +507 -0
  103. package/dist/flavors/iec/model.d.ts +54 -0
  104. package/dist/flavors/iec/model.js +437 -0
  105. package/dist/flavors/ieee/grammar.d.ts +2 -0
  106. package/dist/flavors/ieee/grammar.js +626 -0
  107. package/dist/flavors/ieee/index.d.ts +3 -0
  108. package/dist/flavors/ieee/index.js +1186 -0
  109. package/dist/flavors/ieee/model.d.ts +142 -0
  110. package/dist/flavors/ieee/model.js +1148 -0
  111. package/dist/flavors/ieee/preprocessor.d.ts +8 -0
  112. package/dist/flavors/ieee/preprocessor.js +410 -0
  113. package/dist/flavors/ieee/update_codes.d.ts +8 -0
  114. package/dist/flavors/ieee/update_codes.js +191 -0
  115. package/dist/flavors/ietf/index.d.ts +30 -0
  116. package/dist/flavors/ietf/index.js +151 -0
  117. package/dist/flavors/iho/index.d.ts +4 -0
  118. package/dist/flavors/iho/index.js +126 -0
  119. package/dist/flavors/index.d.ts +9 -0
  120. package/dist/flavors/index.js +136 -0
  121. package/dist/flavors/isbn/index.d.ts +13 -0
  122. package/dist/flavors/isbn/index.js +97 -0
  123. package/dist/flavors/iso/grammar.d.ts +2 -0
  124. package/dist/flavors/iso/grammar.js +207 -0
  125. package/dist/flavors/iso/index.d.ts +2 -0
  126. package/dist/flavors/iso/index.js +343 -0
  127. package/dist/flavors/iso/model.d.ts +159 -0
  128. package/dist/flavors/iso/model.js +802 -0
  129. package/dist/flavors/iso/stages.generated.d.ts +13 -0
  130. package/dist/flavors/iso/stages.generated.js +391 -0
  131. package/dist/flavors/itu/grammar.d.ts +4 -0
  132. package/dist/flavors/itu/grammar.js +205 -0
  133. package/dist/flavors/itu/index.d.ts +2 -0
  134. package/dist/flavors/itu/index.js +224 -0
  135. package/dist/flavors/itu/model.d.ts +184 -0
  136. package/dist/flavors/itu/model.js +599 -0
  137. package/dist/flavors/jcgm/index.d.ts +7 -0
  138. package/dist/flavors/jcgm/index.js +300 -0
  139. package/dist/flavors/jis/index.d.ts +4 -0
  140. package/dist/flavors/jis/index.js +267 -0
  141. package/dist/flavors/nist/grammar.d.ts +2 -0
  142. package/dist/flavors/nist/grammar.js +287 -0
  143. package/dist/flavors/nist/index.d.ts +2 -0
  144. package/dist/flavors/nist/index.js +1244 -0
  145. package/dist/flavors/nist/model.d.ts +155 -0
  146. package/dist/flavors/nist/model.js +823 -0
  147. package/dist/flavors/nist/preprocessor.d.ts +11 -0
  148. package/dist/flavors/nist/preprocessor.js +281 -0
  149. package/dist/flavors/oasis/index.d.ts +23 -0
  150. package/dist/flavors/oasis/index.js +110 -0
  151. package/dist/flavors/ogc/index.d.ts +20 -0
  152. package/dist/flavors/ogc/index.js +75 -0
  153. package/dist/flavors/oiml/grammar.d.ts +2 -0
  154. package/dist/flavors/oiml/grammar.js +180 -0
  155. package/dist/flavors/oiml/implementation.d.ts +9 -0
  156. package/dist/flavors/oiml/implementation.js +16 -0
  157. package/dist/flavors/oiml/model.d.ts +4 -0
  158. package/dist/flavors/oiml/model.js +462 -0
  159. package/dist/flavors/omg/index.d.ts +14 -0
  160. package/dist/flavors/omg/index.js +73 -0
  161. package/dist/flavors/plateau/index.d.ts +4 -0
  162. package/dist/flavors/plateau/index.js +97 -0
  163. package/dist/flavors/tgpp/index.d.ts +4 -0
  164. package/dist/flavors/tgpp/index.js +122 -0
  165. package/dist/flavors/un/index.d.ts +13 -0
  166. package/dist/flavors/un/index.js +90 -0
  167. package/dist/flavors/w3c/index.d.ts +14 -0
  168. package/dist/flavors/w3c/index.js +148 -0
  169. package/dist/flavors/xsf/index.d.ts +18 -0
  170. package/dist/flavors/xsf/index.js +65 -0
  171. package/dist/grammar/engine.d.ts +78 -0
  172. package/dist/grammar/engine.js +351 -0
  173. package/dist/model/attribute.d.ts +54 -0
  174. package/dist/model/attribute.js +53 -0
  175. package/dist/model/builder.d.ts +39 -0
  176. package/dist/model/builder.js +124 -0
  177. package/dist/model/component.d.ts +70 -0
  178. package/dist/model/component.js +170 -0
  179. package/dist/model/identifier.d.ts +83 -0
  180. package/dist/model/identifier.js +270 -0
  181. package/dist/model/urn-generator.d.ts +27 -0
  182. package/dist/model/urn-generator.js +91 -0
  183. package/package.json +1 -1
@@ -0,0 +1,159 @@
1
+ import { BaseIdentifier } from "../../model/identifier.js";
2
+ import type { IdentifierStatic } from "../../model/identifier.js";
3
+ import { type FieldMapping } from "../../model/attribute.js";
4
+ import { PubidDate, Language, Iteration } from "../../model/component.js";
5
+ import { Component } from "../../model/component.js";
6
+ import { BaseUrnGenerator } from "../../model/urn-generator.js";
7
+ import { type IsoTypedStage } from "./stages.generated.js";
8
+ /**
9
+ * Port of lib/pubid/iso/identifiers/* on the unified model. The typed
10
+ * stage is the single source of truth for stage and doctype; the wire
11
+ * hash carries only the non-published stage CODE under "stage"
12
+ * (identifier.rb's stage_to_kv). number/part/subpart are plain strings;
13
+ * date is flat year/month/day; publisher serializes only when it is
14
+ * not the class default.
15
+ */
16
+ export declare function locateStage(abbr: string): IsoTypedStage | undefined;
17
+ export declare function locateType(typeKey: string): IsoTypedStage[];
18
+ export declare function locateStageByCode(code: string): IsoTypedStage | undefined;
19
+ export declare function publishedStage(typeKey: string): IsoTypedStage | undefined;
20
+ /** Tokens for the parser, longest first (array_to_str semantics). */
21
+ export declare function stageTokens(typeKeys?: string[]): string[];
22
+ /** TypedStage#abbreviation: long/short override, else abbr[0]; the
23
+ * parsed spelling (originalAbbr) decides long vs short via context. */
24
+ export declare function stageAbbr(entry: IsoTypedStage, formatLong: boolean, originalAbbr?: string): string;
25
+ /** The runtime typed-stage state: the registry entry + parsed spelling. */
26
+ export interface TypedStageState {
27
+ entry: IsoTypedStage;
28
+ originalAbbr?: string | undefined;
29
+ }
30
+ export interface IsoLanguageState {
31
+ code: string;
32
+ originalCode: string;
33
+ }
34
+ /** The ISO Edition: number + original spelling ("Edition 13"). */
35
+ export declare class IsoEdition extends Component {
36
+ readonly number: string | undefined;
37
+ readonly original_text: string | undefined;
38
+ constructor(attrs: Record<string, unknown>);
39
+ render(): string;
40
+ toWire(): Record<string, unknown>;
41
+ }
42
+ export declare abstract class IsoIdentifier extends BaseIdentifier {
43
+ static attributes: import("../../model/attribute.js").AttributeTable;
44
+ readonly number: string | undefined;
45
+ readonly part: string | undefined;
46
+ readonly subpart: string | undefined;
47
+ readonly stage_iteration: Iteration | undefined;
48
+ readonly date: PubidDate | undefined;
49
+ readonly edition: IsoEdition | undefined;
50
+ readonly languages: Language[] | undefined;
51
+ readonly all_parts: boolean | undefined;
52
+ readonly typedStageState: TypedStageState | undefined;
53
+ constructor(attrs?: Record<string, unknown>);
54
+ /** The class's type key (drives URN type component + class identity). */
55
+ typeKey(): string;
56
+ root(): IsoIdentifier;
57
+ /** detect_stage_format_long: the parsed spelling picks long form. */
58
+ protected stageFormatLong(): boolean;
59
+ /** detect_language_code_format: single (E) vs iso (en). */
60
+ protected languageSingle(): boolean;
61
+ protected stageString(): string;
62
+ /** Render with an EXPLICIT long-format flag (the supplement
63
+ * renderer propagates its own context to the base). */
64
+ renderWithFormat(formatLong: boolean): string;
65
+ /** Ruby SupplementRenderer renders the base with the wrapper's
66
+ * detected context (stage_format_long propagates down the chain;
67
+ * with_date being non-nil pins it against re-detection — a nested
68
+ * amendment renders "AMD" under a "CD Cor" top but "Amd" under a
69
+ * "Cor." top). */
70
+ renderAsSupplementBase(long: boolean): string;
71
+ private stageStringFor;
72
+ protected numberPortion(withDate: boolean): string;
73
+ protected languagePortion(single: boolean): string;
74
+ }
75
+ /** identifier.rb's base key_value block (the single-document whitelist). */
76
+ export declare const ISO_MAPPINGS: FieldMapping[];
77
+ /** The ISO Publisher component: "ISO/IEC/IEEE". */
78
+ export declare class IsoPublisher {
79
+ readonly publisher: string;
80
+ readonly copublisher: string[] | undefined;
81
+ constructor(attrs: {
82
+ publisher?: unknown;
83
+ copublisher?: unknown;
84
+ });
85
+ render(): string;
86
+ }
87
+ /** Single documents (everything except supplements, TcDocument, Bundled). */
88
+ export declare abstract class IsoSingleIdentifier extends IsoIdentifier {
89
+ static attributes: import("../../model/attribute.js").AttributeTable;
90
+ readonly publisher: IsoPublisher | undefined;
91
+ readonly copublishers: IsoPublisher[] | undefined;
92
+ readonly typedStageState: TypedStageState | undefined;
93
+ constructor(attrs?: Record<string, unknown>);
94
+ render(): string;
95
+ }
96
+ declare class IsoUrnGenerator extends BaseUrnGenerator<IsoIdentifier> {
97
+ generate(): string;
98
+ private originator;
99
+ private typeComponent;
100
+ private stageComponent;
101
+ private generateBaseUrn;
102
+ private generateSupplementUrn;
103
+ }
104
+ export declare abstract class IsoSupplementIdentifier extends IsoSingleIdentifier {
105
+ static attributes: import("../../model/attribute.js").AttributeTable;
106
+ static mappings: FieldMapping[];
107
+ readonly base: IsoIdentifier | undefined;
108
+ render(): string;
109
+ renderAsSupplementBase(long: boolean): string;
110
+ private renderSupplement;
111
+ }
112
+ export declare abstract class IsoBundledBase extends IsoSingleIdentifier {
113
+ }
114
+ export declare function isoClassForType(typeKey: string): IdentifierStatic | undefined;
115
+ export declare class IsoDirectives extends IsoSingleIdentifier {
116
+ static polymorphicName: string;
117
+ static typeKey: string;
118
+ static attributes: import("../../model/attribute.js").AttributeTable;
119
+ static mappings: FieldMapping[];
120
+ static urnGenerator: typeof IsoUrnGenerator;
121
+ readonly subgroup: string | undefined;
122
+ render(): string;
123
+ }
124
+ export declare class IsoDirectivesSupplement extends IsoSupplementIdentifier {
125
+ static polymorphicName: string;
126
+ static typeKey: string;
127
+ static attributes: import("../../model/attribute.js").AttributeTable;
128
+ static mappings: FieldMapping[];
129
+ static urnGenerator: typeof IsoUrnGenerator;
130
+ readonly supplement_publisher: string | undefined;
131
+ readonly base: IsoIdentifier | undefined;
132
+ render(): string;
133
+ }
134
+ export declare class IsoTcDocument extends IsoIdentifier {
135
+ static polymorphicName: string;
136
+ static typeKey: string;
137
+ static attributes: import("../../model/attribute.js").AttributeTable;
138
+ static mappings: FieldMapping[];
139
+ static urnGenerator: typeof IsoUrnGenerator;
140
+ readonly publisher: IsoPublisher | undefined;
141
+ readonly tc_type: string | undefined;
142
+ readonly tc_number: string | undefined;
143
+ readonly sc_type: string | undefined;
144
+ readonly sc_number: string | undefined;
145
+ readonly wg_type: string | undefined;
146
+ readonly wg_number: string | undefined;
147
+ render(): string;
148
+ }
149
+ export declare class IsoBundledIdentifier extends IsoIdentifier {
150
+ static polymorphicName: string;
151
+ static typeKey: string;
152
+ static attributes: import("../../model/attribute.js").AttributeTable;
153
+ static mappings: FieldMapping[];
154
+ static urnGenerator: typeof IsoUrnGenerator;
155
+ readonly base_document: IsoIdentifier | undefined;
156
+ readonly supplements: IsoIdentifier[];
157
+ render(): string;
158
+ }
159
+ export {};