From bbfafa4e9a15bbbd215d5a1d5fc07189c6303a28 Mon Sep 17 00:00:00 2001 From: qiuguohua Date: Thu, 21 Jul 2022 14:55:27 +0800 Subject: [PATCH] Added interface for copying text to clipboard (#12029) * Added interface for copying text to clipboard * Bind the context to the function --- cocos/native-binding/impl.ts | 1 + cocos/native-binding/index.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/cocos/native-binding/impl.ts b/cocos/native-binding/impl.ts index 6cdb99890c..8f143d55bc 100644 --- a/cocos/native-binding/impl.ts +++ b/cocos/native-binding/impl.ts @@ -6,4 +6,5 @@ export const native = { zipUtils: globalJsb.zipUtils, fileUtils: globalJsb.fileUtils, DebugRenderer: globalJsb.DebugRenderer, + copyTextToClipboard: globalJsb.copyTextToClipboard?.bind(globalJsb), }; diff --git a/cocos/native-binding/index.ts b/cocos/native-binding/index.ts index f920bde7a6..b9f5c76f43 100644 --- a/cocos/native-binding/index.ts +++ b/cocos/native-binding/index.ts @@ -36,6 +36,12 @@ export declare namespace native { */ export type DownloaderTask = { requestURL: string, storagePath: string, identifier: string }; + /** + * @en Copy text to clipboard @zh 拷贝字符串到剪切板 + * @param text + */ + export function copyTextToClipboard(text:string): void; + /** * @en DownloaderHints @zh 下载任务的配置接口 * @param countOfMaxProcessingTasks