evt-models.ts 35 KB

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