Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PartMetadata

Hierarchy

  • PartMetadata

Implements

  • Iterable<PartOption & IPartOptionMetadata>

Index

Properties

Optional description

description: undefined | string

Optional remarks

remarks: undefined | string

Methods

__@iterator

  • __@iterator(): Iterator<PartOption & IPartOptionMetadata>
  • Returns Iterator<PartOption & IPartOptionMetadata>

addOption

  • Describe a new option for this part.

    Parameters

    • name: string

      The name of the option, as a string.

    • type: Type

      The type of the option, which will be used for serialization and type checking

    • value: unknown

      The default value. New instances of the part will have their options set to defaults.

    • Optional metadata: IPartOptionMetadata

      Metadata about this option, such as a short description of what it does

      A note on types and schema

      Types and schema are not currently validated in the framework, except to provide additional UI features in editors. Providing a type will not guarantee that all values match that type, it will merely document that the option should be a particular type and make the Part Properties dialog show a more appropriate type editor.

      In a similar vein, providing an 'enum' schema for a String option will make the Part Properties dialog show a dropdown with each enum value, instead of the usual string editor.

      At some point in the future, we will be tightening up the Type annotations system and hope to offer this guarantee to parts.

    Returns void

getMetadataForOption

  • getMetadataForOption(name: string): PartOption & IPartOptionMetadata | undefined
  • Parameters

    • name: string

    Returns PartOption & IPartOptionMetadata | undefined

Generated using TypeDoc