diff --git a/api/@ohos.animation.windowAnimationManager.d.ts b/api/@ohos.animation.windowAnimationManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8baf4fb1c4fa4374811aa8d0d4e7327588fcf5b --- /dev/null +++ b/api/@ohos.animation.windowAnimationManager.d.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2022 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. + */ + +declare namespace windowAnimationManager { + function setController(controller: WindowAnimationController): void; + + export enum WindowAnimationTargetType { + NORMAL_APP = 0, + LAUNCHER, + SCREEN_LOCK, + SYSTEM_UI, + } + + export interface RRect { + left: number; + + top: number; + + width: number; + + height: number; + + radius: number; + } + + export interface WindowAnimationTarget { + readonly type: WindowAnimationTargetType; + + readonly bundleName: string; + + readonly abilityName: string; + + readonly windowBounds: RRect; + + readonly windowId: number; + + readonly surfaceNodeId: number; + } + + export interface WindowAnimationFinishedCallback { + onAnimationFinish(): void; + } + + export interface WindowAnimationController { + onTransition(fromWindow: WindowAnimationTarget, toWindow: WindowAnimationTarget, + finishCallback: WindowAnimationFinishedCallback): void; + + onMinimizeWindow(minimizingWindow: WindowAnimationTarget, finishCallback: WindowAnimationFinishedCallback): void; + + onCloseWindow(closingWindow: WindowAnimationTarget, finishCallback: WindowAnimationFinishedCallback): void + } +} + +export default windowAnimationManager;