//#region src/codegen/types.d.ts type GroupBy = 'tag' | 'path'; /** * The HTTP transport used by the generated runtime. * * - `'fetch'` (default): native `fetch()`, zero `HttpClient` dependency. * - `'httpClient'`: Angular `HttpClient` wrapper, integrates with the * Angular interceptor ecosystem and `provideHttpClient()`. */ type HttpTransport = 'fetch' | 'httpClient'; /** * OpenAPI parameter serialization styles for query parameters. * * - `'form'` (default): comma-separated when `explode: false`, * repeated keys when `explode: true`. * - `'spaceDelimited'`: space-separated (`%20`). * - `'pipeDelimited'`: pipe-separated (`|`). * - `'deepObject'`: nested key notation (`key[prop]=value`). */ type QueryStyle = 'form' | 'spaceDelimited' | 'pipeDelimited' | 'deepObject'; /** * Runtime-related generator options. * * These influence the generated runtime files (providers, fetch client). * Runtime extension points that are functions (middleware, auth, hooks, * error mapper) are configured at runtime via Angular DI tokens emitted by * `provideNgOpenapiSignals`. Only static, codegen-time defaults live here. */ interface RuntimeConfig { /** * Selects the HTTP transport for the generated runtime. * * - `'fetch'` (default): generates `ApiFetchClient` using native `fetch()`. * - `'httpClient'`: generates `ApiHttpClient` wrapping Angular `HttpClient`. * * The `fetch` transport preserves the zero-`HttpClient` guarantee. */ transport?: HttpTransport; /** * Static default headers merged into every request. These are baked into * the generated `provideNgOpenapiSignals` default and can be overridden * per request via `ApiRequestOptions.headers`. */ defaultHeaders?: Record; /** * When `true` (default), generated API methods emit a `responseType` * hint (`'json' | 'text' | 'blob' | 'arrayBuffer' | 'stream'`) derived from the * OpenAPI response `content` type. Set to `false` to rely solely on * runtime content-type sniffing. */ responseTypeHints?: boolean; /** * Default query parameter serialization style when the OpenAPI spec does * not specify `style`. Defaults to `'form'` (the OpenAPI default for * query parameters). */ defaultQueryStyle?: QueryStyle; /** * Default `explode` flag for query parameters when the OpenAPI spec does * not specify `explode`. Defaults to `true` (the OpenAPI default for * `form` style query parameters). */ defaultQueryExplode?: boolean; /** * Preferred content type when a request body offers multiple media types. * Defaults to `'application/json'`. Set to e.g. `'multipart/form-data'` * to prefer multipart when available. */ preferContentType?: string; /** * When `true`, generates an additional signal-based `…Mutation()` method * for every POST/PUT/PATCH/DELETE operation, alongside the existing * Promise-based method. The generated `…Mutation()` returns a `Mutation` * object exposing `result`, `error`, `status`, `isLoading` signals and a * `mutate(body, signal?)` function. Defaults to `false` to preserve the * zero-magic generation default. */ signalMutations?: boolean; /** * When `true`, generates a `transformDates` runtime helper and wires it * into the JSON response parsing path of both transports. ISO-8601 * date-time strings (e.g. `2026-07-15T12:00:00Z`) found anywhere in a * parsed JSON body are recursively converted to `Date` instances. * Non-JSON responses (text, blob, arrayBuffer, stream) are left * untouched. Defaults to `false` to preserve the zero-magic default. */ dateTransformer?: boolean; } interface GeneratorConfig { input: string; output: string; clean: boolean; groupBy: GroupBy; /** Runtime options. Omitted in partial configs; defaulted by `resolveConfig`. */ runtime?: RuntimeConfig; } type PartialGeneratorConfig = Partial> & { runtime?: Partial; }; //#endregion //#region src/config.d.ts declare const DEFAULT_RUNTIME_CONFIG: RuntimeConfig; declare const DEFAULT_CONFIG: GeneratorConfig; declare const DEFAULT_CONFIG_FILE = "ng-openapi-signals.config.ts"; /** * Helper for type inference in user config files. * * @example * ```ts * export default defineConfig({ * input: './openapi.json', * output: './src/generated/api', * groupBy: 'tag', * }); * ``` */ declare function defineConfig(config: PartialGeneratorConfig): PartialGeneratorConfig; /** * Loads a config file (`ng-openapi-signals.config.ts`) from the given path * or from the current working directory. * * Returns an empty object if no config file is found. */ declare function loadConfig(configPath?: string): Promise; /** * Merges CLI options (highest priority) over file config over defaults. * * The nested `runtime` object is deep-merged field-by-field so that partial * overrides (e.g. only `defaultHeaders`) don't wipe out other runtime fields. */ declare function resolveConfig(cliOptions: PartialGeneratorConfig, fileConfig: PartialGeneratorConfig): GeneratorConfig; /** * Validates that the resolved config has the required `input` and `output` paths. */ declare function validateConfig(config: GeneratorConfig): void; /** * Type guard for the `GroupBy` union. */ declare function isGroupBy(value: unknown): value is GroupBy; /** * Type guard for the `HttpTransport` union. */ declare function isTransport(value: unknown): value is HttpTransport; /** * Type guard for the `QueryStyle` union. */ declare function isQueryStyle(value: unknown): value is QueryStyle; //#endregion export { DEFAULT_CONFIG, DEFAULT_CONFIG_FILE, DEFAULT_RUNTIME_CONFIG, defineConfig, isGroupBy, isQueryStyle, isTransport, loadConfig, resolveConfig, validateConfig };