2023-08-24 22:00:08 +00:00
|
|
|
import { UserRow } from '@/db.ts';
|
2023-08-16 17:54:17 +00:00
|
|
|
import { type Filter } from '@/deps.ts';
|
|
|
|
|
|
|
|
/** Custom filter interface that extends Nostr filters with extra options for Ditto. */
|
|
|
|
interface DittoFilter<K extends number = number> extends Filter<K> {
|
|
|
|
local?: boolean;
|
|
|
|
}
|
|
|
|
|
2023-08-17 02:21:29 +00:00
|
|
|
/** Additional options to apply to the whole subscription. */
|
|
|
|
interface GetFiltersOpts {
|
2023-08-17 02:38:21 +00:00
|
|
|
/** How long to wait (in milliseconds) until aborting the request. */
|
2023-08-17 02:21:29 +00:00
|
|
|
timeout?: number;
|
2023-08-17 02:38:21 +00:00
|
|
|
/** Event limit for the whole subscription. */
|
|
|
|
limit?: number;
|
2023-08-17 02:21:29 +00:00
|
|
|
}
|
|
|
|
|
2023-08-24 22:00:08 +00:00
|
|
|
interface EventData {
|
|
|
|
user: UserRow | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type { DittoFilter, EventData, GetFiltersOpts };
|