@tinyshed/tinystore 0.1.0-rc.5 → 0.1.0-rc.7

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.
Files changed (122) hide show
  1. package/README.md +37 -37
  2. package/bin/tinystore.js +12 -1
  3. package/dist/backup.d.ts +33 -0
  4. package/dist/backup.js +49 -0
  5. package/dist/blobs.d.ts +160 -79
  6. package/dist/blobs.js +510 -217
  7. package/dist/channels.d.ts +90 -0
  8. package/dist/channels.js +291 -0
  9. package/dist/clock.js +3 -3
  10. package/dist/config.d.ts +209 -86
  11. package/dist/config.js +581 -538
  12. package/dist/connection.d.ts +64 -2
  13. package/dist/connection.js +201 -16
  14. package/dist/console.d.ts +27 -3
  15. package/dist/console.js +165 -12
  16. package/dist/dotenv.d.ts +7 -0
  17. package/dist/dotenv.js +79 -0
  18. package/dist/errors.d.ts +61 -1
  19. package/dist/errors.js +81 -1
  20. package/dist/handles.d.ts +44 -2
  21. package/dist/handles.js +81 -2
  22. package/dist/index.d.ts +17 -11
  23. package/dist/index.js +5 -3
  24. package/dist/instruments.d.ts +177 -0
  25. package/dist/instruments.js +819 -0
  26. package/dist/jobs.d.ts +335 -239
  27. package/dist/jobs.js +716 -536
  28. package/dist/json.d.ts +2 -0
  29. package/dist/json.js +122 -0
  30. package/dist/kv.d.ts +130 -243
  31. package/dist/kv.js +273 -640
  32. package/dist/limits.d.ts +80 -0
  33. package/dist/limits.js +139 -0
  34. package/dist/locks.d.ts +62 -0
  35. package/dist/locks.js +237 -0
  36. package/dist/logger.d.ts +45 -9
  37. package/dist/logger.js +150 -38
  38. package/dist/metrics.d.ts +210 -209
  39. package/dist/metrics.js +319 -556
  40. package/dist/once.d.ts +19 -18
  41. package/dist/once.js +74 -63
  42. package/dist/query.d.ts +181 -0
  43. package/dist/query.js +788 -0
  44. package/dist/records.d.ts +241 -150
  45. package/dist/records.js +507 -291
  46. package/dist/runtime/addon.d.ts +14 -0
  47. package/dist/runtime/addon.js +69 -0
  48. package/dist/runtime/bun.js +5 -7
  49. package/dist/runtime/node.js +5 -7
  50. package/dist/runtime/pipe.d.ts +17 -0
  51. package/dist/runtime/pipe.js +133 -0
  52. package/dist/runtime/shared.d.ts +6 -0
  53. package/dist/runtime/shared.js +19 -0
  54. package/dist/runtime.d.ts +5 -2
  55. package/dist/search.d.ts +189 -0
  56. package/dist/search.js +281 -0
  57. package/dist/session.d.ts +31 -3
  58. package/dist/session.js +153 -41
  59. package/dist/sql.d.ts +228 -78
  60. package/dist/sql.js +745 -240
  61. package/dist/store.d.ts +244 -24
  62. package/dist/store.js +270 -67
  63. package/dist/time.d.ts +5 -1
  64. package/dist/time.js +22 -2
  65. package/dist/tx.d.ts +61 -0
  66. package/dist/tx.js +314 -0
  67. package/dist/wire/codec.d.ts +23 -7
  68. package/dist/wire/codec.js +56 -35
  69. package/dist/wire/frame.d.ts +2 -0
  70. package/dist/wire/frame.js +31 -14
  71. package/dist/wire/messages.d.ts +259 -0
  72. package/dist/wire/messages.js +22 -0
  73. package/dist/wire/msgpack.d.ts +49 -1
  74. package/dist/wire/msgpack.js +293 -56
  75. package/dist/wire/protocol.d.ts +2683 -0
  76. package/dist/wire/protocol.js +10846 -0
  77. package/package.json +39 -38
  78. package/src/backup.ts +81 -0
  79. package/src/blobs.ts +678 -301
  80. package/src/channels.ts +377 -0
  81. package/src/clock.ts +4 -4
  82. package/src/config.ts +902 -612
  83. package/src/connection.ts +279 -21
  84. package/src/console.ts +180 -12
  85. package/src/dotenv.ts +82 -0
  86. package/src/errors.ts +105 -0
  87. package/src/handles.ts +157 -8
  88. package/src/index.ts +158 -52
  89. package/src/instruments.ts +1042 -0
  90. package/src/jobs.ts +1017 -733
  91. package/src/json.ts +133 -0
  92. package/src/kv.ts +424 -847
  93. package/src/limits.ts +202 -0
  94. package/src/locks.ts +320 -0
  95. package/src/logger.ts +209 -40
  96. package/src/metrics.ts +557 -752
  97. package/src/once.ts +86 -83
  98. package/src/query.ts +1005 -0
  99. package/src/records.ts +795 -418
  100. package/src/runtime/addon.ts +99 -0
  101. package/src/runtime/bun.ts +5 -7
  102. package/src/runtime/node.ts +5 -7
  103. package/src/runtime/pipe.ts +178 -0
  104. package/src/runtime/shared.ts +20 -0
  105. package/src/runtime.ts +5 -2
  106. package/src/search.ts +480 -0
  107. package/src/session.ts +187 -41
  108. package/src/sql.ts +993 -306
  109. package/src/store.ts +473 -78
  110. package/src/time.ts +48 -3
  111. package/src/tx.ts +426 -0
  112. package/src/wire/codec.ts +78 -37
  113. package/src/wire/frame.ts +44 -14
  114. package/src/wire/messages.ts +25 -0
  115. package/src/wire/msgpack.ts +327 -56
  116. package/src/wire/protocol.ts +11709 -0
  117. package/dist/limiter.d.ts +0 -45
  118. package/dist/limiter.js +0 -68
  119. package/dist/quota.d.ts +0 -44
  120. package/dist/quota.js +0 -98
  121. package/src/limiter.ts +0 -99
  122. package/src/quota.ts +0 -137
