evt-models.ts 34 KB

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