turbodombuilder - v0.9.22
    Preparing search index...

    Function expose

    • Function

      Parameters

      • rootKey: string

        The property key of the instance to expose from.

      • OptionalexposeSetter: boolean = true

        Whether to expose a setter for the property. Defaults to true.

      Returns <Type extends object, Value>(
          value:
              | {
                  get?: (this: Type) => Value;
                  set?: (this: Type, value: Value) => void;
              }
              | ((initial: Value) => Value)
              | ((this: Type, ...args: any[]) => any),
          context:
              | ClassFieldDecoratorContext<Type, Value>
              | ClassAccessorDecoratorContext<Type, Value>
              | ClassMethodDecoratorContext<Type, (this: Type, ...args: any) => any>,
      ) => any

      expose

      Stage-3 decorator that augments fields, accessors, and methods to expose fields and methods from inner instances.

      protected model: TurboModel;
      @expose("model") public color: string;

      Is equivalent to:

      protected model: TurboModel;

      public get color(): string {
      return this.model.color;
      }

      public set color(value: string) {
      this.model.color = value;
      }