Skip to main content

ObjectType <Shape>

Hierarchy

Index

Constructors

publicconstructor

  • new ObjectType<Shape>(shape: ObjectShape<Shape>, options: SchemaOptions<ObjectOptions, { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>): ObjectType<Shape>
  • Type parameters

    • Shape: Record<string, Node> = Record<string, Node>

    Parameters

    • shape: ObjectShape<Shape>
    • options: SchemaOptions<ObjectOptions, { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>

    Returns ObjectType<Shape>

Properties

public_attributes

_attributes: { generic: GenericAttributes; typescript: TypescriptAttributes } = ...

Type declaration

  • generic: GenericAttributes
  • typescript: TypescriptAttributes

publicoptional_canReference

_canReference?: boolean

public_children

_children: Node[]

publicoptional_connections

_connections?: Node[]

public_definition

_definition: ThereforeNodeDefinition<{ [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }> = {}

publicoptional_hooks

_hooks?: Hooks

public_id

_id: string = ...

public_isCommutative

_isCommutative: boolean = false

publicoptional_name

_name?: string

public_options

_options: ObjectOptions

publicoptional_sourcePath

_sourcePath?: string

publicoptional_transform

_transform?: { aliasName?: (name: string) => string; referenceName?: (name: string) => string; symbolName?: (name: string) => string }

Type declaration

  • optionalaliasName?: (name: string) => string
      • (name: string): string
      • Parameters

        • name: string

        Returns string

  • optionalreferenceName?: (name: string) => string
      • (name: string): string
      • Parameters

        • name: string

        Returns string

  • optionalsymbolName?: (name: string) => string
      • (name: string): string
      • Parameters

        • name: string

        Returns string

public_type

_type: object = ...

publicinfer

infer: { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }

publicinput

input: { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][input] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>[KeyType] }

publicshape

shape: { [ K in string | number | symbol ]: Shape[K] }

Accessors

public_output

  • get _output(): (TypescriptOutput | GenericOutput)[]
  • Returns (TypescriptOutput | GenericOutput)[]

Methods

public_from

publicarray

publiccompile

  • compile(__namedParameters?: { formats?: boolean }): Schema<{ [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>
  • Parameters

    • __namedParameters: { formats?: boolean } = {}
      • optionalformats: boolean = true

    Returns Schema<{ [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>

publicdefault

  • default(value: { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][input] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>[KeyType] }): DefaultType<ObjectType<Shape>>
  • Parameters

    • value: { [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][input] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][input] }>[KeyType] }

    Returns DefaultType<ObjectType<Shape>>

publicdescribe

  • describe(description: string): this
  • Parameters

    • description: string

    Returns this

publicextend

  • extend<Extra>(extra: ObjectShape<Extra>): ObjectType<{ [ KeyType in string | number | symbol ]: Shape & Extra[KeyType] }>
  • Type parameters

    • Extra: Record<string, Node>

    Parameters

    Returns ObjectType<{ [ KeyType in string | number | symbol ]: Shape & Extra[KeyType] }>

publicjsonschema

  • jsonschema(schema: JsonSchema<{ [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>): this
  • Parameters

    • schema: JsonSchema<{ [ KeyType in string | number | symbol ]: Omit<{ [ K in string | number | symbol ]: Shape[K][infer] }, keyof UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>> & UndefinedToOptional<{ [ K in string | number | symbol ]: Shape[K][infer] }>[KeyType] }>

    Returns this

publickeyof

publicmerge

  • merge<Other>(other: Other): ObjectType<{ [ KeyType in string | number | symbol ]: Shape & Other[shape][KeyType] }>
  • Type parameters

    Parameters

    • other: Other

    Returns ObjectType<{ [ KeyType in string | number | symbol ]: Shape & Other[shape][KeyType] }>

publicnullable

  • Returns NullableType<ObjectType<Shape>>

publicomit

  • omit<Key>(...properties: Key[]): ObjectType<{ [ KeyType in string | number | symbol ]: Omit<Shape, Key>[KeyType] }>
  • Type parameters

    • Key: string | number | symbol

    Parameters

    • rest...properties: Key[]

    Returns ObjectType<{ [ KeyType in string | number | symbol ]: Omit<Shape, Key>[KeyType] }>

publicoptional

  • Returns OptionalType<ObjectType<Shape>>

publicpartial

  • partial<Keys>(...properties: Keys): ObjectType<ShapeToPartial<Shape, Keys>>
  • Type parameters

    • Keys: keyof Shape[]

    Parameters

    • rest...properties: Keys

    Returns ObjectType<ShapeToPartial<Shape, Keys>>

publicpick

  • pick<Key>(...properties: Key[]): ObjectType<{ [ KeyType in string | number | symbol ]: Pick<Shape, Key>[KeyType] }>
  • Type parameters

    • Key: string | number | symbol

    Parameters

    • rest...properties: Key[]

    Returns ObjectType<{ [ KeyType in string | number | symbol ]: Pick<Shape, Key>[KeyType] }>

publicreference

publicrequired

  • required<Keys>(...properties: Keys): ObjectType<ShapeToRequired<Shape, Keys>>
  • Type parameters

    • Keys: keyof Shape[]

    Parameters

    • rest...properties: Keys

    Returns ObjectType<ShapeToRequired<Shape, Keys>>

publicstrict

  • strict(strict?: boolean): this
  • Parameters

    • strict: boolean = true

    Returns this

publicvalidator

  • validator(validator?: Partial<ValidatorOptions>): this
  • Parameters

    • validator: Partial<ValidatorOptions> = {}

    Returns this