@opendoc/openapi-reference-parser
Version:
Get the dependencies of reference in openapi.
40 lines (39 loc) • 1.43 kB
TypeScript
import { ReferenceStorage } from './types/reference-storage';
export declare abstract class Reference {
static from($ref: string | string[]): Reference;
abstract toString(): string;
abstract set<T>(storage: ReferenceStorage<T>, value: T): void;
abstract get<T>(storage: ReferenceStorage<T>): T | undefined;
abstract equals(ref: Reference): boolean;
}
/**
* Represents a reference to a location within the same document.
*/
export declare class LocalReference extends Reference {
private paths;
constructor(paths: string[]);
toString(): string;
set<T>(storage: ReferenceStorage<T>, value: T): void;
get<T>(storage: ReferenceStorage<T>): T | undefined;
equals(ref: Reference): boolean;
}
/**
* Represents a reference to a location within a remote document.
*/
export declare class RemoteReference extends Reference {
private address;
constructor(address: string);
toString(): string;
set<T>(storage: ReferenceStorage<T>, value: T): void;
get<T>(storage: ReferenceStorage<T>): T | undefined;
equals(ref: Reference): boolean;
}
export declare class ExternalFileReference extends Reference {
private address;
constructor(address: string);
resolve<T>(): Promise<T | undefined>;
toString(): string;
set<T>(storage: ReferenceStorage<T>, value: T): void;
get<T>(storage: ReferenceStorage<T>): T | undefined;
equals(ref: Reference): boolean;
}