import { CallableDeclaration, CallableExpr, CallableSpec } from './callable'; import { DocsSpec, Documented } from './documented'; import { Expression, ObjectPropertyAccess } from './expressions'; import { MemberType } from './member-type'; import { Parameter, ParameterSpec } from './parameter'; import { Property as PropertyType } from './property'; import { Block, Statement } from './statements'; import { Type } from './type'; export interface TypeMemberSpec { name: string; docs?: DocsSpec; abstract?: boolean; static?: boolean; } export declare enum MemberKind { Initializer = "initializer", Method = "method", Property = "property" } export declare enum MemberVisibility { Public = "public", Protected = "protected", Private = "Private" } export declare abstract class TypeMember implements Documented { readonly scope: MemberType; readonly spec: TypeMemberSpec; /** * The simple name of the type (MyClass). */ get name(): string; /** * The kind of the type. */ abstract readonly kind: MemberKind; /** * The fully qualified name of the member (``..#member``) */ get fqn(): string; /** * Documentation for this type member */ get docs(): DocsSpec | undefined; get abstract(): boolean; get static(): boolean; abstract visibility: MemberVisibility; constructor(scope: MemberType, spec: TypeMemberSpec); /** * Simple Human readable string representation of the property. */ toString(): string; /** * Determines whether this is a property type or not. */ isProperty(): this is PropertyType; } export interface MethodSpec extends CallableSpec { visibility?: MemberVisibility; static?: boolean; } export declare class Method extends TypeMember implements CallableDeclaration, CallableExpr { readonly type: MemberType; readonly methodSpec: MethodSpec; readonly returnType: Type; readonly visibility: MemberVisibility; readonly parameters: Parameter[]; private _body?; constructor(type: MemberType, methodSpec: MethodSpec); get body(): Block | undefined; get kind(): MemberKind; get name(): string; invoke(...args: Expression[]): Expression; bind(receiver: Expression): ObjectPropertyAccess; addParameter(spec: ParameterSpec): Parameter; addBody(...stmts: Array): void; } export interface InitializerSpec extends Omit { } export declare class Initializer extends Method implements CallableDeclaration { readonly type: MemberType; readonly initializerSpec: InitializerSpec; constructor(type: MemberType, initializerSpec: InitializerSpec); get kind(): MemberKind; } export declare function isCallable(x: unknown): unknown;