Skip to content

@vtj / Modules / core / PropModel

Class: PropModel

core.PropModel

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PropModel(name, value?, defaultValue?): PropModel

Parameters

NameType
namestring
value?JSONValue | JSExpression | JSFunction
defaultValue?JSONValue | JSExpression | JSFunction

Returns

PropModel

Defined in

packages/core/src/models/prop.ts:13

Properties

defaultValue

Optional defaultValue: JSONValue | JSExpression | JSFunction

Defined in

packages/core/src/models/prop.ts:16


isUnset

isUnset: boolean = false

标识是否设置了值, 设置的值与默认值一致,表示未设置,在转换成dsl时会排查该属性

Defined in

packages/core/src/models/prop.ts:12


name

name: string

Defined in

packages/core/src/models/prop.ts:14


value

Optional value: JSONValue | JSExpression | JSFunction

Defined in

packages/core/src/models/prop.ts:15

Methods

getValue

getValue(): JSONValue | JSExpression | JSFunction

Returns

JSONValue | JSExpression | JSFunction

Defined in

packages/core/src/models/prop.ts:24


setValue

setValue(value): void

Parameters

NameType
valueJSONValue | JSExpression | JSFunction

Returns

void

Defined in

packages/core/src/models/prop.ts:20


parse

parse(props?): Record<string, PropModel>

Parameters

NameType
propsNodeProps

Returns

Record<string, PropModel>

Defined in

packages/core/src/models/prop.ts:36


toDsl

toDsl(props?): NodeProps

Parameters

NameType
propsRecord<string, PropModel>

Returns

NodeProps

Defined in

packages/core/src/models/prop.ts:27

Released under the MIT License.