import * as _reapi_core from '@reapi/core';
import { SchemaOrRef, RefObject, ObjectSchemaProperty, Path, Component, Project, Service, $Referable, ResponseObject, Operation } from '@reapi/core';
import { TreeNodeProps } from '@reapi/react';
import * as react from 'react';
import { ReactNode } from 'react';

interface ObjectViewerProps {
    lang?: 'json' | 'yaml';
    value: string | object;
}

interface SchemaOrRefViewProps extends Partial<TreeNodeProps> {
    schemaOrRef: SchemaOrRef;
    _fixedName?: ReactNode;
    _ref?: RefObject;
}
declare function SchemaOrRefView(props: SchemaOrRefViewProps): JSX.Element;

interface SchemaViewNodeProps<T> extends Partial<TreeNodeProps> {
    schemaOrRef: T;
    recursive?: boolean;
    name?: string;
    noName?: boolean;
    required?: boolean;
    prop?: ObjectSchemaProperty;
    resolveRef?: boolean;
    _ref?: RefObject;
}

declare function importOA3(data: any): {
    service: {
        description?: string | undefined;
        overview?: string | undefined;
        noOfComponents?: number | null | undefined;
        groupId?: string | undefined;
        noOfPaths?: number | null | undefined;
        noOfOps?: number | null | undefined;
        explorerOverview?: string | undefined;
        projectId: string;
        name: string;
        id: string;
        workspaceId: string;
        settings: {
            termsOfService?: string | null | undefined;
            contact?: {
                name?: string | null | undefined;
                url?: string | null | undefined;
                email?: string | null | undefined;
            } | null | undefined;
            license?: {
                name?: string | null | undefined;
                url?: string | null | undefined;
            } | null | undefined;
            security?: {
                values: string[];
                schemeId: string;
            }[] | null | undefined;
            securityOptional?: boolean | null | undefined;
            servers?: {
                description?: string | null | undefined;
                envId?: string | null | undefined;
                variables?: Record<string, {
                    description?: string | undefined;
                    enum?: string[] | undefined;
                    default: string;
                }> | null | undefined;
                url: string;
            }[] | null | undefined;
            specSourceUrl?: string | null | undefined;
            externalDocs?: {
                description?: string | null | undefined;
                url?: string | null | undefined;
            } | null | undefined;
            pathsConfig?: {
                globalParams: (_reapi_core.RefObject | {
                    required?: boolean | null | undefined;
                    description?: string | null | undefined;
                    deprecated?: boolean | null | undefined;
                    examples?: Record<string, _reapi_core.RefObject | {
                        description?: string | null | undefined;
                        value?: string | null | undefined;
                        summary?: string | null | undefined;
                        externalValue?: string | null | undefined;
                    }> | null | undefined;
                    schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
                    allowEmptyValue?: boolean | null | undefined;
                    style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
                    explode?: boolean | null | undefined;
                    allowReserved?: boolean | null | undefined;
                    example?: any;
                    name: string;
                    in: "path" | "query" | "header" | "cookie";
                })[];
                globalResponses: {
                    responseObject?: _reapi_core.RefObject | {
                        description?: string | null | undefined;
                        content?: {
                            type: string;
                            mediaTypeObject: _reapi_core.MediaTypeObject;
                        }[] | null | undefined;
                        defaultStatus?: string | number | null | undefined;
                        headers?: {
                            name: string;
                            headerObject: _reapi_core.RefObject | {
                                required?: boolean | null | undefined;
                                description?: string | null | undefined;
                                deprecated?: boolean | null | undefined;
                                examples?: Record<string, _reapi_core.RefObject | {
                                    description?: string | null | undefined;
                                    value?: string | null | undefined;
                                    summary?: string | null | undefined;
                                    externalValue?: string | null | undefined;
                                }> | null | undefined;
                                schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
                                allowEmptyValue?: boolean | null | undefined;
                                style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
                                explode?: boolean | null | undefined;
                                allowReserved?: boolean | null | undefined;
                                example?: any;
                                name: string;
                            };
                        }[] | null | undefined;
                        links?: {
                            name: string;
                            linkObject: {
                                description: string;
                                operationRef: string;
                                operationId: string;
                                server: {
                                    description?: string | null | undefined;
                                    envId?: string | null | undefined;
                                    variables?: Record<string, {
                                        description?: string | undefined;
                                        enum?: string[] | undefined;
                                        default: string;
                                    }> | null | undefined;
                                    url: string;
                                };
                            };
                        }[] | null | undefined;
                    } | null | undefined;
                    statusCode: string | number;
                }[];
            } | null | undefined;
            version: string;
            publicAccess: {
                password?: string | null | undefined;
                enabled: boolean;
            };
        };
    };
    paths: {
        description?: string | null | undefined;
        params?: (_reapi_core.RefObject | {
            required?: boolean | null | undefined;
            description?: string | null | undefined;
            deprecated?: boolean | null | undefined;
            examples?: Record<string, _reapi_core.RefObject | {
                description?: string | null | undefined;
                value?: string | null | undefined;
                summary?: string | null | undefined;
                externalValue?: string | null | undefined;
            }> | null | undefined;
            schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
            allowEmptyValue?: boolean | null | undefined;
            style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
            explode?: boolean | null | undefined;
            allowReserved?: boolean | null | undefined;
            example?: any;
            name: string;
            in: "path" | "query" | "header" | "cookie";
        })[] | null | undefined;
        path?: string | null | undefined;
        name?: string | null | undefined;
        parentId?: string | null | undefined;
        dir?: boolean | null | undefined;
        projectId: string;
        serviceId: string;
        id: string;
        operations: {
            description?: string | null | undefined;
            deprecated?: boolean | null | undefined;
            name?: string | null | undefined;
            operationId?: string | null | undefined;
            parameters?: (_reapi_core.RefObject | {
                required?: boolean | null | undefined;
                description?: string | null | undefined;
                deprecated?: boolean | null | undefined;
                examples?: Record<string, _reapi_core.RefObject | {
                    description?: string | null | undefined;
                    value?: string | null | undefined;
                    summary?: string | null | undefined;
                    externalValue?: string | null | undefined;
                }> | null | undefined;
                schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
                allowEmptyValue?: boolean | null | undefined;
                style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
                explode?: boolean | null | undefined;
                allowReserved?: boolean | null | undefined;
                example?: any;
                name: string;
                in: "path" | "query" | "header" | "cookie";
            })[] | null | undefined;
            responses?: {
                responseObject?: _reapi_core.RefObject | {
                    description?: string | null | undefined;
                    content?: {
                        type: string;
                        mediaTypeObject: _reapi_core.MediaTypeObject;
                    }[] | null | undefined;
                    defaultStatus?: string | number | null | undefined;
                    headers?: {
                        name: string;
                        headerObject: _reapi_core.RefObject | {
                            required?: boolean | null | undefined;
                            description?: string | null | undefined;
                            deprecated?: boolean | null | undefined;
                            examples?: Record<string, _reapi_core.RefObject | {
                                description?: string | null | undefined;
                                value?: string | null | undefined;
                                summary?: string | null | undefined;
                                externalValue?: string | null | undefined;
                            }> | null | undefined;
                            schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
                            allowEmptyValue?: boolean | null | undefined;
                            style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
                            explode?: boolean | null | undefined;
                            allowReserved?: boolean | null | undefined;
                            example?: any;
                            name: string;
                        };
                    }[] | null | undefined;
                    links?: {
                        name: string;
                        linkObject: {
                            description: string;
                            operationRef: string;
                            operationId: string;
                            server: {
                                description?: string | null | undefined;
                                envId?: string | null | undefined;
                                variables?: Record<string, {
                                    description?: string | undefined;
                                    enum?: string[] | undefined;
                                    default: string;
                                }> | null | undefined;
                                url: string;
                            };
                        };
                    }[] | null | undefined;
                } | null | undefined;
                statusCode: string | number;
            }[] | null | undefined;
            internal?: boolean | null | undefined;
            requestBody?: _reapi_core.RefObject | {
                description?: string | undefined;
                required: boolean;
                content: {
                    type: string;
                    mediaTypeObject: _reapi_core.MediaTypeObject;
                }[];
            } | null | undefined;
            security?: {
                values: string[];
                schemeId: string;
            }[] | null | undefined;
            securityOptional?: boolean | null | undefined;
            id: string;
            method: "GET" | "POST" | "DELETE" | "PUT" | "PATCH" | "HEAD" | "OPTIONS" | "TRACE";
        }[];
    }[];
    components: ({
        serviceId?: string | null | undefined;
        folderId?: string | undefined;
        meta?: Record<string, any> | null | undefined;
        type: "SCHEMA";
        projectId: string;
        name: string;
        id: string;
        definition: _reapi_core.RefObject | _reapi_core.SchemaObject;
    } | {
        serviceId?: string | null | undefined;
        folderId?: string | undefined;
        meta?: Record<string, any> | null | undefined;
        type: "RESPONSE";
        projectId: string;
        name: string;
        id: string;
        definition: {
            description?: string | null | undefined;
            content?: {
                type: string;
                mediaTypeObject: _reapi_core.MediaTypeObject;
            }[] | null | undefined;
            defaultStatus?: string | number | null | undefined;
            headers?: {
                name: string;
                headerObject: _reapi_core.RefObject | {
                    required?: boolean | null | undefined;
                    description?: string | null | undefined;
                    deprecated?: boolean | null | undefined;
                    examples?: Record<string, _reapi_core.RefObject | {
                        description?: string | null | undefined;
                        value?: string | null | undefined;
                        summary?: string | null | undefined;
                        externalValue?: string | null | undefined;
                    }> | null | undefined;
                    schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
                    allowEmptyValue?: boolean | null | undefined;
                    style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
                    explode?: boolean | null | undefined;
                    allowReserved?: boolean | null | undefined;
                    example?: any;
                    name: string;
                };
            }[] | null | undefined;
            links?: {
                name: string;
                linkObject: {
                    description: string;
                    operationRef: string;
                    operationId: string;
                    server: {
                        description?: string | null | undefined;
                        envId?: string | null | undefined;
                        variables?: Record<string, {
                            description?: string | undefined;
                            enum?: string[] | undefined;
                            default: string;
                        }> | null | undefined;
                        url: string;
                    };
                };
            }[] | null | undefined;
        };
    } | {
        serviceId?: string | null | undefined;
        folderId?: string | undefined;
        meta?: Record<string, any> | null | undefined;
        type: "PARAMETER";
        projectId: string;
        name: string;
        id: string;
        definition: {
            required?: boolean | null | undefined;
            description?: string | null | undefined;
            deprecated?: boolean | null | undefined;
            examples?: Record<string, _reapi_core.RefObject | {
                description?: string | null | undefined;
                value?: string | null | undefined;
                summary?: string | null | undefined;
                externalValue?: string | null | undefined;
            }> | null | undefined;
            schema?: _reapi_core.RefObject | _reapi_core.SchemaObject | null | undefined;
            allowEmptyValue?: boolean | null | undefined;
            style?: "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject" | null | undefined;
            explode?: boolean | null | undefined;
            allowReserved?: boolean | null | undefined;
            example?: any;
            name: string;
            in: "path" | "query" | "header" | "cookie";
        };
    } | {
        serviceId?: string | null | undefined;
        folderId?: string | undefined;
        meta?: Record<string, any> | null | undefined;
        type: "EXAMPLE";
        projectId: string;
        name: string;
        id: string;
        definition: {
            description?: string | null | undefined;
            value?: string | null | undefined;
            summary?: string | null | undefined;
            externalValue?: string | null | undefined;
        };
    } | {
        serviceId?: string | null | undefined;
        folderId?: string | undefined;
        meta?: Record<string, any> | null | undefined;
        type: "SECURITY_SCHEME";
        projectId: string;
        name: string;
        id: string;
        definition: _reapi_core.SecuritySchemeObject;
    })[];
};

