import { OpenrpcDocument as OpenRPC } from "./types"; import referenceResolver from "@json-schema-tools/reference-resolver"; export type ReferenceResolver = typeof referenceResolver; /** * Provides an error interface for OpenRPC Document dereferencing problems * * @category Errors * */ export declare class OpenRPCDocumentDereferencingError implements Error { name: string; message: string; /** * @param e The error that originated from jsonSchemaRefParser */ constructor(e: string); } /** * replaces $ref's within a document and its schemas. The replaced value will be a javascript object reference to the * real schema / open-rpc component * * @param schema The OpenRPC document * * @returns The same OpenRPC Document that was passed in, but with all $ref's dereferenced. * * @throws [[OpenRPCDocumentDereferencingError]] * * @example * ```typescript * * import { OpenRPC } from "@open-rpc/meta-schema" * import { dereferenceDocument } from "@open-rpc/schema-utils-js"; * * try { * const dereffedDocument = await dereferenceDocument({ ... }) as OpenRPC; * } catch (e) { * // handle validation errors * } * ``` * */ export default function dereferenceDocument(openrpcDocument: OpenRPC, resolver?: ReferenceResolver): Promise;