1 | import legacy from 'loopback-datasource-juggler';
|
2 | import { DataObject, Options } from '../common-types';
|
3 | import { Model } from '../model';
|
4 | import { KeyValueFilter, KeyValueRepository } from './kv.repository';
|
5 | import { juggler } from './legacy-juggler-bridge';
|
6 |
|
7 |
|
8 |
|
9 | export declare class DefaultKeyValueRepository<T extends Model> implements KeyValueRepository<T> {
|
10 | private entityClass;
|
11 | |
12 |
|
13 |
|
14 | kvModelClass: typeof juggler.KeyValueModel;
|
15 | |
16 |
|
17 |
|
18 |
|
19 | constructor(entityClass: typeof Model & {
|
20 | prototype: T;
|
21 | }, ds: juggler.DataSource);
|
22 | delete(key: string, options?: Options): Promise<void>;
|
23 | deleteAll(options?: Options): Promise<void>;
|
24 | protected toEntity(modelData: legacy.ModelData): T;
|
25 | get(key: string, options?: Options): Promise<T>;
|
26 | set(key: string, value: DataObject<T>, options?: Options): Promise<void>;
|
27 | expire(key: string, ttl: number, options?: Options): Promise<void>;
|
28 | ttl(key: string, options?: Options): Promise<number>;
|
29 | keys(filter?: KeyValueFilter, options?: Options): AsyncIterable<string>;
|
30 | }
|