import { GenericEventEmitter } from '../core/types/GenericEventEmitter.js'; import type { FullServiceDefinition } from '../helper/types/FullServiceDefinition.js'; import type { ServiceBuilder } from '../ServiceBuilder/ServiceBuilder.impl.js'; import type { ClientBuilderEvents } from './types/ClientBuilderEvents.js'; import type { Config, ConfigFull } from './types/Config.js'; export declare const CONFIG_FILE_NAME = "purista.client.json"; /** * ClientBuilder to generate clients, based on service definitions. */ export declare class ClientBuilder extends GenericEventEmitter { config: ConfigFull; /** * The root path from where relative definition/config/output paths are resolved. * Defaults to the current working directory (`process.cwd()`). */ rootPath: string; constructor(config?: Partial); /** * Loads the config from a JSON file. * If no path is provided, it loads `purista.client.json` from `rootPath`. * @param path */ loadConfig(path?: string): Promise; /** * Gets the definitions from the provided service builders */ getDefinitionsFromServiceBuilders(serviceBuilders: ServiceBuilder[]): Promise; /** * Writes the config to a config file. * Defaults to purista.client.json in rootPath directory * * @param path */ writeConfig(path?: string): Promise; /** * Resolves the definitions folder path from config with rootPath * @returns path of definitions folder */ getDefinitionPath(): string; /** * Resolves the output folder path from config with rootPath * @returns path of output folder */ getOutputPath(): string; /** * Deletes the content of the output folder. * Should be called before generating the client * @returns */ cleanDistFolder(): Promise; /** * Creates a index.ts file which exports the client(s) and types. * Is used in generated package.json */ createIndex(): Promise; /** * Creates a package.json file in the output folder. * Exports the files which are build by tsc based on generated client files */ createPackageJson(): Promise; /** * Runs the tsc against the generated ts source files. * Generates plain ESM output. */ build(): Promise; /** * Internal helper for compiling typescript files * @param fileNames * @param options * @param type */ private compile; /** * Load service definitions from JSON files. * * @param path - Optional path to the folder containing the definition files. * Defaults to the configured definition path. * * @example * ```ts * const defs = await clientBuilder.loadDefinitionFiles() * ``` */ loadDefinitionFiles(path?: string): Promise; /** * Generate zero‑dependency HTTP client source files from the given definition. * * @param serviceDefinition - The full service definition containing the exposed commands. * * @example * ```ts * const services = await clientBuilder.loadDefinitionFiles() * await clientBuilder.generateHttpClient(services) * ``` */ generateHttpClient(serviceDefinition: FullServiceDefinition): Promise; /** * Helper function which generates the getters * @param clientStream * @param typeStream * @param serviceDefinitions */ private generateHttpClientSource; /** * Generates the correlating type file * @returns */ private getHttpClientConfigTypeString; /** * Returns the source of HttpError class as string. * @returns */ private getHttpErrorClassString; /** * Generates the zero-dependency EventBridge client source files. * @param serviceDefinition */ generateEventBridgeClient(serviceDefinition: FullServiceDefinition): Promise; /** * @deprecated Use `generateEventBridgeClient` instead. */ generateHEventBridgeClient(serviceDefinition: FullServiceDefinition): Promise; private generateEventBridgeClientSource; /** * Destroys the builder and cleans the event listeners */ destroy(): void; } //# sourceMappingURL=ClientBuilder.impl.d.ts.map