import { FileSystem, type NowConfig, type Telemetry } from '@servicenow/sdk-build-core';
import type { IConnector } from '../connector';
import { Project } from '../project';
import { templates, type Templates, type TemplateFile, type TemplateInfo, type TemplateLeaf } from './templates';
export interface TemplateQuery {
    label?: string;
}
export declare class ProjectFactory {
    private readonly fs;
    private readonly project?;
    private readonly telemetry;
    private readonly registry;
    private templatePackageAvailability?;
    constructor(fs: FileSystem, telemetry?: Telemetry, project?: Project | undefined, options?: {
        registry?: string;
    });
    preloadTemplatePackages(): Promise<void>;
    private isTemplateAvailable;
    getProjectTemplates(query?: TemplateQuery): (TemplateInfo & {
        id: keyof Templates;
    })[];
    getPartialTemplates(query?: TemplateQuery): (TemplateInfo & {
        id: keyof Templates;
    })[];
    private wouldConflict;
    getConfigurationTemplate(): (TemplateInfo & {
        id: keyof Templates;
    })[];
    getOriginalFiles(workingDir: string): Record<string, string>;
    createProjectFromApp(workingDir: string, scopeId: string, connector: IConnector, options: Partial<Pick<InitOptions, 'sdkVersion' | 'packageName' | 'conversion'>>): Promise<Project>;
    createConfigurationProject(workingDir: string, connector: IConnector, scopeOptions: {
        scope: string | undefined;
        scopeId: string | undefined;
    }, options: Partial<Pick<InitOptions, 'sdkVersion' | 'packageName'>>): Promise<Project>;
    createProjectFromDirectory(workingDir: string, metadataDir: string, options: Partial<Pick<InitOptions, 'sdkVersion' | 'packageName' | 'conversion'>>): Promise<Project>;
    private createProjectFromDirectory0;
    private findPackageJsonModule;
    createProject(workingDir: string, options: InitOptions): Promise<Project>;
    private findSysAppXmlInformation;
    private findPluginPropertiesInfo;
    private getSysAppXML;
    private renderExtractedFiles;
    private writeTemplates;
    static createNpmPackageName(appName: string): string;
}
export type InitOptions = Pick<NowConfig, 'name' | 'scope'> & {
    scopeId?: string;
    packageName: string;
    description: string;
    sdkVersion?: string;
    projectVersion?: string;
    templateId?: keyof Templates;
    metadataDir?: string | undefined;
    conversion?: boolean | undefined;
};
export declare const ProjectInitValidation: {
    validateInitOptions(options: InitOptions): string[];
    validateAppName(name: string | undefined): string | void;
    validateScopeName(name: string | undefined, requiredPrefix?: string | undefined, conversion?: boolean): string | void;
    validateNpmPackageName(name: string | undefined): string | void;
};
export declare function wouldTemplateConflict(templateContent: string, existingContent: string, newContent: string): boolean;
type RenderedTemplateFile = TemplateFile & {
    templateFile: TemplateFile;
};
export declare const renderTemplates: (templates: TemplateFile[], data: Record<string, unknown>, originalFiles: Record<string, string>) => RenderedTemplateFile[];
export { templates };
export type { Templates, TemplateFile, TemplateInfo, TemplateLeaf };
