@diffdelta/client 0.1.0
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/dist/index.d.mts +230 -0
- package/dist/index.d.ts +230 -0
- package/dist/index.js +399 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +370 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +50 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/** A single item from a DiffDelta feed. */
|
|
2
|
+
interface FeedItem {
|
|
3
|
+
/** Source identifier (e.g. "cisa_kev", "nist_nvd"). */
|
|
4
|
+
source: string;
|
|
5
|
+
/** Unique item ID within the source. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Human/agent-readable headline. */
|
|
8
|
+
headline: string;
|
|
9
|
+
/** Link to the original source. */
|
|
10
|
+
url: string;
|
|
11
|
+
/** Summary text extracted from the source. */
|
|
12
|
+
excerpt: string;
|
|
13
|
+
/** When the item was originally published. */
|
|
14
|
+
publishedAt: string | null;
|
|
15
|
+
/** When the item was last updated. */
|
|
16
|
+
updatedAt: string | null;
|
|
17
|
+
/** Which change bucket: "new", "updated", or "removed". */
|
|
18
|
+
bucket: "new" | "updated" | "removed";
|
|
19
|
+
/** Risk score 0–10, or null if not scored. */
|
|
20
|
+
riskScore: number | null;
|
|
21
|
+
/** Raw provenance data (fetched_at, evidence_urls, content_hash). */
|
|
22
|
+
provenance: Record<string, unknown>;
|
|
23
|
+
/** The full raw item object from the feed. */
|
|
24
|
+
raw: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/** The lightweight head pointer for change detection. */
|
|
27
|
+
interface Head {
|
|
28
|
+
/** Opaque cursor string for change detection. */
|
|
29
|
+
cursor: string;
|
|
30
|
+
/** Content hash of the latest feed. */
|
|
31
|
+
hash: string;
|
|
32
|
+
/** Whether content has changed since last generation. */
|
|
33
|
+
changed: boolean;
|
|
34
|
+
/** When this head was generated. */
|
|
35
|
+
generatedAt: string;
|
|
36
|
+
/** Recommended polling interval in seconds. */
|
|
37
|
+
ttlSec: number;
|
|
38
|
+
}
|
|
39
|
+
/** A full DiffDelta feed response. */
|
|
40
|
+
interface Feed {
|
|
41
|
+
/** The new cursor (save this for next poll). */
|
|
42
|
+
cursor: string;
|
|
43
|
+
/** The previous cursor. */
|
|
44
|
+
prevCursor: string;
|
|
45
|
+
/** Source ID (if per-source feed) or "global". */
|
|
46
|
+
sourceId: string;
|
|
47
|
+
/** When this feed was generated. */
|
|
48
|
+
generatedAt: string;
|
|
49
|
+
/** All items across all buckets. */
|
|
50
|
+
items: FeedItem[];
|
|
51
|
+
/** Items in the "new" bucket. */
|
|
52
|
+
new: FeedItem[];
|
|
53
|
+
/** Items in the "updated" bucket. */
|
|
54
|
+
updated: FeedItem[];
|
|
55
|
+
/** Items in the "removed" bucket. */
|
|
56
|
+
removed: FeedItem[];
|
|
57
|
+
/** Human-readable summary of what changed. */
|
|
58
|
+
narrative: string;
|
|
59
|
+
/** The full raw feed object. */
|
|
60
|
+
raw: Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
/** Metadata about an available DiffDelta source. */
|
|
63
|
+
interface SourceInfo {
|
|
64
|
+
/** Unique source identifier (e.g. "cisa_kev"). */
|
|
65
|
+
sourceId: string;
|
|
66
|
+
/** Human-readable display name. */
|
|
67
|
+
name: string;
|
|
68
|
+
/** List of tags (e.g. ["security"]). */
|
|
69
|
+
tags: string[];
|
|
70
|
+
/** Brief description of the source. */
|
|
71
|
+
description: string;
|
|
72
|
+
/** URL of the source's homepage. */
|
|
73
|
+
homepage: string;
|
|
74
|
+
/** Whether the source is currently active. */
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
/** Health status ("ok", "degraded", "error"). */
|
|
77
|
+
status: string;
|
|
78
|
+
/** Path to the source's head.json. */
|
|
79
|
+
headUrl: string;
|
|
80
|
+
/** Path to the source's latest.json. */
|
|
81
|
+
latestUrl: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* DiffDelta TypeScript client — agent-ready intelligence feeds.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* import { DiffDelta } from "diffdelta";
|
|
90
|
+
*
|
|
91
|
+
* const dd = new DiffDelta();
|
|
92
|
+
*
|
|
93
|
+
* // Poll for new items across all sources
|
|
94
|
+
* const items = await dd.poll();
|
|
95
|
+
* items.forEach(i => console.log(`${i.source}: ${i.headline}`));
|
|
96
|
+
*
|
|
97
|
+
* // Poll only security sources
|
|
98
|
+
* const sec = await dd.poll({ tags: ["security"] });
|
|
99
|
+
*
|
|
100
|
+
* // Continuous monitoring
|
|
101
|
+
* dd.watch(item => console.log("🚨", item.headline), { tags: ["security"] });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
interface DiffDeltaOptions {
|
|
106
|
+
/** DiffDelta API base URL. Defaults to https://diffdelta.io. */
|
|
107
|
+
baseUrl?: string;
|
|
108
|
+
/** Pro/Enterprise API key (dd_live_...). */
|
|
109
|
+
apiKey?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Path to cursor file. Defaults to ~/.diffdelta/cursors.json.
|
|
112
|
+
* Set to `null` to disable file persistence (in-memory only).
|
|
113
|
+
* Set to `"memory"` for explicit in-memory mode (serverless, edge).
|
|
114
|
+
*/
|
|
115
|
+
cursorPath?: string | null;
|
|
116
|
+
/** HTTP timeout in milliseconds. Defaults to 15000. */
|
|
117
|
+
timeout?: number;
|
|
118
|
+
}
|
|
119
|
+
interface PollOptions {
|
|
120
|
+
/** Filter items to these tags (e.g. ["security"]). */
|
|
121
|
+
tags?: string[];
|
|
122
|
+
/** Filter items to these source IDs (e.g. ["cisa_kev", "nist_nvd"]). */
|
|
123
|
+
sources?: string[];
|
|
124
|
+
/**
|
|
125
|
+
* Which buckets to return.
|
|
126
|
+
* Defaults to ["new", "updated"].
|
|
127
|
+
* Use ["new", "updated", "removed"] to include removals.
|
|
128
|
+
*/
|
|
129
|
+
buckets?: Array<"new" | "updated" | "removed">;
|
|
130
|
+
}
|
|
131
|
+
interface WatchOptions extends PollOptions {
|
|
132
|
+
/** Seconds between polls. Defaults to feed TTL (usually 900s). */
|
|
133
|
+
interval?: number;
|
|
134
|
+
/** If provided, an AbortSignal to stop watching. */
|
|
135
|
+
signal?: AbortSignal;
|
|
136
|
+
}
|
|
137
|
+
declare class DiffDelta {
|
|
138
|
+
readonly baseUrl: string;
|
|
139
|
+
readonly apiKey?: string;
|
|
140
|
+
readonly timeout: number;
|
|
141
|
+
private cursors;
|
|
142
|
+
private sourceTagsCache;
|
|
143
|
+
constructor(options?: DiffDeltaOptions);
|
|
144
|
+
/**
|
|
145
|
+
* Poll the global feed for new items since last poll.
|
|
146
|
+
*
|
|
147
|
+
* Checks head.json first (~400 bytes). Only fetches the full feed
|
|
148
|
+
* if the cursor has changed. Automatically saves the new cursor.
|
|
149
|
+
*/
|
|
150
|
+
poll(options?: PollOptions): Promise<FeedItem[]>;
|
|
151
|
+
/**
|
|
152
|
+
* Poll a specific source for new items since last poll.
|
|
153
|
+
*
|
|
154
|
+
* More efficient than `poll({ sources: [...] })` if you only
|
|
155
|
+
* care about one source — fetches a smaller payload.
|
|
156
|
+
*/
|
|
157
|
+
pollSource(sourceId: string, options?: Omit<PollOptions, "sources">): Promise<FeedItem[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Fetch a head.json pointer.
|
|
160
|
+
* @param url Full URL to head.json. Defaults to global head.
|
|
161
|
+
*/
|
|
162
|
+
head(url?: string): Promise<Head>;
|
|
163
|
+
/**
|
|
164
|
+
* Fetch a full latest.json feed.
|
|
165
|
+
* @param url Full URL to latest.json. Defaults to global latest.
|
|
166
|
+
*/
|
|
167
|
+
fetchFeed(url?: string): Promise<Feed>;
|
|
168
|
+
/** List all available DiffDelta sources. */
|
|
169
|
+
sources(): Promise<SourceInfo[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Continuously poll and call a function for each new item.
|
|
172
|
+
*
|
|
173
|
+
* @param callback - Async or sync function called for each new FeedItem.
|
|
174
|
+
* @param options - Watch options (tags, sources, interval, signal).
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* dd.watch(item => {
|
|
179
|
+
* console.log(`🚨 ${item.source}: ${item.headline}`);
|
|
180
|
+
* }, { tags: ["security"] });
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* // Stop with AbortController
|
|
186
|
+
* const ac = new AbortController();
|
|
187
|
+
* dd.watch(handler, { signal: ac.signal });
|
|
188
|
+
* setTimeout(() => ac.abort(), 60_000); // stop after 1 minute
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
watch(callback: (item: FeedItem) => void | Promise<void>, options?: WatchOptions): Promise<void>;
|
|
192
|
+
/** Reset stored cursors so the next poll returns all current items. */
|
|
193
|
+
resetCursors(sourceId?: string): void;
|
|
194
|
+
private pollFeed;
|
|
195
|
+
private getSourceTags;
|
|
196
|
+
private fetchJson;
|
|
197
|
+
toString(): string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Persists cursors to a local JSON file so bots survive restarts.
|
|
202
|
+
*
|
|
203
|
+
* By default, cursors are saved to ~/.diffdelta/cursors.json.
|
|
204
|
+
* Each feed key gets its own cursor entry.
|
|
205
|
+
*/
|
|
206
|
+
declare class CursorStore {
|
|
207
|
+
private path;
|
|
208
|
+
private cursors;
|
|
209
|
+
constructor(path?: string);
|
|
210
|
+
/** Get the stored cursor for a feed key. */
|
|
211
|
+
get(key: string): string | undefined;
|
|
212
|
+
/** Save a cursor and persist to disk. */
|
|
213
|
+
set(key: string, cursor: string): void;
|
|
214
|
+
/** Clear cursor(s). If key is undefined, clears all cursors. */
|
|
215
|
+
clear(key?: string): void;
|
|
216
|
+
private load;
|
|
217
|
+
private save;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* In-memory-only cursor store (no file I/O).
|
|
221
|
+
* Useful for serverless, browser, or Deno environments.
|
|
222
|
+
*/
|
|
223
|
+
declare class MemoryCursorStore {
|
|
224
|
+
private cursors;
|
|
225
|
+
get(key: string): string | undefined;
|
|
226
|
+
set(key: string, cursor: string): void;
|
|
227
|
+
clear(key?: string): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { CursorStore, DiffDelta, type DiffDeltaOptions, type Feed, type FeedItem, type Head, MemoryCursorStore, type PollOptions, type SourceInfo, type WatchOptions };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/** A single item from a DiffDelta feed. */
|
|
2
|
+
interface FeedItem {
|
|
3
|
+
/** Source identifier (e.g. "cisa_kev", "nist_nvd"). */
|
|
4
|
+
source: string;
|
|
5
|
+
/** Unique item ID within the source. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Human/agent-readable headline. */
|
|
8
|
+
headline: string;
|
|
9
|
+
/** Link to the original source. */
|
|
10
|
+
url: string;
|
|
11
|
+
/** Summary text extracted from the source. */
|
|
12
|
+
excerpt: string;
|
|
13
|
+
/** When the item was originally published. */
|
|
14
|
+
publishedAt: string | null;
|
|
15
|
+
/** When the item was last updated. */
|
|
16
|
+
updatedAt: string | null;
|
|
17
|
+
/** Which change bucket: "new", "updated", or "removed". */
|
|
18
|
+
bucket: "new" | "updated" | "removed";
|
|
19
|
+
/** Risk score 0–10, or null if not scored. */
|
|
20
|
+
riskScore: number | null;
|
|
21
|
+
/** Raw provenance data (fetched_at, evidence_urls, content_hash). */
|
|
22
|
+
provenance: Record<string, unknown>;
|
|
23
|
+
/** The full raw item object from the feed. */
|
|
24
|
+
raw: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/** The lightweight head pointer for change detection. */
|
|
27
|
+
interface Head {
|
|
28
|
+
/** Opaque cursor string for change detection. */
|
|
29
|
+
cursor: string;
|
|
30
|
+
/** Content hash of the latest feed. */
|
|
31
|
+
hash: string;
|
|
32
|
+
/** Whether content has changed since last generation. */
|
|
33
|
+
changed: boolean;
|
|
34
|
+
/** When this head was generated. */
|
|
35
|
+
generatedAt: string;
|
|
36
|
+
/** Recommended polling interval in seconds. */
|
|
37
|
+
ttlSec: number;
|
|
38
|
+
}
|
|
39
|
+
/** A full DiffDelta feed response. */
|
|
40
|
+
interface Feed {
|
|
41
|
+
/** The new cursor (save this for next poll). */
|
|
42
|
+
cursor: string;
|
|
43
|
+
/** The previous cursor. */
|
|
44
|
+
prevCursor: string;
|
|
45
|
+
/** Source ID (if per-source feed) or "global". */
|
|
46
|
+
sourceId: string;
|
|
47
|
+
/** When this feed was generated. */
|
|
48
|
+
generatedAt: string;
|
|
49
|
+
/** All items across all buckets. */
|
|
50
|
+
items: FeedItem[];
|
|
51
|
+
/** Items in the "new" bucket. */
|
|
52
|
+
new: FeedItem[];
|
|
53
|
+
/** Items in the "updated" bucket. */
|
|
54
|
+
updated: FeedItem[];
|
|
55
|
+
/** Items in the "removed" bucket. */
|
|
56
|
+
removed: FeedItem[];
|
|
57
|
+
/** Human-readable summary of what changed. */
|
|
58
|
+
narrative: string;
|
|
59
|
+
/** The full raw feed object. */
|
|
60
|
+
raw: Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
/** Metadata about an available DiffDelta source. */
|
|
63
|
+
interface SourceInfo {
|
|
64
|
+
/** Unique source identifier (e.g. "cisa_kev"). */
|
|
65
|
+
sourceId: string;
|
|
66
|
+
/** Human-readable display name. */
|
|
67
|
+
name: string;
|
|
68
|
+
/** List of tags (e.g. ["security"]). */
|
|
69
|
+
tags: string[];
|
|
70
|
+
/** Brief description of the source. */
|
|
71
|
+
description: string;
|
|
72
|
+
/** URL of the source's homepage. */
|
|
73
|
+
homepage: string;
|
|
74
|
+
/** Whether the source is currently active. */
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
/** Health status ("ok", "degraded", "error"). */
|
|
77
|
+
status: string;
|
|
78
|
+
/** Path to the source's head.json. */
|
|
79
|
+
headUrl: string;
|
|
80
|
+
/** Path to the source's latest.json. */
|
|
81
|
+
latestUrl: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* DiffDelta TypeScript client — agent-ready intelligence feeds.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* import { DiffDelta } from "diffdelta";
|
|
90
|
+
*
|
|
91
|
+
* const dd = new DiffDelta();
|
|
92
|
+
*
|
|
93
|
+
* // Poll for new items across all sources
|
|
94
|
+
* const items = await dd.poll();
|
|
95
|
+
* items.forEach(i => console.log(`${i.source}: ${i.headline}`));
|
|
96
|
+
*
|
|
97
|
+
* // Poll only security sources
|
|
98
|
+
* const sec = await dd.poll({ tags: ["security"] });
|
|
99
|
+
*
|
|
100
|
+
* // Continuous monitoring
|
|
101
|
+
* dd.watch(item => console.log("🚨", item.headline), { tags: ["security"] });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
interface DiffDeltaOptions {
|
|
106
|
+
/** DiffDelta API base URL. Defaults to https://diffdelta.io. */
|
|
107
|
+
baseUrl?: string;
|
|
108
|
+
/** Pro/Enterprise API key (dd_live_...). */
|
|
109
|
+
apiKey?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Path to cursor file. Defaults to ~/.diffdelta/cursors.json.
|
|
112
|
+
* Set to `null` to disable file persistence (in-memory only).
|
|
113
|
+
* Set to `"memory"` for explicit in-memory mode (serverless, edge).
|
|
114
|
+
*/
|
|
115
|
+
cursorPath?: string | null;
|
|
116
|
+
/** HTTP timeout in milliseconds. Defaults to 15000. */
|
|
117
|
+
timeout?: number;
|
|
118
|
+
}
|
|
119
|
+
interface PollOptions {
|
|
120
|
+
/** Filter items to these tags (e.g. ["security"]). */
|
|
121
|
+
tags?: string[];
|
|
122
|
+
/** Filter items to these source IDs (e.g. ["cisa_kev", "nist_nvd"]). */
|
|
123
|
+
sources?: string[];
|
|
124
|
+
/**
|
|
125
|
+
* Which buckets to return.
|
|
126
|
+
* Defaults to ["new", "updated"].
|
|
127
|
+
* Use ["new", "updated", "removed"] to include removals.
|
|
128
|
+
*/
|
|
129
|
+
buckets?: Array<"new" | "updated" | "removed">;
|
|
130
|
+
}
|
|
131
|
+
interface WatchOptions extends PollOptions {
|
|
132
|
+
/** Seconds between polls. Defaults to feed TTL (usually 900s). */
|
|
133
|
+
interval?: number;
|
|
134
|
+
/** If provided, an AbortSignal to stop watching. */
|
|
135
|
+
signal?: AbortSignal;
|
|
136
|
+
}
|
|
137
|
+
declare class DiffDelta {
|
|
138
|
+
readonly baseUrl: string;
|
|
139
|
+
readonly apiKey?: string;
|
|
140
|
+
readonly timeout: number;
|
|
141
|
+
private cursors;
|
|
142
|
+
private sourceTagsCache;
|
|
143
|
+
constructor(options?: DiffDeltaOptions);
|
|
144
|
+
/**
|
|
145
|
+
* Poll the global feed for new items since last poll.
|
|
146
|
+
*
|
|
147
|
+
* Checks head.json first (~400 bytes). Only fetches the full feed
|
|
148
|
+
* if the cursor has changed. Automatically saves the new cursor.
|
|
149
|
+
*/
|
|
150
|
+
poll(options?: PollOptions): Promise<FeedItem[]>;
|
|
151
|
+
/**
|
|
152
|
+
* Poll a specific source for new items since last poll.
|
|
153
|
+
*
|
|
154
|
+
* More efficient than `poll({ sources: [...] })` if you only
|
|
155
|
+
* care about one source — fetches a smaller payload.
|
|
156
|
+
*/
|
|
157
|
+
pollSource(sourceId: string, options?: Omit<PollOptions, "sources">): Promise<FeedItem[]>;
|
|
158
|
+
/**
|
|
159
|
+
* Fetch a head.json pointer.
|
|
160
|
+
* @param url Full URL to head.json. Defaults to global head.
|
|
161
|
+
*/
|
|
162
|
+
head(url?: string): Promise<Head>;
|
|
163
|
+
/**
|
|
164
|
+
* Fetch a full latest.json feed.
|
|
165
|
+
* @param url Full URL to latest.json. Defaults to global latest.
|
|
166
|
+
*/
|
|
167
|
+
fetchFeed(url?: string): Promise<Feed>;
|
|
168
|
+
/** List all available DiffDelta sources. */
|
|
169
|
+
sources(): Promise<SourceInfo[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Continuously poll and call a function for each new item.
|
|
172
|
+
*
|
|
173
|
+
* @param callback - Async or sync function called for each new FeedItem.
|
|
174
|
+
* @param options - Watch options (tags, sources, interval, signal).
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* dd.watch(item => {
|
|
179
|
+
* console.log(`🚨 ${item.source}: ${item.headline}`);
|
|
180
|
+
* }, { tags: ["security"] });
|
|
181
|
+
* ```
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```ts
|
|
185
|
+
* // Stop with AbortController
|
|
186
|
+
* const ac = new AbortController();
|
|
187
|
+
* dd.watch(handler, { signal: ac.signal });
|
|
188
|
+
* setTimeout(() => ac.abort(), 60_000); // stop after 1 minute
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
watch(callback: (item: FeedItem) => void | Promise<void>, options?: WatchOptions): Promise<void>;
|
|
192
|
+
/** Reset stored cursors so the next poll returns all current items. */
|
|
193
|
+
resetCursors(sourceId?: string): void;
|
|
194
|
+
private pollFeed;
|
|
195
|
+
private getSourceTags;
|
|
196
|
+
private fetchJson;
|
|
197
|
+
toString(): string;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Persists cursors to a local JSON file so bots survive restarts.
|
|
202
|
+
*
|
|
203
|
+
* By default, cursors are saved to ~/.diffdelta/cursors.json.
|
|
204
|
+
* Each feed key gets its own cursor entry.
|
|
205
|
+
*/
|
|
206
|
+
declare class CursorStore {
|
|
207
|
+
private path;
|
|
208
|
+
private cursors;
|
|
209
|
+
constructor(path?: string);
|
|
210
|
+
/** Get the stored cursor for a feed key. */
|
|
211
|
+
get(key: string): string | undefined;
|
|
212
|
+
/** Save a cursor and persist to disk. */
|
|
213
|
+
set(key: string, cursor: string): void;
|
|
214
|
+
/** Clear cursor(s). If key is undefined, clears all cursors. */
|
|
215
|
+
clear(key?: string): void;
|
|
216
|
+
private load;
|
|
217
|
+
private save;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* In-memory-only cursor store (no file I/O).
|
|
221
|
+
* Useful for serverless, browser, or Deno environments.
|
|
222
|
+
*/
|
|
223
|
+
declare class MemoryCursorStore {
|
|
224
|
+
private cursors;
|
|
225
|
+
get(key: string): string | undefined;
|
|
226
|
+
set(key: string, cursor: string): void;
|
|
227
|
+
clear(key?: string): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export { CursorStore, DiffDelta, type DiffDeltaOptions, type Feed, type FeedItem, type Head, MemoryCursorStore, type PollOptions, type SourceInfo, type WatchOptions };
|