index.d.ts 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import { IonicNativePlugin } from '@ionic-native/core';
  2. export interface TagOptions {
  3. sequence: number;
  4. tags?: Array<string>;
  5. }
  6. export interface AliasOptions {
  7. sequence: number;
  8. alias?: string;
  9. }
  10. /**
  11. * @name jpush
  12. * @description
  13. * This plugin does something
  14. *
  15. * @usage
  16. * ```typescript
  17. * import { jpush } from '@ionic-native/jpush';
  18. *
  19. *
  20. * constructor(private jpush: jpush) { }
  21. *
  22. * ...
  23. *
  24. *
  25. * this.jpush.functionName('Hello', 123)
  26. * .then((res: any) => console.log(res))
  27. * .catch((error: any) => console.error(error));
  28. *
  29. * ```
  30. */
  31. export declare class JPushOriginal extends IonicNativePlugin {
  32. /**
  33. * This function does something
  34. * @param arg1 {string} Some param to configure something
  35. * @param arg2 {number} Another param to configure something
  36. * @return {Promise<any>} Returns a promise that resolves when something happens
  37. */
  38. functionName(arg1: string, arg2: number): Promise<any>;
  39. init(): void;
  40. setDebugMode(enable: boolean): void;
  41. getRegistrationID(): Promise<any>;
  42. stopPush(): Promise<any>;
  43. resumePush(): Promise<any>;
  44. isPushStopped(): Promise<any>;
  45. setTags(params: TagOptions): Promise<any>;
  46. addTags(params: TagOptions): Promise<any>;
  47. deleteTags(params: TagOptions): Promise<any>;
  48. cleanTags(params: TagOptions): Promise<any>;
  49. getAllTags(params: TagOptions): Promise<any>;
  50. /**
  51. * @param params { sequence: number, tag: string }
  52. */
  53. checkTagBindState(params: object): Promise<any>;
  54. setAlias(params: AliasOptions): Promise<any>;
  55. deleteAlias(params: AliasOptions): Promise<any>;
  56. getAlias(params: AliasOptions): Promise<any>;
  57. /**
  58. * Determinate whether the application notification has been opened.
  59. *
  60. * iOS: 0: closed; >1: opened.
  61. * UIRemoteNotificationTypeNone = 0,
  62. * UIRemoteNotificationTypeBadge = 1 << 0,
  63. * UIRemoteNotificationTypeSound = 1 << 1,
  64. * UIRemoteNotificationTypeAlert = 1 << 2,
  65. * UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3
  66. *
  67. * Android: 0: closed; 1: opened.
  68. */
  69. getUserNotificationSettings(): Promise<any>;
  70. clearLocalNotifications(): Promise<any>;
  71. setBadge(badge: number): void;
  72. resetBadge(): void;
  73. setApplicationIconBadgeNumber(badge: number): void;
  74. getApplicationIconBadgeNumber(): Promise<any>;
  75. addLocalNotificationForIOS(delayTime: number, content: string, badge: number, identifierKey: string, extras?: object): void;
  76. deleteLocalNotificationWithIdentifierKeyInIOS(identifierKey: string): void;
  77. addDismissActions(actions: Array<object>, categoryId: string): void;
  78. addNotificationActions(actions: Array<object>, categoryId: string): void;
  79. setLocation(latitude: number, longitude: number): void;
  80. startLogPageView(pageName: string): void;
  81. stopLogPageView(pageName: string): void;
  82. beginLogPageView(pageName: string, duration: number): void;
  83. getConnectionState(): Promise<any>;
  84. setBasicPushNotificationBuilder(): Promise<any>;
  85. setCustomPushNotificationBuilder(): Promise<any>;
  86. clearAllNotification(): Promise<any>;
  87. clearNotificationById(id: number): Promise<any>;
  88. setLatestNotificationNum(num: number): Promise<any>;
  89. addLocalNotification(builderId: number, content: string, title: string, notificationId: number, broadcastTime: number, extras?: string): Promise<any>;
  90. removeLocalNotification(notificationId: number): Promise<any>;
  91. reportNotificationOpened(msgId: number): Promise<any>;
  92. requestPermission(): Promise<any>;
  93. setSilenceTime(startHour: number, startMinute: number, endHour: number, endMinute: number): Promise<any>;
  94. setPushTime(weekdays: Array<string>, startHour: number, endHour: number): Promise<any>;
  95. }
  96. export declare const JPush: JPushOriginal;