Class OverrideClassRegistry<T>

Type Parameters

  • T extends AbstractCtor

Constructors

Methods

  • Create an object of the given className. The constructor is passed args.

    Parameters

    • className: string
    • Rest...args: unknown[]

    Returns undefined | InstanceType<T>

  • A convenience API to pass in a serialized VcsObject directly. It calls create using options.type as the className. Will throw an error if options.type is not a string or options is not an Object. Passes options and args to the constructor in that order.

    Parameters

    • options: {
          type?: string;
      } & Record<string, unknown>
    • Rest...args: unknown[]

    Returns undefined | InstanceType<T>

  • Gets the constructor for a registered class or undefined, if no such class was registerd

    Parameters

    • className: string

    Returns undefined | Ctor<T>

  • Register a class for a given module by name. If the class already exists, it will be replaced and replaced called with the classeName.

    Parameters

    • moduleId: string
    • className: string
    • ctor: Ctor<T>

    Returns void

  • Removes all classes registered from within a certain module. Will re-instate classes overwritten by the module and call the appropriate events, outlined in unregisterClass.

    Parameters

    • moduleId: string

    Returns void

  • Unregister a previously registered class. You can only unregister classes added to this registry, not the underlying core registry. If when registering this class you have replaced class, it will be re-instated and replaced called. If there is no previously registered class, it will be removed and removed will be called.

    Parameters

    • moduleId: string
    • className: string

    Returns void

Properties

removed: VcsEvent<string> = ...

Called if a class was removed. Is passed the className

replaced: VcsEvent<string> = ...

Called if a class was replaced. Is passed the className