story-research-zapwall/types/nostr-tools-extended.ts
2025-12-23 02:20:57 +01:00

14 lines
437 B
TypeScript

import { SimplePool } from 'nostr-tools'
/**
* Alias for SimplePool with typed sub method from nostr-tools definitions.
* Using the existing type avoids compatibility issues while keeping explicit intent.
*/
export interface SimplePoolWithSub extends SimplePool {
sub: SimplePool['sub']
}
export function hasSubMethod(pool: SimplePool): pool is SimplePoolWithSub {
return typeof (pool as SimplePoolWithSub).sub === 'function'
}