@@ -28,16 +28,13 @@ export interface ParamSpec<T = unknown> {
2828 default ?: T ;
2929 label ?: string ;
3030 description ?: string ;
31- valueType ? : ParamValueType ;
31+ type : ParamValueType ;
3232}
3333
34- export type ParamOptions < T = unknown > = Omit <
35- ParamSpec < T > ,
36- 'name' | 'valueType'
37- > ;
34+ export type ParamOptions < T = unknown > = Omit < ParamSpec < T > , 'name' | 'type' > ;
3835
3936export class Param < T = unknown > {
40- static valueType : ParamValueType = 'string' ;
37+ static type : ParamValueType = 'string' ;
4138
4239 constructor ( readonly name : string , readonly options : ParamOptions < T > = { } ) { }
4340
@@ -61,7 +58,7 @@ export class Param<T = unknown> {
6158 const out : ParamSpec = {
6259 name : this . name ,
6360 ...this . options ,
64- valueType : ( this . constructor as typeof Param ) . valueType ,
61+ type : ( this . constructor as typeof Param ) . type ,
6562 } ;
6663 if ( this . options . default && typeof this . options . default !== 'string' ) {
6764 out . default = ( this . options . default as
@@ -78,7 +75,7 @@ export class StringParam extends Param<string> {
7875}
7976
8077export class IntParam extends Param < number > {
81- static valueType : ParamValueType = 'int' ;
78+ static type : ParamValueType = 'int' ;
8279
8380 get value ( ) : number {
8481 const intVal = parseInt (
@@ -97,7 +94,7 @@ export class IntParam extends Param<number> {
9794}
9895
9996export class FloatParam extends Param < number > {
100- static valueType : ParamValueType = 'float' ;
97+ static type : ParamValueType = 'float' ;
10198
10299 get value ( ) : number {
103100 const floatVal = parseFloat (
@@ -115,7 +112,7 @@ export class FloatParam extends Param<number> {
115112}
116113
117114export class BooleanParam extends Param {
118- static valueType : ParamValueType = 'boolean' ;
115+ static type : ParamValueType = 'boolean' ;
119116
120117 get value ( ) : boolean {
121118 const lowerVal = (
@@ -137,7 +134,7 @@ export class BooleanParam extends Param {
137134}
138135
139136export class ListParam extends Param < string [ ] > {
140- static valueType : ParamValueType = 'list' ;
137+ static type : ParamValueType = 'list' ;
141138
142139 get value ( ) : string [ ] {
143140 return typeof this . rawValue === 'string'
@@ -148,7 +145,7 @@ export class ListParam extends Param<string[]> {
148145 toSpec ( ) : ParamSpec < string > {
149146 const out : ParamSpec = {
150147 name : this . name ,
151- valueType : 'list' ,
148+ type : 'list' ,
152149 ...this . options ,
153150 } ;
154151 if ( this . options . default && this . options . default . length > 0 ) {
@@ -160,7 +157,7 @@ export class ListParam extends Param<string[]> {
160157}
161158
162159export class JSONParam < T = any > extends Param < T > {
163- static valueType : ParamValueType = 'json' ;
160+ static type : ParamValueType = 'json' ;
164161
165162 get value ( ) : T {
166163 if ( this . rawValue ) {
0 commit comments