import * as openapi3_ts_oas31 from 'openapi3-ts/oas31'; import { OpenAPIObject, ReferenceObject, OperationObject, SchemaObject } from 'openapi3-ts/oas31'; import { SchemaObject as SchemaObject$1 } from 'openapi3-ts/oas30'; declare class Box { definition: T; type: T["type"]; value: T["value"]; params: T["params"]; schema: T["schema"]; ctx: T["ctx"]; constructor(definition: T); toJSON(): { type: T["type"]; value: T["value"]; }; toString(): string; recompute(callback: OpenapiSchemaConvertContext["onBox"]): Box; static fromJSON(json: string): Box; static isBox(box: unknown): box is Box; static isUnion(box: Box): box is Box; static isIntersection(box: Box): box is Box; static isArray(box: Box): box is Box; static isOptional(box: Box): box is Box; static isReference(box: Box): box is Box; static isKeyword(box: Box): box is Box; static isObject(box: Box): box is Box; static isLiteral(box: Box): box is Box; } type RefInfo = { /** * The (potentially autocorrected) ref * @example "#/components/schemas/MySchema" */ ref: string; /** * The name of the ref * @example "MySchema" * */ name: string; normalized: string; kind: "schemas" | "responses" | "parameters" | "requestBodies" | "headers"; }; declare const createRefResolver: (doc: OpenAPIObject, factory: GenericFactory, nameTransform?: NameTransformOptions) => { get: (ref: string) => T; unwrap: (component: T) => Exclude; getInfosByRef: (ref: string) => RefInfo; infos: Map; /** * Get the schemas in the order they should be generated, depending on their dependencies * so that a schema is generated before the ones that depend on it */ getOrderedSchemas: () => [schema: Box, infos: RefInfo][]; directDependencies: Map>; transitiveDependencies: Map>; }; interface RefResolver extends ReturnType { } declare const mapOpenApiEndpoints: (doc: OpenAPIObject, options?: { nameTransform?: NameTransformOptions; }) => { doc: OpenAPIObject; refs: { get: (ref: string) => T; unwrap: (component: T) => Exclude; getInfosByRef: (ref: string) => RefInfo; infos: Map; getOrderedSchemas: () => [schema: Box, infos: RefInfo][]; directDependencies: Map>; transitiveDependencies: Map>; }; endpointList: Endpoint[]; factory: { union: (types: StringOrBox[]) => string; intersection: (types: StringOrBox[]) => string; array: (type: StringOrBox) => string; optional: (type: StringOrBox) => string; reference: (name: string, typeArgs: StringOrBox[] | undefined) => string; literal: (value: StringOrBox) => string; string: () => "string"; number: () => "number"; boolean: () => "boolean"; unknown: () => "unknown"; any: () => "any"; never: () => "never"; object: (props: Record) => string; }; }; type MutationMethod = "post" | "put" | "patch" | "delete"; type Method = "get" | "head" | "options" | MutationMethod; type EndpointParameters = { body?: Box; query?: Box | Record; header?: Box | Record; path?: Box | Record; }; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; type DefaultEndpoint = { parameters?: EndpointParameters | undefined; responses?: Record; responseHeaders?: Record>; }; type Endpoint = { operation: OperationObject; method: Method; path: string; parameters?: TConfig["parameters"]; requestFormat: RequestFormat; meta: { alias: string; hasParameters: boolean; areParametersRequired: boolean; }; responses?: TConfig["responses"]; responseHeaders?: TConfig["responseHeaders"]; }; type LibSchemaObject = SchemaObject & SchemaObject$1; type BoxDefinition = { type: string; params: unknown; value: string; }; type BoxParams = string | BoxDefinition; type WithSchema = { schema: LibSchemaObject | ReferenceObject | undefined; ctx: OpenapiSchemaConvertContext; }; type BoxUnion = WithSchema & { type: "union"; params: { types: Array; }; value: string; }; type BoxIntersection = WithSchema & { type: "intersection"; params: { types: Array; }; value: string; }; type BoxArray = WithSchema & { type: "array"; params: { type: BoxParams; }; value: string; }; type BoxOptional = WithSchema & { type: "optional"; params: { type: BoxParams; }; value: string; }; type BoxRef = WithSchema & { type: "ref"; params: { name: string; generics?: BoxParams[] | undefined; }; value: string; }; type BoxLiteral = WithSchema & { type: "literal"; params: {}; value: string; }; type BoxKeyword = WithSchema & { type: "keyword"; params: { name: string; }; value: string; }; type BoxObject = WithSchema & { type: "object"; params: { props: Record; }; value: string; }; type AnyBoxDef = BoxUnion | BoxIntersection | BoxArray | BoxOptional | BoxRef | BoxLiteral | BoxKeyword | BoxObject; type AnyBox = Box; type OpenapiSchemaConvertArgs = { schema: SchemaObject | ReferenceObject; ctx: OpenapiSchemaConvertContext; meta?: {} | undefined; }; type FactoryCreator = (schema: SchemaObject | ReferenceObject, ctx: OpenapiSchemaConvertContext) => GenericFactory; type NameTransformOptions = { transformSchemaName?: (name: string) => string; transformEndpointName?: (endpoint: { alias: string; operation: OperationObject; method: Method; path: string; }) => string; }; type OpenapiSchemaConvertContext = { factory: FactoryCreator | GenericFactory; refs: RefResolver; onBox?: (box: Box) => Box; nameTransform?: NameTransformOptions; }; type StringOrBox = string | Box; type BoxFactory = { union: (types: Array) => Box; intersection: (types: Array) => Box; array: (type: StringOrBox) => Box; object: (props: Record) => Box; optional: (type: StringOrBox) => Box; reference: (name: string, generics?: Array | undefined) => Box; literal: (value: StringOrBox) => Box; string: () => Box; number: () => Box; boolean: () => Box; unknown: () => Box; any: () => Box; never: () => Box; }; type GenericFactory = { callback?: OpenapiSchemaConvertContext["onBox"]; union: (types: Array) => string; intersection: (types: Array) => string; array: (type: StringOrBox) => string; object: (props: Record) => string; optional: (type: StringOrBox) => string; reference: (name: string, generics?: Array | undefined) => string; literal: (value: StringOrBox) => string; string: () => string; number: () => string; boolean: () => string; unknown: () => string; any: () => string; never: () => string; }; export { type AnyBoxDef as A, type BoxFactory as B, type Endpoint as E, type FactoryCreator as F, type GenericFactory as G, type LibSchemaObject as L, type Method as M, type NameTransformOptions as N, type OpenapiSchemaConvertContext as O, type RefInfo as R, type StringOrBox as S, type WithSchema as W, type OpenapiSchemaConvertArgs as a, Box as b, type AnyBox as c, type BoxArray as d, type BoxDefinition as e, type BoxIntersection as f, type BoxKeyword as g, type BoxLiteral as h, type BoxObject as i, type BoxOptional as j, type BoxParams as k, type BoxRef as l, mapOpenApiEndpoints as m, type BoxUnion as n, type EndpointParameters as o, type RefResolver as p, createRefResolver as q };