/// <reference types="lodash" />
import { AnyEvent, ApiConfig, Asset, Collection, DeviceInfo, Feature, Modal, ModalReason, ShareResult, ShareType, SharedSpace, StatusEmitter, Toast, ToastReason, UploadData, UserInfo } from '@showpad/experience-app-types';
/**
 * @returns Version of the ShowpadJS integration.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const version = await Showpad.getVersion()
 * ```
 */
export declare const getVersion: (() => Promise<number>) & import("lodash").MemoizedFunction;
/**
 * @returns Information of the active user.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const userInfo = await Showpad.getUserInfo()
 * ```
 */
export declare const getUserInfo: (() => Promise<UserInfo>) & import("lodash").MemoizedFunction;
/**
 * @returns Information of the current device.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const deviceInfo = await Showpad.getDeviceInfo()
 * ```
 */
export declare const getDeviceInfo: (() => Promise<DeviceInfo>) & import("lodash").MemoizedFunction;
/**
 * Use this method to know if a specific feature is supported on the app your content is running in.
 * All supported methods already use the hasFeature internally.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const hasCollections = await Showpad.hasFeature('collections')
 * ```
 */
export declare const hasFeature: ((feature: Feature) => Promise<boolean>) & import("lodash").MemoizedFunction;
/**
 * Track an event in your Experience App. This is used to track how conversations
 * are happening within the experience.
 *
 * The method accepts a single event or an array of events. The order of the
 * array is the order they are tracked in.
 *
 * Use the more specific {@link trackExperiencePageview} and {@link trackExperienceEvent}
 * following our <a href="https://showpad.pages.showpad.io/showpad-js-lib/reference-v11.html#trackevent" target="_parent">proposed scheme</a>
 * for future reporting support.
 *
 * Currently, the events aren't visualized in the Online-Platform but can be exported
 * through Showpad's <a href="https://developer.showpad.com/docs/apis/references/v3#/operations/get_exports_events" target="_parent">Content Reporting/Exports API</a> or
 * <a href="https://developer.showpad.com/docs/apps/bonus/powertools#analytics-export" target="_parent">Powertools</a>.
 *
 * Events logged with this method end up in de events table with type
 * <a href="https://developer.showpad.com/docs/apis/reporting/content-reporting/event-types#showpad-app--experience" target="_parent">experience-tracked-event</a>
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const event = {
 *   id: '<eventId>',
 *   sourceId: '<sourceId>',
 *   destinationId: '<destinationId>'
 * }
 *
 * await Showpad.trackEvent(event)
 * ```
 */
export declare const trackEvent: (event: AnyEvent | AnyEvent[]) => void;
/**
 * Shows a modal view to share contents. The provided assets will be added so they can be shared.
 *
 * @param type The type of the modal is either email or link.
 *
 * @returns If some of the assets are not shareable (expired, deleted, unshareable, …),
 * the modal will still be shown, but the callback function will be called with result partial.
 *
 * In this case, the Showpad client will show a warning message to the user that some content cannot be shared.
 *
 * If none of the provided assets can be shared, a warning will be shown, but no sharing modal will be displayed and the result will be error.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const shareResult = await Showpad.share('email', assetSlugs)
 * ```
 */
export declare const share: (type: ShareType, assetSlugs: Asset['slug'][]) => Promise<ShareResult>;
/**
 * @param size The maximum dimension for the width or height.
 *
 * @returns A URL to download the file preview. This URL can be used within the Showpad apps without authentication. If called outside of the Showpad context, authentication will need to be added manually (eg. by calling getShowpadApi).
 *
 * @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 previewUrl = await Showpad.getAssetPreviewUrl(asset.id, asset.slug, 400)
 * ```
 */
export declare const getAssetPreviewUrl: (assetId: Asset['id'], assetSlug: Asset['slug'], size: number) => Promise<string>;
/**
 * @returns A URL to download the full file. This URL can be used within the Showpad apps without authentication. If called outside of the Showpad context, authentication will need to be added manually (eg. by calling getShowpadApi).
 *
 * @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 fileUrl = await Showpad.getAssetFileUrl(asset.id, asset.slug)
 * ```
 */
export declare const getAssetFileUrl: (assetId: Asset['id'], assetSlug: Asset['slug']) => Promise<string>;
/**
 * @returns List of assets that have all the given tags (AND).
 * (Loop over each tag serially with this method to get the OR result.)
 *
 * This method interprets equally named local and global tags as two tags,
 * so the filtered result only contains assets containing both the local and the global tag.
 *
 * Use only global tags if you're experiencing this issue.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const tags = ['pdf', 'sample']
 *
 * const assets = await Showpad.getAssetsByTags(tags)
 * ```
 */
