Interface ISearchProps<Entity, Values, Request>

Configuration interface for search validation functionality.

Defines the structure needed to validate search operations by specifying how to extract search values from entities, filter the dataset manually, and construct API requests.

interface ISearchProps<
    Entity extends IEntity<any>,
    Values extends any[],
    Request,
> {
    fields: string[];
    filter(entity: Entity, values: Values): boolean;
    request(values: Values): Request;
    values(entity: Entity): Values;
}

Type Parameters

  • Entity extends IEntity<any>

    Type of entities being searched, must have an ID field

  • Values extends any[]

    Tuple type representing the search values extracted from entities

  • Request

    Type of the API request object

Properties

Methods

Properties

fields: string[]

Field names being searched, used in error messages for identification

Methods

  • Manual filter function to determine if an entity matches search criteria

    Parameters

    • entity: Entity

      Entity to test against criteria

    • values: Values

      Search values to match against

    Returns boolean

    True if entity matches the search criteria