Browse Source

A todo for CIF schemas

David Sehnal 7 years ago
parent
commit
cd04952ad3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/reader/cif/schema/utils.ts

+ 4 - 0
src/reader/cif/schema/utils.ts

@@ -118,6 +118,10 @@ function getCode (d: Data.Frame, ctx: SafeFrameData): string|undefined {
 export function getSchema (dic: Data.Block) {  // todo Block needs to be specialized with safe frames as well
     const schema: FrameSchema = {}  // { [category: string]: Category.Schema } = {}
 
+    // TODO: for fields with finite allowed values, generate:
+    // type FieldValue = 'a' | 'b' | 'c'
+    // const catetegory = { field: <type> as Field.Schema<FieldValue> }
+
     const categories: SafeFrameCategories = {}
     const links: SafeFrameLinks = {}
     dic.saveFrames.forEach(d => {