a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import { Injectable } from '@angular/core';
  2. import { Platform } from '../platform/platform';
  3. /**
  4. * @name Haptic
  5. * @description
  6. * The `Haptic` class interacts with a haptic engine on the device, if
  7. * available. Generally, Ionic components use this under the hood, but you're
  8. * welcome to get a bit crazy with it if you fancy.
  9. *
  10. * Currently, this uses the Taptic engine on iOS.
  11. *
  12. * @usage
  13. * ```ts
  14. * export class MyClass {
  15. *
  16. * constructor(haptic: Haptic) {
  17. * haptic.selection();
  18. * }
  19. * }
  20. *
  21. * ```
  22. */
  23. export class Haptic {
  24. constructor(plt) {
  25. if (plt) {
  26. plt.ready().then(() => {
  27. this._p = plt.win().TapticEngine;
  28. });
  29. }
  30. }
  31. /**
  32. * Check to see if the Haptic Plugin is available
  33. * @return {boolean} Returns true or false if the plugin is available
  34. *
  35. */
  36. available() {
  37. return !!this._p;
  38. }
  39. /**
  40. * Trigger a selection changed haptic event. Good for one-time events
  41. * (not for gestures)
  42. */
  43. selection() {
  44. this._p && this._p.selection();
  45. }
  46. /**
  47. * Tell the haptic engine that a gesture for a selection change is starting.
  48. */
  49. gestureSelectionStart() {
  50. this._p && this._p.gestureSelectionStart();
  51. }
  52. /**
  53. * Tell the haptic engine that a selection changed during a gesture.
  54. */
  55. gestureSelectionChanged() {
  56. this._p && this._p.gestureSelectionChanged();
  57. }
  58. /**
  59. * Tell the haptic engine we are done with a gesture. This needs to be
  60. * called lest resources are not properly recycled.
  61. */
  62. gestureSelectionEnd() {
  63. this._p && this._p.gestureSelectionEnd();
  64. }
  65. /**
  66. * Use this to indicate success/failure/warning to the user.
  67. * options should be of the type `{ type: 'success' }` (or `warning`/`error`)
  68. */
  69. notification(options) {
  70. this._p && this._p.notification(options);
  71. }
  72. /**
  73. * Use this to indicate success/failure/warning to the user.
  74. * options should be of the type `{ style: 'light' }` (or `medium`/`heavy`)
  75. */
  76. impact(options) {
  77. this._p && this._p.impact(options);
  78. }
  79. }
  80. Haptic.decorators = [
  81. { type: Injectable },
  82. ];
  83. /** @nocollapse */
  84. Haptic.ctorParameters = () => [
  85. { type: Platform, },
  86. ];
  87. //# sourceMappingURL=haptic.js.map