export declare const getAssetsByTags: (tags: string[]) => Promise<Asset[]>;
/**
 * @param folder The last part of the folder app link, eg. xyz2250 in `showpad://folder/xyz2250`.
 * Also accepts the folder app link for convenience (See example code).
 *
 * You can assign folders through the experience app editor <a href="https://showpad.pages.showpad.io/public-sdk/experience_app_editor.html" target="_parent">(https://showpad.pages.showpad.io/public-sdk/experience_app_editor.html)</a>.
 *
 * @returns List of assets that can be found in the given folder. This will not work recursively and will only return actual assets.
 * So it does not return values from deeper levels nor will it return folders.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const folder = 'showpad://folder/1' // Or you can also just pass '1' as a string
 *
 * const assets = await Showpad.getAssetsInFolder(folder)
 * ```
 */
export declare const getAssetsInFolder: (folder: string) => Promise<Asset[]>;
/**
 * @param query A string we'll look for in the asset displayName.
 *
 * Internally, this will translate to `WHERE displayName LIKE "%query%"`.
 *
 * @returns List of assets that match with the given query.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const query = 'sample'
 *
 * const assets = await Showpad.getAssetsByQuery(query)
 * ```
 */
export declare const getAssetsByQuery: (query: string) => Promise<Asset[]>;
/**
 * @returns List of collections
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const collections = await Showpad.getCollections()
 * ```
 */
export declare const getCollections: () => Promise<Collection[]>;
/**
 * Shows a modal view with the contents of the collection. This view allows for the collection to be shared.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const collection = {
 *   "id": "c3e2a7a48eea0209af74c0d45e616da6",
 *   "name": "Sample"
 * }
 *
 * await Showpad.openCollection(collection.id)
 * ```
 */
export declare const openCollection: (collectionId: Collection['id']) => Promise<void>;
/**
 * Creates a new collection with the specified name.
 *
 * @returns Id of the new collection the assets were added to.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const collectionId = await Showpad.createCollection('Sample')
 * ```
 */
export declare const createCollection: (name: Collection['name']) => Promise<Collection['id']>;
/**
 * Opens a modal with all collections to choose from and adds asset(s) to it.
 *
 * @returns Id of the collection the assets were added to.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const collectionId = await Showpad.addAssetsToCollection(assetSlugs)
 * ```
 */
export declare const addAssetsToCollection: (assetSlugs: Asset['slug'][]) => Promise<Collection['id']>;
/**
 * Opens modal with all Collections to choose from and adds asset(s) to the selected ones.
 *
 * Multiple Collections can be picked at once if enabled.
 *
 * @returns Ids of the collections the assets were added to.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const collectionIds = await Showpad.addAssetsToCollections(assetSlugs)
 * ```
 */
export declare const addAssetsToCollections: (assetSlugs: Asset['slug'][]) => Promise<Collection['id'][]>;
/**
 * Adds assets to a collection with the given id.
 *
 * @returns Id of the collection the assets were added to.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const collection = {
 *   "id": "c3e2a7a48eea0209af74c0d45e616da6",
 *   "name": "Sample"
 * }
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const collectionId = await Showpad.addAssetsToCollectionWithId(collection.id, assetSlugs)
 * ```
 */
export declare const addAssetsToCollectionWithId: (collectionId: Collection['id'], assetSlugs: Asset['slug'][]) => Promise<Collection['id']>;
/**
 * Removes all items from the given collection.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const collection = {
 *   "id": "c3e2a7a48eea0209af74c0d45e616da6",
 *   "name": "Sample"
 * }
 *
 * await Showpad.clearCollection(collection.id)
 * ```
 */
export declare const clearCollection: (collectionId: Collection['id']) => Promise<void>;
/**
 * Opens a modal which prompts the user to select the Shared Space to add the assets to.
 *
 * @returns Id of the shared space the assets were added to.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const sharedSpaceId = await Showpad.addAssetsToSharedSpace(assetSlugs)
 * ```
 */
export declare const addAssetsToSharedSpace: (assetSlugs: Asset['slug'][]) => Promise<SharedSpace['id']>;
/**
 * Opens modal with defined Assets to choose from and adds asset(s) to the current context
 * (i.e. the feature the user is currently in, could be a Shared Space, a Collection, My Files, ...).
 *
 * @returns Slugs of the assets that were added.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const assetSlugsAdded = await Showpad.addAssetsToCurrentContext(assetSlugs)
 * ```
 */
export declare const addAssetsToCurrentContext: (assetSlugs: Asset['slug'][]) => Promise<Asset['slug'][]>;
/**
 * Use this method to close the current extension.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * await Showpad.closeExtension()
 * ```
 */
