/// <reference types="lodash" />
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { ApiConfig, Asset, ConfigJSON, EnrichedAsset, EnrichedConfigJSON, EventTouchpoint, PageViewTouchpoint, ParseConfigOptions, PasswordModalConfig, ToastReason } from '@showpad/experience-app-types';
export declare const SDK_VERSION: string;
export declare const onShowpadLibLoaded: () => Promise<boolean>;
/**
 * @typeParam T Generic to completely type your `config.json` structure.
 *
 * Use {@link Label} or one of the {@link Content} interfaces to get maximum
 * type support. See example.
 *
 * @returns the computed config.json from the experience app editor.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * // config.json
 * {
 *   "version": 1,
 *   "labels": {
 *     "labels_sample": ""
 *   },
 *   "contents": {
 *     "contents_sample": {
 *       "type": "asset"
 *     }
 *   }
 * }
 *
 * // main.ts
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * interface ConfigJSON extends Showpad.ConfigJSON {
 *   labels: {
 *     labels_sample: Showpad.Label
 *   }
 *   contents: {
 *     contents_sample: Showpad.ContentAsset
 *   }
 * }
 *
 * const configJSON = await Showpad.parseConfig<ConfigJSON>()
 * ```
 */
export declare const parseConfig: (<T extends ConfigJSON = ConfigJSON>(options?: ParseConfigOptions) => Promise<T>) & import("lodash").MemoizedFunction;
/**
 * Programmatically invoke <a href="https://help.showpad.com/hc/en-us/articles/211957029-Showpad-URL-scheme-requirements" target="_parent">Showpad URLs</a>.
 *
 * @category Offline
 *
 * @param showpadUrl <a href="https://help.showpad.com/hc/en-us/articles/211957029-Showpad-URL-scheme-requirements" target="_parent">https://help.showpad.com/hc/en-us/articles/211957029-Showpad-URL-scheme-requirements</a>.
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const showpadUrl = 'showpad://video'
 *
 * await Showpad.openShowpadUrl(showpadUrl)
 * ```
 */
export declare const openShowpadUrl: (showpadUrl: string) => void;
/**
 * Programmatically open the asset viewer with the passed asset.
 *
 * @category Offline
 *
 * @param useModal Open a file in modal mode. This means it will be
 *                 opened on top of the current context, so closing the file brings
 *                 you back to the original context. The default value is true.
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlug = '648b2eb8-6fa1-40f2-b787-39cb1d51db69'
 *
 * await Showpad.openAssetViewer(assetSlug)
 * ```
 */
export declare const openAssetViewer: (assetSlug: Asset['slug'], useModal?: boolean) => void;
/**
 * Check if the current user is a Showpad Admistrator (or Owner).
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const isAdmin = await Showpad.isAdmin()
 * ```
 */
export declare const isAdmin: (() => Promise<boolean>) & import("lodash").MemoizedFunction;
/**
 * This is a more specific version of {@link trackEvent}, used to track a
 * {@link TrackEventPageView | Page View}. A Page View is the transition of one
 * page to another.
 *
 * This method helps the developer to pass data that will allow future reporting
 * on Page Views.
 * <a href="https://showpad.pages.showpad.io/showpad-js-lib/reference-v11.html#trackevent" target="_parent">See ShowpadJS trackevent</a>.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const event = {
 *   id: '<eventId>',
 *   sourceId: '<sourceId>',
 *   destinationId: '<destinationId>'
 * }
 *
 * await Showpad.trackExperiencePageview(event)
 * ```
 */
export declare const trackExperiencePageview: (touchpoint: PageViewTouchpoint) => void;
/**
 * This is a more specific version of {@link trackEvent}, used to track an
 * {@link TrackEventEvent | Experience Event}. An Experience Event is something
 * that happens in the App: clicking a button, starting a video, ...
 *
 * This method helps the developer to pass data that will allow future reporting
 * on Experience Events.
 * <a href="https://showpad.pages.showpad.io/showpad-js-lib/reference-v11.html#trackevent" target="_parent">See ShowpadJS trackevent</a>.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const event = {
 *   id: '<eventId>',
 *   sourceId: '<sourceId>'
 * }
 *
 * await Showpad.trackExperienceEvent(event)
 * ```
 */
export declare const trackExperienceEvent: (touchpoint: EventTouchpoint) => void;
/**
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * try {
 *  // Faulty code
 * } catch (error) {
 *   Showpad.handleErrorWithToast(error)
 * }
 * ```
 */
export declare const handleErrorWithToast: (error: unknown) => Promise<ToastReason>;
/**
 * Enriches assets with the {@link getAssetFileUrl} and {@link getAssetPreviewUrl} method.
 *
 * @param size The maximum dimension for the width or height of the preview.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assets = [{
 *   "id": "a3e72bbfae0b87381106b1beb685ea88",
 *   "slug": "648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "applink": "showpad://file/648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "name": "sample.pdf",
 *   "displayName": "sample",
 *   "type": "document",
 *   "description": "",
 *   "permissions": {
 *     "share": true,
 *     "download": true,
 *     "annotate": true
 *   },
 *   "tagIds": [
 *     "5debee5405cfd4e2797b553037ceb78c"
 *   ],
 *   "createdAt": "1970-01-19T21:15:07.909Z",
 *   "updatedAt": "1970-01-19T23:24:34.801Z",
 *   "expiresAt": null
 * }]
 *
 * const enrichedAssets = await Showpad.enrichAssets(assets, 400)
 * ```
 */
