-
Notifications
You must be signed in to change notification settings - Fork 18
/
d-dialog-gesture.ts
48 lines (38 loc) · 1.06 KB
/
d-dialog-gesture.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright (C) 2019 Toshiba Corporation
* SPDX-License-Identifier: Apache-2.0
*/
import { DApplicationLayerLike } from "./d-application-layer-like";
import { DBase } from "./d-base";
import { DDialogGestureMode } from "./d-dialog-gesture-mode";
export type DDialogGestureConstraint = (
target: DBase,
layer: DApplicationLayerLike,
x: number,
y: number
) => void;
export interface DDialogGestureOptions {
enable?: boolean;
mode?: DDialogGestureMode | keyof typeof DDialogGestureMode;
constraint?: DDialogGestureConstraint;
}
export interface DDialogGestureParent extends DBase {
readonly layer: DApplicationLayerLike | null;
}
export interface DDialogGesture<PARENT extends DDialogGestureParent> {
parent: PARENT;
mode: DDialogGestureMode;
constraint: DDialogGestureConstraint;
/**
* Returns true if thhe dialog position is changed by gestures.
*/
isDirty(): boolean;
/**
* Returns true if the dialog position is not changed by gestures.
*/
isClean(): boolean;
/**
* Marks the dialog position is not changed by gestures.
*/
toClean(): void;
}