Improved TS interfaces for the config checker

This commit is contained in:
DJj123dj
2025-04-08 13:49:59 +02:00
parent d545d21bb1
commit 1fddad1e96
+9 -9
View File
@@ -410,7 +410,7 @@ export interface ODCheckerStructureOptions {
/**The description of this config in the Interactive Setup CLI. */ /**The description of this config in the Interactive Setup CLI. */
cliDisplayDescription?:string cliDisplayDescription?:string
/**The default value of this variable when creating it in the Interactive Setup CLI. When not specified, the user will be asked to insert a value. */ /**The default value of this variable when creating it in the Interactive Setup CLI. When not specified, the user will be asked to insert a value. */
cliInitDefaultValue?:string cliInitDefaultValue?:ODValidJsonType
} }
/**## ODCheckerStructure `class` /**## ODCheckerStructure `class`
@@ -445,7 +445,7 @@ export class ODCheckerStructure {
*/ */
export interface ODCheckerObjectStructureOptions extends ODCheckerStructureOptions { export interface ODCheckerObjectStructureOptions extends ODCheckerStructureOptions {
/**Add a checker for a property in an object (can also be optional) */ /**Add a checker for a property in an object (can also be optional) */
children?:{key:string, priority:number, optional:boolean, cliHideInEditMode?:boolean, checker:ODCheckerStructure}[], children:{key:string, priority:number, optional:boolean, cliHideInEditMode?:boolean, checker:ODCheckerStructure}[],
/**A list of keys to skip when creating this object with the Interactive Setup CLI. The default value of these properties will be used instead. */ /**A list of keys to skip when creating this object with the Interactive Setup CLI. The default value of these properties will be used instead. */
cliInitSkipKeys?:string[], cliInitSkipKeys?:string[],
/**The key of a (primitive) property in this object to show the value of in the Interactive Setup CLI when listed in an array. */ /**The key of a (primitive) property in this object to show the value of in the Interactive Setup CLI when listed in an array. */
@@ -900,7 +900,7 @@ export interface ODCheckerTypeSwitchStructureOptions extends ODCheckerStructureO
/**A checker when the property is something else */ /**A checker when the property is something else */
other?:ODCheckerStructure, other?:ODCheckerStructure,
/**A list of allowed types */ /**A list of allowed types */
allowedTypes?:("string"|"number"|"boolean"|"null"|"array"|"object"|"other")[] allowedTypes:("string"|"number"|"boolean"|"null"|"array"|"object"|"other")[]
} }
/**## ODCheckerTypeSwitchStructure `class` /**## ODCheckerTypeSwitchStructure `class`
@@ -954,9 +954,9 @@ export class ODCheckerTypeSwitchStructure extends ODCheckerStructure {
*/ */
export interface ODCheckerObjectSwitchStructureOptions extends ODCheckerStructureOptions { export interface ODCheckerObjectSwitchStructureOptions extends ODCheckerStructureOptions {
/**An array of object checkers with their name, properties & priority. */ /**An array of object checkers with their name, properties & priority. */
objects?:{ objects:{
/**The properties to match for this checker to be used. */ /**The properties to match for this checker to be used. */
properties:{key:string, value:any}[], properties:{key:string, value:boolean|string|number}[],
/**The name for this object type (used in rendering) */ /**The name for this object type (used in rendering) */
name:string, name:string,
/**The higher the priority, the earlier this checker will be tested. */ /**The higher the priority, the earlier this checker will be tested. */
@@ -1022,11 +1022,11 @@ export class ODCheckerObjectSwitchStructure extends ODCheckerStructure {
*/ */
export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructureOptions { export interface ODCheckerEnabledObjectStructureOptions extends ODCheckerStructureOptions {
/**The name of the property to match the `enabledValue`. */ /**The name of the property to match the `enabledValue`. */
property?:string, property:string,
/**The value of the property to be enabled. Defaults to `true` */ /**The value of the property to be enabled. (e.g. `true`) */
enabledValue?:any, enabledValue:boolean|string|number,
/**The object checker to use once the property has been matched. */ /**The object checker to use once the property has been matched. */
checker?:ODCheckerObjectStructure checker:ODCheckerObjectStructure
} }
/**## ODCheckerEnabledObjectStructure `class` /**## ODCheckerEnabledObjectStructure `class`