import ts from "typescript"; import { IPureObject, MapValueType } from "./common"; export declare type ImportStatementsUpdater = (statements: ts.ImportDeclaration[]) => void; export interface IBasicCompilationFinalContext { imports: ts.ImportDeclaration[]; extendParent: ts.HeritageClause | null; implementParents: ts.HeritageClause[]; fields: ts.PropertyDeclaration[]; properties: ts.PropertyDeclaration[]; methods: ts.MethodDeclaration[]; classes: ts.ClassDeclaration[]; functions: ts.FunctionDeclaration[]; parameters: ts.ParameterDeclaration[]; statements: ts.Statement[]; } declare type EntityType = "directive" | "component" | "childref" | "entity"; export interface IScopeStructure { scope: string | symbol; type: TYPE; container: ENTITY; } export declare type IBasicCompilationContext = Map>>; export declare type IBasicComponentAppendType = "push" | "unshift" | "reset"; export declare function createEntityId(): string; export interface IEwsEntity { readonly entityId: string; setEntityId(id: string): this; } export interface IEwsEntityGetters { getImports(): IScopeStructure; getMethods(): IScopeStructure; getProperties(): IScopeStructure; getFields(): IScopeStructure; getImplementParents(): IScopeStructure; getExtendParent(): IScopeStructure; } export interface IEwsEntitySetters { addImports(args: ts.ImportDeclaration[], type?: IBasicComponentAppendType): void; addMethods(args: ts.MethodDeclaration[], type?: IBasicComponentAppendType): void; addProperties(args: ts.PropertyDeclaration[], type?: IBasicComponentAppendType): void; addFields(args: ts.PropertyDeclaration[], type?: IBasicComponentAppendType): void; addImplementParents(args: ts.HeritageClause[], type?: IBasicComponentAppendType): void; setExtendParent(arg: ts.HeritageClause | null): void; } export interface IEwsEntityState { setState(key: K, value: T[K]): void; getState(key: K, defaultValue?: T[K] | null): T[K]; } export interface IEwsEntityPrivates { readonly __scope: string; readonly __etype: E; readonly __context: IBasicCompilationContext; __addChildElements(target: keyof IBasicCompilationContext, args: A[], type: IBasicComponentAppendType): void; __getChildElements(target: K): MapValueType; } export interface IEwsEntityProtectedHooks { onInit(): Promise; } export interface IInnerEwsEntity extends IEwsEntity, IEwsEntityState, IEwsEntitySetters, IEwsEntityGetters, IEwsEntityProtectedHooks, IEwsEntityPrivates { } export declare class BasicCompilationEntity { private __scope; private __etype; private __state; private __context; get entityId(): string; setEntityId(id: string): this; protected onInit(): Promise; protected setState(key: K, value: T[K]): void; protected getState(key: K, defaultValue?: T[K] | null): T[K]; protected addImports(args: ts.ImportDeclaration[], type?: IBasicComponentAppendType): void; protected getImports(): ts.ImportDeclaration[]; protected addMethods(args: ts.MethodDeclaration[], type?: IBasicComponentAppendType): void; protected getMethods(): ts.MethodDeclaration[]; protected addProperties(args: ts.PropertyDeclaration[], type?: IBasicComponentAppendType): void; protected getProperties(): ts.PropertyDeclaration[]; protected addFields(args: ts.PropertyDeclaration[], type?: IBasicComponentAppendType): void; protected getFields(): ts.PropertyDeclaration[]; protected addImplementParents(args: ts.HeritageClause[], type?: IBasicComponentAppendType): void; protected getImplementParents(): ts.HeritageClause[]; protected setExtendParent(arg: ts.HeritageClause | null): void; protected getExtendParent(): ts.HeritageClause | null; protected addStatements(arg: ts.Statement[], type?: IBasicComponentAppendType): void; protected getStatements(): ts.Statement[]; protected addParameters(arg: ts.ParameterDeclaration[], type?: IBasicComponentAppendType): void; protected getParameters(): ts.ParameterDeclaration[]; private __addChildElements; private __getChildElements; } export declare function resolveSyntaxInsert(type: "string", expression: string): ts.StringLiteral; export declare function resolveSyntaxInsert(type: "number", expression: number): ts.NumericLiteral; export declare function resolveSyntaxInsert(type: "boolean", expression: boolean): ts.BooleanLiteral; export declare function resolveSyntaxInsert(type: string, expression: any, otherHandler?: (type: string, exp: any) => ts.Expression | null): ts.BooleanLiteral; export {};