@inrupt/solid-client-authn-browser / ISessionEventListener

Interface: ISessionEventListener#

Hierarchy#

  • EventEmitter

    ISessionEventListener

Methods#

[captureRejectionSymbol]#

[captureRejectionSymbol]<K>(error, event, ...args): void

Type parameters#

Name

K

Parameters#

Name

Type

error

Error

event

string | symbol

...args

AnyRest

Returns#

void

Inherited from#

EventEmitter.[captureRejectionSymbol]

Defined in#

node_modules/@types/node/events.d.ts:115


addListener#

addListener(eventName, listener): this

Register a listener called on successful login.

Parameters#

Name

Type

Description

eventName

"login"

The login event name

listener

() => void

The callback called on successful login

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:103

addListener(eventName, listener): this

Register a listener called on successful logout.

Parameters#

Name

Type

Description

eventName

"logout"

The logout event name.

listener

() => void

The callback called on successful logout.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:109

addListener(eventName, listener): this

Register a listener called on session expiration.

Parameters#

Name

Type

Description

eventName

"sessionExpired"

The session expiration event name.

listener

() => void

The callback called on session expiration.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:115

addListener(eventName, listener): this

Register a listener called on session restoration after a silent login.

Parameters#

Name

Type

Description

eventName

"sessionRestore"

The session restoration event name.

listener

(currentUrl: string) => unknown

The callback called on successful session restore.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:121

addListener(eventName, listener): this

Register a listener called on error, with an error identifier and description.

Parameters#

Name

Type

Description

eventName

"error"

The error event name.

listener

(error: null | string, errorDescription?: null | string) => unknown

The callback called on error.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:127

addListener(eventName, listener): this

Register a listener called on session extension.

Parameters#

Name

Type

Description

eventName

"sessionExtended"

The session extension event name.

listener

(expiresIn: number) => void

The callback called on session extension.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:133

addListener(eventName, listener): this

Register a listener called when a timeout is set for a session event with the timeout handle.

Parameters#

Name

Type

Description

eventName

"timeoutSet"

The timeout set event name.

listener

(timeoutId: number) => void

The callback called when setting a timeout.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:140

addListener(eventName, listener): this

Register a listener called when a new refresh token is issued for the session.

Parameters#

Name

Type

Description

eventName

"newRefreshToken"

The new refresh token issued event name.

listener

(newToken: string) => void

The callback called when a new refresh token is issued.

Returns#

this

Overrides#

EventEmitter.addListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:146


eventNames#

eventNames(): (string | symbol)[]

Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

import { EventEmitter } from 'node:events';

const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});

const sym = Symbol('symbol');
myEE.on(sym, () => {});

console.log(myEE.eventNames());
// Prints: [ 'foo', 'bar', Symbol(symbol) ]

Returns#

(string | symbol)[]

Since

v6.0.0

Inherited from#

EventEmitter.eventNames

Defined in#

node_modules/@types/node/events.d.ts:875


getMaxListeners#

getMaxListeners(): number

Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

Returns#

number

Since

v1.0.0

Inherited from#

EventEmitter.getMaxListeners

Defined in#

node_modules/@types/node/events.d.ts:727


listenerCount#

listenerCount<K>(eventName, listener?): number

Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

Type parameters#

Name

K

Parameters#

Name

Type

Description

eventName

string | symbol

The name of the event being listened for

listener?

Function

The event handler function

Returns#

number

Since

v3.2.0

Inherited from#

EventEmitter.listenerCount

Defined in#

node_modules/@types/node/events.d.ts:821


listeners#

listeners<K>(eventName): Function[]

Returns a copy of the array of listeners for the event named eventName.

server.on('connection', (stream) => {
  console.log('someone connected!');
});
console.log(util.inspect(server.listeners('connection')));
// Prints: [ [Function] ]

Type parameters#

Name

K

Parameters#

Name

Type

eventName

string | symbol

Returns#

Function[]

Since

v0.1.26

Inherited from#

EventEmitter.listeners

Defined in#

node_modules/@types/node/events.d.ts:740


off#

off(eventName, listener): this

Unegister a listener called on successful login with the logged in WebID.

Parameters#

Name

Type

Description

eventName

"login"

The login event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:212

off(eventName, listener): this

Unegister a listener called on successful logout.

Parameters#

Name

Type

Description

eventName

"logout"

The logout event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:218

off(eventName, listener): this

Unegister a listener called on session expiration.

Parameters#

Name

Type

Description

eventName

"sessionExpired"

The session expiration event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:224

off(eventName, listener): this

Unegister a listener called on session restoration after a silent login.

Parameters#

Name

Type

Description

eventName

"sessionRestore"

The session restoration event name.

listener

(currentUrl: string) => unknown

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:230

off(eventName, listener): this

Unegister a listener called on error, with an error identifier and description.

