import { JSONSchema4, JSONSchema6, JSONSchema7 } from 'json-schema';
import { OpenAPIV3_1, OpenAPIV3 } from 'openapi-types';

type JSONSchema = JSONSchema4 | JSONSchema6 | JSONSchema7;
/**
 * @param check Data to determine if it contains a ReferenceObject (`$ref` pointer`).
 * @returns If the supplied data has a `$ref` pointer.
 */
declare function isRef(check: unknown): check is OpenAPIV3_1.ReferenceObject | OpenAPIV3.ReferenceObject;
/**
 * @param check API definition to determine if it's a 3.1 definition.
 * @returns If the definition is a 3.1 definition.
 */
declare function isOAS31(check: OpenAPIV3_1.Document | OpenAPIV3.Document): check is OpenAPIV3_1.Document;
/**
 * Data shape for taking OpenAPI operation data and converting it into HAR.
 *
 * @see {@link https://github.com/readmeio/oas/tree/main/packages/oas-to-har}
 */
interface DataForHAR {
    body?: any;
    cookie?: Record<string, any>;
    formData?: Record<string, any>;
    header?: Record<string, any>;
    path?: Record<string, any>;
    query?: Record<string, any>;
    server?: {
        selected: number;
        variables?: ServerVariable;
    };
}
type AuthForHAR = Record<string, number | string | {
    pass?: string;
    user?: string;
}>;
interface User {
    [key: string]: unknown;
    keys?: {
        [key: string]: unknown;
        name: number | string;
        pass?: number | string;
        user?: number | string;
    }[];
}
/**
 * The type of security scheme. Used by `operation.getSecurityWithTypes()` and `operation.prepareSecurity()`.
 */
type SecurityType = 'apiKey' | 'Basic' | 'Bearer' | 'Cookie' | 'Header' | 'http' | 'OAuth2' | 'Query';
type HttpMethods = OpenAPIV3_1.HttpMethods | OpenAPIV3.HttpMethods | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
 */
type OASDocument = (OpenAPIV3_1.Document | OpenAPIV3.Document) & Record<string, unknown>;
type OAS31Document = OpenAPIV3_1.Document & Record<string, unknown>;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object}
 */
type ServerObject = OpenAPIV3_1.ServerObject | OpenAPIV3.ServerObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object}
 */
type ServerVariableObject = OpenAPIV3_1.ServerVariableObject | OpenAPIV3.ServerVariableObject;
type ServerVariablesObject = Record<string, ServerVariableObject>;
type ServerVariable = Record<string, {
    default?: number | string;
}[] | Record<string, never> | number | string | {
    default?: number | string;
}>;
interface Servers {
    selected: number;
    variables: ServerVariable;
}
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object}
 */
type ComponentsObject = OpenAPIV3_1.ComponentsObject | OpenAPIV3.ComponentsObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#paths-object}
 */
type PathsObject = OpenAPIV3_1.PathsObject | OpenAPIV3.PathsObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object}
 */
type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV3.PathItemObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object}
 */
type OperationObject = (OpenAPIV3_1.OperationObject | OpenAPIV3.OperationObject) & Record<string, unknown>;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object}
 */
type ParameterObject = {
    in: 'cookie' | 'header' | 'path' | 'query';
} & (OpenAPIV3_1.ParameterObject | OpenAPIV3.ParameterObject);
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object}
 */
type RequestBodyObject = OpenAPIV3_1.RequestBodyObject | OpenAPIV3.RequestBodyObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
 */
type MediaTypeObject = OpenAPIV3_1.MediaTypeObject | OpenAPIV3.MediaTypeObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#response-object}
 */
type ResponseObject = OpenAPIV3_1.ResponseObject | OpenAPIV3.ResponseObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
 */
type CallbackObject = OpenAPIV3_1.CallbackObject | OpenAPIV3.CallbackObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#example-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#example-object}
 */
type ExampleObject = OpenAPIV3_1.ExampleObject | OpenAPIV3.ExampleObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tag-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tag-object}
 */
type TagObject = OpenAPIV3_1.TagObject | OpenAPIV3.TagObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#header-object}
 */
type HeaderObject = OpenAPIV3_1.HeaderObject | OpenAPIV3.HeaderObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object}
 */
type SchemaObject = {
    externalDocs?: unknown;
    xml?: unknown;
} & {
    $schema?: string;
    components?: OpenAPIV3_1.ComponentsObject;
    deprecated?: boolean;
    example?: unknown;
    examples?: unknown[];
    nullable?: boolean;
    readOnly?: boolean;
    writeOnly?: boolean;
    'x-readme-ref-name'?: string;
} & (OpenAPIV3.SchemaObject | OpenAPIV3_1.SchemaObject | JSONSchema);
/**
 * @param check JSON Schema object to determine if it's a non-polymorphic schema.
 * @param isPolymorphicAllOfChild If this JSON Schema object is the child of a polymorphic `allOf`.
 * @returns If the JSON Schema object is a JSON Schema object.
 */
declare function isSchema(check: unknown, isPolymorphicAllOfChild?: boolean): check is SchemaObject;
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object}
 */
type SecuritySchemeObject = OpenAPIV3_1.SecuritySchemeObject | OpenAPIV3.SecuritySchemeObject;
type SecuritySchemesObject = Record<string, SecuritySchemeObject>;
type KeyedSecuritySchemeObject = SecuritySchemeObject & {
    /**
     * The key for the given security scheme object
     */
    _key: string;
    /**
     * An array of required scopes for the given security scheme object.
     * Used for `oauth2` security scheme types.
     */
    _requirements?: string[];
    'x-default'?: number | string;
};
/**
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
 * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-requirement-object}
 */
type SecurityRequirementObject = OpenAPIV3_1.SecurityRequirementObject | OpenAPIV3.SecurityRequirementObject;

export { type AuthForHAR, type CallbackObject, type ComponentsObject, type DataForHAR, type ExampleObject, type HeaderObject, type HttpMethods, type JSONSchema, type KeyedSecuritySchemeObject, type MediaTypeObject, type OAS31Document, type OASDocument, type OperationObject, type ParameterObject, type PathItemObject, type PathsObject, type RequestBodyObject, type ResponseObject, type SchemaObject, type SecurityRequirementObject, type SecuritySchemeObject, type SecuritySchemesObject, type SecurityType, type ServerObject, type ServerVariable, type ServerVariableObject, type ServerVariablesObject, type Servers, type TagObject, type User, isOAS31, isRef, isSchema };
