@tusss/ood
    Preparing search index...

    Class Sort<TField>

    A class representing a sort configuration, implementing SortParams.

    Basic usage showing default sort creation and sorting with custom parameters:

    // Default sort: field is "id", direction is "asc"
    const defaultSort = new Sort();
    console.log(defaultSort.field); // "id"
    console.log(defaultSort.direction); // "asc"

    // Custom sort
    const nameSort = new Sort({ field: "name", direction: "desc" });
    console.log(nameSort.field); // "name"
    console.log(nameSort.direction); // "desc"

    Type Parameters

    • TField extends string = string

      The union type of valid fields that can be sorted. Defaults to string.

    Implements

    Index

    Constructors

    Properties

    Constructors

    • Initializes a new instance of the Sort class.

      Type Parameters

      • TField extends string = string

        The union type of valid fields that can be sorted. Defaults to string.

      Parameters

      • Optionaldata: SortParams<TField>

        Optional sort parameters to initialize the configuration.

      Returns Sort<TField>

    Properties

    direction: "asc" | "desc"

    The direction of the sort: ascending (asc) or descending (desc).

    field: TField

    The field to sort by.