/** * Generates OpenAPI / Swagger annotation files from schemas (issue #35). * * Off by default. Opt in via `codegen.laravel.openapi.enable: true`. Requires * `darkaonline/l5-swagger` (or any zircote/swagger-php consumer) installed in * the host Laravel project. * * Output (under `app/Omnify/OpenApi/` by default): * - `Common.php` — `OmnifyFile`, `PaginationMeta`, `ValidationError` * - `OmnifyApiInfo.php` — `#[OA\Info]`, security scheme, one `#[OA\Tag]` per schema * - `Schemas/{Name}Schema.php` — one component per schema with `options.api` * * Controller method attributes are emitted by `controller-generator.ts` — * not here. We only own the standalone OpenAPI scaffold files. */ import { SchemaReader } from './schema-reader.js'; import type { GeneratedFile, PhpConfig } from './types.js'; import type { SchemaDefinition } from '../types.js'; /** Public entry. Generates the OpenAPI scaffold files. No-op when disabled. */ export declare function generateOpenApi(reader: SchemaReader, config: PhpConfig): GeneratedFile[]; /** * Build the `#[OA\Get(...)]` / `#[OA\Post(...)]` attributes for one CRUD * method on a generated controller. Returned as an array of indented attribute * lines ready to splice into the controller template. * * Returns an empty array when openapi codegen is disabled, so callers can * unconditionally interpolate `${attrs.join('\n')}\n` without branching. */ export declare function buildControllerMethodAttributes(config: PhpConfig, schema: SchemaDefinition, modelName: string, schemaName: string, method: 'index' | 'store' | 'show' | 'update' | 'destroy' | 'lookup' | 'bulkDelete' | 'restore'): string[]; /** Returns the imports needed by controller files when openapi is enabled. */ export declare function openApiControllerImports(config: PhpConfig): string[];