// Generated by dts-bundle-generator v8.1.2

export declare class IRTCBeautyExtension {
	constructor(options?: IRTCBeautyExtensionConfig);
	
	/** 
	 * @brief Check the compatibility of current browser.
	 * @return Compatibility check result.
	 */
	checkCompatibility: () => Promise<CompatibilityCheckResult>;
	
	/** 
	 * @brief Enable basic beauty effects.
	 * @notes + Call [setBeautyIntensity](#setbeautyintensity) to set the beauty effect intensity. If you do not set the intensity, the brightness, smoothness, and sharpness intensity will default to 0.5.
	 *        + Call [disable](#disable) to turn off basic beauty effects.
	 *        + This API is not applicable to screen capturing.
	 */
	enableBeauty: () => Promise<void>;
	
	/** 
	 * @hidden
	 * @deprecated since 4.52, use enableBeauty instead.
	 * @brief Enable basic beauty effects.
	 * @notes + Call [setBeautyIntensity](#setbeautyintensity) to set the beauty effect intensity. If you do not set the intensity, the brightness, smoothness, and sharpness intensity will default to 0.5.
	 *        + Call [disable](#disable) to turn off basic beauty effects.
	 *        + This API is not applicable to screen capturing.
	 */
	enable: () => Promise<void>;
	
	/** 
	 * @brief Disable basic beauty effects.
	 */
	disableBeauty: () => Promise<void>;
	
	/** 
	 * @hidden
	 * @deprecated since 4.52, use disableBeauty instead.
	 * @brief Disable basic beauty effects.
	 */
	disable: () => Promise<void>;
	
	/** 
	 * @brief Set the beauty effect intensity.
	 * @param beautyMode Basic beauty effect.
	 * @param intensity Beauty effect intensity in range of [0,1], default to 0.5. When you set it to 0, the beauty effect will be turned off.
	 * @notes + If you call this API before calling [enable](#enable), the default settings of beauty effect intensity will adjust accordingly.
	 *        + If you destroy the engine, the beauty effect settings will be invalid.
	 */
	setBeautyIntensity: (beautyMode: EffectBeautyMode, intensity: number) => void;
	
	/** 
	 * @brief Enable virtual background.
	 * @notes + Call [setBackgroundMode](#setbackgroundmode) to set the virtual background mode. If you do not set the mode, the blur background will be enabled.
	 *        + Call [disableVirtualBackground](#disablevirtualbackground) to turn off virtual background.
	 *        + This API is not applicable to screen capturing.
	 */
	enableVirtualBackground: () => Promise<void>;
	
	/** 
	 * @brief Disable virtual background.
	 */
	disableVirtualBackground: () => Promise<void>;
	
	/** 
	 * @brief Set the virtual background mode.
	 * @param mode Virtual background mode.
	 * @notes After turning on the virtual background, you can call this API to switch the used virtual background mode.
	 */
	setBackgroundMode: (mode: BackgroundMode) => void;
	
	/** 
	 * @brief Get the current virtual background image. Ensure that the background mode is set to `BACKGROUND_IMAGE`.
	 * @return The URL of the current virtual background image.
	 */
	getBackgroundImage: () => string;
	
	/** 
	 * @brief Set the virtual background image. Ensure that the background mode is set to `BACKGROUND_IMAGE`.
	 * @param url URL of the virtual background image.
	 * @return
	 * @notes + You can upload a .JPG, .PNG, or .JPEG file.
	 * + If the image’s aspect ratio doesn't match the video's, the shortest side (either height or width) of the image will be stretched proportionally to match the video. Then the image will be cropped to fill in the video.
	 * + The transparent area in the image will be filled with black.
	 * + The setting can be stored and continue to be effective throughout the duration of the extension's lifecycle.
	 */
	loadBackgroundImage: (url: string) => Promise<void>;
	
	/** 
	 * @brief Set the priority of the facial recognition AI algorithm.
	 * @param type The priority of the facial recognition AI algorithm.
	 */
	setAIModelType: (type: BackgroundAIModelType) => void;
	
	/** 
	 * @brief Sets the radius of the blur effect, measured in pixels (px). Ensure that the background mode is set to `BACKGROUND_BLUR`.
	 * @param radius The radius of the blur effect. The blur radius defaults to 20 px.
	 * The valid range for the radius is [0, ∞). However, note that the blur effect will no longer change beyond the half of the longer side of the video.
	 * For example, in a video of 640x480, if you set a blur radius greater than 320 pixels, it will have the same effect as setting it to 320 pixels.
	 * @notes The setting can be stored and continue to be effective throughout the duration of the extension's lifecycle.
	 */
	setBackgroundBlurRadius: (radius: number) => void;
	