package/dist/records.d.ts CHANGED
@@ -1,182 +1,273 @@
1
1
  import { type Link } from './connection.ts';
2
- import type { Page } from './handles.ts';
3
- import { type Logger, type LoggerOptions } from './logger.ts';
4
- import { type Duration } from './time.ts';
5
- /** slog's levels: -4 debug, 0 info, 4 warn, 8 error, or any other it may name. */
2
+ import { type ConsoleLine } from './console.ts';
3
+ import { type LogConfig, type Logger, type LoggerOptions } from './logger.ts';
4
+ import type { Stream } from './session.ts';
5
+ import { type Duration, type DurationText } from './time.ts';
6
+ import { methods } from './wire/protocol.ts';
7
+ /** A level a logger logs at: one of its four names, or slog's number between them. */
6
8
  export type Level = 'debug' | 'info' | 'warn' | 'error' | number;
7
- /**
8
- * Fields: keys and values, each value written as JSON. An object's keys keep
9
- * their order; an array of pairs may repeat a key.
10
- */
9
+ /** An event's level: what loggers and the programs whose lines are kept write. */
10
+ export type EventLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
11
+ /** What happened, or what it happened in: an object, or its pairs in their order. */
11
12
  export type Fields = Record<string, unknown> | readonly (readonly [string, unknown])[];
