Interface AttributeCaster

Interface describes what's expected to be implemented by a class that is tasked with value casting.

See

CastsAttributes.prototype.implementsCaster

Hierarchy

  • AttributeCaster

Properties

Properties

get: ((value: unknown, attributes: Attributes<default>) => unknown)

Type declaration

    • (value: unknown, attributes: Attributes<default>): unknown
    • Transform the attribute from the underlying model value and return it.

      Returns

      Parameters

      • value: unknown

        the value to return

      • attributes: Attributes<default>

        receives a clone of the raw attributes

      Returns unknown

set: ((value: unknown, attributes: Attributes<default>) => unknown)

Type declaration

    • (value: unknown, attributes: Attributes<default>): unknown
    • Transform the attribute to its underlying model values and return it.

      Returns

      Parameters

      • value: unknown

        the value to set

      • attributes: Attributes<default>

        receives a clone of the raw attributes

      Returns unknown

Generated using TypeDoc