# Class Repository<E>

#### Type Parameters

- E extends HashedEvent = TrustedEvent

#### Hierarchy (View Summary)

- Emitter
  - Repository

- Defined in packages/util/src/Repository.ts:13

#####
Index

### Constructors

constructor

### Properties

deletes
eventsByAddress
eventsByAuthor
eventsByDay
eventsById
eventsByTag
eventsByWrap
defaultMaxListeners

### Methods

_updateIndex
addListener
dump
emit
eventNames
getEvent
getMaxListeners
hasEvent
isDeleted
isDeletedByAddress
isDeletedById
listenerCount
listeners
load
off
on
once
prependListener
prependOnceListener
publish
query
rawListeners
removeAllListeners
removeEvent
removeListener
setMaxListeners
listenerCount

##
Constructors

### constructor

- new Repository< E extends HashedEvent = TrustedEvent >(): Repository < E >

- #### Type Parameters

  - E extends HashedEvent = TrustedEvent

  #### Returns Repository < E >

  Overrides Emitter.constructor

  - Defined in packages/util/src/Repository.ts:22

##
Properties

### deletes

deletes: Map<string, number> = ...

- Defined in packages/util/src/Repository.ts:20

### eventsByAddress

eventsByAddress: Map<string, E > = ...

- Defined in packages/util/src/Repository.ts:16

### eventsByAuthor

eventsByAuthor: Map<string, E []> = ...

- Defined in packages/util/src/Repository.ts:19

### eventsByDay

eventsByDay: Map<number, E []> = ...

- Defined in packages/util/src/Repository.ts:18

### eventsById

eventsById: Map<string, E > = ...

- Defined in packages/util/src/Repository.ts:14

### eventsByTag

eventsByTag: Map<string, E []> = ...

- Defined in packages/util/src/Repository.ts:17

### eventsByWrap

eventsByWrap: Map<string, E > = ...

- Defined in packages/util/src/Repository.ts:15

### `Static` defaultMaxListeners

defaultMaxListeners: number

Inherited from Emitter.defaultMaxListeners

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

##
Methods

### _updateIndex

- _updateIndex< K >(m: Map< K , E []>, k: K , add?: E , remove?: E ): void

- #### Type Parameters

  - K

  #### Parameters

  - m: Map< K , E []>
  - k: K
  - `Optional` add: E
  - `Optional` remove: E

  #### Returns void

  - Defined in packages/util/src/Repository.ts:252

### 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

### dump

- dump(): E []

- #### Returns E []

  - Defined in packages/util/src/Repository.ts:30

### 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

### getEvent

- getEvent(idOrAddress: string): undefined | E

- #### Parameters

  - idOrAddress: string

  #### Returns undefined | E

  - Defined in packages/util/src/Repository.ts:77

### getMaxListeners

- getMaxListeners(): number

- #### Returns number

  Inherited from Emitter.getMaxListeners

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

### hasEvent

- hasEvent(event: E ): undefined | boolean

- #### Parameters

  - event: E

  #### Returns undefined | boolean

  - Defined in packages/util/src/Repository.ts:83

### isDeleted

- isDeleted(event: E ): boolean

- #### Parameters

  - event: E

  #### Returns boolean

  - Defined in packages/util/src/Repository.ts:248

### isDeletedByAddress

- isDeletedByAddress(event: E ): boolean

- #### Parameters

  - event: E

  #### Returns boolean

  - Defined in packages/util/src/Repository.ts:244

### isDeletedById

- isDeletedById(event: E ): boolean

- #### Parameters

  - event: E

  #### Returns boolean

  - Defined in packages/util/src/Repository.ts:246

### 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(events: E [], chunkSize?: number): void

- #### Parameters

  - events: E []
  - chunkSize: number = 1000

  #### Returns void

  - Defined in packages/util/src/Repository.ts:34

### 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

### publish

- publish(event: E , __namedParameters?: { shouldNotify?: boolean }): boolean

- #### Parameters

  - event: E
  - __namedParameters: { shouldNotify?: boolean } = {}

  #### Returns boolean

  - Defined in packages/util/src/Repository.ts:172

### query

- query(filters: Filter [], __namedParameters?: { includeDeleted?: boolean }): E []

- #### Parameters

  - filters: Filter []
  - __namedParameters: { includeDeleted?: boolean } = {}

  #### Returns E []

  - Defined in packages/util/src/Repository.ts:117

### 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

### removeEvent

- removeEvent(idOrAddress: string): void

- #### Parameters

  - idOrAddress: string

  #### Returns void

  - Defined in packages/util/src/Repository.ts:92

### 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

### setMaxListeners

- setMaxListeners(n: number): this

- #### Parameters

  - n: number

  #### Returns this

  Inherited from Emitter.setMaxListeners

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

### `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