Parameters#

Name

Type

Description

eventName

"error"

The error event name.

listener

(error: null | string, errorDescription?: null | string) => unknown

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:236

off(eventName, listener): this

Unegister a listener called on session extension.

Parameters#

Name

Type

Description

eventName

"sessionExtended"

The session extension event name.

listener

(expiresIn: number) => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:242

off(eventName, listener): this

Unegister a listener called when a timeout is set for a session event.

Parameters#

Name

Type

Description

eventName

"timeoutSet"

The timeout set event name.

listener

(timeoutId: number) => void

The callback called when next setting a timeout.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:248

off(eventName, listener): this

Unegister a listener called when a new refresh token is issued.

Parameters#

Name

Type

Description

eventName

"newRefreshToken"

The new refresh token issued event name.

listener

(newToken: string) => void

The callback called next time a new refresh token is issued.

Returns#

this

Overrides#

EventEmitter.off

Defined in#

packages/core/dist/SessionEventListener.d.ts:254


on#

on(eventName, listener): this

Register a listener called on successful login.

Parameters#

Name

Type

Description

eventName

"login"

The login event name

listener

() => void

The callback called on successful login

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:49

on(eventName, listener): this

Register a listener called on successful logout.

Parameters#

Name

Type

Description

eventName

"logout"

The logout event name.

listener

() => void

The callback called on successful logout.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:55

on(eventName, listener): this

Register a listener called on session expiration.

Parameters#

Name

Type

Description

eventName

"sessionExpired"

The session expiration event name.

listener

() => void

The callback called on session expiration.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:61

on(eventName, listener): this

Register a listener called on session restoration after a silent login.

Parameters#

Name

Type

Description

eventName

"sessionRestore"

The session restoration event name.

listener

(currentUrl: string) => unknown

The callback called on successful session restore.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:67

on(eventName, listener): this

Register a listener called on error, with an error identifier and description.

Parameters#

Name

Type

Description

eventName

"error"

The error event name.

listener

(error: null | string, errorDescription?: null | string) => unknown

The callback called on error.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:73

on(eventName, listener): this

Register a listener called on session extension.

Parameters#

Name

Type

Description

eventName

"sessionExtended"

The session extension event name.

listener

(expiresIn: number) => void

The callback called on session extension.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:79

on(eventName, listener): this

Register a listener called when a timeout is set for a session event with the timeout handle.

Parameters#

Name

Type

Description

eventName

"timeoutSet"

The timeout set event name.

listener

(timeoutId: number) => void

The callback called when setting a timeout.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:86

on(eventName, listener): this

Register a listener called when a new refresh token is issued for the session.

Parameters#

Name

Type

Description

eventName

"newRefreshToken"

The new refresh token issued event name.

listener

(newToken: string) => void

The callback called when a new refresh token is issued.

Returns#

this

Overrides#

EventEmitter.on

Defined in#

packages/core/dist/SessionEventListener.d.ts:92


once#

once(eventName, listener): this

Register a listener called on the next successful login with the logged in WebID.

Parameters#

Name

Type

Description

eventName

"login"

The login event name.

listener

() => void

The callback called on the next successful login.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:157

once(eventName, listener): this

Register a listener called on the next successful logout.

Parameters#

Name

Type

Description

eventName

"logout"

The logout event name.

listener

() => void

The callback called on the next successful logout.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:163

once(eventName, listener): this

Register a listener called on the next session expiration.

Parameters#

Name

Type

Description

eventName

"sessionExpired"

The session expiration event name.

listener

() => void

The callback called on the next session expiration.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:169

once(eventName, listener): this

Register a listener called on the next session restoration after a silent login.

Parameters#

Name

Type

Description

eventName

"sessionRestore"

The session restoration event name.

listener

(currentUrl: string) => unknown

The callback called on the next successful session restore.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:175

once(eventName, listener): this

Register a listener called on the next error, with an error identifier and description.

Parameters#

Name

Type

Description

eventName

"error"

The error event name.

listener

(error: null | string, errorDescription?: null | string) => unknown

The callback called on the next error.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:181

once(eventName, listener): this

Register a listener called on the next session extension.

Parameters#

Name

Type

Description

eventName

"sessionExtended"

The session extension event name.

listener

(expiresIn: number) => void

The callback called on the next session extension.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:187

once(eventName, listener): this

Register a listener called the next time a timeout is set for a session event with the timeout handle.

Parameters#

Name

Type

Description

eventName

"timeoutSet"

The timeout set event name.

listener

(timeoutId: number) => void

The callback called when next setting a timeout.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:194

once(eventName, listener): this

Register a listener called the next time a new refresh token is issued for the session.

Parameters#

Name

Type

Description

eventName

"newRefreshToken"

The new refresh token issued event name.

listener

(newToken: string) => void

