代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/interface_sdk-js 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkUI
*/
import { AsyncCallback } from './@ohos.base';
import image from './@ohos.multimedia.image'
/**
* This module allows developers to export snapshot image from a component or a custom builder.
*
* @namespace componentSnapshot
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* This module allows developers to export snapshot image from a component or a custom builder.
*
* @namespace componentSnapshot
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
declare namespace componentSnapshot {
/**
* Defines the extra options for snapshot taking.
*
* @typedef SnapshotOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
interface SnapshotOptions {
/**
* Defines the scale property to render the snapshot.
*
* @type {?number}
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
scale?: number
/**
* Whether to wait the rendering is finished.
*
* @type {?boolean}
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
waitUntilRenderFinished?: boolean
}
/**
* Take a snapshot of the target component.
*
* @param { string } id - Target component ID, set by developer through .id attribute.
* @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - Invalid ID.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Take a snapshot of the target component.
*
* @param { string } id - Target component ID, set by developer through .id attribute.
* @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format.
* @param { SnapshotOptions } [options] - Define the snapshot options.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - Invalid ID.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
function get(id: string, callback: AsyncCallback<image.PixelMap>, options?: SnapshotOptions): void;
/**
* Take a snapshot of the target component.
*
* @param { string } id - Target component ID, set by developer through .id attribute.
* @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - Invalid ID.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Take a snapshot of the target component.
*
* @param { string } id - Target component ID, set by developer through .id attribute.
* @param { SnapshotOptions } [options] - Define the snapshot options.
* @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - Invalid ID.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
function get(id: string, options?: SnapshotOptions): Promise<image.PixelMap>;
/**
* Generate a snapshot from a custom component builder.
*
* @param { CustomBuilder } builder - Builder function of a custom component.
* @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - The builder is not a valid build function.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Generate a snapshot from a custom component builder.
*
* @param { CustomBuilder } builder - Builder function of a custom component.
* @param { AsyncCallback<image.PixelMap> } callback - Callback that contains the snapshot in PixelMap format.
* @param { number } [delay] - Defines the delay time to render the snapshot.
* @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot.
* @param { SnapshotOptions } [options] - Define the snapshot options.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - The builder is not a valid build function.
* @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for
* the ready state is required when the checkImageStatus option is enabled.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
function createFromBuilder(builder: CustomBuilder, callback: AsyncCallback<image.PixelMap>,
delay?: number, checkImageStatus?: boolean, options?: SnapshotOptions): void;
/**
* Generate a snapshot from a custom component builder.
*
* @param { CustomBuilder } builder - Builder function of a custom component.
* @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - The builder is not a valid build function.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
/**
* Generate a snapshot from a custom component builder.
*
* @param { CustomBuilder } builder - Builder function of a custom component.
* @param { number } [delay] - Defines the delay time to render the snapshot.
* @param { boolean } [checkImageStatus] - Defines if check the image decoding status before taking snapshot.
* @param { SnapshotOptions } [options] - Define the snapshot options.
* @returns { Promise<image.PixelMap> } A Promise with the snapshot in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - The builder is not a valid build function.
* @throws { BusinessError } 160001 - An image component in builder is not ready for taking a snapshot. The check for
* the ready state is required when the checkImageStatus option is enabled.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
function createFromBuilder(builder: CustomBuilder, delay?: number,
checkImageStatus?: boolean, options?: SnapshotOptions): Promise<image.PixelMap>;
/**
* Take a screenshot of the specified component in synchronous mode,
* this mode will block the main thread, please use it with caution, the maximum
* waiting time of the interface is 3s, if it does not return after 3s, an exception will be thrown.
*
* @param { string } id - Target component ID, set by developer through .id attribute.
* @param { SnapshotOptions } [options] - Define the snapshot options.
* @returns { image.PixelMap } The snapshot result in PixelMap format.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* <br> 1. Mandatory parameters are left unspecified.
* <br> 2. Incorrect parameters types.
* <br> 3. Parameter verification failed.
* @throws { BusinessError } 100001 - Invalid ID.
* @throws { BusinessError } 160002 - Timeout.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
function getSync(id: string, options?: SnapshotOptions): image.PixelMap;
}
export default componentSnapshot;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。