UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

50 lines (49 loc) 2.07 kB
import { type AbstractMixable, type AnyValue, type Model } from '../Contracts'; import type { Field } from '../Fields'; import type { Filter } from '../Filters'; import type AvonRequest from '../Http/Requests/AvonRequest'; import type { Repository } from '../Repositories'; declare const _default: <T extends AbstractMixable<Filter>>(Parent: T) => (abstract new (...args: import("../Contracts").Args) => { field: Field; /** * Apply the filter into the given repository. */ apply(request: AvonRequest, queryBuilder: Repository<Model>, value: AnyValue): Promise<void>; /** * Get the attribute that the date filter should perform on it. */ filterableAttribute(request: AvonRequest): string; /** * Determine if the given value is considered a valid null value if the field supports them. */ isValidNullValue(value: AnyValue): boolean; /** * Determine if the field supports null values. */ isNullable(): boolean; /** * Apply filter for valid null values. */ applyNullFilter(request: AvonRequest, queryBuilder: Repository<Model>): Repository<Model>; /** * Parse the value given from request. */ parseValue(value: AnyValue): any; /** * Get the query parameter key for filter. */ key(): string; helpText?: string; help(helpText: string): any; serializeParameters(request: AvonRequest): import("openapi-types").OpenAPIV3.ParameterObject[]; schema(request: AvonRequest): import("../Contracts").OpenApiSchema; canSee(callback: import("../Contracts").SeeCallback): any; seeCallback: import("../Contracts").SeeCallback; authorizedToSee(request: AvonRequest): boolean; nullable(nullable?: boolean, validator?: import("../Contracts").NullableCallback | undefined): any; acceptsNullValues: boolean; nullValidator: import("../Contracts").NullableCallback; nullValues(nullValidator: import("../Contracts").NullableCallback): any; valueIsConsideredNull(value: AnyValue): boolean; }) & T; export default _default;