credl-parser-evaluator
Version:
TypeScript-based CREDL Parser and Evaluator that processes CREDL files and outputs complete Intermediate Representations
82 lines • 3.22 kB
TypeScript
export interface TemplateVariable {
name: string;
description: string;
defaultValue?: string;
required?: boolean;
type: 'string' | 'number' | 'boolean' | 'date' | 'select';
options?: string[];
validation?: RegExp;
example?: string;
}
export interface TemplateMetadata {
name: string;
description: string;
version: string;
author?: string;
category: string;
tags: string[];
variables: TemplateVariable[];
files: Array<{
path: string;
description: string;
required: boolean;
}>;
}
export interface TemplateContext {
[key: string]: any;
project_name: string;
created_date: string;
author?: string;
version: string;
location?: string;
description?: string;
}
export declare const PROPERTY_TYPES: {
readonly office: {
readonly name: "Office Building";
readonly description: "Commercial office space template";
readonly icon: "🏢";
readonly defaultUnits: "sf";
};
readonly retail: {
readonly name: "Retail Property";
readonly description: "Retail commercial space template";
readonly icon: "🛍️";
readonly defaultUnits: "sf";
};
readonly 'mixed-use': {
readonly name: "Mixed-Use Development";
readonly description: "Mixed-use property with multiple space types";
readonly icon: "🏬";
readonly defaultUnits: "sf";
};
readonly industrial: {
readonly name: "Industrial Property";
readonly description: "Manufacturing, warehouse, and distribution facilities";
readonly icon: "🏭";
readonly defaultUnits: "sf";
};
readonly residential: {
readonly name: "Residential Property";
readonly description: "Apartment, condo, and residential developments";
readonly icon: "🏠";
readonly defaultUnits: "sf";
};
};
export type PropertyType = keyof typeof PROPERTY_TYPES;
export declare function generateOfficeTemplate(context: TemplateContext): string;
export declare function generateRetailTemplate(context: TemplateContext): string;
export declare function generateMixedUseTemplate(context: TemplateContext): string;
export declare function generateIndustrialTemplate(context: TemplateContext): string;
export declare function generateResidentialTemplate(context: TemplateContext): string;
export declare const templateGenerators: {
office: typeof generateOfficeTemplate;
retail: typeof generateRetailTemplate;
'mixed-use': typeof generateMixedUseTemplate;
industrial: typeof generateIndustrialTemplate;
residential: typeof generateResidentialTemplate;
};
export declare function getTemplateGenerator(propertyType: PropertyType): typeof generateOfficeTemplate | typeof generateRetailTemplate | typeof generateMixedUseTemplate | typeof generateIndustrialTemplate | typeof generateResidentialTemplate;
export declare function validateTemplateContext(context: TemplateContext, _propertyType: PropertyType): string[];
export declare function generateTemplateFile(propertyType: PropertyType, context: TemplateContext, outputPath: string): Promise<void>;
//# sourceMappingURL=templates.d.ts.map