1 |
|
2 | import { DurabilityLevel } from './generaltypes';
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export interface Cas {
|
10 | |
11 |
|
12 |
|
13 | toString(): string;
|
14 | |
15 |
|
16 |
|
17 | toJSON(): any;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | export type CasInput = Cas | string | Buffer;
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | export interface NodeCallback<T> {
|
32 | (err: Error | null, result: T | null): void;
|
33 | }
|
34 |
|
35 |
|
36 |
|
37 | export declare class PromiseHelper {
|
38 | |
39 |
|
40 |
|
41 | static wrapAsync<T, U extends Promise<T>>(fn: () => U, callback?: (err: Error | null, result: T | null) => void): U;
|
42 | /**
|
43 | * @internal
|
44 | */
|
45 | static wrap<T>(fn: (callback: NodeCallback<T>) => void, callback?: NodeCallback<T> | null): Promise<T>;
|
46 | }
|
47 | /**
|
48 | * @internal
|
49 | */
|
50 | export declare class CompoundTimeout {
|
51 | private _start;
|
52 | private _timeout;
|
53 | /**
|
54 | * @internal
|
55 | */
|
56 | constructor(timeout: number | undefined);
|
57 | /**
|
58 | * @internal
|
59 | */
|
60 | left(): number | undefined;
|
61 | /**
|
62 | * @internal
|
63 | */
|
64 | expired(): boolean;
|
65 | }
|
66 | /**
|
67 | * @internal
|
68 | */
|
69 | export declare function duraLevelToNsServerStr(level: DurabilityLevel | string | undefined): string | undefined;
|
70 | /**
|
71 | * @internal
|
72 | */
|
73 | export declare function nsServerStrToDuraLevel(level: string | undefined): DurabilityLevel;
|
74 | /**
|
75 | * @internal
|
76 | */
|
77 | export declare function cbQsStringify(values: {
|
78 | [key: string]: any;
|
79 | }, options?: {
|
80 | boolAsString?: boolean;
|
81 | }): string;
|
82 | /**
|
83 | * @internal
|
84 | */
|
85 | export declare function expiryToTimestamp(expiry: number): number;
|
86 |
|
\ | No newline at end of file |