UNPKG

couchbase

Version:

The official Couchbase Node.js Client Library.

74 lines (73 loc) 1.65 kB
import { DurabilityLevel } from './generaltypes'; /** * CAS represents an opaque value which can be used to compare documents to * determine if a change has occurred. * * @category Key-Value */ export interface Cas { /** * Generates a string representation of this CAS. */ toString(): string; /** * Generates a JSON representation of this CAS. */ toJSON(): any; } /** * Reprents a node-style callback which receives an optional error or result. * * @category Utilities */ export interface NodeCallback<T> { (err: Error | null, result: T | null): void; } /** * @internal */ export declare class PromiseHelper { /** * @internal */ static wrapAsync<T, U extends Promise<T>>(fn: () => U, callback?: (err: Error | null, result: T | null) => void): U; /** * @internal */ static wrap<T>(fn: (callback: NodeCallback<T>) => void, callback?: NodeCallback<T> | null): Promise<T>; } /** * @internal */ export declare class CompoundTimeout { private _start; private _timeout; /** * @internal */ constructor(timeout: number | undefined); /** * @internal */ left(): number | undefined; /** * @internal */ expired(): boolean; } /** * @internal */ export declare function duraLevelToNsServerStr(level: DurabilityLevel | string | undefined): string | undefined; /** * @internal */ export declare function nsServerStrToDuraLevel(level: string): DurabilityLevel; /** * @internal */ export declare function cbQsStringify(values: { [key: string]: any; }, options?: { boolAsString?: boolean; }): string;