import * as Generator from '@postxl/generator';
export type WithBackend<Context extends Generator.Context = Generator.Context> = Generator.ExtendContext<Context, {
    /**
     * The global configuration for the NestJS generator.
     *
     * Allows to register NestJS modules and npm dependencies for backend projects.
     */
    backend: BackendContextEntry;
}>;
/**
 * The global configuration for the NestJS generator.
 *
 * Allows to register NestJS modules and npm dependencies for backend projects.
 */
export type BackendContextEntry = {
    /**
     * Contains references to all modules that should be registered in addition to the default modules.
     */
    modules: NestJSModule[];
    packageJson: Generator.PackageJsonConfig;
    /**
     * Any additional tsconfig references that should be added to the main tsconfig.json file.
     */
    tsConfigReferences: string[];
};
/**
 * A NestJS module that should be registered in the app.
 */
export type NestJSModule = {
    /**
     * The name of the module.
     *
     * Example: `s3`
     */
    name: Generator.BackendModuleName;
    /**
     * Indicates if the generated module exposes an index.ts file.
     */
    hasIndex?: boolean;
    /**
     * If the module provides a Module class, this contains the class name and import location.
     *
     * Most modules will have a module class and need to be injected - however, the `@types` module
     * only exposes the types and does not need to be injected, hence it is optional.
     */
    moduleClass?: Generator.ImportableItem;
    /**
     * NestJS Module registration statement to register the module with NestJS's dependency injection.
     */
    apiModuleRegistration?: {
        /**
         * The import code for the module.
         *
         * If not provided, it will be derived from the `name` and `importLocation` property.
         * This should be used for more complicated imports, for instance:
         * ```
         * import { DatabaseModule } from '@database/database.module'
         * import { DatabaseConfigModule } from '@database/database.config'
         * ```
         */
        import?: Generator.Typescript;
        /**
         * NestJS Module registration statement to register the module with NestJS's dependency injection.
         *
         * Example: `S3Module.forRoot()`
         *
         * If not provided, the default will be the className
         */
        code?: Generator.Typescript;
        provider?: Generator.Typescript[];
    };
    /**
     * In case the module requires a env configuration, this is the decoder and transformer to use.
     */
    envConfig?: EnvConfig;
    /**
     * The code that should be executed when the app is bootstrapped.
     *
     * Example: `await app.get(TRPCPlugin).register(app)`
     */
    bootStrap?: {
        /**
         * The import statement that should be added to the main file.
         *
         * Example: `import { TRPCPlugin } from '@trpc/trpc.plugin'`
         */
        import: Generator.Typescript;
        /**
         * The code that should be executed when the app is bootstrapped.
         *
         * Example: `await app.get(TRPCPlugin).register(app)`
         */
        code: Generator.Typescript;
    };
    /**
     * The libraries' generated code.
     */
    vfs?: Generator.VirtualFileSystem;
};
export type EnvConfig = {
    /**
     * Example:
     *    AWS_ACCESS_KEY: z.string(),
     *    AWS_SECRET_ACCESS_KEY: z.string(),
     *    AWS_BUCKET: z.string(),
     *    AWS_REGION: z.string(),
     */
    decoder: Generator.Typescript;
    /**
     * Example:
     * aws: {
     *      accessKey: val.AWS_ACCESS_KEY,
     *      secretAccessKey: val.AWS_SECRET_ACCESS_KEY,
     *      bucket: val.AWS_BUCKET,
     *      region: val.AWS_REGION,
     *    },
     */
    transformer: Generator.Typescript;
    /**
     * An example for the module's env configuration.
     *
     * Example:
     * AWS_ACCESS_KEY=""
     * AWS_SECRET_ACCESS_KEY=""
     * AWS_BUCKET=""
     * AWS_REGION="eu-central-1"
     */
    dotEnvExample: string;
    /**
     * Any config type definitions that the module should expose.
     *
     * Example:
     * export type TestConfig = TestConfig_NoTest | TestConfig_Test
     *     type TestConfig_NoTest = {
     *       isTest: false
     *     }
     *
     *     export type TestConfig_Test = {
     *       isTest: true
     *       isStateful: boolean
     *     }
     *   }
     */
    type?: Generator.Typescript;
};
