/** role→resource (URL order) vs resource→role (swap after version) */ export type TreeLayout = 'role-resource' | 'resource-role'; /** @deprecated use role-resource / resource-role */ export type LegacyTreeLayout = 'url-order' | 'resource-first'; export type ExampleLabelStyle = 'status-case' | 'status-title-case' | 'full'; export type SpecInfo = { title?: string; version?: string; description?: string; }; /** Named Try-it preset: own baseUrl + optional extra variables (tokens, etc.). */ export type EnvPreset = { baseUrl: string; /** * Variable name that carries the base URL in Try-it and Postman exports. * Default `baseUrl`; set e.g. `ONBOARDING_SERVICE` to match an existing collection. */ baseUrlKey?: string; /** Extra variables merged into the preset (baseUrl wins from EnvPreset.baseUrl). */ variables?: Record; }; export type DaxtaConfig = { workspace?: string; baseUrl?: string; /** * Multi-base Try-it presets (local / staging / production, …). * Seeded into the API docs env picker and `.daxta/viewer-store.json` on first write. * Default: `{ local: { baseUrl } }` from `baseUrl`. */ envPresets?: Record; controllersRoot?: string; outDir?: string; /** * Sidebar / tag folder order after version: * - role-resource → v1 › admin › baskets (URL order, recommended) * - resource-role → v1 › baskets › admin */ treeLayout?: TreeLayout | LegacyTreeLayout; /** * Do not create sidebar folders for `{param}` segments (and anything after). * Ops like POST …/{id}/lock sit under the parent resource. Default true. */ treeSkipParams?: boolean; /** * Fold a leaf folder into its parent when it holds a single operation and no * subfolders, so `merchants › tr › POST` becomes `merchants › POST onboard tr merchant` * while `external-checkouts` keeps its folder because several ops live there. * One level only. Default true. */ treeCollapseSingle?: boolean; treePathOverrides?: Record; /** * OpenAPI example + scenario labels: * - status-case → `201 — cyprus payload shape` * - status-title-case → `201 — Create Mock Tbs — cyprus payload shape` * - full → includes path + POSITIVE CASES + clause * Ideal it(): docs take the when-clause. Parametric it(): pre-when field context is kept. */ exampleLabelStyle?: ExampleLabelStyle; port?: number; fieldsFile?: string; /** * URL prefix for the viewer. Default `/docs`. * Override with env `DAXTA_DOCS_PATH` (e.g. `/docs` or `docs`). */ docsPath?: string; /** * Persisted Try-it env/header store (survives rebuild). Default `.daxta/viewer-store.json`. * Served at `{docsPath}/env.json`. Keep out of git if it holds secrets. */ viewerStoreFile?: string; testScript?: string; testCommand?: string; daxtaVersion?: string; jestConfig?: string; templatize?: (pathname: string, test?: string) => string | null | undefined; operationTag?: (pathTemplate: string, method: string) => string | undefined; operationTitle?: (method: string, pathTemplate: string) => string | undefined; securitySchemeId?: (headerName: string) => string | undefined; specInfo?: () => SpecInfo | undefined; operationOrder?: (opKey: string) => number | undefined; includeHit?: (method: string, pathTemplate: string, test?: string) => boolean; treePathSegments?: (pathTemplate: string) => string[] | undefined; }; export type ResolvedDaxtaConfig = Required> & DaxtaConfig; export declare const DEFAULT_DOCS_PATH = "/docs"; export declare function normalizeDocsPath(raw?: string | null): string; export declare function defineConfig(config: DaxtaConfig): DaxtaConfig; export declare function normalizeTreeLayout(layout: TreeLayout | LegacyTreeLayout | undefined): TreeLayout; export declare function resolveConfig(cwd?: string, overrides?: DaxtaConfig): ResolvedDaxtaConfig; /** * Env name for a base URL when the config does not name it: * loopback → local, host keywords (staging/dev/test/qa/sandbox) → that keyword, * anything else → first non-generic subdomain, or `production` for plain api.* hosts. */ export declare function envNameFromUrl(url: string): string; /** Unique-ified `{ url, description }` servers for the spec, one per env preset. */ export declare function serversFromEnvPresets(presets: Record | undefined, fallbackBaseUrl: string): Array<{ url: string; description: string; }>; export declare function getConfig(forceReload?: boolean): ResolvedDaxtaConfig; export declare function setConfig(config: ResolvedDaxtaConfig): void; export declare function resetConfig(): void;