UNPKG

api-ref-bundler

Version:

Bundle all external $ref in Json based API document into single document

24 lines (23 loc) 1.21 kB
import { JsonPath } from "json-crawl"; import { JsonType } from "./types"; export declare class MapArray<K, V> extends Map<K, Array<V>> { add(key: K, value: V): this; } export declare const validURL: (str: any) => boolean; export declare const calcJsonType: (data: any) => JsonType; export declare const parseRef: ($ref: string, basePath?: string) => { filePath: string; pointer: string; normalized: string; }; export declare const createRef: (basePath?: string, pointer?: string) => string; export declare const relativePath: (path: string, basePath?: string) => string; export declare const filename: (str: string) => string; export declare const isJsonSchema: (value: any) => boolean; export declare const isBasicJsonSchema: (value: any) => boolean; export declare const parsePointer: (pointer: string) => string[]; export declare const buildRef: (path: JsonPath, fileName?: string) => string; export declare const buildPointer: (path: JsonPath) => string; export declare const mergeValues: (value: any, patch: any) => any; export declare const getValueByPath: (obj: any, path: JsonPath) => any; export declare const setValueByPath: (obj: any, path: JsonPath, value: any, i?: number) => void;