gesture-controller.d.ts 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { App } from '../components/app/app';
  2. /** @hidden */
  3. export declare const GESTURE_GO_BACK_SWIPE = "goback-swipe";
  4. /** @hidden */
  5. export declare const GESTURE_MENU_SWIPE = "menu-swipe";
  6. /** @hidden */
  7. export declare const GESTURE_ITEM_SWIPE = "item-swipe";
  8. /** @hidden */
  9. export declare const GESTURE_REFRESHER = "refresher";
  10. /** @hidden */
  11. export declare const GESTURE_TOGGLE = "toggle";
  12. /** @hidden */
  13. export declare const GESTURE_PRIORITY_SLIDING_ITEM = -10;
  14. /** @hidden */
  15. export declare const GESTURE_PRIORITY_REFRESHER = 0;
  16. /** @hidden */
  17. export declare const GESTURE_PRIORITY_MENU_SWIPE = 10;
  18. /** @hidden */
  19. export declare const GESTURE_PRIORITY_GO_BACK_SWIPE = 20;
  20. /** @hidden */
  21. export declare const GESTURE_PRIORITY_TOGGLE = 30;
  22. /**
  23. * @hidden
  24. */
  25. export interface GestureOptions {
  26. name: string;
  27. disableScroll?: boolean;
  28. priority?: number;
  29. }
  30. /**
  31. * @hidden
  32. */
  33. export interface BlockerOptions {
  34. disableScroll?: boolean;
  35. disable?: string[];
  36. }
  37. /**
  38. * @hidden
  39. */
  40. export declare const BLOCK_ALL: BlockerOptions;
  41. /**
  42. * @hidden
  43. */
  44. export declare class GestureController {
  45. private _app;
  46. private id;
  47. private requestedStart;
  48. private disabledGestures;
  49. private disabledScroll;
  50. private capturedID;
  51. constructor(_app: App);
  52. createGesture(opts: GestureOptions): GestureDelegate;
  53. createBlocker(opts?: BlockerOptions): BlockerDelegate;
  54. newID(): number;
  55. start(gestureName: string, id: number, priority: number): boolean;
  56. capture(gestureName: string, id: number, priority: number): boolean;
  57. release(id: number): void;
  58. disableGesture(gestureName: string, id: number): void;
  59. enableGesture(gestureName: string, id: number): void;
  60. disableScroll(id: number): void;
  61. enableScroll(id: number): void;
  62. canStart(gestureName: string): boolean;
  63. isCaptured(): boolean;
  64. isScrollDisabled(): boolean;
  65. isDisabled(gestureName: string): boolean;
  66. }
  67. /**
  68. * @hidden
  69. */
  70. export declare class GestureDelegate {
  71. private name;
  72. private id;
  73. private controller;
  74. private priority;
  75. private disableScroll;
  76. constructor(name: string, id: number, controller: GestureController, priority: number, disableScroll: boolean);
  77. canStart(): boolean;
  78. start(): boolean;
  79. capture(): boolean;
  80. release(): void;
  81. destroy(): void;
  82. }
  83. /**
  84. * @hidden
  85. */
  86. export declare class BlockerDelegate {
  87. private id;
  88. private controller;
  89. private disable;
  90. private disableScroll;
  91. blocked: boolean;
  92. constructor(id: number, controller: GestureController, disable: string[], disableScroll: boolean);
  93. block(): void;
  94. unblock(): void;
  95. destroy(): void;
  96. }