ui5plugin-parser
Version:
144 lines (143 loc) • 4.71 kB
TypeScript
import { ClassDeclaration, ConstructorDeclaration, MethodDeclaration, PropertyDeclaration, TypeChecker } from "ts-morph";
import { UI5TSParser } from "../../../../parser/UI5TSParser";
import { IUIAssociation, IUIProperty } from "../AbstractBaseClass";
import { AbstractCustomClass, ICustomClassField, ICustomClassMethod, IUIDefine, IViewsAndFragmentsCache } from "../AbstractCustomClass";
export interface ICustomClassTSField extends ICustomClassField<PropertyDeclaration> {
}
export interface ICustomClassTSMethod extends ICustomClassMethod<MethodDeclaration> {
}
export interface ICustomClassTSConstructor extends ICustomClassMethod<ConstructorDeclaration> {
}
export declare class CustomTSClass extends AbstractCustomClass<MethodDeclaration, PropertyDeclaration, ClassDeclaration, ClassInfo> {
parentClassNameDotNotation: string;
readonly typeChecker: TypeChecker;
protected _fillIsAbstract(): void;
protected _getUIDefine(): IUIDefine<any>[];
protected _fillParentClassName(): void;
methods: ICustomClassTSMethod[];
fields: ICustomClassTSField[];
constructors: ICustomClassTSConstructor[];
fsPath: string;
defaultModelClassName?: string;
readonly classText: string;
UIDefine: IUIDefine[];
relatedViewsAndFragments?: IViewsAndFragmentsCache[];
readonly node: ClassDeclaration;
private readonly _sourceFile;
constructor(classDeclaration: ClassDeclaration, parser: UI5TSParser, typeChecker: TypeChecker);
private _fillClassJSDoc;
private _fillDefaultModelClassName;
private _fillClassDescription;
loadTypes(): void;
_fillUIDefine(): void;
private _generateClassNameDotNotationFor;
private _guessTypeFromUIDefine;
protected _fillFields(metadata?: ClassInfo, fillTypes?: boolean): ICustomClassTSField[];
private _guessTypeFromInitialization;
protected _fillMethods(metadata?: ClassInfo, fillTypes?: boolean): ICustomClassTSMethod[];
private _modifyType;
protected _fillUI5Metadata(classInfo?: ClassInfo, fillTypes?: boolean): void;
private _fillConstructors;
protected _fillInterfaces(metadata: ClassInfo): string[];
protected _fillAggregations(metadata: ClassInfo): {
name: string;
type: string;
multiple: boolean;
singularName: string;
description: string;
visibility: string;
default: boolean;
}[];
protected _fillEvents(metadata: ClassInfo): {
name: string;
description: string;
visibility: string;
params: {
name: string;
type: string;
}[];
}[];
protected _fillProperties(metadata: ClassInfo): IUIProperty[];
protected _fillAssociations(metadata: ClassInfo): IUIAssociation[];
}
interface APIMember {
name: string;
doc?: string;
since?: string;
deprecation?: string;
experimental?: string;
visibility?: string;
}
interface APIMemberWithMethods extends APIMember {
methods: {
[key: string]: string;
};
}
interface APIMemberWithType extends APIMember {
type: string;
}
interface Property extends APIMemberWithMethods, APIMemberWithType {
defaultValue?: any;
bindable?: boolean;
}
interface Aggregation extends APIMemberWithMethods, APIMemberWithType {
cardinality: "0..1" | "0..n";
altTypes: [string];
singularName: string;
bindable: boolean;
}
interface Association extends APIMemberWithMethods, APIMemberWithType {
cardinality: "0..1" | "0..n";
singularName: string;
}
interface UI5Event extends APIMemberWithMethods {
allowPreventDefault: boolean;
enableEventBubbling: boolean;
parameters: {
[key: string]: EventParameter;
};
}
interface EventParameter {
name: string;
doc: string;
deprecation: string;
since: string;
experimental: string;
type: string;
}
type SpecialSetting = APIMemberWithType;
interface ClassInfo {
name?: string;
interfaces?: string[];
doc?: string;
deprecation?: string;
since?: string;
experimental?: string;
specialSettings?: {
[key: string]: SpecialSetting;
};
properties?: {
[key: string]: Property;
};
defaultProperty?: string;
aggregations?: {
[key: string]: Aggregation;
};
defaultAggregation?: string;
associations?: {
[key: string]: Association;
};
events?: {
[key: string]: UI5Event;
};
methods?: Record<string, unknown>;
annotations?: Record<string, unknown>;
designtime?: boolean | string;
designTime?: boolean | string;
stereotype?: null;
metadataClass?: undefined;
library?: string;
abstract?: boolean;
final?: boolean;
}
export {};