Fudge Core
    Preparing search index...

    Function enumerate

    • Decorator for making getters in a Mutable class enumerable. This ensures that the getters are included in mutators and are subsequently displayed in the editor.

      Usage: Apply this decorator to both the getter method and the class to make it effective.

      Example:

      @ƒ.enumerate // apply the decorator to the class.
      export class SomeScript extends ƒ.ComponentScript {
      #size: number = 1;

      @ƒ.enumerate // apply the decorator to the getter
      public get size(): number {
      return this.#size;
      }

      // define a setter to allow writing, or omit it to leave the property read-only
      public set size(_size: number) {
      this.#size = _size;
      }
      }

      Parameters

      • _value: unknown
      • _context: ClassDecoratorContext<new (...args: any[]) => Mutable>

      Returns void

    • Decorator for making getters in a Mutable class enumerable. This ensures that the getters are included in mutators and are subsequently displayed in the editor.

      Usage: Apply this decorator to both the getter method and the class to make it effective.

      Example:

      @ƒ.enumerate // apply the decorator to the class.
      export class SomeScript extends ƒ.ComponentScript {
      #size: number = 1;

      @ƒ.enumerate // apply the decorator to the getter
      public get size(): number {
      return this.#size;
      }

      // define a setter to allow writing, or omit it to leave the property read-only
      public set size(_size: number) {
      this.#size = _size;
      }
      }

      Parameters

      • _value: unknown
      • _context:
            | ClassGetterDecoratorContext<Mutable, unknown>
            | ClassAccessorDecoratorContext<Mutable, unknown>

      Returns void