evt-models.ts 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212
  1. import { Type } from '@angular/core';
  2. import { EditionLevelType } from '../app.config';
  3. import { ParseResult } from '../services/xml-parsers/parser-models';
  4. export interface EditorialConvention {
  5. element: string;
  6. attributes: Attributes;
  7. layouts: EditorialConventionLayouts;
  8. }
  9. export type EditorialConventionLayouts = Partial<{ [key in EditionLevelType]: Partial<EditorialConventionLayout> }>;
  10. export interface EditorialConventionLayout {
  11. // tslint:disable-next-line: no-any
  12. style: { [cssProperty: string]: any; }; // List of CSS properties to be assigned to the output element
  13. pre: string; // Text to be shown before the element
  14. post: string; // Text to be shown after the element
  15. }
  16. export interface HighlightData {
  17. highlight: boolean;
  18. highlightColor: string;
  19. }
  20. export class GenericElement {
  21. // tslint:disable-next-line: no-any
  22. type: Type<any>;
  23. path?: string;
  24. class?: string;
  25. attributes: Attributes;
  26. content: Array<ParseResult<GenericElement>>;
  27. }
  28. export type XMLElement = HTMLElement;
  29. export type OriginalEncodingNodeType = XMLElement;
  30. export interface EditionStructure {
  31. pages: Page[];
  32. }
  33. export type ViewModeId = 'readingText' | 'imageText' | 'textText' | 'collation' | 'textSources' | 'textVersions';
  34. export interface ViewMode {
  35. id: ViewModeId;
  36. icon: string;
  37. iconSet?: 'evt' | 'far' | 'fas';
  38. label: string;
  39. disabled?: boolean;
  40. }
  41. export interface Page {
  42. id: string;
  43. label: string;
  44. facs: string;
  45. originalContent: OriginalEncodingNodeType[];
  46. parsedContent: Array<ParseResult<GenericElement>>;
  47. url: string;
  48. facsUrl: string;
  49. }
  50. export interface NamedEntities {
  51. all: {
  52. lists: NamedEntitiesList[];
  53. entities: NamedEntity[];
  54. };
  55. persons: {
  56. lists: NamedEntitiesList[];
  57. entities: NamedEntity[];
  58. };
  59. places: {
  60. lists: NamedEntitiesList[];
  61. entities: NamedEntity[];
  62. };
  63. organizations: {
  64. lists: NamedEntitiesList[];
  65. entities: NamedEntity[];
  66. };
  67. relations: Relation[];
  68. events: {
  69. lists: NamedEntitiesList[];
  70. entities: NamedEntity[];
  71. };
  72. }
  73. export interface Attributes { [key: string]: string; }
  74. export interface OriginalEncoding {
  75. originalEncoding: OriginalEncodingNodeType;
  76. }
  77. export type NamedEntityType = 'person' | 'place' | 'org' | 'relation' | 'event' | 'generic';
  78. export class NamedEntitiesList extends GenericElement {
  79. id: string;
  80. label: string;
  81. namedEntityType: NamedEntityType;
  82. description?: Description;
  83. sublists: NamedEntitiesList[];
  84. content: NamedEntity[];
  85. relations: Relation[];
  86. originalEncoding: OriginalEncodingNodeType;
  87. }
  88. export class NamedEntity extends GenericElement {
  89. id: string;
  90. sortKey: string;
  91. label: NamedEntityLabel;
  92. namedEntityType: NamedEntityType | 'personGrp';
  93. content: NamedEntityInfo[];
  94. originalEncoding: OriginalEncodingNodeType;
  95. }
  96. export type NamedEntityLabel = string;
  97. export class NamedEntityInfo extends GenericElement {
  98. label: string;
  99. }
  100. export interface NamedEntityOccurrence {
  101. pageId: string;
  102. pageLabel: string;
  103. refsByDoc: NamedEntityOccurrenceRef[];
  104. }
  105. export interface NamedEntityOccurrenceRef {
  106. docId: string;
  107. docLabel: string;
  108. refs: GenericElement[];
  109. }
  110. export class Relation extends GenericElement {
  111. name?: string;
  112. activeParts: string[]; // Pointers to entities involved in relation
  113. mutualParts: string[]; // Pointers to entities involved in relation
  114. passiveParts: string[]; // Pointers to entities involved in relation
  115. description: Description;
  116. relationType?: string;
  117. }
  118. export type Description = Array<ParseResult<GenericElement>>;
  119. export class NamedEntityRef extends GenericElement {
  120. entityId: string;
  121. entityType: NamedEntityType;
  122. }
  123. export interface Witnesses {
  124. witnesses: Witness[];
  125. groups: WitnessGroup[];
  126. }
  127. export interface Witness {
  128. id: string;
  129. name: string | Array<ParseResult<GenericElement>> | XMLElement;
  130. attributes: Attributes;
  131. content: Array<ParseResult<GenericElement>>;
  132. groupId: string;
  133. }
  134. export interface WitnessGroup {
  135. id: string;
  136. name: string;
  137. attributes: Attributes;
  138. witnesses: string[];
  139. groupId: string;
  140. }
  141. export class ApparatusEntry extends GenericElement {
  142. id: string;
  143. lemma: Reading;
  144. readings: Reading[];
  145. notes: Note[];
  146. originalEncoding: string;
  147. nestedAppsIDs: string[];
  148. }
  149. export class Reading extends GenericElement {
  150. id: string;
  151. witIDs: string[];
  152. significant: boolean;
  153. }
  154. export interface GridItem {
  155. id: string;
  156. url: string;
  157. name: string;
  158. }
  159. export type HTML = GenericElement & {
  160. content: OriginalEncodingNodeType[];
  161. };
  162. export class Text extends GenericElement {
  163. text: string;
  164. }
  165. export type NoteLayout = 'popover' | 'plain-text';
  166. export class Note extends GenericElement {
  167. noteLayout: NoteLayout;
  168. noteType: string;
  169. exponent: string;
  170. }
  171. export class Paragraph extends GenericElement {
  172. n: string;
  173. }
  174. export class Lb extends GenericElement {
  175. id: string;
  176. n?: string;
  177. facs?: string; // Needed to handle ITL
  178. rend?: string;
  179. }
  180. export type Comment = GenericElement;
  181. export class Surface extends GenericElement {
  182. id: string;
  183. corresp: string;
  184. graphics: Graphic[];
  185. zones: {
  186. lines: ZoneLine[];
  187. hotspots: ZoneHotSpot[];
  188. };
  189. }
  190. export type ZoneRendition = 'Line' | 'HotSpot'; // EVT rule to distinguish lines for ITL from HotSpots
  191. export interface Point {
  192. x: number;
  193. y: number;
  194. }
  195. export class Zone extends GenericElement {
  196. id: string;
  197. coords: Point[];
  198. rendition?: ZoneRendition;
  199. // In lines @corresp points to <lb> @xml:id in the main text; in HotSpots it points to @xml:id of element which contains HS description
  200. // In Embedded Transcription it is the same as @xml:id of zone itself
  201. corresp?: string;
  202. rend?: string;
  203. rotate?: number;
  204. surface?: string;
  205. }
  206. export class ZoneLine extends Zone {
  207. rendition: 'Line';
  208. }
  209. export class ZoneHotSpot extends Zone {
  210. rendition: 'HotSpot';
  211. }
  212. export class Graphic extends GenericElement {
  213. url: string;
  214. height: string;
  215. width: string;
  216. }
  217. export interface CharMapping {
  218. type: string;
  219. subtype: string;
  220. attributes: Attributes;
  221. content: Array<ParseResult<GenericElement>>;
  222. }
  223. export interface CharProp {
  224. name: string;
  225. value: string;
  226. }
  227. export interface EncodingProp extends CharProp {
  228. version: string;
  229. }
  230. export class Char extends GenericElement {
  231. id: string;
  232. name: string;
  233. entityName: string;
  234. localProps: CharProp[];
  235. mappings: CharMapping[];
  236. unicodeProp?: EncodingProp;
  237. unihanProp?: EncodingProp;
  238. graphics: Graphic[];
  239. }
  240. export class G extends GenericElement {
  241. id: string;
  242. charId: string;
  243. }
  244. export type ChoiceType = 'normalization' | 'emendation';
  245. export class Choice extends GenericElement {
  246. editorialInterventionType: ChoiceType | '';
  247. originalContent: Array<ParseResult<GenericElement>>;
  248. normalizedContent: Array<ParseResult<GenericElement>>;
  249. }
  250. export class Verse extends GenericElement {
  251. n: string;
  252. }
  253. export class VersesGroup extends GenericElement {
  254. n: string;
  255. groupType: string;
  256. }
  257. export class Supplied extends GenericElement {
  258. reason?: string;
  259. source?: string;
  260. resp?: string;
  261. }
  262. export type DamageDegree = 'high' | 'medium' | 'low' | 'unknown';
  263. export class Damage extends GenericElement {
  264. agent: string;
  265. group?: number;
  266. degree?: DamageDegree | string; // string representing a number between 0 (undamaged) and 1 (very extensively damaged)
  267. }
  268. export class Surplus extends GenericElement {
  269. reason?: string;
  270. }
  271. export class Gap extends GenericElement {
  272. reason?: string;
  273. agent?: string;
  274. quantity?: number;
  275. unit?: string;
  276. extent?: string;
  277. }
  278. export type PlacementType = 'above' | 'below' | 'inline' | 'left' | 'right' | 'inspace' | 'end' | 'sup' | 'sub' | 'under';
  279. export class Addition extends GenericElement {
  280. place: PlacementType;
  281. }
  282. export type SicType = 'crux'; // sic types supported in specific ways
  283. export class Sic extends GenericElement {
  284. sicType?: SicType | string;
  285. }
  286. export class Word extends GenericElement {
  287. lemma?: string;
  288. }
  289. export class Deletion extends GenericElement {
  290. rend: string;
  291. }
  292. export class MsFrag extends GenericElement {
  293. additional: Additional;
  294. altIdentifier: AltIdentifier;
  295. history: History;
  296. msContents: MsContents;
  297. msIdentifier: MsIdentifier;
  298. physDesc: PhysDesc;
  299. pEl: Paragraph[];
  300. }
  301. export class MsPart extends MsFrag {
  302. head: Head;
  303. msParts: MsPart[];
  304. }
  305. export class MsDesc extends MsPart {
  306. id: string;
  307. n: string;
  308. label: string;
  309. msFrags: MsFrag[];
  310. }
  311. // TODO: fix classes MsDesc, MsPart and MsFrag
  312. export class Identifier extends GenericElement {
  313. collection: CollectionEl[];
  314. idnos: Array<ParseResult<GenericElement>>; // TODO: Add specific type when idno is handled
  315. regions: Array<ParseResult<GenericElement>>; // TODO: Add specific type when region is handled
  316. repository: Repository;
  317. settlements: Array<ParseResult<GenericElement>>; // TODO: Add specific type when settlement is handled
  318. countries: Array<ParseResult<GenericElement>>; // TODO: Add specific type when country is handled
  319. }
  320. export class AltIdentifier extends Identifier {
  321. noteEl: Note[];
  322. }
  323. export class MsIdentifier extends Identifier {
  324. id: string;
  325. institution: Institution;
  326. altIdentifier: AltIdentifier[];
  327. msName: MsName[];
  328. }
  329. export class MsContents extends GenericElement {
  330. summary: Summary;
  331. msItem: MsItem[];
  332. msItemStruct: MsItemStruct;
  333. pEl: Paragraph[];
  334. textLangs: Array<ParseResult<GenericElement>>; // TODO: Add specific type when textLang is handled
  335. }
  336. export class PhysDesc extends GenericElement {
  337. objectDesc: ObjectDesc;
  338. bindingDesc: BindingDesc;
  339. decoDesc: DecoDesc;
  340. handDesc: HandDesc;
  341. accMat: AccMat;
  342. additions: Additions;
  343. musicNotation: MusicNotation;
  344. scriptDesc: ScriptDesc;
  345. sealDesc: SealDesc;
  346. typeDesc: TypeDesc;
  347. pEl: Paragraph[];
  348. }
  349. export class History extends GenericElement {
  350. acquisition: Acquisition;
  351. origin: Origin;
  352. provenance: Provenance[];
  353. summary: Summary;
  354. pEl: Paragraph[];
  355. }
  356. export class Head extends GenericElement {
  357. place: string;
  358. rend: string;
  359. style: string;
  360. rendition: string;
  361. n: string;
  362. facs: string;
  363. lbEl: Lb[];
  364. hi: Array<ParseResult<GenericElement>>; // TODO: Add specific type when hi is handled
  365. title: Array<ParseResult<GenericElement>>; // TODO: Add specific type when title is handled
  366. origPlace: OrigPlace;
  367. origDate: OrigDate;
  368. }
  369. export class Institution extends GenericElement {
  370. country: Array<ParseResult<GenericElement>>; // TODO: Add specific type when country is handled
  371. region: Array<ParseResult<GenericElement>>; // TODO: Add specific type when region is handled
  372. }
  373. export class Repository extends GenericElement {
  374. lang: string;
  375. }
  376. export class MsName extends GenericElement {
  377. name: Array<ParseResult<GenericElement>>; // TODO: Add specific type when idno is handled
  378. rs: Array<ParseResult<GenericElement>>; // TODO: Add specific type when rs is handled
  379. gEl: G[];
  380. }
  381. export class CollectionEl extends GenericElement {
  382. collectionType: string;
  383. }
  384. export class MsItemStruct extends GenericElement {
  385. n: string;
  386. defective: boolean;
  387. authors: Array<ParseResult<GenericElement>>; // TODO: Add specific type when author is handled
  388. respStmt: Array<ParseResult<GenericElement>>; // TODO: Add specific type when restStmt is handled
  389. titles: Array<ParseResult<GenericElement>>; // TODO: Add specific type when title is handled
  390. rubric: Rubric;
  391. incipit: Incipit;
  392. quote: Array<ParseResult<GenericElement>>; // TODO: Add specific type when quote is handled
  393. explicit: Explicit;
  394. finalRubric: FinalRubric;
  395. colophons: Array<ParseResult<GenericElement>>; // TODO: Add specific type when colophon is handled
  396. decoNote: DecoNote;
  397. listBibl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when listBibl is handled
  398. bibl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when bibl is handled
  399. filiation: Filiation[];
  400. noteEl: Note[];
  401. textLangs: Array<ParseResult<GenericElement>>; // TODO: Add specific type when textLang is handled
  402. locus: Locus;
  403. }
  404. export class MsItem extends MsItemStruct {
  405. docAuthors: Array<ParseResult<GenericElement>>; // TODO: Add specific type when docAuthor is handled
  406. docTitles: Array<ParseResult<GenericElement>>; // TODO: Add specific type when docTitle is handled
  407. docImprints: Array<ParseResult<GenericElement>>; // TODO: Add specific type when docImprint is handled
  408. docDate: Array<ParseResult<GenericElement>>; // TODO: Add specific type when docDate is handled
  409. locusGrp: LocusGrp;
  410. gapEl: Gap[];
  411. msItem: MsItem[];
  412. }
  413. export class Summary extends GenericElement {
  414. pEl: Paragraph[];
  415. }
  416. export class Acquisition extends GenericElement {
  417. notBefore: string;
  418. notAfter: string;
  419. name: Array<ParseResult<GenericElement>>; // TODO: Add specific type when name is handled
  420. }
  421. export class Origin extends GenericElement {
  422. notBefore: string;
  423. notAfter: string;
  424. evidence: string;
  425. resp: string;
  426. origDate: OrigDate;
  427. origPlace: OrigPlace;
  428. }
  429. export class OrigDate extends GenericElement {
  430. notBefore: string;
  431. notAfter: string;
  432. when: string;
  433. origDateType: string;
  434. }
  435. export class OrigPlace extends GenericElement {
  436. key: string;
  437. origPlaceType: string;
  438. }
  439. export class Provenance extends GenericElement {
  440. when: string;
  441. }
  442. export class ObjectDesc extends GenericElement {
  443. form: string;
  444. layoutDesc: LayoutDesc;
  445. supportDesc: SupportDesc;
  446. pEl: Paragraph[];
  447. }
  448. export class LayoutDesc extends GenericElement {
  449. pEl: Paragraph[];
  450. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  451. layout: Layout;
  452. summary: Summary;
  453. }
  454. export class Layout extends GenericElement {
  455. columns: number;
  456. streams: number;
  457. ruledLines: number;
  458. writtenLines: number;
  459. pEl: Paragraph[];
  460. }
  461. export type MaterialValues = 'paper' | 'parch' | 'perg' | 'mixes';
  462. export class SupportDesc extends GenericElement {
  463. material: MaterialValues;
  464. pEl: Paragraph[];
  465. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  466. extents: Array<ParseResult<GenericElement>>; // TODO: Add specific type when extent is handled
  467. collation: Collation;
  468. condition: Condition;
  469. foliation: Foliation;
  470. support: Support;
  471. }
  472. export class Condition extends GenericElement {
  473. pEl: Paragraph[];
  474. }
  475. export class Collation extends GenericElement {
  476. pEl: Paragraph[];
  477. }
  478. export class Foliation extends GenericElement {
  479. id: string;
  480. pEl: Paragraph[];
  481. }
  482. export class Support extends GenericElement {
  483. material: Array<ParseResult<GenericElement>>; // TODO: Add specific type when material is handled
  484. watermark: Array<ParseResult<GenericElement>>; // TODO: Add specific type when watermark is handled
  485. }
  486. export class BindingDesc extends GenericElement {
  487. binding: Binding[];
  488. condition: Array<ParseResult<GenericElement>>; // TODO: Add specific type when condition is handled
  489. decoNote: DecoNote[];
  490. pEl: Paragraph[];
  491. }
  492. export class Binding extends GenericElement {
  493. contemporary: boolean;
  494. condition: Array<ParseResult<GenericElement>>; // TODO: Add specific type when condition is handled
  495. decoNote: DecoNote[];
  496. pEl: Paragraph[];
  497. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  498. }
  499. export class DecoDesc extends GenericElement {
  500. decoNote: DecoNote;
  501. pEl: Paragraph[];
  502. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  503. summary: Summary;
  504. }
  505. export class Additions extends GenericElement {
  506. pEl: Paragraph[];
  507. }
  508. export class HandDesc extends GenericElement {
  509. hands: string;
  510. handNote: HandNote[];
  511. }
  512. export class ScriptDesc extends GenericElement {
  513. scriptNote: Array<ParseResult<GenericElement>>; // TODO: Add specific type when scriptNote is handled
  514. summary: Summary;
  515. }
  516. export class Seal extends GenericElement {
  517. contemporary: boolean;
  518. sealType: string;
  519. n: string;
  520. decoNote: DecoNote;
  521. pEl: Paragraph[];
  522. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  523. }
  524. export class SealDesc extends GenericElement {
  525. seal: Seal;
  526. }
  527. export class TypeDesc extends GenericElement {
  528. summary: Summary;
  529. typeNote: TypeNote;
  530. }
  531. export class TypeNote extends GenericElement {
  532. id: string;
  533. scope: string;
  534. }
  535. export class MusicNotation extends GenericElement {
  536. term: Array<ParseResult<GenericElement>>; // TODO: Add specific type when term is handled
  537. }
  538. export class AccMat extends GenericElement {
  539. pEl: Paragraph[];
  540. }
  541. export class Additional extends GenericElement {
  542. listBibls: Array<ParseResult<GenericElement>>; // TODO: Add specific type when listBibl is handled
  543. adminInfo: AdminInfo;
  544. surrogates: Surrogates;
  545. }
  546. export class AdminInfo extends GenericElement {
  547. noteEl: Note[];
  548. availabilities: Array<ParseResult<GenericElement>>; // TODO: Add specific type when listBibl is handled
  549. custodialHist: CustodialHist;
  550. recordHist: RecordHist;
  551. }
  552. export class CustodialHist extends GenericElement {
  553. pEl: Paragraph[];
  554. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  555. custEvent?: CustEvent[];
  556. }
  557. export class CustEvent extends GenericElement {
  558. custEventType: string;
  559. notBefore: string;
  560. notAfter: string;
  561. when: string;
  562. from: string;
  563. to: string;
  564. }
  565. export class RecordHist extends GenericElement {
  566. pEl: Paragraph[];
  567. changes: Array<ParseResult<GenericElement>>; // TODO: Add specific type when change is handled
  568. source: Source[];
  569. ab: Array<ParseResult<GenericElement>>; // TODO: Add specific type when ab is handled
  570. }
  571. export class Source extends GenericElement {
  572. pEl: Paragraph[];
  573. }
  574. export class Surrogates extends GenericElement {
  575. bibls: Array<ParseResult<GenericElement>>; // TODO: Add specific type when bibl is handled
  576. pEl: Paragraph[];
  577. }
  578. export class Rubric extends GenericElement {
  579. lang: string;
  580. rend: string;
  581. lbEl: Lb[];
  582. locus: Locus;
  583. stamp: Array<ParseResult<GenericElement>>; // TODO: Add specific type when stamp is handled
  584. }
  585. export class FinalRubric extends GenericElement {
  586. lbEl: Lb[];
  587. }
  588. export class Incipit extends GenericElement {
  589. lang: string;
  590. defective: boolean;
  591. lbEl: Lb[];
  592. locus: Locus;
  593. }
  594. export class Explicit extends GenericElement {
  595. lang: string;
  596. defective: boolean;
  597. locus: Locus;
  598. }
  599. export class Locus extends GenericElement {
  600. scheme: string;
  601. from: string;
  602. to: string;
  603. facs: string;
  604. target: string;
  605. hi: Array<ParseResult<GenericElement>>; // TODO: Add specific type when hi is handled
  606. gEl: G[];
  607. locus: Locus;
  608. }
  609. export class LocusGrp extends GenericElement {
  610. scheme: string;
  611. locus: Locus;
  612. }
  613. export class DecoNote extends GenericElement {
  614. decoNoteType: string;
  615. watermark: Array<ParseResult<GenericElement>>; // TODO: Add specific type when watermark is handled
  616. }
  617. export class Filiation extends GenericElement {
  618. filiationType: string;
  619. }
  620. export class Dimensions extends GenericElement {
  621. dimensionsType: string;
  622. scope: string;
  623. extent: string;
  624. unit: string;
  625. quantity: number;
  626. atLeast: number;
  627. atMost: number;
  628. min: number;
  629. max: number;
  630. height: Height;
  631. width: Width;
  632. depth: Depth;
  633. dim: Dim;
  634. }
  635. export class Height extends GenericElement {
  636. scope: string;
  637. extent: string;
  638. unit: string;
  639. quantity: number;
  640. atLeast: number;
  641. atMost: number;
  642. min: number;
  643. max: number;
  644. gEl: G[];
  645. }
  646. export class Width extends GenericElement {
  647. scope: string;
  648. extent: string;
  649. unit: string;
  650. quantity: number;
  651. atLeast: number;
  652. atMost: number;
  653. min: number;
  654. max: number;
  655. gEl: G[];
  656. }
  657. export class Depth extends GenericElement {
  658. scope: string;
  659. extent: string;
  660. unit: string;
  661. quantity: number;
  662. atLeast: number;
  663. atMost: number;
  664. min: number;
  665. max: number;
  666. gEl: G[];
  667. }
  668. export class Dim extends GenericElement {
  669. dimType: string;
  670. scope: string;
  671. extent: string;
  672. unit: string;
  673. quantity: number;
  674. atLeast: number;
  675. atMost: number;
  676. min: number;
  677. max: number;
  678. gEl: G[];
  679. }
  680. export class FileDesc extends GenericElement {
  681. titleStmt: TitleStmt;
  682. publicationStmt: PublicationStmt;
  683. sourceDesc: SourceDesc;
  684. editionStmt?: EditionStmt;
  685. extent?: Extent;
  686. seriesStmt?: SeriesStmt;
  687. notesStmt?: NotesStmt;
  688. }
  689. export class TitleStmt extends GenericElement {
  690. titles: Array<ParseResult<GenericElement>>; // TODO: Add specific type when title is handled
  691. subtitles: Array<ParseResult<GenericElement>>; // TODO: Add specific type when subtitle is handled
  692. authors: Array<ParseResult<GenericElement>>; // TODO: Add specific type when author is handled
  693. principals: Array<ParseResult<GenericElement>>; // TODO: Add specific type when principal is handled
  694. respStmts: RespStmt[];
  695. editors: Array<ParseResult<GenericElement>>; // TODO: Add specific type when editor is handled
  696. sponsors: Array<ParseResult<GenericElement>>; // TODO: Add specific type when sponsor is handled
  697. funders: Array<ParseResult<GenericElement>>; // TODO: Add specific type when funder is handled
  698. }
  699. export class RespStmt extends GenericElement {
  700. responsibility: Resp;
  701. people: Array<ParseResult<NamedEntityRef>>;
  702. notes: Note[];
  703. }
  704. export class Resp extends GenericElement {
  705. normalizedResp: string;
  706. date: string;
  707. }
  708. export class EditionStmt extends GenericElement {
  709. structuredData: boolean;
  710. edition: Array<ParseResult<GenericElement>>; // TODO: Add specific type when edition is handled
  711. respStmt: RespStmt[];
  712. }
  713. export class PublicationStmt extends GenericElement {
  714. structuredData: boolean;
  715. publisher: Array<ParseResult<GenericElement>>; // TODO: Add specific type when publisher is handled
  716. distributor: Array<ParseResult<GenericElement>>; // TODO: Add specific type when distributor is handled
  717. authority: Array<ParseResult<GenericElement>>; // TODO: Add specific type when authority is handled
  718. pubPlace: Array<ParseResult<GenericElement>>; // TODO: Add specific type when pubPlace is handled
  719. address: Array<ParseResult<GenericElement>>; // TODO: Add specific type when address is handled
  720. idno: Array<ParseResult<GenericElement>>; // TODO: Add specific type when idno is handled
  721. availability: Array<ParseResult<GenericElement>>; // TODO: Add specific type when availability is handled
  722. date: Array<ParseResult<GenericElement>>; // TODO: Add specific type when date is handled
  723. licence: Array<ParseResult<GenericElement>>; // TODO: Add specific type when licence is handled
  724. }
  725. export class SeriesStmt extends GenericElement {
  726. structuredData: boolean;
  727. title: Array<ParseResult<GenericElement>>; // TODO: Add specific type when title is handled
  728. idno: Array<ParseResult<GenericElement>>; // TODO: Add specific type when idno is handled
  729. respStmt: RespStmt[];
  730. biblScope: Array<ParseResult<GenericElement>>; // TODO: Add specific type when biblScope is handled
  731. editor: Array<ParseResult<GenericElement>>; // TODO: Add specific type when editor is handled
  732. }
  733. export class NotesStmt extends GenericElement {
  734. notes: Note[];
  735. relatedItems: Array<ParseResult<GenericElement>>; // TODO: Add specific type when relatedItem is handled
  736. }
  737. export class SourceDesc extends GenericElement {
  738. structuredData: boolean;
  739. msDescs: MsDesc[];
  740. bibl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when bibl is handled
  741. biblFull: Array<ParseResult<GenericElement>>; // TODO: Add specific type when biblFull is handled
  742. biblStruct: Array<ParseResult<GenericElement>>; // TODO: Add specific type when biblStruct is handled
  743. recordingStmt: Array<ParseResult<GenericElement>>; // TODO: Add specific type when recordingStmt is handled
  744. scriptStmt: Array<ParseResult<GenericElement>>; // TODO: Add specific type when scriptStmt is handled
  745. }
  746. export class Extent extends GenericElement { }
  747. export class EncodingDesc extends GenericElement {
  748. structuredData: boolean;
  749. projectDesc: ProjectDesc[];
  750. samplingDecl: SamplingDecl[];
  751. editorialDecl: EditorialDecl[];
  752. tagsDecl: TagsDecl[];
  753. styleDefDecl: ParseResult<GenericElement>; // TODO: Add specific type when styleDefDecl is handled
  754. refsDecl: RefsDecl[];
  755. classDecl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when classDecl is handled
  756. geoDecl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when geoDecl is handled
  757. unitDecl: Array<ParseResult<GenericElement>>; // TODO: Add specific type when unitDecl is handled
  758. schemaSpec: Array<ParseResult<GenericElement>>; // TODO: Add specific type when schemaSpec is handled
  759. schemaRef: Array<ParseResult<GenericElement>>; // TODO: Add specific type when schemaRef is handled
  760. }
  761. export class ProjectDesc extends GenericElement {
  762. content: Paragraph[];
  763. }
  764. export class SamplingDecl extends GenericElement {
  765. content: Paragraph[];
  766. }
  767. export type CorrectionStatus = 'high' | 'medium' | 'low' | 'unknown';
  768. export type CorrectionMethod = 'silent' | 'markup';
  769. export class Correction extends ProjectDesc {
  770. status?: CorrectionStatus;
  771. method?: CorrectionMethod;
  772. }
  773. export type NormalizationMethod = 'silent' | 'markup';
  774. export class Normalization extends ProjectDesc {
  775. method: NormalizationMethod;
  776. sources: string[];
  777. }
  778. export type PunctuationMarks = 'none' | 'some' | 'all';
  779. export type PunctuationPlacement = 'internal' | 'external';
  780. export class Punctuation extends ProjectDesc {
  781. marks?: PunctuationMarks;
  782. placement?: PunctuationPlacement;
  783. }
  784. export type QuotationMarks = 'none' | 'some' | 'all';
  785. export class Quotation extends ProjectDesc {
  786. marks?: QuotationMarks;
  787. }
  788. export type HyphenationEol = 'all' | 'some' | 'hard' | 'none';
  789. export class Hyphenation extends ProjectDesc {
  790. eol?: HyphenationEol;
  791. }
  792. export class Segmentation extends GenericElement {
  793. content: Paragraph[];
  794. }
  795. export class StdVals extends GenericElement {
  796. content: Paragraph[];
  797. }
  798. export class Interpretation extends GenericElement {
  799. content: Paragraph[];
  800. }
  801. export class EditorialDecl extends GenericElement {
  802. structuredData: boolean;
  803. correction: Correction[];
  804. hyphenation: Hyphenation[];
  805. interpretation: Interpretation[];
  806. normalization: Normalization[];
  807. punctuation: Punctuation[];
  808. quotation: Quotation[];
  809. segmentation: Segmentation[];
  810. stdVals: StdVals[];
  811. }
  812. export type RenditionScope = 'first-line' | 'first-letter' | 'before' | 'after';
  813. export type Scheme = 'css' | 'xslfo' | 'free' | 'other';
  814. export class Rendition extends GenericElement {
  815. id: string;
  816. scope?: RenditionScope | string;
  817. selector?: string;
  818. scheme?: Scheme;
  819. schemeVersion?: string;
  820. }
  821. export class TagUsage extends GenericElement {
  822. gi: string;
  823. occurs: number;
  824. withId?: number;
  825. }
  826. export class Namespace extends GenericElement {
  827. name: string;
  828. tagUsage: TagUsage[];
  829. }
  830. export class TagsDecl extends GenericElement {
  831. rendition: Rendition[];
  832. namespace: Namespace[];
  833. }
  834. export class RefsDecl extends GenericElement {
  835. structuredData: boolean;
  836. cRefPattern: CRefPattern[];
  837. refState: RefState[];
  838. }
  839. export class RefState extends GenericElement {
  840. ed: string;
  841. unit: string;
  842. length: number;
  843. delim?: string;
  844. }
  845. export class CRefPattern extends GenericElement {
  846. matchPattern: string;
  847. replacementPattern: string;
  848. }
  849. export class Abstract extends GenericElement {
  850. resp: string;
  851. lang: string;
  852. }
  853. export class Calendar extends GenericElement {
  854. id: string;
  855. target: string;
  856. }
  857. export class CalendarDesc extends GenericElement {
  858. calendars: Calendar[];
  859. }
  860. export type CorrespActionType = 'sent' | 'received' | 'transmitted' | 'redirected' | 'forwarded';
  861. export class CorrespAction extends GenericElement {
  862. actionType: CorrespActionType | string;
  863. }
  864. export class CorrespContext extends GenericElement { }
  865. export class CorrespDesc extends GenericElement {
  866. content: Array<CorrespAction | CorrespContext | Note | Paragraph>;
  867. }
  868. export class Creation extends GenericElement { }
  869. export class Language extends GenericElement {
  870. ident: string;
  871. usage?: number;
  872. }
  873. export class LangUsage extends GenericElement {
  874. structuredData: boolean;
  875. languages: Language[];
  876. }
  877. export class CatRef extends GenericElement {
  878. scheme?: string;
  879. target?: string;
  880. }
  881. export class ClassCode extends GenericElement {
  882. scheme?: string;
  883. }
  884. export class Term extends GenericElement {
  885. id?: string;
  886. ref?: string;
  887. rend?: string;
  888. }
  889. export class Keywords extends GenericElement {
  890. scheme?: string;
  891. terms: Term[];
  892. }
  893. export class TextClass extends GenericElement {
  894. catRef: CatRef[];
  895. classCode: ClassCode[];
  896. keywords: Keywords[];
  897. }
  898. export type HandNoteScope = 'sole' | 'major' | 'minor';
  899. export class HandNote extends GenericElement {
  900. id: string;
  901. scribe?: string;
  902. scribeRef?: string;
  903. script?: string;
  904. scriptRef?: string;
  905. medium?: string;
  906. scope?: HandNoteScope;
  907. }
  908. export class HandNotes extends GenericElement {
  909. content: HandNote[];
  910. }
  911. export class Ptr extends GenericElement {
  912. id?: string;
  913. target?: string;
  914. cRef?: string;
  915. ptrType?: string;
  916. rend?: string;
  917. }
  918. export class Transpose extends GenericElement {
  919. content: Ptr[];
  920. }
  921. export class ListTranspose extends GenericElement {
  922. description: Description[];
  923. transposes: Transpose[];
  924. }
  925. export type ChannelMode = 's' | 'w' | 'sw' | 'ws' | 'm' | 'x';
  926. export class Channel extends GenericElement {
  927. mode?: ChannelMode;
  928. }
  929. export class Constitution extends GenericElement {
  930. constitutionType?: string;
  931. }
  932. export class Derivation extends GenericElement {
  933. derivationType?: string;
  934. }
  935. export class Domain extends GenericElement {
  936. domainType?: string;
  937. }
  938. export class Factuality extends GenericElement {
  939. factualityType?: string;
  940. }
  941. export type ActiveParticipants = 'singular' | 'plural' | 'corporate' | 'unknown';
  942. export type PassiveParticipants = 'self' | 'single' | 'many' | 'group' | 'world';
  943. export class Interaction extends GenericElement {
  944. interactionType?: string;
  945. active?: ActiveParticipants | string;
  946. passive?: PassiveParticipants | string;
  947. }
  948. export class Preparedness extends GenericElement {
  949. preparednessType?: string;
  950. }
  951. export type Degree = 'high' | 'medium' | 'low' | 'unknown';
  952. export class Purpose extends GenericElement {
  953. purposeType?: string;
  954. degree?: Degree;
  955. }
  956. export class TextDesc extends GenericElement {
  957. channel: Channel[];
  958. constitution: Constitution[];
  959. derivation: Derivation[];
  960. domain: Domain[];
  961. factuality: Factuality[];
  962. interaction: Interaction[];
  963. preparedness: Preparedness[];
  964. purpose: Purpose[];
  965. }
  966. export class ParticDesc extends GenericElement {
  967. structuredData: boolean;
  968. participants: NamedEntitiesList[];
  969. }
  970. export class Setting extends GenericElement {
  971. who?: string;
  972. name: GenericElement[]; // TODO: Add specific type when name is handled
  973. date: GenericElement[]; // TODO: Add specific type when date is handled
  974. time: GenericElement[]; // TODO: Add specific type when time is handled
  975. locale: GenericElement[]; // TODO: Add specific type when locale is handled
  976. activity: GenericElement[]; // TODO: Add specific type when activity is handled
  977. }
  978. export class SettingDesc extends GenericElement {
  979. structuredData: boolean;
  980. settings: Setting[];
  981. places: NamedEntitiesList[];
  982. }
  983. export class ProfileDesc extends GenericElement {
  984. abstract: Abstract[];
  985. calendarDesc: CalendarDesc[];
  986. correspDesc: CorrespDesc[];
  987. creation: Creation[];
  988. handNotes: HandNotes[];
  989. langUsage: LangUsage[];
  990. listTranspose: ListTranspose[];
  991. particDesc: ParticDesc[];
  992. settingDesc: SettingDesc[];
  993. textClass: TextClass[];
  994. textDesc: TextDesc[];
  995. }
  996. export type Status = 'approved' | 'candidate' | 'cleared' | 'deprecated' | 'draft' | 'embargoed' | 'expired' | 'frozen' | 'galley' | 'proposed' | 'published' | 'recommendation' | 'submitted' | 'unfinished' | 'withdrawn';
  997. export class Change extends GenericElement {
  998. id?: string;
  999. who?: string;
  1000. status?: Status | string;
  1001. when?: string;
  1002. notBefore?: string;
  1003. notAfter?: string;
  1004. targets?: string[];
  1005. }
  1006. export class ListChange extends GenericElement {
  1007. content: Array<ListChange | Change>;
  1008. id?: string;
  1009. description?: Description;
  1010. ordered?: boolean;
  1011. }
  1012. export class RevisionDesc extends GenericElement {
  1013. content: Array<ListChange | Change>;
  1014. status?: Status | string;
  1015. }
  1016. export class ProjectInfo {
  1017. fileDesc: FileDesc;
  1018. encodingDesc: EncodingDesc;
  1019. profileDesc: ProfileDesc;
  1020. revisionDesc: RevisionDesc;
  1021. }
  1022. export interface ViewerDataValue {
  1023. manifestURL?: string;
  1024. xmlImages?: XMLImagesValues[];
  1025. }
  1026. export interface XMLImagesValues {
  1027. url: string;
  1028. width?: number;
  1029. height?: number;
  1030. }
  1031. export interface ViewerDataType {
  1032. type: string;
  1033. value: ViewerDataValue;
  1034. }