# Class Router

- Defined in packages/app/src/router.ts:119

#####
Index

### Constructors

constructor

### Properties

options

### Methods

Event
EventAncestors
EventMentions
EventParents
EventRoots
ForPubkey
ForPubkeys
ForUser
FromPubkey
FromPubkeys
FromRelays
FromUser
getRelaysForPubkey
getRelaysForPubkeys
getRelaysForUser
merge
PubkeyInbox
PubkeyInboxes
PublishEvent
Quote
Replies
scenario
UserInbox

##
Constructors

### constructor

- new Router(options: RouterOptions ): Router

- #### Parameters

  - options: RouterOptions

  #### Returns Router

  - Defined in packages/app/src/router.ts:120

##
Properties

### `Readonly` options

options: RouterOptions

- Defined in packages/app/src/router.ts:120

##
Methods

### Event

- Event(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:175

### EventAncestors

- EventAncestors(
  event: TrustedEvent ,
  type: "mentions" | "replies" | "roots",
  ): RouterScenario

- #### Parameters

  - event: TrustedEvent
  - type: "mentions" | "replies" | "roots"

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:199

### EventMentions

- EventMentions(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:219

### EventParents

- EventParents(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:221

### EventRoots

- EventRoots(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:223

### ForPubkey

- ForPubkey(pubkey: string): RouterScenario

- #### Parameters

  - pubkey: string

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:157

### ForPubkeys

- ForPubkeys(pubkeys: string[]): RouterScenario

- #### Parameters

  - pubkeys: string[]

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:166

### ForUser

- ForUser(): RouterScenario

- #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:148

### FromPubkey

- FromPubkey(pubkey: string): RouterScenario

- #### Parameters

  - pubkey: string

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:160

### FromPubkeys

- FromPubkeys(pubkeys: string[]): RouterScenario

- #### Parameters

  - pubkeys: string[]

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:169

### FromRelays

- FromRelays(relays: string[]): RouterScenario

- #### Parameters

  - relays: string[]

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:145

### FromUser

- FromUser(): RouterScenario

- #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:151

### getRelaysForPubkey

- getRelaysForPubkey(pubkey: string, mode?: RelayMode ): string[]

- #### Parameters

  - pubkey: string
  - `Optional` mode: RelayMode

  #### Returns string[]

  - Defined in packages/app/src/router.ts:124

### getRelaysForPubkeys

- getRelaysForPubkeys(pubkeys: string[], mode?: RelayMode ): string[][]

- #### Parameters

  - pubkeys: string[]
  - `Optional` mode: RelayMode

  #### Returns string[][]

  - Defined in packages/app/src/router.ts:127

### getRelaysForUser

- getRelaysForUser(mode?: RelayMode ): string[]

- #### Parameters

  - `Optional` mode: RelayMode

  #### Returns string[]

  - Defined in packages/app/src/router.ts:130

### merge

- merge(scenarios: RouterScenario []): RouterScenario

- #### Parameters

  - scenarios: RouterScenario []

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:140

### PubkeyInbox

- PubkeyInbox(pubkey: string): RouterScenario

- #### Parameters

  - pubkey: string

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:163

### PubkeyInboxes

- PubkeyInboxes(pubkeys: string[]): RouterScenario

- #### Parameters

  - pubkeys: string[]

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:172

### PublishEvent

- PublishEvent(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:225

### Quote

- Quote(event: TrustedEvent , value: string, relays?: string[]): RouterScenario

- #### Parameters

  - event: TrustedEvent
  - value: string
  - relays: string[] = []

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:181

### Replies

- Replies(event: TrustedEvent ): RouterScenario

- #### Parameters

  - event: TrustedEvent

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:178

### scenario

- scenario(selections: Selection []): RouterScenario

- #### Parameters

  - selections: Selection []

  #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:138

### UserInbox

- UserInbox(): RouterScenario

- #### Returns RouterScenario

  - Defined in packages/app/src/router.ts:154