mongodb-rag-ingest
Version:
MongoDB Ingest CLI for the MongoDB Chatbot Framework.
20 lines • 741 B
TypeScript
import yargs from "yargs";
import { Config } from "./Config";
export type LoadConfigArgs = {
config?: string;
};
export declare const loadConfig: ({ config: configPathIn, }: LoadConfigArgs) => Promise<Config>;
export declare const withConfig: <T>(action: (config: ResolvedConfig, args: T) => Promise<void>, args: LoadConfigArgs & T) => Promise<void>;
/**
Apply config options to CLI command.
*/
export declare const withConfigOptions: <T>(args: yargs.Argv<T>) => yargs.Argv<T & LoadConfigArgs>;
/**
Config with promises resolved.
*/
export type ResolvedConfig = {
[K in keyof Config]: Constructed<Config[K]>;
};
type Constructed<T> = Awaited<T extends () => infer R ? R : T>;
export {};
//# sourceMappingURL=withConfig.d.ts.map