14 lines
437 B
TypeScript
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'
|
|
}
|