12
- /** A record to append: when, where, what, and its fields. */
13
- export interface RecordInput {
14
- /** its time: a Date, or unix nanoseconds as a bigint; now when absent */
15
- at?: Date | bigint;
16
- /** the namespace the application names: 'web', 'billing' */
13
+ /** An event as a read gives it. */
14
+ export interface Event {
15
+ /** its time, which the file keeps to the nanosecond */
16
+ at: Date;
17
17
  stream: string;
18
- /** the event: 'log' for a log line */
18
+ /** what happened; `log` for a logger's line */
19
19
  name: string;
20
- level?: Level;
21
- /** absent is none, which an empty body is not */
22
- body?: string | Uint8Array;
23
- /** sixteen bytes, or their 32 hex digits */
24
- traceId?: Uint8Array | string | undefined;
25
- /** eight bytes, or their 16 hex digits */
26
- spanId?: Uint8Array | string | undefined;
27
- /** who produced it */
28
- context?: Fields;
29
- /** what happened */
30
- attrs?: Fields;
20
+ level?: EventLevel;
21
+ message?: string;
22
+ /** each value as JSON.parse reads it, an integer past 2^53 a bigint */
23
+ fields: Record<string, unknown>;
24
+ context: Record<string, unknown>;
25
+ /** 32 hex digits */
26
+ traceId?: string;
27
+ /** 16 hex digits */
28
+ spanId?: string;
31
29
  }
32
- /** A record as it was kept: a field's value is the JSON it was written as, spelled as it was given. */
33
- export interface LogRecord {
34
- /** unix nanoseconds */
35
- at: bigint;
36
- stream: string;
30
+ /** An event to append: its name, what happened, and what it carries beside. */
31
+ export interface NewEvent {
37
32
  name: string;
38
- level: number | undefined;
39
- body: string | Uint8Array | undefined;
40
- traceId: Uint8Array | undefined;
41
- spanId: Uint8Array | undefined;
42
- context: [key: string, json: string | Uint8Array][];
43
- attrs: [key: string, json: string | Uint8Array][];
33
+ fields?: Fields;
34
+ /** its time: now unless given, from what the stream keeps to ten minutes ahead */
35
+ at?: Date;
36
+ context?: Fields;
37
+ level?: EventLevel | number;
38
+ message?: string;
39
+ /** a trace's 32 hex digits, with its span's 16: the current trace's unless given */
40
+ traceId?: string;
41
+ spanId?: string;
44
42
  }
45
- /**
46
- * A record's fields, its attrs or its context, as an object, each value read
47
- * as JSON.parse reads the JSON it was kept as; the last of a repeated key is
48
- * kept. The pairs keep what JSON.parse may not: 1.2300 as written, an integer
49
- * past 2^53 whole.
50
- *
51
- * ```ts
52
- * for await (const record of store.records.all({ since: '1h', streams: ['readers'] })) {
53
- * const { page, from } = fields(record.attrs)
54
- * }
55
- * ```
56
- */
57
- export declare function fields(pairs: LogRecord['attrs']): Record<string, unknown>;
58
- /**
59
- * The records in a range that meet every condition given.
60
- *
61
- * ```ts
62
- * { since: '1h', minLevel: 'warn' } // the last hour's warnings
63
- * { since: '1h', search: 'connection reset' } // whose text holds it, case ignored
64
- * { from: start, to: end, streams: ['api'] }
65
- * ```
66
- */
67
- export interface RecordsQuery {
68
- /** the span before now the range covers: '1h', '15m', or milliseconds; or from and to */
43
+ export type AppendOptions = Omit<NewEvent, 'name' | 'fields'>;
44
+ export interface EventsOptions {
45
+ /** how long the stream keeps its events: its own, kept in the file; 14 days until one says */
46
+ keep?: Duration;
47
+ }
48
+ /** What a read finds: every condition given holds; one given as undefined is InvalidError. */
49
+ export interface Query {
50
+ /** the span before now, '1h'; or from and to */
69
51
  since?: Duration;
70
- /** the range's start, included; open when absent */
71
- from?: Date | bigint;
72
- /** the range's end, excluded; open when absent */
73
- to?: Date | bigint;
74
- /** none or empty is every stream */
75
- streams?: string[];
76
- names?: string[];
77
- /** a record without a level does not match */
78
- minLevel?: Level;
79
- traceId?: Uint8Array | string;
80
- /** each a record must hold, by key and exact JSON spelling */
81
- attrs?: Fields;
82
- context?: Fields;
83
- /**
84
- * text a record's body or name holds, its case ignored: every record the
85
- * rest of the query leaves is read for it, so a search over much text ends
86
- * pages early at the budget, and next goes on
87
- */
52
+ /** the range's start, included */
53
+ from?: Date;
54
+ /** the range's end, excluded */
55
+ to?: Date;
56
+ /** any of these streams, for every stream's read */
57
+ streams?: readonly string[];
58
+ /** any of these names: ['log'] is the lines */
59
+ names?: readonly string[];
60
+ /** this level and worse; an event without a level is not found */
61
+ minLevel?: EventLevel;
62
+ traceId?: string;
63
+ /** each key with this value, by the JSON it was written as, in fields or in context */
64
+ where?: Record<string, unknown>;
65
+ /** this text in the message, the name or a value, its case ignored */
88
66
  search?: string;
89
- /** newest first; oldest first when absent */
67
+ /** newest first; oldest first without it */
90
68
  newest?: boolean;
91
- /** the records a page holds: 1000, and 10000 at most */
69
+ /** the events of a page: 1000, and 10,000 at most */
92
70
  limit?: number;
93
- /** what one read may open, fetch and decode; each narrows the server's */
94
- budget?: {
95
- blocks?: number;
96
- bytes?: number;
97
- records?: number;
98
- };
99
- /** a page's next, which this page continues from; the rest of the query as it was */
100
- after?: string | undefined;
101
- }
102
- /** Where a follower stands in the sealed segments: kept by the caller between follows. */
103
- export interface Cursor {
104
- segment: number;
105
- row: number;
106
- }
107
- /** A row that no longer reads, which a drop removes. */
71
+ /** a page's next, with the rest of the query as it was */
72
+ after?: string;
73
+ }
74
+ /** A query of every event it finds, for what counts them. */
75
+ export type Counted = Omit<Query, 'newest' | 'limit' | 'after'>;
76
+ export interface Page {
77
+ events: Event[];
78
+ /** the page after it; the last page has none */
79
+ next?: string;
80
+ }
81
+ export interface Top {
82
+ value: unknown;
83
+ count: number;
84
+ }
85
+ /** A field's numbers in a row: a sum of integers exact, a bigint past 2^53. */
86
+ export interface Stats {
87
+ samples: number;
88
+ sum: number | bigint;
89
+ min: number | bigint;
90
+ max: number | bigint;
91
+ avg: number;
92
+ }
93
+ export interface Row {
94
+ /** where the row's span begins, counted from 1970 in UTC */
95
+ at: Date;
96
+ count: number;
97
+ by: Record<string, unknown>;
98
+ stats: Record<string, Stats>;
99
+ distinct: Record<string, number>;
100
+ }
101
+ export interface Aggregate extends Counted {
102
+ /** the span of a row: the range is one without it */
103
+ every?: Duration;
104
+ /** keys whose every value has rows of its own */
105
+ by?: readonly string[];
106
+ /** fields whose numbers a row sums */
107
+ stats?: readonly string[];
108
+ /** fields whose different values a row counts */
109
+ distinct?: readonly string[];
110
+ }
111
+ export interface StreamInfo {
112
+ name: string;
113
+ keep: DurationText;
114
+ /** its oldest event, or where its keep begins while it holds older */
115
+ retainedFrom: Date;
116
+ newest: Date;
117
+ }
118
+ export interface PollBatch {
119
+ events: Event[];
120
+ /** where the next poll begins, kept once these events are safe */
121
+ cursor: string;
122
+ /** the events keep removed before the cursor reached them */
123
+ expired: number;
124
+ }
125
+ /** What a tail finds: a query's conditions, and no range, order or limit. */
126
+ export type TailQuery = Pick<Query, 'streams' | 'names' | 'minLevel' | 'traceId' | 'where' | 'search'>;
127
+ /** A tail's batch: the events written since the last, and how many it missed. */
128
+ export interface TailBatch {
129
+ events: Event[];
130
+ /** the events that left the store's hold before the tail read them */
131
+ missed: number;
132
+ }
133
+ /** A head row or a segment that no longer reads, as `damaged` lists it and `drop` takes it. */
108
134
  export interface Damage {
135
+ /** a head row holds events not packed yet, a segment packed ones */
136
+ part: 'head row' | 'segment';
137
+ id: number;
109
138
  stream: string;
110
- /** a sealed segment, dropped whole; or a head row */
111
- segment: number | undefined;
112
- headRow: number | undefined;
113
- /** the times it held, unix nanoseconds */
114
- from: bigint;
115
- to: bigint;
116
- /** the invariant its bytes broke */
117
- reason: string;
118
- }
119
- export declare class Records {
120
- #private;
121
- constructor(link: Link);
139
+ /** its events' oldest and newest times */
140
+ first: Date;
141
+ last: Date;
142
+ /** what broke */
143
+ error: string;
144
+ }
145
+ type Method = keyof typeof methods;
146
+ /** What every read takes: a stream's handle, or every stream without one. */
147
+ declare abstract class Reads {
148
+ protected abstract ask(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Uint8Array>;
149
+ protected abstract opened(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Stream>;
150
+ /** One page, from one moment of the file: `{ events, next }`. */
151
+ list(query?: Query): Promise<Page>;
152
+ /** Every event the query finds, a page after another. */
153
+ all(query?: Query): AsyncGenerator<Event>;
154
+ /** How many events the query finds. */
155
+ count(query?: Counted): Promise<number>;
122
156
  /**
123
- * A logger of a stream: its calls return at once, and its lines reach the
124
- * server every second, as Go's slog handler's and Python's logging.Handler's do.
157
+ * A key's most frequent values and how many events hold each: ten unless
158
+ * `limit` asks for more, at most 1000. The key is a field's or a
159
+ * context's, or `stream`, `name` or `level`.
125
160
  */
126
- logger(stream: string, options?: LoggerOptions): Logger;
127
- /** Hands over what every logger holds, as the store does when it closes. */
128
- stop(): Promise<void>;
161
+ top(key: string, query?: Counted & {
162
+ limit?: number;
163
+ }): Promise<Top[]>;
164
+ /** A row for each span of `every` and each value of the keys of `by`, with its count. */
165
+ aggregate(query?: Aggregate): Promise<Row[]>;
166
+ /** The keys the events hold, in fields and in context, sorted; `prefix` narrows them. */
167
+ fieldNames(query?: Omit<Query, 'newest' | 'after'> & {
168
+ prefix?: string;
169
+ }): Promise<string[]>;
129
170
  /**
130
- * Appends records in one transaction, all or none; a refused one names
131
- * itself as `call`, with its stream and name. A read sees them at once. A
132
- * record of no trace of its own takes the one withTrace runs the call in.
171
+ * The events written from now on that the query finds, a batch as they
172
+ * are written: `{ events, missed }`. A reader slower than the writers
173
+ * skips what left the store's hold, and the batch after says how many.
174
+ * It ends when its loop is left, and when the server's store closes.
133
175
  */
134
- append(records: RecordInput | readonly RecordInput[]): Promise<void>;
176
+ tail(query?: TailQuery): AsyncGenerator<TailBatch>;
177
+ }
178
+ /** Opens a stream of events: lazily, at its first call on a connection. */
179
+ export declare function openEvents(link: Link, stream: string, options?: EventsOptions): Events;
180
+ /** A stream of events: written with `append`, which waits for the file, and read back. */
181
+ export declare class Events extends Reads {
182
+ #private;
183
+ readonly stream: string;
184
+ /** Events come from `store.events(stream)`. */
185
+ constructor(link: Link, stream: string, open: Uint8Array);
135
186
  /**
136
- * One page of the records a query matches, from one snapshot, in event-time
137
- * order; next, while a limit or a budget ended the page early, is passed back
138
- * as `after` with the same query. A page never splits a timestamp.
187
+ * Writes an event, or a list of them whole or not at all: it returns once
188
+ * they are written, and a read finds them at once. A refused event names
189
+ * its place in the list and its name.
139
190
  */
140
- scan(query?: RecordsQuery): Promise<Page<LogRecord, string>>;
141
- /** Every record a query matches, a page at a time. */
142
- all(query?: Omit<RecordsQuery, 'after'>): AsyncGenerator<LogRecord>;
191
+ append(name: string, fields?: Fields, options?: AppendOptions): Promise<void>;
192
+ append(events: readonly NewEvent[]): Promise<void>;
193
+ /** A logger's lines, each an event of this stream. */
194
+ appendLines(lines: readonly ConsoleLine[]): Promise<void>;
195
+ /**
196
+ * A writer of another program's output into this stream: each line it is
197
+ * given becomes an event at the time it arrived, a stack trace's or a JSON
198
+ * value's lines one, and a write never waits.
199
+ *
200
+ * const out = store.events('worker').lines()
201
+ * child.stdout.on('data', chunk => out.write(chunk))
202
+ * child.on('close', () => out.end())
203
+ */
204
+ lines(): Lines;
205
+ protected ask(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Uint8Array>;
206
+ protected opened(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Stream>;
207
+ }
208
+ /** Every stream's events, to read: `store.events()`. */
209
+ export declare class AllEvents extends Reads {
210
+ #private;
211
+ /** AllEvents come from `store.events()`. */
212
+ constructor(link: Link);
213
+ /** Every stream with events, by name, with what it keeps, where that begins and its newest event's time. */
214
+ streams(): Promise<StreamInfo[]>;
143
215
  /**
144
- * The sealed records after a cursor, in the order they were sealed; the
145
- * cursor to follow from next, and the segments retention removed before
146
- * the cursor reached them. A record reaches a follower once it is sealed.
216
+ * Every event once, a batch a call, from a cursor the program keeps, the
217
+ * oldest event kept without one: `{ events, cursor, expired }`. With no
218
+ * event past the cursor, the batch is empty and its cursor the one given.
147
219
  */
148
- follow(cursor?: Cursor, limit?: number): Promise<{
149
- records: LogRecord[];
150
- cursor: Cursor;
151
- expired: number;
152
- }>;
220
+ poll(cursor?: string, options?: {
221
+ limit?: number;
222
+ }): Promise<PollBatch>;
223
+ protected ask(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Uint8Array>;
153
224
  /**
154
- * A writer of another program's output, pino's lines or a child's stdout,
155
- * that never waits: each line becomes a record of the stream as the server's
156
- * Lines makes it, a stack trace's lines joined and a JSON or logfmt line's
157
- * fields kept. What does not fit its buffer is dropped and counted.
225
+ * What reads met that no longer reads, which `drop` removes: each head
226
+ * row and segment with its stream and its events' times. What the store
227
+ * has not met since it opened is not listed.
158
228
  */
159
- lines(stream: string, options?: {
160
- buffer?: number;
161
- }): LinesWriter;
162
- /** The rows the server's records have met that no longer read. */
163
229
  damaged(): Promise<Damage[]>;
164
- /** Removes a damaged row, a repair an admin connection alone may make. */
230
+ /**
231
+ * Removes a head row or a segment that `damaged` listed, so that the
232
+ * reads over it work again; what still reads is refused.
233
+ *
234
+ * for (const damage of await store.events().damaged()) await store.events().drop(damage)
235
+ */
165
236
  drop(damage: Damage): Promise<void>;
237
+ protected opened(method: Method, body: (handle: number | undefined) => Uint8Array): Promise<Stream>;
238
+ }
239
+ /** A writer's stream, and the bytes a piece of it carries. */
240
+ interface Opened {
241
+ stream: Stream;
242
+ piece: number;
166
243
  }
167
244
  /**
168
- * An upload of lines that stays open while it is written: write never waits,
169
- * holding what the stream's credit does not let go yet up to its buffer and
170
- * dropping past it. A connection lost drops what it held and the next write
171
- * uploads on the next connection.
245
+ * A writer of another program's output into a stream, as `events.lines()`
246
+ * begins it: each line becomes an event, and a write never waits. It sends
247
+ * whole lines, so that what it has no room for, `dropped` counts as lines.
172
248
  */
173
- export declare class LinesWriter {
249
+ export declare class Lines {
174
250
  #private;
175
- /** bytes dropped since the writer began: a full buffer, or a lost connection */
176
- dropped: number;
177
- constructor(link: Link, stream: string, most: number);
178
- /** Takes a piece of output, cut anywhere. It returns at once. */
179
- write(chunk: string | Uint8Array): boolean;
180
- /** Hands over what the writer holds, a line cut short included, and ends the upload. */
251
+ /** Lines come from `events.lines()`. */
252
+ constructor(open: () => Promise<Opened>);
253
+ /** The lines dropped: past what the writer holds, and, once it ended, by the store. */
254
+ get dropped(): number;
255
+ /** Takes a piece of output, cut anywhere; it never waits. */
256
+ write(chunk: Uint8Array | string): void;
257
+ /**
258
+ * Ends the writer: what it holds goes, a last line without its newline
259
+ * too, and it returns once the store wrote them.
260
+ */
181
261
  end(): Promise<void>;
182
262
  }
263
+ /** What a store's logger is told: a logger's options, and how long its stream keeps. */
264
+ export interface StoreLoggerOptions extends LoggerOptions {
265
+ /** how long the stream keeps its events, as store.events takes it */
266
+ keep?: Duration;
267
+ }
268
+ /**
269
+ * A logger of `stream` that keeps its lines there through an append of their
270
+ * own, and what it declares its config `log` with.
271
+ */
272
+ export declare function storeLogger(link: Link, stream: string, options?: StoreLoggerOptions): [Logger, LogConfig];
273
+ export {};