UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

35 lines (34 loc) 1.17 kB
import { type AbstractMixable, type AnyValue, type FilterableCallback, type Model } from '../Contracts'; import type AvonRequest from '../Http/Requests/AvonRequest'; import type { Repository } from '../Repositories'; declare const _default: <T extends AbstractMixable = AbstractMixable>(Parent: T) => (abstract new (...args: import("../Contracts").Args) => { /** * The callback to be used for the field's default value. */ lookupCallback?: FilterableCallback | boolean; /** * The key used to look up the resource. */ lookupKeyUsing?: string; /** * Apply the filter to the given query. */ applyLookup(request: AvonRequest, queryBuilder: Repository<Model>, value: AnyValue): Promise<void>; /** * Indicates the field is look up able. */ isLookupable(): boolean; /** * The callback used to determine if the field is lookupable. */ lookupable(callback?: FilterableCallback | boolean): any; /** * Get the look up key name. */ lookupKey(): string; /** * Set the look up key name. */ lookupUsing(lookupKey: string): any; }) & T; export default _default;