/// import 'reflect-metadata'; /** * A builder class used to create a pointer. */ export declare class PointerBuilder { private uri; private classType; /** * @param uri the URI pointing to the external data source. * @returns the builder instance. */ withUri(uri: string | URL): this; /** * @param classType the class type of the data model * that is associated with the pointer. * @returns the builder instance. */ withClassType(classType: any): this; /** * @returns a new pointer instance. */ build(): Pointer; } /** * A pointer is a class that represents a reference * to an external data model. It is used to de-serialize * data models that are stored in external data sources. * Pointers are used for large data types that are not * suitable for being exchanged over size limited mediums * such as a queue or a message bus. * The semantics of a pointer revolves around the storage * of a URI that points to the external data source, as well * as the type of the data model that is associated with * the pointer. */ export declare class Pointer { /** * The URI pointing to the external data source. */ private uri; /** * The data source which provides the concrete * implementation to fetch the data located at * the URI. */ private dataSource; /** * A class reference to the data model that * is associated with the pointer. */ private classType; /** * A reference to the resolved data. This provides * a caching mechanism to avoid fetching the data * multiple times. */ private value; /** * Creates a new pointer instance. * @param uri the URI pointing to the external * data source. * @param classType the class reference to the * data model that is associated with the pointer. */ constructor(uri: URL, classType: any); /** * Resolves the pointer by loading the data associated * with the pointer URI in memory, and de-serializes * the data into the data model that is associated * with the pointer. * @returns the data model instance. * @throws an error if the pointer could not be resolved. */ resolve(): Promise; /** * @returns the URI pointing to the external data source. */ getUri(): URL; /** * @returns whether the pointer has been resolved. */ isResolved(): boolean; /** * @returns the JSON representation of the class. */ toJSON(): string; }