The callback called next time a new refresh token is issued.

Returns#

this

Overrides#

EventEmitter.once

Defined in#

packages/core/dist/SessionEventListener.d.ts:201


prependListener#

prependListener<K>(eventName, listener): this

Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

server.prependListener('connection', (stream) => {
  console.log('someone connected!');
});

Returns a reference to the EventEmitter, so that calls can be chained.

Type parameters#

Name

K

Parameters#

Name

Type

Description

eventName

string | symbol

The name of the event.

listener

(…args: any[]) => void

The callback function

Returns#

this

Since

v6.0.0

Inherited from#

EventEmitter.prependListener

Defined in#

node_modules/@types/node/events.d.ts:839


prependOnceListener#

prependOnceListener<K>(eventName, listener): this

Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

server.prependOnceListener('connection', (stream) => {
  console.log('Ah, we have our first user!');
});

Returns a reference to the EventEmitter, so that calls can be chained.

Type parameters#

Name

K

Parameters#

Name

Type

Description

eventName

string | symbol

The name of the event.

listener

(…args: any[]) => void

The callback function

Returns#

this

Since

v6.0.0

Inherited from#

EventEmitter.prependOnceListener

Defined in#

node_modules/@types/node/events.d.ts:855


rawListeners#

rawListeners<K>(eventName): Function[]

Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

import { EventEmitter } from 'node:events';
const emitter = new EventEmitter();
emitter.once('log', () => console.log('log once'));

// Returns a new Array with a function `onceWrapper` which has a property
// `listener` which contains the original listener bound above
const listeners = emitter.rawListeners('log');
const logFnWrapper = listeners[0];

// Logs "log once" to the console and does not unbind the `once` event
logFnWrapper.listener();

// Logs "log once" to the console and removes the listener
logFnWrapper();

emitter.on('log', () => console.log('log persistently'));
// Will return a new Array with a single function bound by `.on()` above
const newListeners = emitter.rawListeners('log');

// Logs "log persistently" twice
newListeners[0]();
emitter.emit('log');

Type parameters#

Name

K

Parameters#

Name

Type

eventName

string | symbol

Returns#

Function[]

Since

v9.4.0

Inherited from#

EventEmitter.rawListeners

Defined in#

node_modules/@types/node/events.d.ts:771


removeAllListeners#

removeAllListeners(eventName?): this

Removes all listeners, or those of the specified eventName.

It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters#

Name

Type

eventName?

string | symbol

Returns#

this

Since

v0.1.26

Inherited from#

EventEmitter.removeAllListeners

Defined in#

node_modules/@types/node/events.d.ts:711


removeListener#

removeListener(eventName, listener): this

Unegister a listener called on successful login with the logged in WebID.

Parameters#

Name

Type

Description

eventName

"login"

The login event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:265

removeListener(eventName, listener): this

Unegister a listener called on successful logout.

Parameters#

Name

Type

Description

eventName

"logout"

The logout event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:271

removeListener(eventName, listener): this

Unegister a listener called on session expiration.

Parameters#

Name

Type

Description

eventName

"sessionExpired"

The session expiration event name.

listener

() => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:277

removeListener(eventName, listener): this

Unegister a listener called on session restoration after a silent login.

Parameters#

Name

Type

Description

eventName

"sessionRestore"

The session restoration event name.

listener

(currentUrl: string) => unknown

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:283

removeListener(eventName, listener): this

Unegister a listener called on error, with an error identifier and description.

Parameters#

Name

Type

Description

eventName

"error"

The error event name.

listener

(error: null | string, errorDescription?: null | string) => unknown

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:289

removeListener(eventName, listener): this

Unegister a listener called on session extension.

Parameters#

Name

Type

Description

eventName

"sessionExtended"

The session extension event name.

listener

(expiresIn: number) => void

The callback to unregister.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:295

removeListener(eventName, listener): this

Unegister a listener called when a timeout is set for a session event.

Parameters#

Name

Type

Description

eventName

"timeoutSet"

The timeout set event name.

listener

(timeoutId: number) => void

The callback called when next setting a timeout.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:301

removeListener(eventName, listener): this

Unegister a listener called when a new refresh token is issued.

Parameters#

Name

Type

Description

eventName

"newRefreshToken"

The new refresh token issued event name.

listener

(newToken: string) => void

The callback called next time a new refresh token is issued.

Returns#

this

Overrides#

EventEmitter.removeListener

Defined in#

packages/core/dist/SessionEventListener.d.ts:307


setMaxListeners#

setMaxListeners(n): this

By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

Returns a reference to the EventEmitter, so that calls can be chained.

Parameters#

Name

Type

n

number

Returns#

this

Since

v0.3.5

Inherited from#

EventEmitter.setMaxListeners

Defined in#

node_modules/@types/node/events.d.ts:721