export declare const closeExtension: () => void;
/**
 * Opens a modal with all Shared Spaces to choose from and adds asset(s) to the selected Shared Spaces.
 *
 * @returns Ids of the shared space the assets were added to.
 *
 * @category Online
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const assetSlugs = ['648b2eb8-6fa1-40f2-b787-39cb1d51db69']
 *
 * const sharedSpaceIds = await Showpad.addAssetsToSharedSpaces(assetSlugs)
 * ```
 */
export declare const addAssetsToSharedSpaces: (assetSlugs: Asset['slug'][]) => Promise<SharedSpace['id'][]>;
/**
 * @returns Object with the required information (token, ...) to do an HTTP
 * request to the Showpad API.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const apiConfig = await Showpad.getShowpadApi()
 * ```
 */
export declare const getShowpadApi: () => Promise<ApiConfig>;
/**
 * Refreshes the Showpad access token.
 *
 * @returns Object with the required information to do an HTTP request to the Showpad API.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const apiConfig = await Showpad.refreshShowpadApi()
 * ```
 */
export declare const refreshShowpadApi: () => Promise<ApiConfig>;
/**
 * @returns Object with the required information to do an HTTP request to the Salesforce API.
 *
 * @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'
 *
 * const apiConfig = await Showpad.getSalesforceApi()
 * ```
 */
export declare const getSalesforceApi: () => Promise<ApiConfig>;
/**
 * Refreshes the Salesforce access token.
 *
 * @returns Object with the required information to do an HTTP request to the Showpad API.
 *
 * @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'
 *
 * const apiConfig = await Showpad.refreshSalesforceApi()
 * ```
 */
export declare const refreshSalesforceApi: () => Promise<ApiConfig>;
/**
 * Uploads a single file to “My files”.
 *
 * @returns statusEmitter which emits the upload status.
 *
 * @support [Windows] Only online support.
 *
 * @support [iOS, Android] Will fire the failed event offline. The expected behavior
 *          indicates that the upload can't be done at the moment because there
 *          is no internet connection. If you switch to the "My Files" tab, you
 *          will see the uploaded items with the "failed" label. Once the app
 *          re-establish a connection, the file will be uploaded and processed.
 *
 * @category Offline
 *
 * @example
 *```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 * import { PDFDocument } from 'pdf-lib'
 *
 * const filename = 'experience-app-test.pdf'
 *
 * const pdfDoc = await PDFDocument.create()
 * const page = pdfDoc.addPage()
 *
 * page.drawText('Experience App Test')
 *
 * const pdfBytes = await pdfDoc.save()
 * const file = new Blob([pdfBytes], { type: 'application/pdf' })
 *
 * const uploadData: Showpad.UploadData = {
 *   file,
 *   filename,
 * }
 *
 * const emitter = await Showpad.upload(uploadData)
 *
 * emitter.on('queued', async () => {
 *   console.log('queued')
 * })
 *
 * emitter.on('uploading', (result: Showpad.UploadProgress) => {
 *   console.log(result)
 * })
 *
 * emitter.on('processing', () => {
 *   console.log('processing')
 * })
 *
 * emitter.on('success', ({ asset: result }: { asset: Showpad.Asset }) => {
 *   console.log(result)
 * })
 *
 * emitter.on('failed', (result: Showpad.UploadError) => {
 *   console.log(result)
 * })
 * ```
 */
export declare const upload: (uploadData: UploadData) => Promise<StatusEmitter>;
/**
 * Displays a native modal with a title, text and clickable buttons.
 *
 * @returns Reason the dialog was closed. This is either a reason from the
 * passed ModalButtons or "cancel" if the user closed the dialog.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const modal = {
 *   title: 'Sample',
 *   text: 'This is a sample modal',
 *   buttons: [
 *     {
 *       reason: 'cancel'
 *       text: 'Cancel',
 *       tinted: false
 *     },
 *     {
 *       reason: 'ok'
 *       text: 'Ok',
 *       tinted: true
 *     },
 *   ]
 * }
 *
 * const modalReason = await Showpad.displayModal(modal)
 * ```
 */
export declare const displayModal: (modal: Modal) => Promise<ModalReason>;
/**
 * Display a native toast.
 *
 * @category Offline
 *
 * @example
 * ```typescript
 * import { Showpad } from '@showpad/experience-app-sdk'
 *
 * const toast = {
 *   type: 'info',
 *   text: 'This is a sample toast',
 *   actionText: 'dismiss'
 * }
 *
 * const toastReason = await Showpad.displayToast(toast)
 * ```
 */
export declare const displayToast: (toast: Toast) => Promise<ToastReason>;
