evt-models.ts 35 KB

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