import { AxiosInstance } from 'axios';
import { ApiConfig, PasswordModalConfig } from '@showpad/experience-app-types';
import { ShowpadApi } from '../../utils';
/**
 * @param name API name.
 *
 * @param getApi Async function to get the apiConfig.
 *
 * @param refreshApi Async function to refresh apiConfig.
 *
 * @param proxyUrl Reverse proxy your api requests to bypass CORS issues. We
 *                 recommend to use <a href="https://github.com/Rob--W/cors-anywhere" target="_parent">https://github.com/Rob--W/cors-anywhere</a>.
 *                 Pass the hosted url like this: <a href="https://cors-anywhere.herokuapp.com/" target="_parent">https://cors-anywhere.herokuapp.com/</a>
 *                 (with trailing slash).
 *
 * @param customToken The axios instance uses the {@link getShowpadApi} and
 *                    {@link refreshShowpadApi} accessToken by default, pass
 *                    customToken if you want to override this.
 *
 * @returns Axios instance to perform API requests. Instance takes care of
 *          authorization & refreshing access tokens.
 *
 * @category Online
 */
export declare const getApiInstance: (name: string, getApi: () => Promise<ApiConfig>, refreshApi: () => Promise<ApiConfig>, proxyUrl?: string) => Promise<AxiosInstance>;
/**
 * @param proxyUrl Reverse proxy your salesforce requests to bypass CORS issues.
 *                 We recommend to use <a href="https://github.com/Rob--W/cors-anywhere" target="_parent">https://github.com/Rob--W/cors-anywhere</a>.
 *                 Pass the hosted url like this: <a href="https://cors-anywhere.herokuapp.com/" target="_parent">https://cors-anywhere.herokuapp.com/</a>
 *                 (with trailing slash).
 *
 * @returns Axios instance to perform API requests. Instance takes care of
 *          authorization & refreshing access tokens.
 *
 * @support [Web] A Salesforce login popup opens when required. Some browsers
 *          might block the popup, which leads to the promise never resolving
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * type SalesforceType = 'Account' | 'Contact'
 *
 * interface SalesforceAttributes {
 *   type: SalesforceType
 *   url: string
 * }
 *
 * interface SalesforceObject {
 *   Id: string
 *   Name: string
 *   attributes: SalesforceAttributes
 * }
 *
 * interface SalesforceContact extends SalesforceObject {
 *   Email: string
 *   Account: {
 *     Name: string
 *     attributes: SalesforceAttributes
 *   }
 * }
 *
 * interface SalesforceSOQLResponse<T extends SalesforceObject> {
 *   done: boolean
 *   records: T[]
 *   totalSize: number
 * }
 *
 * const query = 'SELECT Id, Name, Email, Account.Name FROM Contact'
 * const salesforceApi = await Showpad.getSalesforceInstance('https://cors-anywhere.herokuapp.com/')
 *
 * const contactsResponse = await salesforceApi.get<SalesforceSOQLResponse<SalesforceContact>>(`/services/data/v51.0/query?q=${query}`)
 * const contacts = contactsResponse.data.records
 * ```
 */
export declare const getSalesforceInstance: (proxyUrl?: string) => Promise<AxiosInstance>;
/**
 * @param api The axios instance uses the {@link getShowpadApi} and
 *            {@link refreshShowpadApi} domain as baseURL, pass api if you want
 *            to use the baseURL of the corresponding api.
 *
 * @param customToken The axios instance uses the {@link getShowpadApi} and
 *                    {@link refreshShowpadApi} accessToken by default, pass
 *                    customToken if you want to override this.
 *
 * @returns Axios instance to perform API requests. Instance takes care of
 *          authorization & refreshing access tokens.
 *
 * @support [Android] Android uses the `showpad://` URL scheme in the file URL of an asset.
 *          getShowpadInstance uses Axios, which currently not allows custom protocols:
 *          <a href="https://github.com/axios/axios/issues/4901" target="_parent">https://github.com/axios/axios/issues/4901</a>.
 *          Use other HTTP methods to fetch the raw asset on Android.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const showpadApi = await Showpad.getShowpadInstance('v3')
 *
 * const userInfoResponse = await showpadApi.get('users/me.json')
 * const userInfo = userInfoResponse.data
 * ```
 */
export declare const getShowpadInstance: (api?: ShowpadApi, customToken?: string) => Promise<AxiosInstance>;
/**
 * @param clientId The clientId of the OAuth Client.
 *
 * @param clientSecret The secret of the OAuth Client.
 *
 * @param allowedEmails Array of email addresses that are allowed to use the
 *                      OAuth Client. An empty array will allow ALL users to
 *                      use the OAuth Client so be careful.
 *
 * @param password The password of the current user.
 *
 * @param api The axios instance uses the {@link getShowpadApi} and
 *            {@link refreshShowpadApi} domain as baseURL, pass api if you want
 *            to use the baseURL of the corresponding api.
 *
 * @returns Axios instance to perform API requests with elevated permissions.
 *          Instance takes care of authorization & refreshing access tokens.
 *
 * @support [Android] Android uses the `showpad://` URL scheme in the file URL of an asset.
 *          getShowpadInstance uses Axios, which currently not allows custom protocols:
 *          <a href="https://github.com/axios/axios/issues/4901" target="_parent">https://github.com/axios/axios/issues/4901</a>.
 *          Use other HTTP methods to fetch the raw asset on Android.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const showpadApi = await Showpad.getShowpadOAuthInstance(
 *   '<clientId>',
 *   '<clientSecret>',
 *   '<allowedEmails>',
 *   '<password>',
 *   'v3'
 * )
 *
 * await showpadApi.post('appsdb/stores/<storeId>')
 * ```
 */
export declare const getShowpadOAuthInstance: (clientId: string, clientSecret: string, allowedEmails: string[], password: string, api?: ShowpadApi) => Promise<AxiosInstance>;
/**
 * @param clientId The clientId of the OAuth Client.
 *
 * @param clientSecret The secret of the OAuth Client.
 *
 * @param allowedEmails Array of email addresses that are allowed to use the
 *                      OAuth Client. An empty array will allow ALL users to
 *                      use the OAuth Client so be careful.
 *
 * @param api The axios instance uses the {@link getShowpadApi} and
 *            {@link refreshShowpadApi} domain as baseURL, pass api if you want
 *            to use the baseURL of the corresponding api.
 *
 * @returns Axios instance to perform API requests with elevated permissions.
 *          Instance takes care of authorization & refreshing access tokens.
 *
 * @support [Android] Android uses the `showpad://` URL scheme in the file URL of an asset.
 *          getShowpadInstance uses Axios, which currently not allows custom protocols:
 *          <a href="https://github.com/axios/axios/issues/4901" target="_parent">https://github.com/axios/axios/issues/4901</a>.
 *          Use other HTTP methods to fetch the raw asset on Android.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const showpadApi = await Showpad.getShowpadOAuthInstanceInteractive(
 *   '<clientId>',
 *   '<clientSecret>',
 *   '<allowedEmails>',
 *   'v3'
 * )
 *
 * await showpadApi.post('appsdb/stores/<storeId>')
 * ```
 */
export declare const getShowpadOAuthInstanceInteractive: (clientId: string, clientSecret: string, allowedEmails: string[], api?: ShowpadApi, passwordModalConfig?: PasswordModalConfig) => Promise<AxiosInstance>;