export declare const enrichAssets: (assets: Asset[], size?: number) => Promise<EnrichedAsset[]>;
/**
 * @typeParam T Generic to completely type your `config.json` structure.
 *
 * Use {@link Label} or one of the {@link Content} interfaces to get maximum
 * type support. See example.
 *
 * @returns the computed `config.json` from the experience app editor,
 *          enriched with the {@link getAssetFileUrl} and {@link getAssetPreviewUrl} method.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * // config.json
 * {
 *   "version": 1,
 *   "labels": {
 *     "labels_sample": ""
 *   },
 *   "contents": {
 *     "contents_sample": {
 *       "type": "asset"
 *     }
 *   }
 * }
 *
 * // main.ts
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * interface ConfigJSON extends Showpad.ConfigJSON {
 *   labels: {
 *     labels_sample: Showpad.Label
 *   }
 *   contents: {
 *     contents_sample: Showpad.ContentAsset
 *   }
 * }
 *
 * const enrichedConfigJSON = await Showpad.parseEnrichedConfig<ConfigJSON>()
 * ```
 */
export declare const parseEnrichedConfig: (<T extends EnrichedConfigJSON = EnrichedConfigJSON>(options?: ParseConfigOptions) => Promise<T>) & import("lodash").MemoizedFunction;
/**
 * This method will refresh the Showpad access token.
 *
 * @returns Object with the required information to do an HTTPrequest to the Showpad API.
 *
 * @param clientId The clientId of the OAuth Client.
 * @param clientSecret The secret of the OAuth Client.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const apiConfig = await Showpad.refreshShowpadOAuthApi(
 *   '<clientId>',
 *   '<clientSecret>',
 * )
 * ```
 */
export declare const refreshShowpadOAuthApi: (clientId: string, clientSecret: string) => Promise<ApiConfig>;
/**
 * @returns Object with the required information to do an HTTP request to the Showpad API.
 *
 * @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.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const apiConfig = await Showpad.getShowpadOAuthApi(
 *   '<clientId>',
 *   '<clientSecret>',
 *   '<allowedEmails>',
 *   '<password>',
 * )
 * ```
 */
export declare const getShowpadOAuthApi: (clientId: string, clientSecret: string, allowedEmails: string[], password: string) => Promise<ApiConfig>;
/**
 * @returns Object with the required information to do an HTTP request to the Showpad API.
 *
 * @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 passwordModalConfig Configuration of the password prompt modal.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const apiConfig = await Showpad.getShowpadOAuthApiInteractive(
 *   '<clientId>',
 *   '<clientSecret>',
 *   '<allowedEmails>',
 *   '<passwordModalConfig>',
 * )
 * ```
 */
export declare const getShowpadOAuthApiInteractive: (clientId: string, clientSecret: string, allowedEmails: string[], passwordModalConfig?: PasswordModalConfig) => Promise<ApiConfig>;
/**
 * @ignore
 */
export declare const requestOnShowpadInstance: <T = any, R = AxiosResponse<T, any>, D = any>(config: AxiosRequestConfig<D>) => Promise<R>;
/**
 * @param size The maximum dimension for the width or height.
 *
 * @returns Raw asset preview (blob).
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const asset = {
 *   "id": "a3e72bbfae0b87381106b1beb685ea88",
 *   "slug": "648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "applink": "showpad://file/648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "name": "sample.pdf",
 *   "displayName": "sample",
 *   "type": "document",
 *   "description": "",
 *   "permissions": {
 *     "share": true,
 *     "download": true,
 *     "annotate": true
 *   },
 *   "tagIds": [
 *     "5debee5405cfd4e2797b553037ceb78c"
 *   ],
 *   "createdAt": "1970-01-19T21:15:07.909Z",
 *   "updatedAt": "1970-01-19T23:24:34.801Z",
 *   "expiresAt": null
 * }
 *
 * const preview = await Showpad.getAssetPreview(asset.id, asset.slug, 400)
 * ```
 */
export declare const getAssetPreview: (assetId: Asset['id'], assetSlug: Asset['slug'], size: number) => Promise<Blob>;
/**
 * @returns Raw asset file (blob).
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const asset = {
 *   "id": "a3e72bbfae0b87381106b1beb685ea88",
 *   "slug": "648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "applink": "showpad://file/648b2eb8-6fa1-40f2-b787-39cb1d51db69",
 *   "name": "sample.pdf",
 *   "displayName": "sample",
 *   "type": "document",
 *   "description": "",
 *   "permissions": {
 *     "share": true,
 *     "download": true,
 *     "annotate": true
 *   },
 *   "tagIds": [
 *     "5debee5405cfd4e2797b553037ceb78c"
 *   ],
 *   "createdAt": "1970-01-19T21:15:07.909Z",
 *   "updatedAt": "1970-01-19T23:24:34.801Z",
 *   "expiresAt": null
 * }
 *
 * const file = await Showpad.getAssetFile(asset.id, asset.slug)
 * ```
 */
export declare const getAssetFile: (assetId: Asset['id'], assetSlug: Asset['slug']) => Promise<Blob>;
