import Hooks from "../models/Hooks"; import { WidgetOptions, WidgetOktaAuthConstructor, WidgetOktaAuthInterface, RenderSuccessCallback, RenderErrorCallback, RenderResult, RenderOptions, HookFunction, EventCallback, EventCallbackWithError, EventName, RouterClassFactory, AbstractRouter, RouterConstructor, OktaData } from '../types'; import { Tokens } from '@okta/okta-auth-js'; declare global { interface Window { oktaData?: OktaData; } } export declare function createOktaSignIn(authClientConstructor: WidgetOktaAuthConstructor, routerClassFactory: RouterClassFactory): { new (options: WidgetOptions): { Router: RouterConstructor; options: WidgetOptions; hooks: Hooks; router: AbstractRouter; authClient: WidgetOktaAuthInterface; _eventCallbackMap: WeakMap; /** * Render the sign in widget to an element. Returns a promise that will resolve on success or reject on error. * @param options - options for the signin widget. * Must have an el or $el property to render the widget to. * @param success - success callback function * @param error - error callback function */ renderEl(renderOptions: RenderOptions, successFn?: RenderSuccessCallback, errorFn?: RenderErrorCallback): Promise; hide(): void; show(): void; remove(): void; /** * Renders the Widget and returns a promise that resolves to OAuth tokens * @param options - options for the signin widget */ showSignInToGetTokens(options?: RenderOptions): Promise; /** * Renders the widget and redirects to the OAuth callback * @param options - options for the signin widget */ showSignInAndRedirect(options?: RenderOptions): Promise; /** * Renders the widget. Either resolves the returned promise, or redirects. * @param options - options for the signin widget */ showSignIn(options?: RenderOptions): Promise; before(formName: string, callbackFn: HookFunction): void; after(formName: string, callbackFn: HookFunction): void; getUser(): any; on(event: EventName, callback: EventCallback | EventCallbackWithError): void; off(event?: EventName, callback?: EventCallback | EventCallbackWithError): void; once(event: EventName, callback: EventCallback): void; stopListening(event?: EventName, callback?: EventCallback): void; listenTo(object: any, event: EventName, callback: EventCallback): void; trigger(event: EventName, ...args: any[]): void; }; }; //# sourceMappingURL=OktaSignIn.d.ts.map