/** * Laravel Policy class generator. * * Generates Policy classes from Cedar-style ABAC policy definitions. * Only generates for schemas that have `policies` defined. */ import { SchemaReader } from './schema-reader.js'; import type { GeneratedFile, PhpConfig } from './types.js'; import type { SchemaDefinition, SingleCondition } from '../types.js'; /** Generate Laravel Policy classes for project-owned visible schemas. * * Issue #98 v5.8.14: every `kind: object` schema now gets a generated * policy base + editable stub by default — Laravel's policy * auto-discovery (`App\\Models\\` → `App\\Policies\\Policy`) * works out of the box without per-project Gate::policy(...) wiring. * * Skip rules: * - `kind: pivot` — pivots have no API surface * - `options.policy: false` — explicit per-schema opt-out * * Two code paths per schema: * - Explicit Cedar-style `policies: [...]` → existing rule-based body * generator (forbid / permit / when conditions). * - No `policies:` declared → standard CRUD scaffolding (viewAny / * view / create / update / delete + restore / forceDelete on * softDelete). Default body: `return true;`. Project secures by * overriding the method in the editable child. */ export declare function generatePolicies(reader: SchemaReader, config: PhpConfig): GeneratedFile[]; /** Convert a single condition to a PHP expression. */ export declare function conditionToPhp(cond: SingleCondition, schema: SchemaDefinition, reader: SchemaReader): string;