hotfix types.
This commit is contained in:
parent
9241089997
commit
bf7e00d32a
1
nip19.ts
1
nip19.ts
|
@ -25,6 +25,7 @@ export type AddressPointer = {
|
|||
|
||||
export type DecodeResult =
|
||||
| {type: 'nprofile'; data: ProfilePointer}
|
||||
| {type: 'nrelay'; data: string}
|
||||
| {type: 'nevent'; data: EventPointer}
|
||||
| {type: 'naddr'; data: AddressPointer}
|
||||
| {type: 'nsec'; data: string}
|
||||
|
|
4
pool.ts
4
pool.ts
|
@ -2,7 +2,7 @@ import {Relay, relayInit} from './relay'
|
|||
import {normalizeURL} from './utils'
|
||||
import {Filter} from './filter'
|
||||
import {Event} from './event'
|
||||
import {SubscriptionOptions, Sub, Pub} from './relay'
|
||||
import {SubscriptionOptions, Sub, Pub, CountPayload} from './relay'
|
||||
|
||||
export class SimplePool {
|
||||
private _conn: {[url: string]: Relay}
|
||||
|
@ -53,7 +53,7 @@ export class SimplePool {
|
|||
}
|
||||
|
||||
let subs: Sub[] = []
|
||||
let eventListeners: Set<(event: Event) => void> = new Set()
|
||||
let eventListeners: Set<any> = new Set()
|
||||
let eoseListeners: Set<() => void> = new Set()
|
||||
let eosesMissing = relays.length
|
||||
|
||||
|
|
7
relay.ts
7
relay.ts
|
@ -11,7 +11,7 @@ type RelayEvent = {
|
|||
notice: (msg: string) => void | Promise<void>
|
||||
auth: (challenge: string) => void | Promise<void>
|
||||
}
|
||||
type CountPayload = {
|
||||
export type CountPayload = {
|
||||
count: number
|
||||
}
|
||||
type SubEvent = {
|
||||
|
@ -371,10 +371,7 @@ export function relayInit(
|
|||
resolve(event)
|
||||
})
|
||||
}),
|
||||
count: (
|
||||
filters: Filter[],
|
||||
opts?: SubscriptionOptions
|
||||
): Promise<CountPayload | null> =>
|
||||
count: (filters: Filter[]): Promise<CountPayload | null> =>
|
||||
new Promise(resolve => {
|
||||
let s = sub(filters, {...sub, verb: 'COUNT'})
|
||||
let timeout = setTimeout(() => {
|
||||
|
|
Loading…
Reference in New Issue