dop-sdk
Version:
Mini App SDK for JavaScript by VTB
33 lines (32 loc) • 1.13 kB
TypeScript
import { MiniAppError } from '../types/error-types';
/**
* Interfaces to communicate with the Host application for gallery-related operations.
*/
export interface GalleryBridgeProvider {
/**
* Requests an image from the host application's gallery.
* @returns A promise that resolves to a GalleryFileInfo object representing the image data.
*/
getImageFromGallery(): Promise<GalleryFileResponse | MiniAppError>;
}
/** @internal */
/**
* Implementation of the GalleryBridgeProvider interface to interact with the host application.
*/
export declare class GalleryBridge implements GalleryBridgeProvider {
/**
* This interface helps you to launch Gallery and user can pick a photo
* from the library and same will be returned to MiniApp
* @returns path of the image which is selected by user
*/
getImageFromGallery(): Promise<GalleryFileResponse | MiniAppError>;
}
/**
* Represents a file in the gallery.
*/
export interface GalleryFileResponse {
/** The name of the file (optional). */
filename?: string;
/** The binary data of the file. */
data: Blob;
}