	/** 
	 * @brief Set the background color. Ensure that the background mode is set to `BACKGROUND_COLOR`.
	 * @param color Color specified as RGBA(red, green, blue, alpha) or #RRGGBBAA.
	 * Each component's value ranges from 0 to 255. The alpha component represents the opacity of the color and ranges from `0` (transparent) to `1` (opaque).
	 * For example, rgba(255, 255, 255, 1) represents the color white with full opacity.
	 * Alternatively, you can also use the hexadecimal color format #RRGGBBAA, where each pair of digits represents the values for red, green, blue, and alpha components. The alpha component ranges from 00 (transparent) to FF (opaque). For example, #FFFFFFFF represents the color white with full opacity.
	 * @return + `true`: Success.
	 *         + `false`: Failure.
	 * @notes The setting can be stored and continue to be effective throughout the duration of the extension's lifecycle.
	 */
	setBackgroundColor: (color: string) => boolean;
	
	/** 
	 * @brief Sets the URL of the virtual background video. Ensure that the background mode is set to `BACKGROUND_VIDEO`.
	 * @param url URL of the virtual background video.
	 * @return promise.reject() is used to throw an exception.
	 * @notes The setting can be stored and continue to be effective throughout the duration of the extension's lifecycle.
	 */
	loadBackgroundVideo: (url: string) => Promise<void>;
	
	/** 
	 * @brief Gets the URL of the virtual background video. Ensure that the background mode is set to `BACKGROUND_VIDEO`.
	 * @return URL of the virtual background video.
	 * @notes The setting can be stored and continue to be effective throughout the duration of the extension's lifecycle.
	 */
	getBackgroundVideo: () => string;
}

/** 
 * @brief Whether to use CPU or GPU mode. CPU mode is set by default.
 */
export declare enum BackgroundAIBackend {
	
	/** 
	 * @brief CPU mode.
	 */
	CPU = "cpu",
	
	/** 
	 * @brief GPU mode. The SDK will check whether the current browser supports GPU mode, and will automatically fall back to CPU mode if GPU mode is not supported.
	 */
	GPU = "gpu"
}

/** 
 * @brief The priority of the facial recognition AI algorithm.
 */
export declare enum BackgroundAIModelType {
	
	/** 
	 * @brief Performance mode.
	 */
	PERFORMANCE = "fast",
	
	/** 
	 * @brief Quality mode.
	 */
	QUALITY = "accurate"
}

/** 
 * @brief Virtual background mode.
 */
export declare enum BackgroundMode {
	
	/** 
	 * @brief Blur background. The blur radius defaults to 20 px. You can specify the blur level via `setBackgroundBlurRadius`.
	 */
	BACKGROUND_BLUR = "blur",
	
	/** 
	 * @brief Image. You need to specify the image via `loadBackgroundImage` before any visible modification will take effect.
	 */
	BACKGROUND_IMAGE = "image-url",
	
	/** 
	 * @brief Solid color. You need to specify the color via `setBackgroundColor` before any visible modification will take effect.
	 */
	BACKGROUND_COLOR = "color",
	
	/** 
	 * @brief Video.  Specify the video via `loadBackgroundVideo` before any visible modification will take effect.
	 */
	BACKGROUND_VIDEO = "video-url"
}

/** 
 * @brief Basic beauty effect mode.
 */
export declare enum EffectBeautyMode {
	
	/** 
	 * @brief Brightness.
	 */
	EFFECT_WHITE_MODE = 0,
	
	/** 
	 * @brief Smoothness.
	 */
	EFFECT_SMOOTH_MODE = 1,
	
	/** 
	 * @brief Sharpness.
	 */
	EFFECT_SHARPEN_MODE = 2
}

/** 
 * @brief Compatibility check result.
 */
export interface CompatibilityCheckResult {
	
	/** 
	 * @brief Whether the system is compatible.
	 *        &ensp; `true`: The system meets the requirements.
	 *        &ensp; `false`: Incompatible.
	 */
	isCompatible: boolean;
	
	/** 
	 * @brief Incompatible reasons.</br>
	 *        &ensp; + 0: Other unknown reasons.
	 *        &ensp; + 1: Browser does not support getUserMedia API.
	 *        &ensp; + 2: Browser does not support WebAssembly.
	 *        &ensp; + 3: Browser cannot get video input devices.
	 *        &ensp; + 100: Failed to load WebAR SDK.
	 */
	reasons: number[];
	
	/** 
	 * @brief Extra message.
	 */
	message?: string;
}

/** 
 * @brief Beauty extension configurations.
 */
export interface IRTCBeautyExtensionConfig {
	/**
	 * @internal
	 */
	sdkUrl?: string;
	/**
	 * @internal
	 */
	sdkSourceUrl?: string;
	/**
	 * @internal
	 */
	sdkHash?: string;
	/**
	 * @internal
	 */
	sdkAuthServer?: string;
	
	/** 
	 * @brief The authentication file's URL.
	 */
	authFileUrl?: string;
	
	/** 
	 * @brief Whether to use CPU or GPU mode. CPU mode is set by default.
	 */
	aiBackend?: BackgroundAIBackend;
	
	/** 
	 * @brief The priority of the facial recognition AI algorithm.
	 */
	aiModelType?: BackgroundAIModelType;
}

export {
	IRTCBeautyExtension as default,
};

export {};
