@tusss/ood
    Preparing search index...

    Interface IModel<TData>

    interface IModel<TData> {
        toJSON(): ClassProperties<TData>;
        toStruct(): ClassProperties<TData>;
    }

    Type Parameters

    • TData

    Implemented by

    Index

    Methods

    • Implements the JSON.stringify() behavior.

      It uses toStruct to get the plain object structure under the hood.

      It is encouraged to use toStruct instead of this method because it provides better clarity and expressiveness about the data structure being serialized. This method is provided only to support the JSON.stringify() serialization.

      Returns ClassProperties<TData>

      A plain object structure containing the model's serializable properties.

    • Converts the model instance into a plain data structure (struct).

      This method extracts the model's property data, removing functions, methods, or class-specific instance details, returning a clean structural representation.

      Returns ClassProperties<TData>

      A plain object structure containing the model's serializable properties.