limgen
Version:
Infrastructure as Code generator
57 lines (56 loc) • 2.47 kB
TypeScript
import { initOptionsSchema } from './commands/init';
import { z } from 'zod';
/**
* Represents the type of framework being used.
*
* - 'nextjs': Indicates that the framework is Next.js.
* - 'unknown': Indicates that the framework is unknown.
*/
export type FrameworkType = 'nextjs' | 'tanstack-start' | 'unknown';
export declare const AllFrameworkTypes: readonly ["nextjs", "tanstack-start", "unknown"];
/**
* Represents a langauge-specific framework, such as Laravel, Django, or Next.js.
*/
export interface Framework {
dependsOn(inputs: any): Promise<{
packages: string[];
files: string[];
}>;
inputs: (cmdArgs: any, projectInputs: any) => Promise<{
name: string;
message: string;
schema: any;
}[]>;
collectInput: (cmdArgs: any, projectInputs: any, frameworkArgs: any) => Promise<any>;
default: (inputs: any) => Promise<void>;
}
/**
* A constant object that maps recognized framework types to their corresponding project types.
*
* @constant
* @type {Record<FrameworkType, ProjectType[]>}
*
* @property {ProjectType[]} nextjs - Represents the project types associated with the 'nextjs' framework.
* @property {ProjectType[]} unknown - Represents all project types associated with an unknown framework.
*/
export declare const RecognizedProjectFrameworkTypes: {
readonly nextjs: readonly ["fullstack-aws", "staticsite-aws"];
readonly 'tanstack-start': readonly ["fullstack-aws"];
readonly unknown: readonly ["fullstack-aws", "staticsite-aws", "fullstack-azure"];
};
/**
* Detects the framework being used in the project.
*
* @returns {Promise<FrameworkType>} The detected framework type.
*/
export declare function detectFramework(): Promise<FrameworkType>;
/**
* Gets the supported project types for a given framework.
*
* @param {FrameworkType} framework - The framework to get supported project types for.
*
* @returns {Promise<ProjectType[]>} The supported project types for the given framework.
*/
export declare function getSupportedProjectTypesForFramework(framework: FrameworkType): Promise<readonly ["fullstack-aws", "staticsite-aws", "fullstack-azure"] | readonly ["fullstack-aws", "staticsite-aws"] | readonly ["fullstack-aws"]>;
export declare function importFramework(frameworkType: FrameworkType): Promise<Framework>;
export declare function renderFramework(cmdArgs: z.infer<typeof initOptionsSchema>, framework: Framework, inputs: any): Promise<void>;