// Type definitions for solid-auth-client 2.4 // Project: https://github.com/solid/solid-auth-client#readme // Definitions by: Vincent // James // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 import { EventEmitter } from 'events'; export interface Session { webId: string; } export interface AsyncStorage { getItem(key: string): Promise; setItem(key: string, value: string): Promise; removeItem(key: string): Promise; } interface LoginOptions { callbackUri?: string; popupUri?: string; storage?: Storage | AsyncStorage; } export interface SolidAuthClient extends EventEmitter { fetch(input: RequestInfo, init?: RequestInit): Promise; currentSession(storage?: AsyncStorage): Promise; trackSession(callback: (session?: Session) => void): Promise; stopTrackSession(callback: (session?: Session) => void): void; login(identityProvider: string, options?: LoginOptions): Promise; logout(storage?: AsyncStorage): Promise; popupLogin(params?: LoginOptions): Promise; } declare const instantiated: SolidAuthClient; export default instantiated;