-
Notifications
You must be signed in to change notification settings - Fork 111
/
index.d.ts
95 lines (82 loc) · 2.92 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
declare module "redux-oidc" {
import { SignoutResponse, UserManager, UserManagerSettings, User } from "oidc-client";
import { Map, fromJS } from "immutable";
import { Middleware, Store } from "redux";
import * as React from "react";
export interface BaseAction {
readonly type: string;
}
export interface Action<Payload> extends BaseAction {
readonly payload?: Payload;
readonly error?: boolean;
}
export interface UserState {
readonly user?: User;
readonly isLoadingUser: boolean;
}
export interface CallbackComponentProps {
readonly userManager: UserManager;
readonly successCallback: (user: User) => void;
readonly errorCallback?: (error: Error) => void;
readonly route?: string;
}
export class CallbackComponent extends React.Component<
CallbackComponentProps
> {}
export interface SignoutCallbackComponentProps {
readonly userManager: UserManager;
readonly successCallback: (response: SignoutResponse) => void;
readonly errorCallback?: (error: Error) => void;
readonly route?: string;
}
export class SignoutCallbackComponent extends React.Component<
SignoutCallbackComponentProps
> {}
export interface OidcProviderProps<TSTate> {
readonly userManager: UserManager;
readonly store: Store<TSTate>;
children?: React.ReactNode;
}
export class OidcProvider<TState> extends React.Component<
OidcProviderProps<TState>
> {}
// Components
export function createUserManager(options: UserManagerSettings): UserManager;
export function processSilentRenew(): void;
export function loadUser<TStore>(
store: TStore,
userManager: UserManager
): Promise<User>;
export function reducer(
state: UserState | undefined,
action: Action<User | Error>
): UserState;
export function immutableReducer(
state: Map<string, any>,
action: Action<User | Error>
): Map<string, any>;
// Constants
export const USER_EXPIRED: string;
export const REDIRECT_SUCCESS: string;
export const USER_LOADED: string;
export const SILENT_RENEW_ERROR: string;
export const SESSION_TERMINATED: string;
export const USER_EXPIRING: string;
export const USER_FOUND: string;
export const LOADING_USER: string;
export const LOAD_USER_ERROR: string;
export const USER_SIGNED_OUT: string;
// Actions
export function userExpired(): BaseAction;
export function redirectSuccess(): Action<User>;
export function userFound(user: User): Action<User>;
export function silentRenewError(error: Error): Action<Error>;
export function sessionTerminated(): BaseAction;
export function userExpiring(): BaseAction;
export function loadingUser(): BaseAction;
export function loadUserError(): BaseAction;
export function userSignedOut(): BaseAction;
export default function createOidcMiddleware(
userManager: UserManager
): Middleware;
}