UNPKG

@avonjs/avonjs

Version:

A fluent Node.js API generator.

126 lines (125 loc) 4.65 kB
import type { AbstractMixable, EvaluatorCallback, Model, ResourceEvaluatorCallback } from '../Contracts'; import type AvonRequest from '../Http/Requests/AvonRequest'; declare const _default: <T extends AbstractMixable = AbstractMixable>(Parent: T) => (abstract new (...args: import("../Contracts").Args) => { /** * Callback that indicates if the attribute should be shown on the index api. */ showOnIndexCallback: ResourceEvaluatorCallback; /** * Callback that indicates if the attribute should be shown on the detail api. */ showOnDetailCallback: ResourceEvaluatorCallback; /** * Callback that indicates if the attribute should be shown on the review api. */ showOnReviewCallback: ResourceEvaluatorCallback; /** * Callback that indicates if the attribute should be shown on the creation api. */ showOnCreationCallback: EvaluatorCallback; /** * Callback that indicates if the attribute should be shown on the update api. */ showOnUpdateCallback: ResourceEvaluatorCallback; /** * Callback that indicates if the attribute should be shown on the association api. */ showOnAssociationCallback: ResourceEvaluatorCallback; /** * Specify that the attribute should be hidden from the index api. */ hideFromIndex(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the detail api. */ hideFromDetail(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the review api. */ hideFromReview(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the association api. */ hideFromAssociation(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the creation api. */ hideWhenCreating(callback?: EvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the update api. */ hideWhenUpdating(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be visible on the index api. */ showOnIndex(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the detail api. */ showOnDetail(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the review api. */ showOnReview(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the association api. */ showOnAssociation(callback?: ResourceEvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the creation api. */ showOnCreating(callback?: EvaluatorCallback | boolean): any; /** * Specify that the attribute should be hidden from the update api. */ showOnUpdating(callback?: ResourceEvaluatorCallback | boolean): any; /** * Check for showing when updating. */ isShownOnUpdate(request: AvonRequest, resource: Model): boolean; /** * Check showing on index. */ isShownOnIndex(request: AvonRequest, resource: Model): boolean; /** * Determine if the field is to be shown on the detail api. */ isShownOnDetail(request: AvonRequest, resource: Model): boolean; /** * Determine if the field is to be shown on the review api. */ isShownOnReview(request: AvonRequest, resource: Model): boolean; /** * Determine if the field is to be shown on the review api. */ isShownOnAssociation(request: AvonRequest): boolean; /** * Check for showing when creating. */ isShownOnCreation(request: AvonRequest): boolean; /** * Specify that the attribute should only be shown on the index api. */ onlyOnIndex(): any; /** * Specify that the attribute should only be shown on the detail api. */ onlyOnDetail(): any; /** * Specify that the attribute should only be shown on the review api. */ onlyOnReview(): any; /** * Specify that the attribute should only be shown on the association api. */ onlyOnAssociation(): any; /** * Specify that the attribute should only be shown on forms. */ onlyOnForms(): any; /** * Specify that the attribute should be hidden from forms. */ exceptOnForms(): any; }) & T; export default _default;