onix-engine 0.1.0 → 0.1.1
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.
- package/README.md +23 -0
- package/dist/index.cjs +97 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -23,6 +23,35 @@ declare function getCodelistHeading(number: number, code: string): string | unde
|
|
|
23
23
|
|
|
24
24
|
declare function hasCodelistCode(number: number, code: string): boolean;
|
|
25
25
|
|
|
26
|
+
interface SubjectVocabularyEntry {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly heading: string;
|
|
29
|
+
readonly parentCode?: string;
|
|
30
|
+
readonly note?: string;
|
|
31
|
+
}
|
|
32
|
+
interface SubjectVocabularyMetadata {
|
|
33
|
+
readonly onixSchemeCode: string;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly version: string;
|
|
36
|
+
}
|
|
37
|
+
interface SubjectVocabularyDocument extends SubjectVocabularyMetadata {
|
|
38
|
+
readonly entries: readonly SubjectVocabularyEntry[];
|
|
39
|
+
}
|
|
40
|
+
interface SubjectVocabulary {
|
|
41
|
+
readonly metadata: SubjectVocabularyMetadata;
|
|
42
|
+
getEntries(): readonly SubjectVocabularyEntry[];
|
|
43
|
+
getEntry(code: string): SubjectVocabularyEntry | undefined;
|
|
44
|
+
getHeading(code: string): string | undefined;
|
|
45
|
+
hasCode(code: string): boolean;
|
|
46
|
+
getChildren(parentCode?: string): readonly SubjectVocabularyEntry[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Creates an immutable, application-supplied ONIX subject vocabulary.
|
|
51
|
+
* The caller is responsible for obtaining and licensing any external data.
|
|
52
|
+
*/
|
|
53
|
+
declare function createSubjectVocabulary(input: string | SubjectVocabularyDocument): SubjectVocabulary;
|
|
54
|
+
|
|
26
55
|
interface ThemaEntry {
|
|
27
56
|
readonly code: string;
|
|
28
57
|
readonly heading: string;
|
|
@@ -55,4 +84,4 @@ declare const metadata: CodelistMetadata;
|
|
|
55
84
|
|
|
56
85
|
declare const themaMetadata: ThemaMetadata;
|
|
57
86
|
|
|
58
|
-
export { type Codelist, type CodelistEntry, type CodelistMetadata, type ThemaEntry, type ThemaMetadata, getCodelist, getCodelistEntries, getCodelistEntry, getCodelistHeading, getCodelists, getThemaChildren, getThemaEntries, getThemaEntry, getThemaHeading, hasCodelistCode, hasThemaCode, metadata, themaMetadata };
|
|
87
|
+
export { type Codelist, type CodelistEntry, type CodelistMetadata, type SubjectVocabulary, type SubjectVocabularyDocument, type SubjectVocabularyEntry, type SubjectVocabularyMetadata, type ThemaEntry, type ThemaMetadata, createSubjectVocabulary, getCodelist, getCodelistEntries, getCodelistEntry, getCodelistHeading, getCodelists, getThemaChildren, getThemaEntries, getThemaEntry, getThemaHeading, hasCodelistCode, hasThemaCode, metadata, themaMetadata };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,35 @@ declare function getCodelistHeading(number: number, code: string): string | unde
|
|
|
23
23
|
|
|
24
24
|
declare function hasCodelistCode(number: number, code: string): boolean;
|
|
25
25
|
|
|
26
|
+
interface SubjectVocabularyEntry {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly heading: string;
|
|
29
|
+
readonly parentCode?: string;
|
|
30
|
+
readonly note?: string;
|
|
31
|
+
}
|
|
32
|
+
interface SubjectVocabularyMetadata {
|
|
33
|
+
readonly onixSchemeCode: string;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly version: string;
|
|
36
|
+
}
|
|
37
|
+
interface SubjectVocabularyDocument extends SubjectVocabularyMetadata {
|
|
38
|
+
readonly entries: readonly SubjectVocabularyEntry[];
|
|
39
|
+
}
|
|
40
|
+
interface SubjectVocabulary {
|
|
41
|
+
readonly metadata: SubjectVocabularyMetadata;
|
|
42
|
+
getEntries(): readonly SubjectVocabularyEntry[];
|
|
43
|
+
getEntry(code: string): SubjectVocabularyEntry | undefined;
|
|
44
|
+
getHeading(code: string): string | undefined;
|
|
45
|
+
hasCode(code: string): boolean;
|
|
46
|
+
getChildren(parentCode?: string): readonly SubjectVocabularyEntry[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Creates an immutable, application-supplied ONIX subject vocabulary.
|
|
51
|
+
* The caller is responsible for obtaining and licensing any external data.
|
|
52
|
+
*/
|
|
53
|
+
declare function createSubjectVocabulary(input: string | SubjectVocabularyDocument): SubjectVocabulary;
|
|
54
|
+
|
|
26
55
|
interface ThemaEntry {
|
|
27
56
|
readonly code: string;
|
|
28
57
|
readonly heading: string;
|
|
@@ -55,4 +84,4 @@ declare const metadata: CodelistMetadata;
|
|
|
55
84
|
|
|
56
85
|
declare const themaMetadata: ThemaMetadata;
|
|
57
86
|
|
|
58
|
-
export { type Codelist, type CodelistEntry, type CodelistMetadata, type ThemaEntry, type ThemaMetadata, getCodelist, getCodelistEntries, getCodelistEntry, getCodelistHeading, getCodelists, getThemaChildren, getThemaEntries, getThemaEntry, getThemaHeading, hasCodelistCode, hasThemaCode, metadata, themaMetadata };
|
|
87
|
+
export { type Codelist, type CodelistEntry, type CodelistMetadata, type SubjectVocabulary, type SubjectVocabularyDocument, type SubjectVocabularyEntry, type SubjectVocabularyMetadata, type ThemaEntry, type ThemaMetadata, createSubjectVocabulary, getCodelist, getCodelistEntries, getCodelistEntry, getCodelistHeading, getCodelists, getThemaChildren, getThemaEntries, getThemaEntry, getThemaHeading, hasCodelistCode, hasThemaCode, metadata, themaMetadata };
|