unikvs 0.0.10 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/src/_merge-variables.d.ts +13 -0
- package/dist/src/_merge-variables.d.ts.map +1 -0
- package/dist/src/_merge-variables.js +12 -0
- package/dist/src/_storage.d.ts +11 -11
- package/dist/src/_storage.d.ts.map +1 -1
- package/dist/src/_storage.js +31 -22
- package/dist/src/_streams.d.ts +20 -0
- package/dist/src/_streams.d.ts.map +1 -0
- package/dist/src/_streams.js +36 -0
- package/dist/src/_transformer.d.ts +7 -7
- package/dist/src/_transformer.d.ts.map +1 -1
- package/dist/src/_transformer.js +12 -12
- package/dist/src/_valibot.d.ts +2 -2
- package/dist/src/_valibot.d.ts.map +1 -1
- package/dist/src/_valibot.js +1 -1
- package/dist/src/_value-schemas.d.ts +179 -0
- package/dist/src/_value-schemas.d.ts.map +1 -0
- package/dist/src/_value-schemas.js +150 -0
- package/dist/src/errors.d.ts +60 -94
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +15 -31
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/unikvs-config.d.ts +58 -139
- package/dist/src/unikvs-config.d.ts.map +1 -1
- package/dist/src/unikvs-config.js +42 -47
- package/dist/src/unikvs.d.ts +84 -166
- package/dist/src/unikvs.d.ts.map +1 -1
- package/dist/src/unikvs.js +230 -169
- package/dist/src/utils.types.d.ts +1 -3
- package/dist/src/utils.types.d.ts.map +1 -1
- package/dist/src/value-stream.types.d.ts +2 -8
- package/dist/src/value-stream.types.d.ts.map +1 -1
- package/dist/src/variables.types.d.ts +11 -0
- package/dist/src/variables.types.d.ts.map +1 -0
- package/package.json +17 -16
- package/src/_merge-variables.ts +19 -0
- package/src/_storage.ts +47 -24
- package/src/_streams.ts +47 -0
- package/src/_transformer.ts +13 -13
- package/src/_valibot.ts +4 -1
- package/src/_value-schemas.ts +362 -0
- package/src/errors.ts +60 -109
- package/src/index.ts +2 -3
- package/src/unikvs-config.ts +143 -168
- package/src/unikvs.ts +359 -290
- package/src/utils.types.ts +1 -3
- package/src/value-stream.types.ts +2 -8
- package/src/variables.types.ts +13 -0
- package/dist/src/_merge-context.d.ts +0 -13
- package/dist/src/_merge-context.d.ts.map +0 -1
- package/dist/src/_merge-context.js +0 -12
- package/dist/src/context.types.d.ts +0 -17
- package/dist/src/context.types.d.ts.map +0 -1
- package/src/_merge-context.ts +0 -19
- package/src/context.types.ts +0 -19
- /package/dist/src/{context.types.js → variables.types.js} +0 -0
package/dist/src/unikvs.d.ts
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Variables, IStorage } from "@unikvs/core";
|
|
2
2
|
import UniKvsStorage from "./_storage.js";
|
|
3
3
|
import UniKvsTransformer from "./_transformer.js";
|
|
4
4
|
import * as v from "./_valibot.js";
|
|
5
|
-
import type
|
|
6
|
-
import { type Value, type PlainValue, type StreamValue, type KeyValueMapping, type $InferPlainValueData, type IUniKvsConfigBuilder, type KeyofKeyValueMapping, type $InferStreamValueChunkData } from "./unikvs-config.js";
|
|
5
|
+
import { type Value, type PlainValue, type StreamValue, type UniKvsSchema, type KeyValueMapping, type UniKvsConfigOptions, type $InferPlainValueData, type IUniKvsConfigBuilder, type IValueSchemaResolver, type KeyofKeyValueMapping, type $InferKeyValueMapping, type $InferPlainValueInput, type $InferStreamValueChunkData } from "./unikvs-config.js";
|
|
7
6
|
import type { ValueOf } from "./utils.types.js";
|
|
8
7
|
import type { ValueStream } from "./value-stream.types.js";
|
|
8
|
+
import type { VariablesSource } from "./variables.types.js";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @template TValue 値の型定義です。
|
|
10
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
13
11
|
*/
|
|
14
|
-
export type SetValue<TValue extends Value> = $
|
|
12
|
+
export type SetValue<TValue extends Value> = $InferPlainValueInput<TValue> | (TValue extends StreamValue<any, infer TChunkInput> ? ReadableStream<TChunkInput> : never);
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @template TKeyValueMapping キーと値のマッピング定義です。
|
|
14
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
19
15
|
*/
|
|
20
16
|
export type KeyofKeyValueMappingHasPlainValue<TKeyValueMapping extends KeyValueMapping> = ValueOf<{
|
|
21
17
|
[TKey in KeyofKeyValueMapping<TKeyValueMapping>]: PlainValue extends TKeyValueMapping[TKey] ? TKey : never;
|
|
22
18
|
}>;
|
|
23
19
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @template TKeyValueMapping キーと値のマッピング定義です。
|
|
20
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-types)
|
|
27
21
|
*/
|
|
28
22
|
export type KeyofKeyValueMappingHasStreamValue<TKeyValueMapping extends KeyValueMapping> = ValueOf<{
|
|
29
23
|
[TKey in KeyofKeyValueMapping<TKeyValueMapping>]: StreamValue extends TKeyValueMapping[TKey] ? TKey : never;
|
|
@@ -40,9 +34,9 @@ declare const OpenOptionsSchema: import("@tai-kun/valibot-extra-lab").ObjectSche
|
|
|
40
34
|
timeout(milliseconds: number): AbortSignal;
|
|
41
35
|
}, undefined>, undefined>;
|
|
42
36
|
/**
|
|
43
|
-
*
|
|
37
|
+
* 実行時の変数です。
|
|
44
38
|
*/
|
|
45
|
-
readonly
|
|
39
|
+
readonly vars: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("@tai-kun/valibot-extra-lab").ArraySchema<import("@tai-kun/valibot-extra-lab").TupleSchema<[import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema], undefined>, undefined>, import("@tai-kun/valibot-extra-lab").RecordSchema<import("valibot").AnySchema, import("valibot").UnknownSchema, undefined>], undefined>, undefined>;
|
|
46
40
|
}, undefined>;
|
|
47
41
|
declare const CloseOptionsSchema: import("@tai-kun/valibot-extra-lab").ObjectSchema<{
|
|
48
42
|
/**
|
|
@@ -56,9 +50,9 @@ declare const CloseOptionsSchema: import("@tai-kun/valibot-extra-lab").ObjectSch
|
|
|
56
50
|
timeout(milliseconds: number): AbortSignal;
|
|
57
51
|
}, undefined>, undefined>;
|
|
58
52
|
/**
|
|
59
|
-
*
|
|
53
|
+
* 実行時の変数です。
|
|
60
54
|
*/
|
|
61
|
-
readonly
|
|
55
|
+
readonly vars: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("@tai-kun/valibot-extra-lab").ArraySchema<import("@tai-kun/valibot-extra-lab").TupleSchema<[import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema], undefined>, undefined>, import("@tai-kun/valibot-extra-lab").RecordSchema<import("valibot").AnySchema, import("valibot").UnknownSchema, undefined>], undefined>, undefined>;
|
|
62
56
|
}, undefined>;
|
|
63
57
|
declare const ClearOptionsSchema: import("@tai-kun/valibot-extra-lab").ObjectSchema<{
|
|
64
58
|
/**
|
|
@@ -72,281 +66,205 @@ declare const ClearOptionsSchema: import("@tai-kun/valibot-extra-lab").ObjectSch
|
|
|
72
66
|
timeout(milliseconds: number): AbortSignal;
|
|
73
67
|
}, undefined>, undefined>;
|
|
74
68
|
/**
|
|
75
|
-
*
|
|
69
|
+
* 実行時の変数です。
|
|
76
70
|
*/
|
|
77
|
-
readonly
|
|
71
|
+
readonly vars: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("@tai-kun/valibot-extra-lab").ArraySchema<import("@tai-kun/valibot-extra-lab").TupleSchema<[import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema], undefined>, undefined>, import("@tai-kun/valibot-extra-lab").RecordSchema<import("valibot").AnySchema, import("valibot").UnknownSchema, undefined>], undefined>, undefined>;
|
|
78
72
|
}, undefined>;
|
|
79
73
|
/**
|
|
80
|
-
*
|
|
74
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
81
75
|
*/
|
|
82
76
|
export type OpenOptions = v.InferInput<typeof OpenOptionsSchema>;
|
|
83
77
|
/**
|
|
84
|
-
*
|
|
78
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
85
79
|
*/
|
|
86
80
|
export type CloseOptions = v.InferInput<typeof CloseOptionsSchema>;
|
|
87
81
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* @template TKeyValueMapping キーと値のマッピング定義です。
|
|
91
|
-
* @template TKey 対象となるキーの型です。
|
|
82
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
92
83
|
*/
|
|
93
84
|
export type SetOptions<TKeyValueMapping extends KeyValueMapping = KeyValueMapping, TKey extends KeyofKeyValueMapping<TKeyValueMapping> = KeyofKeyValueMapping<TKeyValueMapping>> = {
|
|
94
85
|
/**
|
|
95
|
-
*
|
|
86
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
96
87
|
*/
|
|
97
88
|
readonly key: TKey;
|
|
98
89
|
/**
|
|
99
|
-
*
|
|
90
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
100
91
|
*/
|
|
101
92
|
readonly value: SetValue<TKeyValueMapping[TKey]>;
|
|
102
93
|
/**
|
|
103
|
-
*
|
|
94
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
104
95
|
*/
|
|
105
96
|
readonly signal?: AbortSignal | undefined;
|
|
106
97
|
/**
|
|
107
|
-
*
|
|
98
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
108
99
|
*/
|
|
109
|
-
readonly
|
|
100
|
+
readonly vars?: VariablesSource | undefined;
|
|
110
101
|
};
|
|
111
102
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @template TKey 対象となるキーの型です。
|
|
103
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
115
104
|
*/
|
|
116
105
|
export type GetOptions<TKey = IStorage.Key> = {
|
|
117
106
|
/**
|
|
118
|
-
*
|
|
107
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
119
108
|
*/
|
|
120
109
|
readonly key: TKey;
|
|
121
110
|
/**
|
|
122
|
-
*
|
|
111
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
123
112
|
*/
|
|
124
113
|
readonly signal?: AbortSignal | undefined;
|
|
125
114
|
/**
|
|
126
|
-
*
|
|
115
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
127
116
|
*/
|
|
128
|
-
readonly
|
|
117
|
+
readonly vars?: VariablesSource | undefined;
|
|
129
118
|
};
|
|
130
119
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
* @template TKey 対象となるキーの型です。
|
|
120
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-stream)
|
|
134
121
|
*/
|
|
135
122
|
export type StreamOptions<TKey = IStorage.Key> = {
|
|
136
123
|
/**
|
|
137
|
-
*
|
|
124
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-stream)
|
|
138
125
|
*/
|
|
139
126
|
readonly key: TKey;
|
|
140
127
|
/**
|
|
141
|
-
*
|
|
128
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
142
129
|
*/
|
|
143
130
|
readonly signal?: AbortSignal | undefined;
|
|
144
131
|
/**
|
|
145
|
-
*
|
|
132
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
146
133
|
*/
|
|
147
|
-
readonly
|
|
134
|
+
readonly vars?: VariablesSource | undefined;
|
|
148
135
|
};
|
|
149
136
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* @template TKey 対象となるキーの型です。
|
|
137
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
153
138
|
*/
|
|
154
139
|
export type HasOptions<TKey = IStorage.Key> = {
|
|
155
140
|
/**
|
|
156
|
-
*
|
|
141
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
157
142
|
*/
|
|
158
143
|
readonly key: TKey;
|
|
159
144
|
/**
|
|
160
|
-
*
|
|
145
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
161
146
|
*/
|
|
162
147
|
readonly signal?: AbortSignal | undefined;
|
|
163
148
|
/**
|
|
164
|
-
*
|
|
149
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
165
150
|
*/
|
|
166
|
-
readonly
|
|
151
|
+
readonly vars?: VariablesSource | undefined;
|
|
167
152
|
};
|
|
168
153
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* @template TKey 対象となるキーの型です。
|
|
154
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
172
155
|
*/
|
|
173
156
|
export type DeleteOptions<TKey = IStorage.Key> = {
|
|
174
157
|
/**
|
|
175
|
-
*
|
|
158
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
176
159
|
*/
|
|
177
160
|
readonly key: TKey;
|
|
178
161
|
/**
|
|
179
|
-
*
|
|
162
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
180
163
|
*/
|
|
181
164
|
readonly signal?: AbortSignal | undefined;
|
|
182
165
|
/**
|
|
183
|
-
*
|
|
166
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#variables-and-cancellation)
|
|
184
167
|
*/
|
|
185
|
-
readonly
|
|
168
|
+
readonly vars?: VariablesSource | undefined;
|
|
186
169
|
};
|
|
187
170
|
/**
|
|
188
|
-
*
|
|
171
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
189
172
|
*/
|
|
190
173
|
export type ClearOptions = v.InferInput<typeof ClearOptionsSchema>;
|
|
191
174
|
/**
|
|
192
|
-
*
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
175
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
176
|
+
*/
|
|
177
|
+
export type UniKvsDestination = {
|
|
178
|
+
/**
|
|
179
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
180
|
+
*/
|
|
181
|
+
readonly storage: UniKvsStorage;
|
|
182
|
+
/**
|
|
183
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
184
|
+
*/
|
|
185
|
+
readonly transformers: readonly UniKvsTransformer[];
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
197
189
|
*/
|
|
198
190
|
export default class UniKvs<TKeyValueMapping extends KeyValueMapping = KeyValueMapping> {
|
|
199
191
|
#private;
|
|
200
192
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* @template TKeyValueMapping マッピング定義です。
|
|
204
|
-
* @returns 設定ビルダーのインスタンスです。
|
|
205
|
-
* @example
|
|
206
|
-
* ```typescript
|
|
207
|
-
* import { Compression } from "@unikvs/compression";
|
|
208
|
-
* import { FileSystem } from "@unikvs/fs.node";
|
|
209
|
-
* import { UniKvs, type Value } from "unikvs";
|
|
210
|
-
*
|
|
211
|
-
* const kvs = UniKvs.config<{
|
|
212
|
-
* foo: Value<Uint8Array<ArrayBuffer>>;
|
|
213
|
-
* }>()
|
|
214
|
-
* .appendTransformer(new Compression("gzip"))
|
|
215
|
-
* .appendStorage(new FileSystem(".tmp"))
|
|
216
|
-
* .create();
|
|
217
|
-
*
|
|
218
|
-
* await kvs.open();
|
|
219
|
-
*
|
|
220
|
-
* await kvs.set("foo", Uint8Array.from([0, 1, 2]));
|
|
221
|
-
*
|
|
222
|
-
* await kvs.close();
|
|
223
|
-
* ```
|
|
193
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
224
194
|
*/
|
|
225
195
|
static config<TKeyValueMapping extends KeyValueMapping>(): IUniKvsConfigBuilder<TKeyValueMapping>;
|
|
226
196
|
/**
|
|
227
|
-
*
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
197
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
198
|
+
*/
|
|
199
|
+
static config<const TSchema extends UniKvsSchema>(options: {
|
|
200
|
+
readonly schema: TSchema;
|
|
201
|
+
}): IUniKvsConfigBuilder<$InferKeyValueMapping<TSchema>>;
|
|
202
|
+
/**
|
|
203
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#config-builder)
|
|
204
|
+
*/
|
|
205
|
+
static config(options?: UniKvsConfigOptions): IUniKvsConfigBuilder;
|
|
206
|
+
/**
|
|
207
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
233
208
|
*/
|
|
234
|
-
constructor(
|
|
209
|
+
constructor(vars: Readonly<Variables>, destinations: readonly [UniKvsDestination, ...UniKvsDestination[]], transformers: readonly UniKvsTransformer[], valueSchemaResolver?: IValueSchemaResolver | null);
|
|
235
210
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* @returns 利用可能である場合は true、そうでない場合は false を返します。
|
|
211
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
239
212
|
*/
|
|
240
213
|
get isOpen(): boolean;
|
|
241
214
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* @param options オープン時のオプションです。
|
|
245
|
-
* @returns 完了を通知する Promise です。
|
|
215
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
246
216
|
*/
|
|
247
217
|
open(options?: OpenOptions): Promise<void>;
|
|
248
218
|
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* @param options クローズ時のオプションです。
|
|
252
|
-
* @returns 完了を通知する Promise です。
|
|
219
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
253
220
|
*/
|
|
254
221
|
close(options?: CloseOptions): Promise<void>;
|
|
255
222
|
/**
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* `await using` 構文による自動クローズに使用されます。
|
|
259
|
-
*
|
|
260
|
-
* @returns 完了を通知する Promise です。
|
|
223
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
261
224
|
*/
|
|
262
225
|
[Symbol.asyncDispose](): Promise<void>;
|
|
263
226
|
/**
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @template TKey 対象キーの型定義です。
|
|
267
|
-
* @param options セット操作のオプション一式です。
|
|
268
|
-
* @returns 完了を通知する Promise です。
|
|
227
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
269
228
|
*/
|
|
270
229
|
set<const TKey extends KeyofKeyValueMapping<TKeyValueMapping>>(options: SetOptions<TKeyValueMapping, TKey>): Promise<void>;
|
|
271
230
|
/**
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* @template TKey 対象キーの型定義です。
|
|
275
|
-
* @param key 操作対象を識別するためのキーです。
|
|
276
|
-
* @param value 保存する値です。
|
|
277
|
-
* @param options 追加のオプションです。
|
|
278
|
-
* @returns 完了を通知する Promise です。
|
|
231
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
279
232
|
*/
|
|
280
233
|
set<const TKey extends KeyofKeyValueMapping<TKeyValueMapping>>(key: TKey, value: SetValue<TKeyValueMapping[TKey]>, options?: Omit<SetOptions, "key" | "value">): Promise<void>;
|
|
281
234
|
/**
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
* @template TKey 対象キーの型定義です。
|
|
285
|
-
* @param options 取得操作のオプション一式です。
|
|
286
|
-
* @returns 取得した値を返します。
|
|
235
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
287
236
|
*/
|
|
288
237
|
get<const TKey extends KeyofKeyValueMappingHasPlainValue<TKeyValueMapping>>(options: GetOptions<TKey>): Promise<$InferPlainValueData<TKeyValueMapping[TKey]>>;
|
|
289
238
|
/**
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
* @template TKey 対象キーの型定義です。
|
|
293
|
-
* @param key 操作対象を識別するためのキーです。
|
|
294
|
-
* @param options 追加のオプションです。
|
|
295
|
-
* @returns 取得した値を返します。
|
|
239
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
296
240
|
*/
|
|
297
241
|
get<const TKey extends KeyofKeyValueMappingHasPlainValue<TKeyValueMapping>>(key: TKey, options?: Omit<GetOptions, "key">): Promise<$InferPlainValueData<TKeyValueMapping[TKey]>>;
|
|
298
242
|
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* @template TKey 対象キーの型定義です。
|
|
302
|
-
* @param options ストリーム取得操作のオプション一式です。
|
|
303
|
-
* @returns 取得したストリームを返します。
|
|
243
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-stream)
|
|
304
244
|
*/
|
|
305
245
|
stream<const TKey extends KeyofKeyValueMappingHasStreamValue<TKeyValueMapping>>(options: StreamOptions<TKey>): Promise<ValueStream<$InferStreamValueChunkData<TKeyValueMapping[TKey]>>>;
|
|
306
246
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* @template TKey 対象キーの型定義です。
|
|
310
|
-
* @param key 操作対象を識別するためのキーです。
|
|
311
|
-
* @param options 追加のオプションです。
|
|
312
|
-
* @returns 取得したストリームを返します。
|
|
247
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#value-stream)
|
|
313
248
|
*/
|
|
314
249
|
stream<const TKey extends KeyofKeyValueMappingHasStreamValue<TKeyValueMapping>>(key: TKey, options?: Omit<StreamOptions, "key">): Promise<ValueStream<$InferStreamValueChunkData<TKeyValueMapping[TKey]>>>;
|
|
315
250
|
/**
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
* @param options 存在確認操作のオプションです。
|
|
319
|
-
* @returns 存在する場合は true、そうでない場合は false を返します。
|
|
251
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
320
252
|
*/
|
|
321
253
|
has(options: HasOptions<KeyofKeyValueMapping<TKeyValueMapping>>): Promise<boolean>;
|
|
322
254
|
/**
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* @param key 操作対象を識別するためのキーです。
|
|
326
|
-
* @param options 追加のオプションです。
|
|
327
|
-
* @returns 存在する場合は true、そうでない場合は false を返します。
|
|
255
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
328
256
|
*/
|
|
329
257
|
has(key: KeyofKeyValueMapping<TKeyValueMapping>, options?: Omit<HasOptions, "key">): Promise<boolean>;
|
|
330
258
|
/**
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* @param options 削除操作のオプションです。
|
|
334
|
-
* @returns 完了を通知する Promise です。
|
|
259
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
335
260
|
*/
|
|
336
261
|
delete(options: DeleteOptions<KeyofKeyValueMapping<TKeyValueMapping>>): Promise<void>;
|
|
337
262
|
/**
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
* @param key 操作対象を識別するためのキーです。
|
|
341
|
-
* @param options 追加のオプションです。
|
|
342
|
-
* @returns 完了を通知する Promise です。
|
|
263
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
343
264
|
*/
|
|
344
265
|
delete(key: KeyofKeyValueMapping<TKeyValueMapping>, options?: Omit<DeleteOptions, "key">): Promise<void>;
|
|
345
266
|
/**
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* @param options クリア操作のオプションです。
|
|
349
|
-
* @returns 完了を通知する Promise です。
|
|
267
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/unikvs#client-operations)
|
|
350
268
|
*/
|
|
351
269
|
clear(options?: ClearOptions): Promise<void>;
|
|
352
270
|
}
|
package/dist/src/unikvs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unikvs.d.ts","sourceRoot":"","sources":["../../src/unikvs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"unikvs.d.ts","sourceRoot":"","sources":["../../src/unikvs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAmB,MAAM,cAAc,CAAC;AAMzE,OAAO,aAAa,MAAM,eAAe,CAAC;AAG1C,OAAO,iBAAiB,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,CAAC,MAAM,eAAe,CAAC;AAQnC,OAAqB,EACnB,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM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