export interface Type { readonly kind: string; } export declare namespace Type { const FUNCTION_TYPE_NAME = "\uD835\uDC53"; const Kind: { Annotation: string; AnnotationElementValue: string; SingleElementValue: string; ArrayElementValue: string; Array: string; Class: string; GenericTypeVariable: string; Intersection: string; Method: string; Parameterized: string; Primitive: string; ShallowClass: string; Union: string; Unknown: string; Variable: string; }; interface Class extends Type, FullyQualified { readonly kind: typeof Kind.Class; flags: number; classKind: Class.Kind; fullyQualifiedName: string; typeParameters: Type[]; supertype?: Type.Class; owningClass?: Type.Class; annotations: Type.Annotation[]; interfaces: Type.Class[]; members: Type.Variable[]; methods: Type.Method[]; toJSON?(): string; } namespace Class { const enum Kind { Class = "Class", Enum = "Enum", Interface = "Interface", Annotation = "Annotation", Record = "Record", Value = "Value" } } interface Annotation extends Type, FullyQualified { readonly kind: typeof Kind.Annotation; type: Type.FullyQualified; values: Annotation.ElementValue[]; } namespace Annotation { type ElementValue = SingleElementValue | ArrayElementValue; interface SingleElementValue { readonly kind: typeof Kind.SingleElementValue; element: Type; constantValue?: any; referenceValue?: Type; } interface ArrayElementValue { readonly kind: typeof Kind.ArrayElementValue; element: Type; constantValues?: any[]; referenceValues?: Type[]; } } interface Method extends Type { readonly kind: typeof Kind.Method; flags: number; declaringType: Type.FullyQualified; name: string; returnType: Type; parameterNames: string[]; parameterTypes: Type[]; thrownExceptions: Type[]; annotations: Type.Annotation[]; defaultValue?: string[]; declaredFormalTypeNames: string[]; } interface Variable extends Type { readonly kind: typeof Kind.Variable; name: string; owner?: Type; type: Type; annotations: Type.Annotation[]; toJSON?(): string; } interface Parameterized extends Type, FullyQualified { readonly kind: typeof Kind.Parameterized; type: Type.FullyQualified; typeParameters: Type[]; } interface GenericTypeVariable extends Type { readonly kind: typeof Kind.GenericTypeVariable; name: string; variance: GenericTypeVariable.Variance; bounds: Type[]; } namespace GenericTypeVariable { const enum Variance { Covariant = "Covariant", Contravariant = "Contravariant", Invariant = "Invariant" } } interface Array extends Type, FullyQualified { readonly kind: typeof Kind.Array; elemType: Type; annotations: Type.Annotation[]; } class Primitive implements Type { readonly keyword: string; readonly kind: string; private constructor(); static readonly Boolean: Primitive; static readonly Byte: Primitive; static readonly Char: Primitive; static readonly Double: Primitive; static readonly Float: Primitive; static readonly Int: Primitive; static readonly BigInt: Primitive; static readonly Short: Primitive; static readonly String: Primitive; static readonly Void: Primitive; static readonly Null: Primitive; static readonly None: Primitive; private static _all; static values(): Primitive[]; static fromKeyword(keyword: string): Primitive | undefined; } interface Union extends Type { readonly kind: typeof Kind.Union; bounds: Type[]; } interface Intersection extends Type { readonly kind: typeof Kind.Intersection; bounds: Type[]; } interface ShallowClass extends Type.Class { readonly kind: typeof Kind.ShallowClass; } const unknownType: Type; /** * Type guard that checks if an unknown value is a JavaType. * All JavaType kinds start with 'org.openrewrite.java.tree.JavaType$'. */ function isType(value: unknown): value is Type; function isPrimitive(type?: Type): type is Type.Primitive; function isClass(type?: Type): type is Type.Class; function isFunctionType(type?: Type): type is Type.Class; function isMethod(type?: Type): type is Type.Method; function isArray(type?: Type): type is Type.Array; function isParameterized(type?: Type): type is Type.Parameterized; function isGenericTypeVariable(type?: Type): type is Type.GenericTypeVariable; function isUnion(type?: Type): type is Type.Union; function isIntersection(type?: Type): type is Type.Intersection; function isFullyQualified(type?: Type): type is Type.FullyQualified; interface FullyQualified extends Type { } namespace FullyQualified { function getFullyQualifiedName(javaType: FullyQualified): string; } function signature(type: Type | undefined | null): string; } //# sourceMappingURL=type.d.ts.map