import { HttpContentType, HttpMethod } from "./lib"; export interface Api { endpoints: { [name: string]: Endpoint; }; types: { [name: string]: Type; }; } export interface Endpoint { method: HttpMethod; path: PathComponent[]; headers: Headers; requestContentType?: HttpContentType; requestType: Type; responseType: Type; successStatusCode?: number; genericErrorType: Type; specificErrorTypes: { [name: string]: SpecificError; }; } export declare function gatherTypes(endpoint: Endpoint): Type[]; export declare type PathComponent = StaticPathComponent | DynamicPathComponent; export interface StaticPathComponent { kind: "static"; content: string; } export interface DynamicPathComponent { kind: "dynamic"; name: string; type: Type; } export interface Headers { [name: string]: Header; } export interface Header { headerFieldName: string; type: Type; } export interface SpecificError { statusCode: number; type: Type; } export declare type Type = VoidType | NullType | BooleanType | BooleanConstantType | StringType | StringConstantType | NumberType | IntegerConstantType | ObjectType | ArrayType | OptionalType | UnionType | TypeReference; export declare const VOID: VoidType; export interface VoidType { kind: "void"; } export declare const NULL: NullType; export interface NullType { kind: "null"; } export declare const BOOLEAN: BooleanType; export interface BooleanType { kind: "boolean"; } export declare function booleanConstant(value: boolean): BooleanConstantType; export interface BooleanConstantType { kind: "boolean-constant"; value: boolean; } export declare const STRING: StringType; export interface StringType { kind: "string"; } export declare function stringConstant(value: string): StringConstantType; export interface StringConstantType { kind: "string-constant"; value: string; } export declare const NUMBER: NumberType; export interface NumberType { kind: "number"; } export declare function integerConstant(value: number): IntegerConstantType; export interface IntegerConstantType { kind: "integer-constant"; value: number; } export declare function objectType(properties: { [key: string]: Type; }): ObjectType; export interface ObjectType { kind: "object"; properties: { [key: string]: Type; }; } export declare function arrayType(elements: Type): ArrayType; export interface ArrayType { kind: "array"; elements: Type; } export declare function optionalType(type: Type): OptionalType; export interface OptionalType { kind: "optional"; optional: Type; } export declare function unionType(...types: Type[]): Type; export interface UnionType { kind: "union"; types: Type[]; } export declare function typeReference(typeName: string): TypeReference; export declare type TypeReference = { kind: "type-reference"; typeName: string; };