import type { SortBy } from './lib/filter-sort-helper/sort.js'; import type { SchemaParser } from './lib/schema-parer/schema-parser.js'; import type { FilterHelpers } from './lib/filter-sort-helper/filter.js'; import type { SchemaDeclaration } from './schema.js'; type WithEllipsis = '' | `${',' | ', '}${boolean}`; type Modifier = `:excerpt(${number}${WithEllipsis})`; export type Options = { [Key in TKey]: { requestKey?: string | null; /** Array of field names to include in the response. If not provided, all fields will be included. */ fields?: Array; /** Array of relations to include in the response. */ expand?: Array>; } & { subscribe: { filter?: string | ((helpers: FilterHelpers) => string); }; list: { sort?: '@random' | '@rowid' | `${'' | '-'}${keyof TSchema[Key]['type'] & string}` | (string & {}) | ((helpers: { /** @deprecated */ $: FilterHelpers['$']; sortBy: SortBy; }) => string); filter?: string | ((helpers: FilterHelpers) => string); page?: number; perPage?: number; skipTotal?: boolean; }; view: unknown; }[TMethod]; }[TKey]; export type Expand = SchemaParser> = { [Key in keyof _Relations[TTableName]]: { /** Key of the relation to expand (column name or back-relation) */ key: Key; /** Array of field names to include in the response. If not provided, all fields will be included */ fields?: Array; /** Array of relations to include in the response. */ expand?: Array>; }; }[keyof _Relations[TTableName]]; export {};