1 |
|
2 | import { EventEmitter } from "events";
|
3 | import { IStorage } from "@inrupt/solid-client-authn-core";
|
4 | import { Session } from "./Session";
|
5 | export interface ISessionManagerOptions {
|
6 | secureStorage?: IStorage;
|
7 | insecureStorage?: IStorage;
|
8 | }
|
9 | export interface ISessionManager {
|
10 | getSession(sessionId?: string): Promise<Session>;
|
11 | }
|
12 | export declare class SessionManager extends EventEmitter implements ISessionManager {
|
13 | private clientAuthn;
|
14 | private sessionRecords;
|
15 | private isInitialized;
|
16 | private handledIncomingRedirect;
|
17 | constructor(options?: ISessionManagerOptions);
|
18 | private init;
|
19 | private addNewSessionRecord;
|
20 | private getSessionFromCurrentSessionInfo;
|
21 | getSessions(): Promise<Session[]>;
|
22 | getSession(sessionId?: string): Promise<Session>;
|
23 | hasSession(sessionId: string): Promise<boolean>;
|
24 | onSessionLogin(callback: (session: Session) => unknown): void;
|
25 | onSessionLogout(callback: (session: Session) => unknown): void;
|
26 | detachSession(sessionId: string): void;
|
27 | handleIncomingRedirect(url: string): Promise<Session | undefined>;
|
28 | }
|