Skip to content

Commit

Permalink
fix(@libp2p/kad-dht): update timeout ref type
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Aug 14, 2023
1 parent 78b008c commit 02b8932
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/kad-dht/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class Providers implements Startable {
private readonly provideValidity: number
private readonly syncQueue: Queue
private started: boolean
private cleaner?: NodeJS.Timer
private cleaner?: ReturnType<typeof setInterval>

constructor (components: ProvidersComponents, init: ProvidersInit = {}) {
const { cacheSize, cleanupInterval, provideValidity } = init
Expand Down
2 changes: 1 addition & 1 deletion packages/kad-dht/src/query-self.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class QuerySelf implements Startable {
private readonly initialInterval: number
private readonly queryTimeout: number
private started: boolean
private timeoutId?: NodeJS.Timer
private timeoutId?: ReturnType<typeof setTimeout>
private controller?: AbortController
private initialQuerySelfHasRun?: DeferredPromise<void>
private querySelfPromise?: DeferredPromise<void>
Expand Down
2 changes: 1 addition & 1 deletion packages/kad-dht/src/routing-table/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class RoutingTableRefresh {
private readonly refreshInterval: number
private readonly refreshQueryTimeout: number
private readonly commonPrefixLengthRefreshedAt: Date[]
private refreshTimeoutId?: NodeJS.Timer
private refreshTimeoutId?: ReturnType<typeof setTimeout>

constructor (init: RoutingTableRefreshInit) {
const { peerRouting, routingTable, refreshInterval, refreshQueryTimeout, lan } = init
Expand Down
2 changes: 1 addition & 1 deletion packages/peer-discovery-mdns/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { MulticastDNS, QueryPacket, ResponsePacket } from 'multicast-dns'

const log = logger('libp2p:mdns:query')

export function queryLAN (mdns: MulticastDNS, serviceTag: string, interval: number): NodeJS.Timer {
export function queryLAN (mdns: MulticastDNS, serviceTag: string, interval: number): ReturnType<typeof setInterval> {
const query = (): void => {
log('query', serviceTag)

Expand Down

0 comments on commit 02b8932

Please sign in to comment.