okai
Version:
AI-powered code generation tool for ServiceStack Apps. Generate TypeScript data models, C# APIs, migrations, and UI components from natural language prompts using LLMs.
62 lines • 3.1 kB
TypeScript
import type { MetadataType, MetadataTypes, MetadataAttribute, MetadataTypeName } from "./types";
import { ParsedAnnotation, ParsedClass, ParsedEnum, ParseResult } from "./ts-parser.js";
export declare class CSharpAst {
typeMap: {
[js: string]: MetadataTypeName;
};
decimalTypeProps: string[];
valueTypes: string[];
integerTypes: string[];
commonValueTypes: string[];
requestAttrs: string[];
modelAttrs: string[];
requestPropAttrs: string[];
get requestPropAttrsWithoutValidators(): string[];
modelPropAttrs: string[];
targetOnlyAttrs: string[];
ignoreCreateProps: string[];
ignoreUpdateProps: string[];
ignoreUpdateValidators: string[];
ignoreReadValidators: string[];
ignoreDeleteValidators: string[];
ignoreApisFor: string[];
isEnum(type: string): true | MetadataType;
isValueType(type: string): true | MetadataType;
ast: ParseResult;
result: MetadataTypes;
toCsName(tsName: string): string;
csharpType(type: string, propName?: string): MetadataTypeName;
csharpAttribute(attr: ParsedAnnotation): MetadataAttribute;
addMetadataType(cls: ParsedClass): MetadataType;
addMetadataEnum(e: ParsedEnum): MetadataType;
get classes(): MetadataType[];
get typesWithPrimaryKeys(): MetadataType[];
get typesWithReferences(): MetadataType[];
onlyAttrs(attrs: MetadataAttribute[] | null | undefined, only: string[]): MetadataAttribute[];
attrsFor(dtoType: "Read" | "Create" | "Update" | "Delete" | "Model", attrType: "Type" | "Prop", attrs?: MetadataAttribute[]): MetadataAttribute[];
createAutoCrudApis(): MetadataTypes;
filterModelAttributes(): void;
parseTypes(): void;
parse(ast: ParseResult): MetadataTypes;
}
export type Transform = (gen: CSharpAst) => void;
export declare const Transforms: {
Default: (typeof convertReferenceTypes)[];
};
export declare function toMetadataTypes(ast: ParseResult, transforms?: Transform[]): MetadataTypes;
export declare function unwrap(type: string): string;
export declare function nullable(type: string): string;
export declare function replaceReference(gen: CSharpAst, fromType: string, toType: string): void;
export declare function replaceReferences(gen: CSharpAst, references: string[]): void;
export declare function replaceIds(gen: CSharpAst): void;
export declare function removeEmptyAttributes(gen: CSharpAst): void;
export declare function convertReferenceTypes(gen: CSharpAst): void;
export declare function convertArrayReferenceTypes(gen: CSharpAst): void;
export declare function convertArraysToLists(gen: CSharpAst): void;
export declare function addMissingReferencesToForeignKeyProps(gen: CSharpAst): void;
export declare function addAutoIncrementAttrs(gen: CSharpAst): void;
export declare function addIconsToKnownTypes(gen: CSharpAst): void;
export declare function hideReferenceProperties(gen: CSharpAst): void;
export declare function replaceUserReferencesWithAuditTables(gen: CSharpAst): void;
export declare function isDataModel(type: MetadataType): boolean;
//# sourceMappingURL=cs-ast.d.ts.map