import NativeEvents from '../../utils/NativeEvents'; import type { UnsubscribeFunction } from '../conference/models'; import { FileConvertedEventType, FilePresentationChangedEventType, FilePresentationServiceEventNames } from './events'; import type { FileConverted, File, FilePresentation } from './models'; /** * The FilePresentationService allows presenting files during a conference. The Dolby.io Communications APIs service converts provided files into multiple images that are accessible through the [getImage](#getimage) method. * * **The file presentation workflow:** * * **1.** The presenter calls the [convert](#convert) method to upload and convert a file. * * **2.** The presenter receives [information](doc:rn-client-sdk-models-fileconverted) about the converted file via the [onFileConverted](#onfileconverted) listener. * * **3.** The presenter calls the [start](#start) method to start presenting the file. * * **4.** The presenter and the viewers receive [information](doc:rn-client-sdk-models-filepresentation) about the shared file via the [onFilePresentationChange](#onfilepresentationchange) listener. This information should trigger calling the [getImage](#getimage) method to get the converted file images URLs and display the proper page of the file by retrieving the individual images. * * **5.** The application is responsible for coordinating the page flip between the local and the presented files. The presenter calls the [update](#update) method to inform the service to send the updated page number to participants. * * **7.** The presenter and viewers receive [information](doc:rn-client-sdk-models-filepresentation) about the updated file via the [onFilePresentationChange](#onfilepresentationchange) listener with the current page number. This information should trigger calling the [image](#image) method to display the proper page of the file. * * **8.** The presenter may call the [getThumbnail](#getthumbnail) method to obtain thumbnail images of the file and implement a carousel control for the presenting user to flip pages locally. * * **9.** The presenter calls the [stop](#stop) method to end the file presentation. * * **10.** The presenter and the viewers receive [information](doc:rn-client-sdk-models-filepresentation) about the end of the file presentation via the [onFilePresentationChange](#onfilepresentationchange) listener. * */ export declare class FilePresentationService { /** @internal */ _nativeModule: any; /** @internal */ _nativeEvents: NativeEvents; /** * Converts a provided file into multiple images. The file is uploaded as FormData. * * The supported file formats are: * - doc/docx (Microsoft Word) * - ppt/pptx * - pdf * * After the conversion, the files are broken into individual images with a maximum resolution of 2560x1600. * * When a file is converted and ready to be presented, the application receives the [converted](#converted) event. * @param file The file that a presenter wants to share during a conference. */ convert(file: File): Promise; /** * Returns information about the current state of the file presentation. */ getCurrent(): Promise; /** * Provides the image's URL that refers to a specific page of the presented file. * @param page The number of the presented page. Files that do not have any pages, for example, jpg images, require setting the page value to 0. */ getImage(page: number): Promise; /** * Provides the URL of a thumbnail that refers to a specific page of the presented file. * @param page The number of the presented page. Files that do not contain any pages, for example, jpg images, require setting the value of this parameter to 0. */ getThumbnail(page: number): Promise; /** * Informs the service to send the updated page number to conference participants. * @param page The page number that corresponds to the required page. */ setPage(page: number): Promise; /** * Starts a file presentation. * @param file The converted file that the presenter wants to share during the conference. */ start(file: FileConverted): Promise; /** * Stops a file presentation. */ stop(): Promise; /** * Adds a listener to the file converted event. * @param handler An event callback function. * @returns A function that unsubscribes from event listeners. */ onFileConverted(handler: (data: FileConvertedEventType) => void): UnsubscribeFunction; /** * Adds a listener to the file presentation changed event. * @param handler An event callback function. * @returns A function that unsubscribes from event listeners. */ onFilePresentationChange(handler: (data: FilePresentationChangedEventType, type?: FilePresentationServiceEventNames.FilePresentationStarted | FilePresentationServiceEventNames.FilePresentationStopped | FilePresentationServiceEventNames.FilePresentationUpdated) => void): UnsubscribeFunction; } declare const _default: FilePresentationService; export default _default;