UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

100 lines (99 loc) 3.26 kB
import FieldCollection from '../Collections/FieldCollection'; import type { AbstractMixable, Model } from '../Contracts'; import type { Field } from '../Fields'; import type AvonRequest from '../Http/Requests/AvonRequest'; declare const _default: <T extends AbstractMixable = AbstractMixable>(Parent: T) => (abstract new (...args: import("../Contracts").Args) => { resource: Model; /** * Resolve the index fields. */ indexFields(request: AvonRequest, resource: Model): FieldCollection; /** * Resolve the detail fields. */ detailFields(request: AvonRequest, resource: Model): FieldCollection; /** * Resolve the creation fields. */ creationFields(request: AvonRequest): FieldCollection; /** * Resolve the update fields. */ updateFields(request: AvonRequest): FieldCollection; /** * Resolve the review fields. */ reviewFields(request: AvonRequest, resource: Model): FieldCollection; /** * Resolve the association fields. */ associationFields(request: AvonRequest): FieldCollection; /** * Resolve the prunable fields. */ /** * Resolve the filterable fields. */ filterableFields(request: AvonRequest): FieldCollection<Field>; /** * Resolve the orderable fields. */ orderableFields(request: AvonRequest): FieldCollection<Field>; /** * Get the fields for the given request. */ resolveFields(request: AvonRequest, resource?: Model): FieldCollection; /** * Get the fields that are available for the given request. */ availableFields(request: AvonRequest): FieldCollection; /** * Get the fields that are available on "index" or "detail" for the given request. */ availableFieldsOnIndexOrDetail(request: AvonRequest): FieldCollection; /** * Get the fields that are available on "forms" for the given request. */ availableFieldsOnForms(request: AvonRequest): FieldCollection; /** * Get the fields that are available for the given request. */ buildAvailableFields(request: AvonRequest, methods: string[]): FieldCollection; /** * Forwards the dynamic filed method calls. */ callFieldsMethod(method: string, request: AvonRequest): Field[]; /** * Compute the method to use to get the available fields. */ fieldsMethod(request: AvonRequest): keyof any; /** * Get the fields available on the entity. */ fieldsForCreate(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fieldsForUpdate(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fieldsForIndex(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fieldsForDetail(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fieldsForReview(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fieldsForAssociation(request: AvonRequest): Field[]; /** * Get the fields available on the entity. */ fields(request: AvonRequest): Field[]; }) & T; export default _default;