pro-editor-schema 0.1.16 → 0.1.18
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 +140 -0
- package/dist/index.d.mts +25 -393
- package/dist/index.d.ts +25 -393
- package/dist/index.js +812 -608
- package/dist/index.mjs +812 -447
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# pro-editor-schema
|
|
2
|
+
|
|
3
|
+
TypeScript library that defines XML/HTML schema rules used by the editor and provides validation utilities for document structure, attributes, links, and footnotes.
|
|
4
|
+
|
|
5
|
+
## What this repository contains
|
|
6
|
+
|
|
7
|
+
- Schema definitions for supported tags and schema codes.
|
|
8
|
+
- Shared schema constants and attribute helpers.
|
|
9
|
+
- Runtime schema lookup utilities.
|
|
10
|
+
- XML validation utilities (`validateXml`, attribute/child validators, footnote and link validators).
|
|
11
|
+
- Type-safe element factory (`createElement`) based on schema definitions.
|
|
12
|
+
|
|
13
|
+
## Install and build
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
npm run typecheck
|
|
18
|
+
npm run test
|
|
19
|
+
npm run build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Project structure
|
|
23
|
+
|
|
24
|
+
- `src/index.ts`: public exports for schemas, types, shared constants, and validation.
|
|
25
|
+
- `src/schema/schema.types.ts`: core schema and validation-related types.
|
|
26
|
+
- `src/schema/schemas.ts`: central `SCHEMAS` map (`code -> schema`).
|
|
27
|
+
- `src/schema/elementSchemas/elements`: element schema definitions and `ELEMENT_SCHEMAS`.
|
|
28
|
+
- `src/schema/elementSchemas/atoms`: atom schema definitions and `ATOM_SCHEMAS`.
|
|
29
|
+
- `src/schema/elementSchemas/inlineElements`: inline schema definitions and `INLINE_ELEMENT_SCHEMAS`.
|
|
30
|
+
- `src/schema/shared`: shared attribute and ignored-node constants.
|
|
31
|
+
- `src/schema/utils`: schema lookup and element creation helpers.
|
|
32
|
+
- `src/validation`: document validation entrypoint and validation modules.
|
|
33
|
+
|
|
34
|
+
## Schema model
|
|
35
|
+
|
|
36
|
+
Each schema defines:
|
|
37
|
+
|
|
38
|
+
- `code`: internal schema identifier.
|
|
39
|
+
- `kind`: schema category (`element`, `atom`, `inline`).
|
|
40
|
+
- `tag`: uppercase XML tag name used in documents.
|
|
41
|
+
- `requiredAttributes`: required attributes (free or restricted values).
|
|
42
|
+
- `optionalAttributes`: optional attributes (free or restricted values).
|
|
43
|
+
- `defaultChildTagName`: preferred child tag (optional, used by some block-like schemas).
|
|
44
|
+
- `allowedChildTagNames`: allowed child tags and whether each child is required.
|
|
45
|
+
|
|
46
|
+
Schemas are combined in `SCHEMAS` from:
|
|
47
|
+
|
|
48
|
+
- `ELEMENT_SCHEMAS`
|
|
49
|
+
- `ATOM_SCHEMAS`
|
|
50
|
+
- `INLINE_ELEMENT_SCHEMAS`
|
|
51
|
+
|
|
52
|
+
## Public API highlights
|
|
53
|
+
|
|
54
|
+
From `src/index.ts`, consumers can import:
|
|
55
|
+
|
|
56
|
+
- Types: `Schema`, `SchemaCode`, `ElementSchemaCode`, `AtomSchemaCode`, `InlineSchemaCode`
|
|
57
|
+
- Maps: `SCHEMAS`, `ELEMENT_SCHEMAS`, `ATOM_SCHEMAS`, `INLINE_ELEMENT_SCHEMAS`
|
|
58
|
+
- Utilities: `findSchemaByCode`, `findSchemaByElement`, `createElement`
|
|
59
|
+
- Validators: `validateXml`, `validateFootnotes`, `validateLinkend`, `validateAttributes`, `validateChildren`
|
|
60
|
+
- Shared constants: ignored elements/attributes and global attribute constants
|
|
61
|
+
|
|
62
|
+
## Usage examples
|
|
63
|
+
|
|
64
|
+
### Lookup schema by code
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { findSchemaByCode } from "pro-editor-schema";
|
|
68
|
+
|
|
69
|
+
const schema = findSchemaByCode("para");
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Create an element from schema
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { createElement } from "pro-editor-schema";
|
|
76
|
+
|
|
77
|
+
const para = createElement({
|
|
78
|
+
schemaCode: "para",
|
|
79
|
+
attributes: {
|
|
80
|
+
store: "body",
|
|
81
|
+
"ele-id": "p-1",
|
|
82
|
+
role: "body",
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Validate an XML root
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { validateXml } from "pro-editor-schema";
|
|
91
|
+
|
|
92
|
+
const errors = validateXml(rootElement, linkedIds, true);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`validateXml` performs:
|
|
96
|
+
|
|
97
|
+
- Footnote sequence checks
|
|
98
|
+
- Footnote cue sequence checks
|
|
99
|
+
- Link target checks (`linkend`)
|
|
100
|
+
- Optional schema-based attribute and child validation when enabled
|
|
101
|
+
|
|
102
|
+
## How validation works
|
|
103
|
+
|
|
104
|
+
- `validateXml` traverses the XML tree and delegates checks per element.
|
|
105
|
+
- `findSchemaByElement` resolves schema from classes, role, and tag fallback.
|
|
106
|
+
- `validateAttributes` ensures required attributes exist and restricted values are valid.
|
|
107
|
+
- `validateChildren` ensures child tags are allowed and required children exist.
|
|
108
|
+
- `validateFootnotes` and `validateLinkend` provide cross-reference integrity checks.
|
|
109
|
+
|
|
110
|
+
Validation results use `ValidationError`:
|
|
111
|
+
|
|
112
|
+
- `id`
|
|
113
|
+
- `store`
|
|
114
|
+
- `title`
|
|
115
|
+
- `level` (`blocker` | `warning` | `info`)
|
|
116
|
+
- `kind` (`unlinked` | `forbidden` | `missing` | `converted`)
|
|
117
|
+
- `description`
|
|
118
|
+
|
|
119
|
+
## Adding or updating a schema
|
|
120
|
+
|
|
121
|
+
1. Create or update schema file in one of:
|
|
122
|
+
- `src/schema/elementSchemas/elements`
|
|
123
|
+
- `src/schema/elementSchemas/atoms`
|
|
124
|
+
- `src/schema/elementSchemas/inlineElements`
|
|
125
|
+
2. Define schema with `createSchema(...)`.
|
|
126
|
+
3. Add it to the corresponding registry:
|
|
127
|
+
- `ELEMENT_SCHEMAS`
|
|
128
|
+
- `ATOM_SCHEMAS`
|
|
129
|
+
- `INLINE_ELEMENT_SCHEMAS`
|
|
130
|
+
4. Ensure the schema code exists in the matching union type in `schema.types.ts`.
|
|
131
|
+
5. If needed, export constants/types from folder `index.ts` and `src/index.ts`.
|
|
132
|
+
6. Run:
|
|
133
|
+
- `npm run typecheck`
|
|
134
|
+
- `npm run test`
|
|
135
|
+
|
|
136
|
+
## Notes
|
|
137
|
+
|
|
138
|
+
- Tag matching is done in uppercase in schema definitions and validation.
|
|
139
|
+
- Some schema codes represent block/group-like structures while still being typed as `kind: "element"` in the current model.
|
|
140
|
+
- Ignored attributes and ignored UI helper elements are excluded from strict validation by design.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
type
|
|
2
|
-
type SchemaKind = "element" | "atom" | "inline" | "group";
|
|
1
|
+
type SchemaKind = "element" | "atom" | "inline";
|
|
3
2
|
type FreeAttribute = string;
|
|
4
3
|
type RestrictedAttribute<T = readonly string[]> = {
|
|
5
4
|
name: string;
|
|
@@ -17,11 +16,16 @@ type Schema<TRequiredAttributes = readonly AttributeDefinition[], TOptionalAttri
|
|
|
17
16
|
tag: string;
|
|
18
17
|
requiredAttributes: TRequiredAttributes;
|
|
19
18
|
optionalAttributes: TOptionalAttributes;
|
|
19
|
+
defaultChildTagName?: string;
|
|
20
20
|
allowedChildTagNames: ReadonlySet<AllowedChildren>;
|
|
21
|
+
canBeWrappedByInsertOrDelete?: boolean;
|
|
21
22
|
};
|
|
23
|
+
type SchemaCode = ElementSchemaCode | InlineSchemaCode | AtomSchemaCode;
|
|
24
|
+
type ElementSchemaCode = "degrees" | "email" | "equation" | "fignote" | "figsource" | "firstname" | "footnote" | "footnoteno" | "honorific" | "img" | "informalfigure" | "keyword" | "label1" | "li" | "line" | "lrh" | "math" | "mathphrase" | "merror" | "mfrac" | "mi" | "mmultiscripts" | "mn" | "mo" | "mover" | "mpadded" | "mphantom" | "mprescripts" | "mroot" | "mrow" | "ms" | "mspace" | "msqrt" | "mstyle" | "msub" | "msubsup" | "msup" | "mtable" | "mtd" | "mtext" | "mtr" | "munder" | "munderover" | "olink" | "org" | "orgname" | "para" | "punc" | "rrh" | "source1" | "speaker" | "subtitle1" | "surname" | "tag" | "tblfn" | "tblsource" | "thead" | "title1" | "token" | "tp" | "abstract1" | "affiliation" | "alttext" | "appendix" | "author" | "authorgroup" | "blockquote" | "caption1" | "chapter" | "dialogue" | "epigraph" | "figure1" | "footnoteSection" | "heading" | "imageobject" | "info1" | "keywordset" | "mediaobject" | "ol" | "personname" | "poem" | "sidebar" | "table" | "table1" | "tbody" | "td" | "tgroup" | "tr" | "ul";
|
|
25
|
+
type AtomSchemaCode = "indexterm" | "primary" | "secondary" | "tertiary" | "quaternary" | "bookmark" | "see" | "commentQuerySection" | "comment" | "content" | "query" | "reply" | "deletion" | "emphasis" | "highlightmark" | "i" | "insertion" | "sc" | "strike" | "sub" | "sup" | "u" | "b";
|
|
26
|
+
type InlineSchemaCode = "footnote1" | "inlineequation" | "link" | "uri";
|
|
22
27
|
|
|
23
|
-
declare const SCHEMAS:
|
|
24
|
-
declare const SCHEMA_MAP: Map<SchemaCode, Schema>;
|
|
28
|
+
declare const SCHEMAS: Record<SchemaCode, Schema>;
|
|
25
29
|
|
|
26
30
|
declare const isIgnoredAttribute: (attribute: string) => boolean;
|
|
27
31
|
declare const isIgnoredElement: (element: Element) => boolean;
|
|
@@ -38,10 +42,10 @@ type SchemaAttributes<TSchema extends Schema> = TSchema extends Schema<infer TRe
|
|
|
38
42
|
[TAttribute in TOptional[number] as TAttribute extends string ? TAttribute : TAttribute extends RestrictedAttribute ? TAttribute["name"] : never]?: AttributeValue<TAttribute>;
|
|
39
43
|
} : never;
|
|
40
44
|
type CreateElementParams<TSchema extends Schema> = {
|
|
41
|
-
|
|
45
|
+
schemaCode: SchemaCode;
|
|
42
46
|
attributes: SchemaAttributes<TSchema>;
|
|
43
47
|
};
|
|
44
|
-
declare const createElement: <TSchema extends Schema>({
|
|
48
|
+
declare const createElement: <TSchema extends Schema>({ schemaCode, attributes, }: CreateElementParams<TSchema>) => HTMLElement;
|
|
45
49
|
|
|
46
50
|
declare const IGNORED_ELEMENT_SELECTORS: string[];
|
|
47
51
|
|
|
@@ -71,380 +75,11 @@ declare const ELE_ID_ATTRIBUTE = "ele-id";
|
|
|
71
75
|
declare const STORE_ATTRIBUTE = "store";
|
|
72
76
|
declare const ID_ATTRS: readonly ["store", "ele-id"];
|
|
73
77
|
|
|
74
|
-
declare const
|
|
75
|
-
declare const TITLE_TAG = "TITLE1";
|
|
76
|
-
declare const FOOTNOTE_TAG = "FOOTNOTE";
|
|
77
|
-
declare const FOOTNOTE_NUMBER_TAG = "FOOTNOTENO";
|
|
78
|
-
declare const OLINK_TAG = "OLINK";
|
|
79
|
-
declare const FIRSTNAME_TAG = "FIRSTNAME";
|
|
80
|
-
declare const SURNAME_TAG = "SURNAME";
|
|
81
|
-
declare const HONORIFIC_TAG = "HONORIFIC";
|
|
82
|
-
declare const POSTNOMINALS_TAG = "POSTNOMINALS";
|
|
83
|
-
declare const ORGNAME_TAG = "ORGNAME";
|
|
84
|
-
declare const EMAIL_TAG = "EMAIL";
|
|
85
|
-
declare const ORG_TAG = "ORG";
|
|
86
|
-
declare const DEGREES_TAG = "DEGREES";
|
|
87
|
-
declare const DIALOGUE_TAG = "DIALOGUE";
|
|
88
|
-
declare const LINE_TAG = "LINE";
|
|
89
|
-
declare const SPEAKER_TAG = "SPEAKER";
|
|
90
|
-
declare const EQUATION_TAG = "EQUATION";
|
|
91
|
-
declare const FIGURE_TAG = "FIGURE1";
|
|
92
|
-
declare const IMG_TAG = "IMG";
|
|
93
|
-
declare const ALTTEXT_TAG = "ALTTEXT";
|
|
94
|
-
declare const IMAGEOBJECT_TAG = "IMAGEOBJECT";
|
|
95
|
-
declare const MEDIAOBJECT_TAG = "MEDIAOBJECT";
|
|
96
|
-
declare const LABEL_TAG = "LABEL1";
|
|
97
|
-
declare const CAPTION_TAG = "CAPTION1";
|
|
98
|
-
declare const FIGSOURCE_TAG = "FIGSOURCE";
|
|
99
|
-
declare const FIGNOTE_TAG = "FIGNOTE";
|
|
100
|
-
declare const INFORMALFIGURE_TAG = "INFORMALFIGURE";
|
|
101
|
-
declare const KEYWORDSET_TAG = "KEYWORDSET";
|
|
102
|
-
declare const KEYWORD_TAG = "KEYWORD";
|
|
103
|
-
declare const LI_TAG = "LI";
|
|
104
|
-
declare const OL_TAG = "OL";
|
|
105
|
-
declare const UL_TAG = "UL";
|
|
106
|
-
declare const TOKEN_TAG = "TOKEN";
|
|
107
|
-
declare const LRH_TAG = "LRH";
|
|
108
|
-
declare const RRH_TAG = "RRH";
|
|
109
|
-
declare const SOURCE_TAG = "SOURCE1";
|
|
110
|
-
declare const SUBTITLE_TAG = "SUBTITLE1";
|
|
111
|
-
declare const TABLE_TAG = "TABLE1";
|
|
112
|
-
declare const TGROUP_TAG = "TGROUP";
|
|
113
|
-
declare const HTML_TABLE_TAG = "TABLE";
|
|
114
|
-
declare const THEAD_TAG = "THEAD";
|
|
115
|
-
declare const TBODY_TAG = "TBODY";
|
|
116
|
-
declare const TR_TAG = "TR";
|
|
117
|
-
declare const TD_TAG = "TD";
|
|
118
|
-
declare const TP_TAG = "TP";
|
|
119
|
-
declare const TBLFN_TAG = "TBLFN";
|
|
120
|
-
declare const TBLSOURCE_TAG = "TBLSOURCE";
|
|
121
|
-
declare const TAG_TAG = "TAG";
|
|
122
|
-
declare const PUNC_TAG = "PUNC";
|
|
123
|
-
declare const ELEMENT_TAGS: string[];
|
|
78
|
+
declare const ELEMENT_SCHEMAS: Record<ElementSchemaCode, Schema>;
|
|
124
79
|
|
|
125
|
-
declare const
|
|
80
|
+
declare const INLINE_ELEMENT_SCHEMAS: Record<InlineSchemaCode, Schema>;
|
|
126
81
|
|
|
127
|
-
declare const
|
|
128
|
-
|
|
129
|
-
declare const OLINK_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
130
|
-
|
|
131
|
-
declare const PERSONNAME_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
132
|
-
|
|
133
|
-
declare const FIRSTNAME_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
134
|
-
|
|
135
|
-
declare const SURNAME_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
136
|
-
|
|
137
|
-
declare const HONORIFIC_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
138
|
-
|
|
139
|
-
declare const ORGNAME_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
140
|
-
|
|
141
|
-
declare const EMAIL_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
142
|
-
|
|
143
|
-
declare const ORG_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
144
|
-
|
|
145
|
-
declare const AFFILIATION_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
146
|
-
|
|
147
|
-
declare const DEGREES_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
148
|
-
|
|
149
|
-
declare const LINE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly [{
|
|
150
|
-
readonly name: "role";
|
|
151
|
-
readonly values: readonly ["add-element"];
|
|
152
|
-
readonly defaultValue: "add-element";
|
|
153
|
-
}]>;
|
|
154
|
-
|
|
155
|
-
declare const SPEAKER_SCHEMA: Schema<readonly ["store", "ele-id"], readonly [{
|
|
156
|
-
readonly name: "role";
|
|
157
|
-
readonly values: readonly ["add-element"];
|
|
158
|
-
readonly defaultValue: "add-element";
|
|
159
|
-
}]>;
|
|
160
|
-
|
|
161
|
-
declare const DIALOGUE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
162
|
-
readonly name: "role";
|
|
163
|
-
readonly values: readonly ["add-element"];
|
|
164
|
-
readonly defaultValue: "add-element";
|
|
165
|
-
}]>;
|
|
166
|
-
|
|
167
|
-
declare const EQUATION_SCHEMA: Schema<readonly [], readonly []>;
|
|
168
|
-
|
|
169
|
-
declare const IMG_SCHEMA: Schema<readonly ["store", "ele-id", "src", "format"], readonly ["alt", "data-track-alt", "data-alignment", "before-replace-img", "data-prev-alt", {
|
|
170
|
-
readonly name: "role";
|
|
171
|
-
readonly values: readonly ["inline-graphics", "presentation"];
|
|
172
|
-
readonly defaultValue: "inline-graphics";
|
|
173
|
-
}]>;
|
|
174
|
-
|
|
175
|
-
declare const ALTTEXT_SCHEMA: Schema<readonly [], readonly []>;
|
|
176
|
-
|
|
177
|
-
declare const IMAGEOBJECT_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
178
|
-
|
|
179
|
-
declare const MEDIAOBJECT_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
180
|
-
|
|
181
|
-
declare const CAPTION_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
182
|
-
|
|
183
|
-
declare const FIGSOURCE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
184
|
-
|
|
185
|
-
declare const FIGNOTE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
186
|
-
|
|
187
|
-
declare const FIGURE_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", "linkend_fig", "data-anchor-id"]>;
|
|
188
|
-
|
|
189
|
-
declare const FOOTNOTE_SCHEMA: Schema<readonly ["store", "ele-id", "label", "xmlid", {
|
|
190
|
-
readonly name: "role";
|
|
191
|
-
readonly values: readonly ["end-bk-note", "end-ch-note"];
|
|
192
|
-
readonly defaultValue: "end-ch-note";
|
|
193
|
-
}], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
194
|
-
|
|
195
|
-
declare const FOOTNOTE_NUMBER_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
196
|
-
|
|
197
|
-
declare const INFORMALFIGURE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-anchor-id"]>;
|
|
198
|
-
|
|
199
|
-
declare const KEYWORDSET_SCHEMA: Schema<readonly ["store", "ele-id", {
|
|
200
|
-
readonly name: "role";
|
|
201
|
-
readonly values: readonly ["xmlonly", "both"];
|
|
202
|
-
readonly defaultValue: "both";
|
|
203
|
-
}], readonly []>;
|
|
204
|
-
|
|
205
|
-
declare const KEYWORD_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-pos"]>;
|
|
206
|
-
|
|
207
|
-
declare const PUNC_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-role"]>;
|
|
208
|
-
|
|
209
|
-
declare const LABEL_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", {
|
|
210
|
-
readonly name: "fm-role";
|
|
211
|
-
readonly values: readonly ["true", "false"];
|
|
212
|
-
readonly defaultValue: "false";
|
|
213
|
-
}]>;
|
|
214
|
-
|
|
215
|
-
declare const TOKEN_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
216
|
-
|
|
217
|
-
declare const LI_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "token", "element-change-description", {
|
|
218
|
-
readonly name: "role";
|
|
219
|
-
readonly values: readonly ["list-item-added", "add-element", "list-item-split", "level-list"];
|
|
220
|
-
readonly defaultValue: "add-element";
|
|
221
|
-
}]>;
|
|
222
|
-
|
|
223
|
-
declare const OL_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-tagname", {
|
|
224
|
-
readonly name: "role";
|
|
225
|
-
readonly values: readonly ["add-element", "change-style", "change-para-list", "change-element", "changed-element", "LIST1", "LIST2", "LIST3"];
|
|
226
|
-
readonly defaultValue: "add-element";
|
|
227
|
-
}, {
|
|
228
|
-
readonly name: "oldliststyle";
|
|
229
|
-
readonly values: readonly ["bullet", "numbering", "roman", "none"];
|
|
230
|
-
readonly defaultValue: "bullet";
|
|
231
|
-
}, {
|
|
232
|
-
readonly name: "oldmark";
|
|
233
|
-
readonly values: readonly ["disc", "circle", "square", "dash", "ast", "checkbox"];
|
|
234
|
-
readonly defaultValue: "disc";
|
|
235
|
-
}]>;
|
|
236
|
-
|
|
237
|
-
declare const UL_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-tagname", {
|
|
238
|
-
readonly name: "role";
|
|
239
|
-
readonly values: readonly ["add-element", "change-style", "change-para-list", "change-element", "LIST1", "LIST2", "LIST3"];
|
|
240
|
-
readonly defaultValue: "add-element";
|
|
241
|
-
}, {
|
|
242
|
-
readonly name: "oldliststyle";
|
|
243
|
-
readonly values: readonly ["bullet", "numbering", "roman", "none"];
|
|
244
|
-
readonly defaultValue: "bullet";
|
|
245
|
-
}, {
|
|
246
|
-
readonly name: "mark";
|
|
247
|
-
readonly values: readonly ["disc", "circle", "square", "dash", "ast", "checkbox"];
|
|
248
|
-
readonly defaultValue: "disc";
|
|
249
|
-
}, {
|
|
250
|
-
readonly name: "oldmark";
|
|
251
|
-
readonly values: readonly ["disc", "circle", "square", "dash", "ast", "checkbox"];
|
|
252
|
-
readonly defaultValue: "disc";
|
|
253
|
-
}]>;
|
|
254
|
-
|
|
255
|
-
declare const PARA_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", "xmlid", "role", "data-pos"]>;
|
|
256
|
-
|
|
257
|
-
declare const TAG_SCHEMA: Schema<readonly ["store", "ele-id", "data-id"], readonly []>;
|
|
258
|
-
|
|
259
|
-
declare const LRH_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
260
|
-
|
|
261
|
-
declare const RRH_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
262
|
-
|
|
263
|
-
declare const SOURCE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
264
|
-
readonly name: "role";
|
|
265
|
-
readonly values: readonly ["add-element"];
|
|
266
|
-
readonly defaultValue: "add-element";
|
|
267
|
-
}]>;
|
|
268
|
-
|
|
269
|
-
declare const SUBTITLE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly [{
|
|
270
|
-
readonly name: "role";
|
|
271
|
-
readonly values: readonly ["add-element"];
|
|
272
|
-
readonly defaultValue: "add-element";
|
|
273
|
-
}]>;
|
|
274
|
-
|
|
275
|
-
declare const TP_SCHEMA: Schema<readonly [], readonly ["store", "ele-id"]>;
|
|
276
|
-
|
|
277
|
-
declare const TD_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-cell-width"]>;
|
|
278
|
-
|
|
279
|
-
declare const TR_SCHEMA: Schema<readonly [], readonly ["data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", "store", "ele-id", "width"]>;
|
|
280
|
-
|
|
281
|
-
declare const THEAD_SCHEMA: Schema<readonly [], readonly ["store", "ele-id"]>;
|
|
282
|
-
|
|
283
|
-
declare const TBODY_SCHEMA: Schema<readonly [], readonly ["store", "ele-id"]>;
|
|
284
|
-
|
|
285
|
-
declare const HTML_TABLE_SCHEMA: Schema<readonly [], readonly ["store", "ele-id"]>;
|
|
286
|
-
|
|
287
|
-
declare const TGROUP_SCHEMA: Schema<readonly ["store", "ele-id", "cols"], readonly []>;
|
|
288
|
-
|
|
289
|
-
declare const TBLFN_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
290
|
-
|
|
291
|
-
declare const TBLSOURCE_SCHEMA: Schema<readonly [], readonly []>;
|
|
292
|
-
|
|
293
|
-
declare const TABLE_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid", "role"], readonly ["data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", "data-username", "data-userid", "data-time", "data-date", "linkend_tbl", "data-anchor-id", "id", "orient"]>;
|
|
294
|
-
|
|
295
|
-
declare const TITLE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-alignment", "data-left-indent", "data-right-indent", "data-special-indent", "data-space-above", "data-space-below", "data-indent-type", "data-layout-user", "data-cell-width", "data-paragraph-style", "data-table-orientation", "data-table-placement", "data-figure-placement", "role", {
|
|
296
|
-
readonly name: "fm-role";
|
|
297
|
-
readonly values: readonly ["true", "false"];
|
|
298
|
-
readonly defaultValue: "false";
|
|
299
|
-
}, {
|
|
300
|
-
readonly name: "title";
|
|
301
|
-
readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6", "foot_note"];
|
|
302
|
-
readonly defaultValue: "H1";
|
|
303
|
-
}]>;
|
|
304
|
-
|
|
305
|
-
declare const ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
|
|
306
|
-
|
|
307
|
-
declare const SECTION_TAG = "SECTION1";
|
|
308
|
-
declare const ABSTRACT_TAG = "ABSTRACT1";
|
|
309
|
-
declare const AFFILIATION_TAG = "AFFILIATION";
|
|
310
|
-
declare const APPENDIX_TAG = "APPENDIX";
|
|
311
|
-
declare const AUTHORGROUP_TAG = "AUTHORGROUP";
|
|
312
|
-
declare const AUTHOR_TAG = "AUTHOR";
|
|
313
|
-
declare const PERSONNAME_TAG = "PERSONNAME";
|
|
314
|
-
declare const BLOCKQUOTE_TAG = "BLOCKQUOTE";
|
|
315
|
-
declare const SIDEBAR_TAG = "SIDEBAR";
|
|
316
|
-
declare const CHAPTER_TAG = "CHAPTER";
|
|
317
|
-
declare const EPIGRAPH_TAG = "EPIGRAPH";
|
|
318
|
-
declare const INFO_TAG = "INFO1";
|
|
319
|
-
declare const POEM_TAG = "POEM";
|
|
320
|
-
declare const GROUP_ELEMENTS_TAGS: string[];
|
|
321
|
-
|
|
322
|
-
declare const ABSTRACT_SCHEMA: Schema<readonly ["store", "ele-id", {
|
|
323
|
-
readonly name: "role";
|
|
324
|
-
readonly values: readonly ["xmlonly", "both"];
|
|
325
|
-
readonly defaultValue: "both";
|
|
326
|
-
}], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
327
|
-
readonly name: "abstract_type";
|
|
328
|
-
readonly values: readonly ["blurb"];
|
|
329
|
-
readonly defaultValue: "blurb";
|
|
330
|
-
}]>;
|
|
331
|
-
|
|
332
|
-
declare const APPENDIX_SCHEMA: Schema<readonly ["store", "ele-id", "id", "xmlid"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
333
|
-
|
|
334
|
-
declare const BLOCKQUOTE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "xmlid", "data-tagname", "element-change-description", {
|
|
335
|
-
readonly name: "role";
|
|
336
|
-
readonly values: readonly ["add-element", "extract_group", "change-element"];
|
|
337
|
-
readonly defaultValue: "add-element";
|
|
338
|
-
}]>;
|
|
339
|
-
|
|
340
|
-
declare const BOX_SCHEMA: Schema<readonly ["store", "ele-id", {
|
|
341
|
-
readonly name: "status";
|
|
342
|
-
readonly values: readonly ["box1", "box2", "box3", "box4", "box5"];
|
|
343
|
-
readonly defaultValue: "box1";
|
|
344
|
-
}], readonly ["data-username", "data-userid", "data-time", "data-date", "xmlid", {
|
|
345
|
-
readonly name: "role";
|
|
346
|
-
readonly values: readonly ["add-element", "change-para-box"];
|
|
347
|
-
readonly defaultValue: "add-element";
|
|
348
|
-
}]>;
|
|
349
|
-
|
|
350
|
-
declare const CHAPTER_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid"], readonly ["role", "data-paragraph-numbering-padding", "data-paragraph-numbering-format", "data-paragraph-numbering-elements", "data-paragraph-numbering-chapters"]>;
|
|
351
|
-
|
|
352
|
-
declare const EPIGRAPH_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "data-tagname", {
|
|
353
|
-
readonly name: "role";
|
|
354
|
-
readonly values: readonly ["add-element", "change-element"];
|
|
355
|
-
readonly defaultValue: "add-element";
|
|
356
|
-
}]>;
|
|
357
|
-
|
|
358
|
-
declare const FOOTNOTE_SECTION_SCHEMA: Schema<readonly ["store", "ele-id", {
|
|
359
|
-
readonly name: "role";
|
|
360
|
-
readonly values: readonly ["ch", "bk"];
|
|
361
|
-
readonly defaultValue: "ch";
|
|
362
|
-
}], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
363
|
-
|
|
364
|
-
declare const HEADING_SCHEMA: Schema<readonly ["store", "ele-id", "xmlid", {
|
|
365
|
-
readonly name: "role";
|
|
366
|
-
readonly values: readonly ["H1", "H2", "H3", "H4", "H5", "H6", "vignette_group"];
|
|
367
|
-
readonly defaultValue: "H1";
|
|
368
|
-
}], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
369
|
-
|
|
370
|
-
declare const INFO_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
371
|
-
|
|
372
|
-
declare const POEM_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", "role"]>;
|
|
373
|
-
|
|
374
|
-
declare const GROUP_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
|
|
375
|
-
|
|
376
|
-
declare const FOOTNOTE_LINK_TAG = "FOOTNOTE1";
|
|
377
|
-
declare const INLINEEQUATION_TAG = "INLINEEQUATION";
|
|
378
|
-
declare const LINK_TAG = "LINK1";
|
|
379
|
-
declare const URI_TAG = "URI";
|
|
380
|
-
declare const INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN: {
|
|
381
|
-
tagName: string;
|
|
382
|
-
required: boolean;
|
|
383
|
-
}[];
|
|
384
|
-
|
|
385
|
-
declare const FOOTNOTE_LINK_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["linkend"]>;
|
|
386
|
-
|
|
387
|
-
declare const INLINEEQUATION_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["linkend"]>;
|
|
388
|
-
|
|
389
|
-
declare const LINK_SCHEMA: Schema<readonly ["store", "ele-id", "linkend", "data-target-id", {
|
|
390
|
-
readonly name: "role";
|
|
391
|
-
readonly values: readonly ["table", "figure", "equation", "footnote", "bibr"];
|
|
392
|
-
readonly defaultValue: "";
|
|
393
|
-
}], readonly []>;
|
|
394
|
-
|
|
395
|
-
declare const URI_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["linkend"]>;
|
|
396
|
-
|
|
397
|
-
declare const INLINE_ELEMENT_SCHEMAS: ReadonlyArray<Schema>;
|
|
398
|
-
|
|
399
|
-
declare const B_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
400
|
-
|
|
401
|
-
declare const COMMENT_QUERY_SECTION_SCHEMA: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", "title"]>;
|
|
402
|
-
|
|
403
|
-
declare const DELETION_SCHEMA: Schema<readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"], readonly []>;
|
|
404
|
-
|
|
405
|
-
declare const EMPHASIS_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
406
|
-
readonly name: "role";
|
|
407
|
-
readonly values: readonly ["lowercase", "uppercase", "initialcaps"];
|
|
408
|
-
readonly defaultValue: "lowercase";
|
|
409
|
-
}]>;
|
|
410
|
-
|
|
411
|
-
declare const HIGHLIGHTMARK_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
412
|
-
|
|
413
|
-
declare const I_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
414
|
-
|
|
415
|
-
declare const INSERTION_SCHEMA: Schema<readonly ["data-username", "data-userid", "data-time", "data-date", "store", "ele-id"], readonly []>;
|
|
416
|
-
|
|
417
|
-
declare const SC_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
418
|
-
|
|
419
|
-
declare const STRIKE_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
420
|
-
|
|
421
|
-
declare const SUB_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
422
|
-
|
|
423
|
-
declare const SUP_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
424
|
-
|
|
425
|
-
declare const U_SCHEMA: Schema<readonly ["store", "ele-id"], readonly ["data-username", "data-userid", "data-time", "data-date"]>;
|
|
426
|
-
|
|
427
|
-
declare const CONTENT_SCHEMA: Schema<readonly ["store", "ele-id"], readonly []>;
|
|
428
|
-
|
|
429
|
-
declare const COMMENT_SCHEMA: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
430
|
-
readonly name: "status";
|
|
431
|
-
readonly values: readonly ["marks-done", "marks-open"];
|
|
432
|
-
readonly defaultValue: "marks-open";
|
|
433
|
-
}, "title", "markuser", "marktime"]>;
|
|
434
|
-
|
|
435
|
-
declare const QUERY_SCHEMA: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
436
|
-
readonly name: "status";
|
|
437
|
-
readonly values: readonly ["marks-done", "marks-open"];
|
|
438
|
-
readonly defaultValue: "marks-open";
|
|
439
|
-
}, "title", "markuser", "marktime"]>;
|
|
440
|
-
|
|
441
|
-
declare const REPLY_SCHEMA: Schema<readonly ["store", "ele-id", "id"], readonly ["data-username", "data-userid", "data-time", "data-date", {
|
|
442
|
-
readonly name: "status";
|
|
443
|
-
readonly values: readonly ["marks-done", "marks-open"];
|
|
444
|
-
readonly defaultValue: "marks-open";
|
|
445
|
-
}, "title", "markuser", "marktime"]>;
|
|
446
|
-
|
|
447
|
-
declare const ATOM_SCHEMAS: ReadonlyArray<Schema>;
|
|
82
|
+
declare const ATOM_SCHEMAS: Record<AtomSchemaCode, Schema>;
|
|
448
83
|
|
|
449
84
|
type ValidationErrorLevel = "blocker" | "warning" | "info";
|
|
450
85
|
type ValidationErrorKind = "unlinked" | "forbidden" | "missing" | "converted";
|
|
@@ -457,18 +92,15 @@ type ValidationError = {
|
|
|
457
92
|
description: string;
|
|
458
93
|
};
|
|
459
94
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
declare const validateElementAgainstSchema: (element: Element, schema: Schema) => ValidationError[];
|
|
473
|
-
|
|
474
|
-
export { ABSTRACT_SCHEMA, ABSTRACT_TAG, AFFILIATION_SCHEMA, AFFILIATION_TAG, ALIGNMENT_ATTRIBUTE, ALTTEXT_SCHEMA, ALTTEXT_TAG, APPENDIX_SCHEMA, APPENDIX_TAG, ATOM_SCHEMAS, AUTHORGROUP_SCHEMA, AUTHORGROUP_TAG, AUTHOR_SCHEMA, AUTHOR_TAG, type AllowedChildren, type AttributeDefinition, BLOCKQUOTE_SCHEMA, BLOCKQUOTE_TAG, BOX_SCHEMA, B_SCHEMA, CAPTION_SCHEMA, CAPTION_TAG, CHAPTER_SCHEMA, CHAPTER_TAG, COMMENT_QUERY_SECTION_SCHEMA, COMMENT_SCHEMA, CONTENT_SCHEMA, DEGREES_SCHEMA, DEGREES_TAG, DELETION_SCHEMA, DIALOGUE_SCHEMA, DIALOGUE_TAG, ELEMENT_SCHEMAS, ELEMENT_TAGS, ELE_ID_ATTRIBUTE, EMAIL_SCHEMA, EMAIL_TAG, EMPHASIS_SCHEMA, EPIGRAPH_SCHEMA, EPIGRAPH_TAG, EQUATION_SCHEMA, EQUATION_TAG, FIGNOTE_SCHEMA, FIGNOTE_TAG, FIGSOURCE_SCHEMA, FIGSOURCE_TAG, FIGURE_PLACEMENT_ATTRIBUTE, FIGURE_SCHEMA, FIGURE_TAG, FIRSTNAME_SCHEMA, FIRSTNAME_TAG, FOOTNOTE_LINK_SCHEMA, FOOTNOTE_LINK_TAG, FOOTNOTE_NUMBER_SCHEMA, FOOTNOTE_NUMBER_TAG, FOOTNOTE_SCHEMA, FOOTNOTE_SECTION_SCHEMA, FOOTNOTE_TAG, type FreeAttribute, GROUP_ELEMENTS_TAGS, GROUP_ELEMENT_SCHEMAS, HEADING_SCHEMA, HIGHLIGHTMARK_SCHEMA, HONORIFIC_SCHEMA, HONORIFIC_TAG, HTML_TABLE_SCHEMA, HTML_TABLE_TAG, ID_ATTRS, IGNORED_ATTRIBUTES, IGNORED_ATTRIBUTES_STARTS_WITH, IGNORED_ELEMENT_SELECTORS, IMAGEOBJECT_SCHEMA, IMAGEOBJECT_TAG, IMG_SCHEMA, IMG_TAG, INDENT_TYPE_ATTRIBUTE, INFORMALFIGURE_SCHEMA, INFORMALFIGURE_TAG, INFO_SCHEMA, INFO_TAG, INLINEEQUATION_SCHEMA, INLINEEQUATION_TAG, INLINE_ELEMENT_SCHEMAS, INLINE_ELEMENT_TAGS_ALLOWED_CHILDREN, INSERTION_SCHEMA, I_SCHEMA, KEYWORDSET_SCHEMA, KEYWORDSET_TAG, KEYWORD_SCHEMA, KEYWORD_TAG, LABEL_SCHEMA, LABEL_TAG, LAYOUT_ATTRIBUTES, LAYOUT_CELL_WIDTH, LAYOUT_USER_ATTRIBUTE, LEFT_INDENT_ATTRIBUTE, LINE_SCHEMA, LINE_TAG, LINK_SCHEMA, LINK_TAG, LI_SCHEMA, LI_TAG, LRH_SCHEMA, LRH_TAG, MEDIAOBJECT_SCHEMA, MEDIAOBJECT_TAG, OLINK_SCHEMA, OLINK_TAG, OL_SCHEMA, OL_TAG, ORGNAME_SCHEMA, ORGNAME_TAG, ORG_SCHEMA, ORG_TAG, ORIENTATION_ATTRIBUTE, PARA_SCHEMA, PARA_TAG, PERSONNAME_SCHEMA, PERSONNAME_TAG, PLACEMENT_ATTRIBUTE, POEM_SCHEMA, POEM_TAG, POSTNOMINALS_TAG, PUNC_SCHEMA, PUNC_TAG, QUERY_SCHEMA, REPLY_SCHEMA, RIGHT_INDENT_ATTRIBUTE, RRH_SCHEMA, RRH_TAG, type RestrictedAttribute, SCHEMAS, SCHEMA_MAP, SC_SCHEMA, SECTION_TAG, SIDEBAR_TAG, SOURCE_SCHEMA, SOURCE_TAG, SPACE_ABOVE_ATTRIBUTE, SPACE_BELOW_ATTRIBUTE, SPEAKER_SCHEMA, SPEAKER_TAG, SPECIAL_INDENT_ATTRIBUTE, STORE_ATTRIBUTE, STRIKE_SCHEMA, STYLE_NAME_ATTRIBUTE, SUBTITLE_SCHEMA, SUBTITLE_TAG, SUB_SCHEMA, SUP_SCHEMA, SURNAME_SCHEMA, SURNAME_TAG, type Schema, type SchemaCode, type SchemaKind, TABLE_SCHEMA, TABLE_TAG, TAG_SCHEMA, TAG_TAG, TBLFN_SCHEMA, TBLFN_TAG, TBLSOURCE_SCHEMA, TBLSOURCE_TAG, TBODY_SCHEMA, TBODY_TAG, TD_SCHEMA, TD_TAG, TGROUP_SCHEMA, TGROUP_TAG, THEAD_SCHEMA, THEAD_TAG, TITLE_SCHEMA, TITLE_TAG, TOKEN_SCHEMA, TOKEN_TAG, TP_SCHEMA, TP_TAG, TRACK_CHANGES_ATTRS, TRACK_CHANGES_ATTR_DATA_DATE, TRACK_CHANGES_ATTR_DATA_TIME, TRACK_CHANGES_ATTR_DATA_USERID, TRACK_CHANGES_ATTR_DATA_USERNAME, TR_SCHEMA, TR_TAG, UL_SCHEMA, UL_TAG, URI_SCHEMA, URI_TAG, U_SCHEMA, type ValidationError, type ValidationErrorKind, type ValidationErrorLevel, createElement, findAttributeDefinitionByName, findSchemaByCode, findSchemaByElement, getAttributeName, isAttributeRestricted, isIgnoredAttribute, isIgnoredElement, validateAttributes, validateConsecutiveFootnoteCues, validateConsecutiveFootnotes, validateElement, validateElementAgainstSchema, validateFootnoteCue, validateFootnotes, validateLinkend, validateXml };
|
|
95
|
+
/**
|
|
96
|
+
* Validates the XML document against the schema.
|
|
97
|
+
|
|
98
|
+
* @param xml - The XML document to validate.
|
|
99
|
+
* @param elementsLinkedTo - The elements IDs that are linked to.
|
|
100
|
+
* @param shouldValidateAgainstSchema - Whether to validate against the schema.
|
|
101
|
+
* * ValidateConsecutiveFootnotes and ValidateConsecutiveFootnoteCues are default validations.
|
|
102
|
+
* @returns The validation errors.
|
|
103
|
+
*/
|
|
104
|
+
declare const validateXml: (xml: Element, elementsLinkedTo: readonly string[], shouldValidateAgainstSchema?: boolean) => ValidationError[];
|
|
105
|
+
|
|
106
|
+
export { ALIGNMENT_ATTRIBUTE, ATOM_SCHEMAS, type AllowedChildren, type AtomSchemaCode, type AttributeDefinition, ELEMENT_SCHEMAS, ELE_ID_ATTRIBUTE, type ElementSchemaCode, FIGURE_PLACEMENT_ATTRIBUTE, type FreeAttribute, ID_ATTRS, IGNORED_ATTRIBUTES, IGNORED_ATTRIBUTES_STARTS_WITH, IGNORED_ELEMENT_SELECTORS, INDENT_TYPE_ATTRIBUTE, INLINE_ELEMENT_SCHEMAS, type InlineSchemaCode, LAYOUT_ATTRIBUTES, LAYOUT_CELL_WIDTH, LAYOUT_USER_ATTRIBUTE, LEFT_INDENT_ATTRIBUTE, ORIENTATION_ATTRIBUTE, PLACEMENT_ATTRIBUTE, RIGHT_INDENT_ATTRIBUTE, type RestrictedAttribute, SCHEMAS, SPACE_ABOVE_ATTRIBUTE, SPACE_BELOW_ATTRIBUTE, SPECIAL_INDENT_ATTRIBUTE, STORE_ATTRIBUTE, STYLE_NAME_ATTRIBUTE, type Schema, type SchemaCode, type SchemaKind, TRACK_CHANGES_ATTRS, TRACK_CHANGES_ATTR_DATA_DATE, TRACK_CHANGES_ATTR_DATA_TIME, TRACK_CHANGES_ATTR_DATA_USERID, TRACK_CHANGES_ATTR_DATA_USERNAME, type ValidationError, type ValidationErrorKind, type ValidationErrorLevel, createElement, findAttributeDefinitionByName, findSchemaByCode, findSchemaByElement, getAttributeName, isAttributeRestricted, isIgnoredAttribute, isIgnoredElement, validateXml };
|