zenstack
Version:
FullStack enhancement for Prisma ORM: seamless integration from database to UI
17 lines (16 loc) • 485 B
TypeScript
import type { Model } from '@zenstackhq/sdk/ast';
/**
* Generates a `ModelCheckers` interface that contains a `check` method for each model in the schema.
*
* E.g.:
*
* ```ts
* type CheckerOperation = 'create' | 'read' | 'update' | 'delete';
*
* export interface ModelCheckers {
* user: { check(op: CheckerOperation, args?: { email?: string; age?: number; }): Promise<boolean> },
* ...
* }
* ```
*/
export declare function generateCheckerType(model: Model): string;