import { CLI } from "./public-api.mjs"; import { Expand, ParsedArgs } from "@cli-forge/parser"; //#region src/lib/composable-builder.d.ts /** * Extracts the TChildren type parameter from a CLI type. */ type ExtractChildren = T extends CLI ? C : never; /** * Extracts the TArgs type parameter from a CLI type. */ type ExtractArgs = T extends CLI ? A : never; /** * Type for a composable builder function that transforms a CLI. * Used with `chain` to compose multiple builders. */ type ComposableBuilder = (init: CLI) => CLI, THandlerReturn, TChildren & TAddedChildren, TParent, TProviders & TAddedProviders>; /** * Creates a composable builder function that can be used with `chain`. * Can be used to add options, commands, or any other CLI modifications. * Children added by the builder function are properly tracked in the type. * * The builder function runs once at creation time against a recording Proxy. * Subsequent applications replay the captured operations, ensuring inline * middleware closures have stable references for Set-based deduplication. * * @typeParam TArgs2 - The args type after the builder runs * @typeParam TChildren2 - The children type added by the builder * @typeParam TProviders2 - The providers type added by the builder */ declare function makeComposableBuilder(fn: (init: CLI) => CLI): (init: CLI) => CLI, THandlerReturn, TChildren & TChildren2, TParent, TProviders & TProviders2>; //#endregion export { ComposableBuilder, ExtractArgs, ExtractChildren, makeComposableBuilder }; //# sourceMappingURL=composable-builder.d.mts.map