interface OpenApiViewProps {
    specUrl: string;
}
declare function OpenApiView(props: OpenApiViewProps): JSX.Element | null;

interface ProjectViewProps {
    version: string;
    paths: Path[];
    components: Component[];
    project: Project;
    services: Service[];
}
declare function ProjectView(props: ProjectViewProps): JSX.Element;

interface ResponseViewProps {
    response: $Referable<ResponseObject>;
}
declare function ResponseView(props: ResponseViewProps): JSX.Element;

interface ApiViewProps {
    disableTry?: boolean;
    disableSplit?: boolean;
    path: Path;
    operation: Operation;
}
declare function ApiView(props: ApiViewProps): JSX.Element | null;

interface IServiceViewContext {
    pathId?: string | null;
    operationId?: string | null;
    schemaId?: string | null;
    service: Service;
    paths: Path[];
    components: Component[];
    toService(): void;
    toSchema(schemaId: string): void;
    toOp(pathId: string, opId: string): void;
}
declare const ServiceViewContext: react.Context<IServiceViewContext>;

interface ServiceViewProps {
    service: Service;
    paths: Path[];
    components: Component[];
    ctx?: IServiceViewContext;
}
declare function ServiceView(props: ServiceViewProps): JSX.Element | null;

interface Theme {
    sidebar?: {
        sectionTitleColor?: string;
        sectionTitleBgColor?: string;
        sectionTitleActiveBgColor?: string;
        linkColor?: string;
    };
    color: {
        primary?: string;
        positive?: string;
        negative?: string;
    };
}

export { ApiView, IServiceViewContext, ObjectViewerProps, OpenApiView, ProjectView, ResponseView, SchemaOrRefView, SchemaViewNodeProps, ServiceView, ServiceViewContext, Theme, importOA3 };
