UNPKG

@mistlog/typetype

Version:

A programming language designed for typescript type generation

130 lines (129 loc) 4.34 kB
import { IIdentifier } from "./identifier"; import { ITypeExpression, ITypeExpressionList } from "../expression"; import { IFunctionTypeParam } from "../function"; export declare type IBasicType = ITypeLiteral | IStringType | IObjectType | INeverType | IAnyType | INumberType | IBigIntType | ITupleType | IArrayType | IVoidType; export declare function BasicType(): JSX.Element; export interface IObjectType { kind: "ObjectType"; value: "object"; } export declare function ObjectType(): JSX.Element; export interface IStringType { kind: "StringType"; value: "string"; } export declare function StringType(): JSX.Element; export declare type ITypeLiteral = IObjectTypeLiteral | IStringTypeLiteral | INumberTypeLiteral | ITemplateTypeLiteral | IBooleanTypeLiteral; export declare function TypeLiteral(): JSX.Element; export interface ITemplateTypeLiteral { kind: "TemplateTypeLiteral"; items: (ITemplateElement | ITemplateExpression)[]; } export declare function TemplateTypeLiteral(): JSX.Element; export interface ITemplateElement { kind: "TemplateElement"; value: string; } export declare function TemplateElement(): JSX.Element; export interface ITemplateExpression { kind: "TemplateExpression"; expression: ITypeExpression; } export declare function TemplateExpression(): JSX.Element; export declare function TemplateCharSequence(): JSX.Element; export declare function TemplateChar(): JSX.Element; export interface INumberTypeLiteral { kind: "NumberTypeLiteral"; value: number; } export declare function NumberTypeLiteral(): JSX.Element; export declare function Number(): JSX.Element; export interface IStringLiteral { kind: "StringLiteral"; value: string; } export declare function StringLiteral(): JSX.Element; export interface IStringTypeLiteral { kind: "StringTypeLiteral"; value: string; } export declare function StringTypeLiteral(): JSX.Element; export interface IBooleanTypeLiteral { kind: "BooleanTypeLiteral"; value: boolean; } export declare function BooleanTypeLiteral(): JSX.Element; export interface INumberType { kind: "NumberType"; value: "number"; } export declare function NumberType(): JSX.Element; export interface IBigIntType { kind: "BigIntType"; value: "bigint"; } export declare function BigIntType(): JSX.Element; export interface INeverType { kind: "NeverType"; value: "never"; } export declare function NeverType(): JSX.Element; export interface IAnyType { kind: "AnyType"; value: "any"; } export declare function AnyType(): JSX.Element; export interface IVoidType { kind: "VoidType"; value: "void"; } export declare function VoidType(): JSX.Element; export interface ITupleType { kind: "TupleType"; items: ITypeExpressionList; } export declare function TupleType(): JSX.Element; export interface IObjectTypeLiteral { kind: "ObjectTypeLiteral"; props: (ITypeObjectProperty | ITypeSpreadProperty)[]; } export declare function ObjectTypeLiteral(): JSX.Element; export interface ITypeSpreadProperty { kind: "TypeSpreadProperty"; param: ITypeExpression; } export declare function TypeSpreadProperty(): JSX.Element; export interface IRestType { kind: "RestType"; param: ITypeExpression; } export declare function RestType(): JSX.Element; export interface ITypeObjectProperty { kind: "TypeObjectProperty"; name: IIdentifier | ICallSignature | IConstructSignature | IStringLiteral; value: ITypeExpression; readonly: boolean; optional: boolean; } export declare function TypeObjectProperty(): JSX.Element; export interface ICallSignature { kind: "CallSignature"; params: IFunctionTypeParam[]; } export declare function CallSignature(): JSX.Element; export interface IConstructSignature { kind: "ConstructSignature"; params: IFunctionTypeParam[]; } export declare function ConstructSignature(): JSX.Element; export interface ITypeReference { kind: "TypeReference"; typeName: IIdentifier; } export declare function TypeReference(): JSX.Element; export interface IArrayType { kind: "ArrayType"; elementType: ITypeExpression; dimension: number; } export declare function ArrayType(): JSX.Element;