From 49f20a64f924172f2f8ecad936e6bbe9c53f1755 Mon Sep 17 00:00:00 2001 From: zcdqs Date: Tue, 21 Jun 2022 17:18:43 +0800 Subject: [PATCH] move inspector interface to global for IDE Signed-off-by: zcdqs Change-Id: Ic4887ec84edab2d5b87e361a935f036a27d91afa --- api/@internal/component/ets/inspector.d.ts | 48 --------------------- api/@internal/global.d.ts | 49 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/api/@internal/component/ets/inspector.d.ts b/api/@internal/component/ets/inspector.d.ts index 7dc106a2ba..c62f3802cf 100644 --- a/api/@internal/component/ets/inspector.d.ts +++ b/api/@internal/component/ets/inspector.d.ts @@ -29,54 +29,6 @@ declare function getInspectorNodes(): object; */ declare function getInspectorNodeById(id: number): object; -/** - * Get inspector info by key. - * @since 8 - * @systemapi - * @test - */ -declare function getInspectorByKey(id: string): string; - -/** - * Get inspector tree. - * @since 8 - * @systemapi - * @test - */ -declare function getInspectorTree(): string; - -/** - * Send event to inspector by key. Return false if no inspector with key is found. - * @since 8 - * @systemapi - * @test - */ -declare function sendEventByKey(id: string, action: number, params: string): boolean; - -/** - * Send touch event. - * @since 8 - * @systemapi - * @test - */ -declare function sendTouchEvent(event: TouchObject): boolean; - -/** - * Send key event. - * @since 8 - * @systemapi - * @test - */ -declare function sendKeyEvent(event: KeyEvent): boolean; - -/** - * Send mouse event. - * @since 8 - * @systemapi - * @test - */ -declare function sendMouseEvent(event: MouseEvent): boolean; - /** * Profiler tools for inspectors. * @since 8 diff --git a/api/@internal/global.d.ts b/api/@internal/global.d.ts index 81dbba645a..17e8c355ec 100644 --- a/api/@internal/global.d.ts +++ b/api/@internal/global.d.ts @@ -99,3 +99,52 @@ export declare function clearTimeout(timeoutID?: number): void; * @since 8 */ export declare function canIUse(syscap: string): boolean; + +/** + * Obtains all attributes of the component with the specified ID. + * @param id ID of the component whose attributes are to be obtained. + * @since 8 + * @test + */ +export declare function getInspectorByKey(id: string): string; + + /** + * Get components tree. + * @since 8 + * @test + */ +export declare function getInspectorTree(): string; + + /** + * Sends an event to the component with the specified ID. + * @param id ID of the component for which the event is to be sent. + * @param action Type of the event to be sent. The options are as follows: Click event: 10 LongClick: 11. + * @param params Event parameters. If there is no parameter, pass an empty string "". + * @since 8 + * @test + */ +export declare function sendEventByKey(id: string, action: number, params: string): boolean; + + /** + * Send touch event. + * @param event TouchObject to be sent. + * @since 8 + * @test + */ +export declare function sendTouchEvent(event: TouchObject): boolean; + + /** + * Send key event. + * @param event KeyEvent to be sent. + * @since 8 + * @test + */ +export declare function sendKeyEvent(event: KeyEvent): boolean; + + /** + * Send mouse event. + * @param event MouseEvent to be sent. + * @since 8 + * @test + */ +export declare function sendMouseEvent(event: MouseEvent): boolean; -- Gitee