import { Endpoint } from "./common/endpoint"; import { IConstants } from "./model/constants"; import { IUserData } from "./request/connectService/createAccessKey"; export interface IConnectorInstanceOptions { siteUrl: string; } export interface IConnectorState { user: IUserData; config: any; constants: IConstants; } export declare class Connector { /** * Initialize the connector * @param {Object} args * @param {String} args.apiUrl - Full URL to the api end-point. * @param {String} args.username - username to authenticate with. * @param {String} args.password - password. * @returns {Promise}. - a promise that will be resolved once the */ static getConnectorInstance(args: IConnectorInstanceOptions): Promise; readonly siteUrl: string; readonly state: IConnectorState; readonly endpoints: Map; /** * C-tor * @param {Object} args * @param {String} args.apiUrl - Full URL to the api end-point. */ constructor(args?: { siteUrl: string; }); getConstants(): IConstants; /** * Gets the SSO Login URL */ getSSOLoginUrl(callbackUrl: string): string; initializeConnector(): Promise; connectWithAccessKey(accessKey?: string): Promise; connectWithCredentials(username?: string, password?: string): Promise; destroy(): void; private getUserData; private bootstrapConnector; } export declare const getConnectorInstance: typeof Connector.getConnectorInstance; export interface IAttachEndpoint { name: string; getter(connector: Connector): T; } /** * Attach a new endpoint to the connector */ export declare function attachEndpoint({ name, getter }: IAttachEndpoint): void;