Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseProp

All properties derive from this class. It provides a standard interface for rendering and interpreting x- vendor extension properties

Hierarchy

Indexable

[key: string]: any

All properties derive from this class. It provides a standard interface for rendering and interpreting x- vendor extension properties

Index

Constructors

constructor

  • new BaseProp(node: any, name: string): BaseProp
  • Create new property

    Parameters

    • node: any

      The node being managed

    • name: string

      The name of the node

    Returns BaseProp

Properties

classSourcePath

classSourcePath: string | null

The path to the the prooperty from the base property

Optional defaultValue

defaultValue: any

A default value for the property

Optional description

description: undefined | string

Detailed documentation

Optional empty

empty: any

Checks if given value is empty (=== '', === null, === undefined).

Optional equals

equals: any

Checks if value equals ("===") comparison

Optional isDefined

isDefined: any

Checks if value is defined (!== undefined, !== null). This is the only decorator that ignores skipMissingProperties option.

Optional isIn

isIn: any[]

Checks if value is in a array of allowed values.

Optional isNotIn

isNotIn: any[]

Checks if value is not in a array of disallowed values.

Optional isOptional

isOptional: undefined | false | true

Checks if given value is empty (=== null, === undefined) and if so, ignores all the validators on the property.

name

name: string

The name of the symbol

Optional notEmpty

notEmpty: any

Checks if given value is empty (=== '', === null, === undefined).

Optional notEquals

notEquals: any

Checks if value equals ("===") comparison.

Protected ownDecorator

ownDecorator: string = "IsString"

The prop instance's own type decorator

reportedType

reportedType: string

The type that was defined in the json/yaml

Protected sys

sys: LoDashStatic = sys

A local for templates to access lodash

Optional title

title: undefined | string

Short documentation

typeName

typeName: string = ""

The name typescript expects for the type

Accessors

prop

  • get prop(): string
  • The template to render this type

    Returns string

Methods

Protected decs

  • decs(): string[]
  • The list of decorators templates supported by this type

    Returns string[]

headers

  • headers(): string[]
  • Things like extra classes and enums that need to be at the top level of the module

    Returns string[]

imports

  • imports(): string[]
  • Returns a string array of needed imports

    Returns string[]

renderDeclarations

  • renderDeclarations(): string[]
  • Render the decorators and characteristics

    Returns string[]

renderProp

  • renderProp(): string
  • Render the property, decorators and types and formats the output

    Returns string

validationImports

  • validationImports(): string[]
  • Gets the validators that are actually in use so that a single import can be created

    Returns string[]

Object literals

Protected defaultTemplateOptions

defaultTemplateOptions: object

The default options for the template render

compileDebug

compileDebug: boolean = false

debug

debug: boolean = false

rmWhitespace

rmWhitespace: boolean = false

escape

  • escape(s: any): any

propToTemplate

propToTemplate: object

The map from property to template decorators of the class validator class

empty

empty: string = "IsEmpty"

equals

equals: string = "Equals"

isDefined

isDefined: string = "IsDefined"

isIn

isIn: string = "IsIn"

isNotIn

isNotIn: string = "IsNotIn"

notEmpty

notEmpty: string = "NotEmpty"

notEquals

notEquals: string = "NotEquals"

Generated using TypeDoc