UNPKG

2 kBTypeScriptView Raw
1/**
2 * Represents a search term for a RangeScan.
3 *
4 * @see {@link RangeScan}
5 * @category Key-Value
6 */
7export declare class ScanTerm {
8 /**
9 * The scan term.
10 *
11 * @see {@link MutationState}
12 */
13 term: string;
14 /**
15 * Set to true for the scan term to be exclusive. Defaults to false (inclusive).
16 */
17 exclusive?: boolean;
18 /**
19 * @internal
20 */
21 constructor(term: string, exclusive?: boolean);
22}
23/**
24 *
25 * @internal
26 */
27export interface ScanType {
28 /**
29 * Returns string representation of scan type.
30 */
31 getScanType(): string;
32}
33/**
34 * A RangeScan performs a scan on a range of keys with the range specified through
35 * a start and end ScanTerm.
36 *
37 * @category Key-Value
38 */
39export declare class RangeScan implements ScanType {
40 /**
41 * RangeScan start term.
42 */
43 start?: ScanTerm;
44 /**
45 * RangeScan end term.
46 */
47 end?: ScanTerm;
48 /**
49 * @internal
50 */
51 constructor(start?: ScanTerm, end?: ScanTerm);
52 /**
53 * Returns string representation of scan type.
54 */
55 getScanType(): string;
56}
57/**
58 * A SamplingScan performs a scan on a random sampling of keys with the sampling bounded by
59 * a limit.
60 *
61 * @category Key-Value
62 */
63export declare class SamplingScan implements ScanType {
64 /**
65 * SamplingScan limit.
66 */
67 limit: number;
68 /**
69 * SamplingScan seed.
70 */
71 seed?: number;
72 /**
73 * @internal
74 */
75 constructor(limit: number, seed?: number);
76 /**
77 * Returns string representation of scan type.
78 */
79 getScanType(): string;
80}
81/**
82 * A PrefixScan scan type selects every document whose ID starts with a certain prefix.
83 *
84 * @category key-value
85 */
86export declare class PrefixScan implements ScanType {
87 /**
88 * PrefixScan prefix.
89 */
90 prefix: string;
91 /**
92 * @internal
93 */
94 constructor(prefix: string);
95 /**
96 * Returns string representation of scan type.
97 */
98 getScanType(): string;
99}