dic.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * Copyright (c) 2017 molio contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { Field, Block } from '../schema'
  7. const str = Field.str()
  8. const float = Field.float()
  9. const datablock = {
  10. id: str,
  11. description: str
  12. }
  13. const dictionary = {
  14. title: str,
  15. datablock_id: str,
  16. version: str
  17. }
  18. const dictionary_history = {
  19. version: str,
  20. update: str,
  21. revision: str
  22. }
  23. const sub_category = {
  24. id: str,
  25. description: str
  26. }
  27. const category_group_list = {
  28. id: str,
  29. parent_id: str,
  30. description: str
  31. }
  32. const item_type_list = {
  33. code: str,
  34. primitive_code: str,
  35. construct: str,
  36. detail: str
  37. }
  38. const item_units_list = {
  39. code: str,
  40. detail: str
  41. }
  42. const item_units_conversion = {
  43. from_code: str,
  44. to_code: str,
  45. operator: str,
  46. factor: float
  47. }
  48. // TODO save frame dic schema
  49. const dic = {
  50. datablock,
  51. dictionary,
  52. dictionary_history,
  53. sub_category,
  54. category_group_list,
  55. item_type_list,
  56. item_units_list,
  57. item_units_conversion
  58. }
  59. type dic = Block.Instance<typeof dic>
  60. export default dic