UNPKG

documentdb-typescript

Version:
33 lines (32 loc) 2.21 kB
import * as _DocumentDB from "./_DocumentDB"; import { Database } from "./Database"; /** Represents a DocumentDB endpoint */ export declare class Client { constructor(url?: string, masterKey?: string); /** Global concurrency limit for all server requests */ static concurrencyLimit: number; /** Set to true to log all requests to the console */ enableConsoleLog: boolean; /** Timeout (ms) used for all requests (defaults to 40s) */ timeout: number; /** The endpoint URL to connect to */ url: string; /** The authentication object used to connect to this endpoint */ authenticationOptions: _DocumentDB.AuthenticationOptions; /** The connection policy used for the connection to this endpoint, if specified; note that the retry policy here is implemented at a lower level than the maxRetries parameter that can be specified when calling some of this module's methods */ connectionPolicy: _DocumentDB.ConnectionPolicy | undefined; /** The consistency level (string: "Strong" | "BoundedStaleness" | "Session" | "Eventual") used for the connection to this endpoint, if specified */ consistencyLevel: _DocumentDB.ConsistencyLevel | undefined; /** The native DocumentClient instance; throws an error if this client is currently not connected (check using .isOpen, or await .openAsync() first) */ readonly documentClient: _DocumentDB.DocumentClient; /** Returns true if this client is currently connected through a native DocumentClient instance */ readonly isOpen: boolean; /** Connect to the endpoint represented by this client and validate the connection, unless already connected */ openAsync(maxRetries?: number): PromiseLike<any>; /** Get a (cached) list of Database instances for all databases in this account */ listDatabasesAsync(forceReload?: boolean, maxRetries?: number): Promise<Database[]>; /** Get account information */ getAccountInfoAsync(): Promise<_DocumentDB.DatabaseAccount>; /** Remove the current connection; an attempt to open the same endpoint again in another instance will open and validate the connection again, but the current instance cannot be re-opened */ close(): void; }