# Tracker | Welshman Docs
Documentation for Welshman Docs

# Class Tracker

#### Hierarchy (View Summary)

- Emitter
  - Tracker

- Defined in packages/net/src/Tracker.ts:3

#####
Index

### Constructors

constructor

### Properties

idsByRelay
relaysById
defaultMaxListeners

### Methods

addListener
addRelay
clear
copy
emit
eventNames
getIds
getMaxListeners
getRelays
hasRelay
listenerCount
listeners
load
off
on
once
prependListener
prependOnceListener
rawListeners
removeAllListeners
removeListener
removeRelay
setMaxListeners
track
listenerCount

##
Constructors

### constructor

- new Tracker(): Tracker

- #### Returns Tracker

  Overrides Emitter.constructor

  - Defined in packages/net/src/Tracker.ts:7

##
Properties

### idsByRelay

idsByRelay: Map<string, Set<string>> = ...

- Defined in packages/net/src/Tracker.ts:5

### relaysById

relaysById: Map<string, Set<string>> = ...

- Defined in packages/net/src/Tracker.ts:4

### `Static` defaultMaxListeners

defaultMaxListeners: number

Inherited from Emitter.defaultMaxListeners

- Defined in node_modules/@types/events/index.d.ts:5

##
Methods

### addListener

- addListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.addListener

  - Defined in node_modules/@types/events/index.d.ts:11

### addRelay

- addRelay(eventId: string, relay: string): void

- #### Parameters

  - eventId: string
  - relay: string

  #### Returns void

  - Defined in packages/net/src/Tracker.ts:19

### clear

- clear(): void

- #### Returns void

  - Defined in packages/net/src/Tracker.ts:79

### copy

- copy(eventId1: string, eventId2: string): void

- #### Parameters

  - eventId1: string
  - eventId2: string

  #### Returns void

  - Defined in packages/net/src/Tracker.ts:59

### emit

- emit(type: string, ...args: any[]): boolean

- #### Parameters

  - type: string
  - ...args: any[]

  #### Returns boolean

  Inherited from Emitter.emit

  - Defined in packages/lib/build/src/Emitter.d.ts:3

### eventNames

- eventNames(): (string | number)[]

- #### Returns (string | number)[]

  Inherited from Emitter.eventNames

  - Defined in node_modules/@types/events/index.d.ts:7

### getIds

- getIds(relay: string): Set<string>

- #### Parameters

  - relay: string

  #### Returns Set<string>

  - Defined in packages/net/src/Tracker.ts:13

### getMaxListeners

- getMaxListeners(): number

- #### Returns number

  Inherited from Emitter.getMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:9

### getRelays

- getRelays(eventId: string): Set<string>

- #### Parameters

  - eventId: string

  #### Returns Set<string>

  - Defined in packages/net/src/Tracker.ts:15

### hasRelay

- hasRelay(eventId: string, relay: string): undefined | boolean

- #### Parameters

  - eventId: string
  - relay: string

  #### Returns undefined | boolean

  - Defined in packages/net/src/Tracker.ts:17

### listenerCount

- listenerCount(type: string | number): number

- #### Parameters

  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:20

### listeners

- listeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.listeners

  - Defined in node_modules/@types/events/index.d.ts:19

### load

- load(relaysById: Map<string, Set<string>>): void

- #### Parameters

  - relaysById: Map<string, Set<string>>

  #### Returns void

  - Defined in packages/net/src/Tracker.ts:65

### off

- off(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.off

  - Defined in node_modules/@types/events/index.d.ts:17

### on

- on(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.on

  - Defined in node_modules/@types/events/index.d.ts:12

### once

- once(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.once

  - Defined in node_modules/@types/events/index.d.ts:13

### prependListener

- prependListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependListener

  - Defined in node_modules/@types/events/index.d.ts:14

### prependOnceListener

- prependOnceListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.prependOnceListener

  - Defined in node_modules/@types/events/index.d.ts:15

### rawListeners

- rawListeners(type: string | number): Listener[]

- #### Parameters

  - type: string | number

  #### Returns Listener[]

  Inherited from Emitter.rawListeners

  - Defined in node_modules/@types/events/index.d.ts:21

### removeAllListeners

- removeAllListeners(type?: string | number): this

- #### Parameters

  - `Optional` type: string | number

  #### Returns this

  Inherited from Emitter.removeAllListeners

  - Defined in node_modules/@types/events/index.d.ts:18

### removeListener

- removeListener(type: string | number, listener: Listener): this

- #### Parameters

  - type: string | number
  - listener: Listener

  #### Returns this

  Inherited from Emitter.removeListener

  - Defined in node_modules/@types/events/index.d.ts:16

### removeRelay

- removeRelay(eventId: string, relay: string): void

- #### Parameters

  - eventId: string
  - relay: string

  #### Returns void

  - Defined in packages/net/src/Tracker.ts:42

### setMaxListeners

- setMaxListeners(n: number): this

- #### Parameters

  - n: number

  #### Returns this

  Inherited from Emitter.setMaxListeners

  - Defined in node_modules/@types/events/index.d.ts:8

### track

- track(eventId: string, relay: string): boolean

- #### Parameters

  - eventId: string
  - relay: string

  #### Returns boolean

  - Defined in packages/net/src/Tracker.ts:51

### `Static` listenerCount

- listenerCount(emitter: EventEmitter, type: string | number): number

- #### Parameters

  - emitter: EventEmitter
  - type: string | number

  #### Returns number

  Inherited from Emitter.listenerCount

  - Defined in node_modules/@types/events/index.d.ts:4