UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

27 lines (26 loc) 843 B
import { type AnyArray, type Model, type OpenApiSchema } from '../Contracts'; import type AvonRequest from '../Http/Requests/AvonRequest'; import type { Repository } from '../Repositories'; import Filter from './Filter'; export default abstract class SelectFilter extends Filter { /** * The help text for the filter. */ helpText?: string; /** * Apply the filter into the given repository. */ apply(request: AvonRequest, repository: Repository<Model>, value: never): void; /** * Get the attribute that the boolean filter should perform on it. */ abstract filterableAttribute(request: AvonRequest): string; /** * Get the possible filtering values. */ options(): AnyArray; /** * Get the swagger-ui schema. */ schema(request: AvonRequest): OpenApiSchema; }