UNPKG

@trapi/query

Version:

A tiny library which provides utility types/functions for request and response query handling.

5 lines 1.38 kB
import { FieldsParseOptions, FieldsParseOutput, FiltersParseOptions, FiltersParseOutput, PaginationParseOptions, PaginationParseOutput, RelationsParseOptions, RelationsParseOutput, SortParseOptions, SortParseOutput } from '../../parameter'; import { Parameter, URLParameter } from '../../constants'; export declare type ParseParameterOptions<T extends `${Parameter}` | `${URLParameter}`> = T extends `${Parameter.FIELDS}` | `${URLParameter.FIELDS}` ? FieldsParseOptions : T extends `${Parameter.FILTERS}` | `${URLParameter.FILTERS}` ? FiltersParseOptions : T extends `${Parameter.RELATIONS}` | `${URLParameter.RELATIONS}` ? RelationsParseOptions : T extends `${Parameter.PAGINATION}` | `${URLParameter.PAGINATION}` ? PaginationParseOptions : T extends `${Parameter.SORT}` | `${URLParameter.SORT}` ? SortParseOptions : never; export declare type ParseParameterOutput<T extends `${Parameter}` | `${URLParameter}`> = T extends `${Parameter.FIELDS}` | `${URLParameter.FIELDS}` ? FieldsParseOutput : T extends `${Parameter.FILTERS}` | `${URLParameter.FILTERS}` ? FiltersParseOutput : T extends `${Parameter.RELATIONS}` | `${URLParameter.RELATIONS}` ? RelationsParseOutput : T extends `${Parameter.PAGINATION}` | `${URLParameter.PAGINATION}` ? PaginationParseOutput : T extends `${Parameter.SORT}` | `${URLParameter.SORT}` ? SortParseOutput : never; //# sourceMappingURL=type.d.ts.map