@domorium/validator 1.4.0 → 1.5.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.
@@ -24,6 +24,12 @@ export declare enum GedcomErrorCode {
24
24
  DuplicateDeclaration = "VAL009",
25
25
  /** An event with neither a payload nor substructures asserts nothing. */
26
26
  EmptyEvent = "VAL010",
27
+ /** The version is one no schema in this package describes. */
28
+ UnsupportedVersion = "VAL011",
29
+ /** No version could be read from HEAD.GEDC.VERS. */
30
+ UndeterminedVersion = "VAL012",
31
+ /** A version checked against a different version's schema. */
32
+ SubstitutedVersion = "VAL013",
27
33
  /** A pointer whose xref names no record of the required type. */
28
34
  UnresolvedXref = "unresolved-xref",
29
35
  /** A line whose level cannot follow the line above it. */
@@ -0,0 +1,28 @@
1
+ import { ASTNode } from "../parser";
2
+ import { GedcomScheme } from "../schemes/schema-types";
3
+ import type { Range } from "../types/position";
4
+ export type GedcomDialect = "7.0" | "5.5.1";
5
+ interface SchemaChoice {
6
+ scheme: GedcomScheme;
7
+ dialect: GedcomDialect;
8
+ /** GEDCOM 7 onwards requires every extension tag to be declared in SCHMA. */
9
+ requiresSchmaDeclaration: boolean;
10
+ }
11
+ export type VersionResolution = ({
12
+ kind: "supported";
13
+ version: string;
14
+ range: Range;
15
+ } & SchemaChoice) | ({
16
+ kind: "substituted";
17
+ version: string;
18
+ range: Range;
19
+ } & SchemaChoice) | {
20
+ kind: "unsupported";
21
+ version: string;
22
+ range: Range;
23
+ } | ({
24
+ kind: "undetermined";
25
+ range: Range;
26
+ } & SchemaChoice);
27
+ export declare function resolveGedcomVersion(nodes: ASTNode[]): VersionResolution;
28
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domorium/validator",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "GEDCOM 5.5.1 and 7.0 parser and validator",
5
5
  "keywords": [
6
6
  "gedcom",