import { Action } from '../actions/Action'; import { Permission, ResourceData, HookFunction, FieldContract, FilterContract, ResourceContract, AuthorizeFunction, ValidationMessages, SerializedResource, HookFunctionPromised, FlushHookFunction, SupportedIcons, ResourceExtendContract } from '@tensei/common'; import { ApiType, MiddlewareFn, ResourceMethod } from '@tensei/common/resources'; interface ResourceDataWithFields extends ResourceData { fields: FieldContract[]; actions: Action[]; } export declare class Resource implements ResourceContract { authorizeCallbacks: { authorizedToShow: AuthorizeFunction[]; authorizedToFetch: AuthorizeFunction[]; authorizedToCreate: AuthorizeFunction[]; authorizedToUpdate: AuthorizeFunction[]; authorizedToDelete: AuthorizeFunction[]; authorizedToRunAction: AuthorizeFunction[]; authorizedToFetchRelation: AuthorizeFunction[]; }; dashboardAuthorizeCallbacks: { authorizedToShow: AuthorizeFunction[]; authorizedToFetch: AuthorizeFunction[]; authorizedToCreate: AuthorizeFunction[]; authorizedToUpdate: AuthorizeFunction[]; authorizedToDelete: AuthorizeFunction[]; authorizedToRunAction: AuthorizeFunction[]; }; hooks: { onInit: HookFunction[]; beforeCreate: HookFunctionPromised[]; afterCreate: HookFunctionPromised[]; beforeUpdate: HookFunctionPromised[]; afterUpdate: HookFunctionPromised[]; beforeDelete: HookFunctionPromised[]; afterDelete: HookFunctionPromised[]; beforeFlush: FlushHookFunction[]; onFlush: FlushHookFunction[]; afterFlush: FlushHookFunction[]; }; constructor(name: string, tableName?: string); Model: () => any; description(description: string): this; enableAutoFills(): this; enableAutoFilters(): this; filters(filters: FilterContract[]): this; data: ResourceDataWithFields; permissions(permissions: Permission[]): this; hideOnApi(): this; showOnInsertSubscription(): this; showOnUpdateSubscription(): this; showOnDeleteSubscription(): this; hideOnCreateApi(): this; hideOnUpdateApi(): this; hideOnDeleteApi(): this; hideOnFetchApi(): this; canShow(authorizeFunction: AuthorizeFunction): this; repositoryMethod(name: string, fn: Fn): this; method(name: string, fn: Fn): this; canFetch(authorizeFunction: AuthorizeFunction): this; canFetchRelation(authorizeFunction: AuthorizeFunction): this; canCreate(authorizeFunction: AuthorizeFunction): this; canUpdate(authorizeFunction: AuthorizeFunction): this; canDelete(authorizeFunction: AuthorizeFunction): this; canRunAction(authorizeFunction: AuthorizeFunction): this; canShowOnDashboard(authorizeFunction: AuthorizeFunction): this; canFetchOnDashboard(authorizeFunction: AuthorizeFunction): this; canCreateOnDashboard(authorizeFunction: AuthorizeFunction): this; canUpdateOnDashboard(authorizeFunction: AuthorizeFunction): this; canDeleteOnDashboard(authorizeFunction: AuthorizeFunction): this; canRunActionOnDashboard(authorizeFunction: AuthorizeFunction): this; createMiddleware(middleware: MiddlewareFn[]): this; fetchMiddleware(middleware: MiddlewareFn[]): this; updateMiddleware(middleware: MiddlewareFn[]): this; deleteMiddleware(middleware: MiddlewareFn[]): this; displayField(displayField: string): this; secondaryDisplayField(displayField: string): this; fields(fields: FieldContract[]): this; actions(actions: Action[]): this; noTimestamps(): this; perPageOptions(perPageOptions: number[]): this; displayInNavigation(): this; hideFromNavigation(): this; validationMessages(validationMessages: ValidationMessages): this; group(groupName: string): this; slug(slug: string): this; label(label: string): this; icon(icon: SupportedIcons): this; serialize(): SerializedResource; beforeCreate(hook: HookFunctionPromised): this; beforeUpdate(hook: HookFunctionPromised): this; afterUpdate(hook: HookFunctionPromised): this; beforeDelete(hook: HookFunctionPromised): this; afterDelete(hook: HookFunctionPromised): this; afterCreate(hook: HookFunctionPromised): this; onInit(hook: HookFunction): this; extend(extend: ResourceExtendContract): this; getCreateApiExposedFields(): FieldContract[]; getPrimaryField(): FieldContract | undefined; getUpdateApiExposedFields(): FieldContract[]; getFetchApiExposedFields(): FieldContract[]; isHiddenOnApi(): boolean; } export declare const resource: (name: string, tableName?: string | undefined) => Resource; export default Resource;