Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MagicalPropertyManager

Hierarchy

Implements

Index

Properties

Readonly event

event: IEventEmitter<this, IMagicalPropertyManagerEvents> = new EventEmitter<this, E>(this)

Methods

all

  • Returns MagicalPropertyEntry[]

    a list of all the magical properties on this object

  • Parameters

    • intersectionType: true

    Returns MagicalPropertyEntryIntersection[]

    a list of all the magical properties on this object,

clear

  • clear(): number
  • Removes any magical properties on this object

    Returns number

    the number of magical properties removed

count

  • count(): number
  • Returns number

    the number of magical properties on this object

get

  • get<T>(type: T): number | undefined
  • get<T>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): number | undefined
  • get(...identity: MagicalPropertyIdentity): number | undefined
  • Type parameters

    Parameters

    • type: T

    Returns number | undefined

    a magical property on this object, if it exists

  • Type parameters

    Parameters

    • type: T
    • subType: MagicalPropertyTypeSubTypeMap[T]

    Returns number | undefined

    a magical sub-property on this object, if it exists

  • Parameters

    Returns number | undefined

has

  • has(type: MagicalPropertyType): boolean
  • has<T>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): boolean
  • Parameters

    Returns boolean

    whether the given type of magical property is present on this object

  • Type parameters

    Parameters

    • type: T
    • subType: MagicalPropertyTypeSubTypeMap[T]

    Returns boolean

    whether the given type of magical sub-property is present on this object

hasAny

  • hasAny(): boolean
  • Returns boolean

    if this object has any magical properties

hasAnyTypes

  • Check to see if any an array of MagicalPropertyTypese exist on an object.

    Parameters

    Returns boolean

    True if any of the magical property types exist on this object.

hash

  • hash(): string
  • Returns string

inherit

  • Removes any magical properties on this object and replaces them with magical properties on the given object

    Parameters

    Returns this

normalTypes

remove

  • remove(type: MagicalPropertyType): boolean
  • remove<T>(type: T, subType: MagicalPropertyTypeSubTypeMap[T]): boolean
  • Removes a magical property on this object, if it exists

    Parameters

    Returns boolean

    whether the magical property was removed — ie, if it existed

  • Removes a magical sub-property on this object, if it exists. If all sub-properties are removed, the super-property is too.

    Type parameters

    Parameters

    • type: T
    • subType: MagicalPropertyTypeSubTypeMap[T]

    Returns boolean

    whether the magical sub-property was removed — ie, if it existed

set

  • set<T>(type: T, value: number): this
  • set<T>(type: T, subType: MagicalPropertyTypeSubTypeMap[T], value: number): this
  • Sets a magical property on this object. Replaces any existing magical property of that type

    Type parameters

    Parameters

    • type: T
    • value: number

    Returns this

  • Sets a magical sub-property on this object. Replaces any existing magical sub-property of that type

    Type parameters

    Parameters

    • type: T
    • subType: MagicalPropertyTypeSubTypeMap[T]
    • value: number

    Returns this

stream

  • stream(): Stream<{ type: MagicalNormalPropertyTypes; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number }>
  • Alias of .all().stream()

    Returns Stream<{ type: MagicalNormalPropertyTypes; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number } | { subType: MagicalPropertyTypeSubTypeMap[K]; type: K; value: number }>

subProperties

  • subProperties<T>(type: T): ReadonlyArray<{ type: MagicalPropertyTypeSubTypeMap[T]; value: number }>
  • Type parameters

    Parameters

    • type: T

    Returns ReadonlyArray<{ type: MagicalPropertyTypeSubTypeMap[T]; value: number }>

    a list of all the magical sub-properties for the given type on this object, if any

subTypes

  • Returns keyof MagicalSubPropertyTypesResult[]

    a list of all the magical sub-property types of the given supertype on this object

  • Type parameters

    Parameters

    • type: T

    Returns ReadonlyArray<MagicalPropertyTypeSubTypeMap[T]>

    a list of all the magical sub-property types of the given supertype on this object

translate

typeStream

  • Alias of .types().stream()

    Returns Stream<MagicalPropertyType>

types

  • Returns MagicalPropertyType[]

    a list of all the magical property types on this object

Static translate

Static translateTooltip

  • Parameters

    Returns Translation

    a translation for a magical property type

  • Type parameters

    Parameters

    • type: T
    • subType: MagicalPropertyTypeSubTypeMap[T]

    Returns Translation

    a translation for a magical sub-property type

Generated using TypeDoc