@@ -47,7 +47,7 @@ function processProperties(obj: JsonSchema, dataKeyPath: string, schemaPath: str
4747/**
4848 * Process a json schema key/value property definition.
4949 */
50- function processProperty ( key : string , value : any , requiredItem : boolean , keyPath : string , schemaPath : string , accumulatedErrors : TranslationError [ ] ) : GuiElement {
50+ function processProperty ( key : string , value : any , requiredItem : boolean , keyPath : string , schemaPath : string , accumulatedErrors : TranslationError [ ] ) : GuiElement | null {
5151 let type = value . type ;
5252 if ( ! isString ( type ) ) {
5353 addError ( accumulatedErrors , 'Type elements must be strings (not ' + typeof type + ') ' , schemaPath ) ;
@@ -75,7 +75,7 @@ function processProperty(key: string, value: any, requiredItem: boolean, keyPath
7575
7676 validateField ( type , dataSubType , defaultValue , enumValues , keyPath , schemaPath , requiredItem , accumulatedErrors ) ;
7777
78- let prop : GuiElement ;
78+ let prop : GuiElement | null ;
7979 switch ( type ) {
8080 case 'number' : prop = createNumberField ( key , keyPath , label , tooltip , defaultValue , requiredItem , dataSubType , enumValues ) ;
8181 break ;
@@ -141,7 +141,7 @@ function validateField(type: string, dataSubType: SubDataType, defaultValue: any
141141 * Create an immutable gui input dropdown element for a number, making any contained objects immutable in the process.
142142 */
143143function createNumberField ( key : string , objectPath : string , label : string , tooltip : string , defaultValue : number ,
144- required : boolean , dataType : SubDataType , values : number [ ] = undefined ) : TypedField < number > {
144+ required : boolean , dataType : SubDataType , values : ( number [ ] | undefined ) = undefined ) : TypedField < number > {
145145 return Object . freeze < TypedField < number > > ( {
146146 kind : 'field' ,
147147 name : key ,
@@ -161,7 +161,7 @@ function createNumberField(key: string, objectPath: string, label: string, toolt
161161 * Create an immutable gui input dropdown element for an integer, making any contained objects immutable in the process.
162162 */
163163function createIntegerField ( key : string , objectPath : string , label : string , tooltip : string , defaultValue : number ,
164- required : boolean , dataType : SubDataType , values : number [ ] = undefined ) : TypedField < number > {
164+ required : boolean , dataType : SubDataType , values : ( number [ ] | undefined ) = undefined ) : TypedField < number > {
165165 return Object . freeze < TypedField < number > > ( {
166166 kind : 'field' ,
167167 name : key ,
@@ -181,7 +181,7 @@ function createIntegerField(key: string, objectPath: string, label: string, tool
181181 * Create an immutable gui input element for a boolean, making any contained objects immutable in the process.
182182 */
183183function createBooleanField ( key : string , objectPath : string , label : string , tooltip : string , defaultValue : boolean ,
184- required : boolean , dataType : SubDataType , values : boolean [ ] = undefined ) : TypedField < boolean > {
184+ required : boolean , dataType : SubDataType , values : ( boolean [ ] | undefined ) = undefined ) : TypedField < boolean > {
185185 return Object . freeze < TypedField < boolean > > ( {
186186 kind : 'field' ,
187187 name : key ,
@@ -201,7 +201,7 @@ function createBooleanField(key: string, objectPath: string, label: string, tool
201201 * Create an immutable gui input dropdown element for a string, making any contained objects immutable in the process.
202202 */
203203function createStringField ( key : string , objectPath : string , label : string , tooltip : string , defaultValue : string ,
204- required : boolean , dataType : SubDataType , values : string [ ] = undefined ) : TypedField < string > {
204+ required : boolean , dataType : SubDataType , values : ( string [ ] | undefined ) = undefined ) : TypedField < string > {
205205 return Object . freeze < TypedField < string > > ( {
206206 kind : 'field' ,
207207 name : key ,
0 commit comments