import { Awaitable, Class, DataProviderInterface, DataStore } from '@midway3-components/core'; import { Context } from '@midwayjs/core'; export interface RESTfulControllerInterface { indexAction(ctx: C, ...args: any): Promise | T[]>; viewAction(ctx: C, ...args: any): Promise; createAction?(ctx: C, ...args: any): Promise; updateAction?(ctx: C, ...args: any): Promise; deleteAction?(ctx: C, ...args: any): Promise; } export interface RESTfulFrom { apply?(model: T): T | void; } export type Scenario = keyof ({ [K in keyof RESTfulControllerInterface as K extends `${infer P}Action` ? P : never]: unknown; }); export interface RESTfulControllerOptions { readonly?: boolean; editBodyClz?: Class; createBodyClz?: Class; updateBodyClz?: Class; } export declare class BaseRESTfulController implements RESTfulControllerInterface { protected readonly store: DataStore; constructor(store: DataStore); protected getOptions(): RESTfulControllerOptions; indexAction(ctx: C, ...args: any): Promise | T[]>; viewAction(ctx: C, ...args: any): Promise; createAction(ctx: C, ...args: any): Promise; updateAction(ctx: C, ...args: any): Promise; deleteAction(ctx: C, ...args: any): Promise; protected assertMutable(ctx: C, scenario: Scenario): Awaitable; protected resolveOne(ctx: C, scenario: Scenario): Promise; protected paramName(): string; protected getRequestBody(ctx: C, scenario: Scenario): Promise; } export type RESTfulControllerConstructor = new (...args: any) => BaseRESTfulController; export declare function RESTfulControllerClass(store: DataStore, options?: RESTfulControllerOptions): RESTfulControllerConstructor; //# sourceMappingURL=restfulController.d.ts.map