From 8d56340561e5e4ed77791cd0862a1ae4199a12d3 Mon Sep 17 00:00:00 2001 From: Andrea Wyss Date: Mon, 11 Mar 2019 17:41:18 -0700 Subject: [PATCH] add missing definitions to index.d.ts --- index.d.ts | 129 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 74 insertions(+), 55 deletions(-) diff --git a/index.d.ts b/index.d.ts index d3fcddb..2f1a4be 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,68 +1,87 @@ -declare module 'redux-oidc' { - import { UserManager, UserManagerSettings, User } from 'oidc-client'; - import { Map, fromJS } from 'immutable'; - import { Middleware, Store } from 'redux'; - import * as React from 'react'; +declare module "redux-oidc" { + import { 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 BaseAction { + readonly type: string; + } - export interface Action extends BaseAction { - readonly payload?: Payload; - readonly error?: boolean; - } + export interface Action extends BaseAction { + readonly payload?: Payload; + readonly error?: boolean; + } - export interface UserState { - readonly user?: User; - readonly isLoadingUser: 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 interface CallbackComponentProps { + readonly userManager: UserManager; + readonly successCallback: (user: User) => void; + readonly errorCallback?: (error: Error) => void; + readonly route?: string; + } - export class CallbackComponent extends React.Component { } + export class CallbackComponent extends React.Component< + CallbackComponentProps + > {} - export class SignoutCallbackComponent extends React.Component { } + export class SignoutCallbackComponent extends React.Component< + CallbackComponentProps + > {} - export interface OidcProviderProps { - readonly userManager: UserManager; - readonly store: Store; - } + export interface OidcProviderProps { + readonly userManager: UserManager; + readonly store: Store; + } - export class OidcProvider extends React.Component> { } + export class OidcProvider extends React.Component< + OidcProviderProps + > {} - // Components - export function createUserManager(options: UserManagerSettings): UserManager; - export function processSilentRenew(): void; - export function loadUser(store: TStore, userManager: UserManager): Promise; - export function reducer(state: UserState | undefined, action: Action): UserState; - export function immutableReducer(state: Map, action: Action): Map; + // Components + export function createUserManager(options: UserManagerSettings): UserManager; + export function processSilentRenew(): void; + export function loadUser( + store: TStore, + userManager: UserManager + ): Promise; + export function reducer( + state: UserState | undefined, + action: Action + ): UserState; + export function immutableReducer( + state: Map, + action: Action + ): Map; - // 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 USER_SIGNED_OUT: string; + // 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; - export function userFound(): Action; - export function silentRenewError(): Action; - export function sessionTerminated(): BaseAction; - export function userExpiring(): BaseAction; - export function loadingUser(): BaseAction; - export function userSignedOut(): BaseAction; + // Actions + export function userExpired(): BaseAction; + export function redirectSuccess(): Action; + export function userFound(): Action; + export function silentRenewError(): Action; + 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; + export default function createOidcMiddleware( + userManager: UserManager + ): Middleware; }