onesignal-vue 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.cjs ADDED
@@ -0,0 +1,38 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ browser: true,
5
+ es6: true,
6
+ node: true,
7
+ worker: true,
8
+ },
9
+ settings: {
10
+ 'import/resolver': {
11
+ node: {
12
+ paths: ['src'],
13
+ extensions: ['.js', '.ts'],
14
+ },
15
+ },
16
+ },
17
+ globals: {
18
+ Atomics: 'readonly',
19
+ SharedArrayBuffer: 'readonly',
20
+ },
21
+ parser: '@typescript-eslint/parser',
22
+ parserOptions: {
23
+ ecmaVersion: 2018,
24
+ sourceType: 'module',
25
+ },
26
+ plugins: ['@typescript-eslint'],
27
+ extends: ['plugin:@typescript-eslint/recommended'],
28
+ rules: {
29
+ 'prefer-destructuring': 0,
30
+ 'no-param-reassign': 0,
31
+ 'import/extensions': 0,
32
+ 'dot-notation': 0,
33
+ 'no-continue': 0,
34
+ 'no-unused-vars': 'off',
35
+ '@typescript-eslint/no-unused-vars': ['error'],
36
+ 'no-prototype-builtins': 'warn',
37
+ },
38
+ };
@@ -24,7 +24,7 @@ jobs:
24
24
  node-version: 'lts/*'
25
25
  registry-url: 'https://registry.npmjs.org'
26
26
  - name: Install dependencies
27
- run: yarn install
27
+ run: npm ci
28
28
  - name: Release
29
29
  env:
30
30
  GITHUB_TOKEN: ${{ secrets.GH_WEB_SHIM_PUSH_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/OneSignal/onesignal-vue/compare/2.1.0...2.2.0) (2025-03-24)
4
+
5
+ ### Features
6
+
7
+ * sync with web-shim-codegen v3.0.2 ([5937a51](https://github.com/OneSignal/onesignal-vue/commit/5937a513bcd7927fc1dc73fcc0407bb3d19f573d))
8
+
3
9
  ## [2.1.0](https://github.com/OneSignal/onesignal-vue/compare/2.0.1...2.1.0) (2025-03-18)
4
10
 
5
11
  ### Features
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <h1 align="center">welcome to onesignal-vue 👋</h1>
1
+ <h1 align="center">Welcome to onesignal-vue 👋</h1>
2
2
 
3
3
  <p>
4
4
  <a href="https://www.npmjs.com/package/onesignal-vue" target="_blank">
@@ -17,57 +17,59 @@
17
17
 
18
18
  > This is a JavaScript module that can be used to easily include [OneSignal](https://onesignal.com/) code in a website or app that uses Vue for its front-end codebase.
19
19
 
20
- * 🏠 [Homepage](https://onesignal.com)
21
- * 🖤 [npm](https://www.npmjs.com/package/onesignal-vue)
20
+ - 🏠 [Homepage](https://onesignal.com)
21
+ - 🖤 [npm](https://www.npmjs.com/package/onesignal-vue)
22
22
 
23
23
  OneSignal is the world's leader for Mobile Push Notifications, Web Push, and In-App Messaging. It is trusted by 800k businesses to send 5 billion Push Notifications per day.
24
24
 
25
25
  You can find more information on OneSignal [here](https://onesignal.com/).
26
26
 
27
27
  > Upgrading from Version 1?
28
- See our [migration guide](./MigrationGuide.md) if coming from v1.
28
+ > See our [migration guide](./MigrationGuide.md) if coming from v1.
29
29
 
30
30
  ## Contents
31
+
31
32
  - [Install](#install)
32
33
  - [Usage](#usage)
33
34
  - [API](#onesignal-api)
34
35
  - [Advanced Usage](#advanced-usage)
35
36
 
36
37
  ---
38
+
37
39
  ## Vue Compatibility
38
- Make sure you install a plugin version compatible with your Vue environment.
39
40
 
40
- | Vue | OneSignal Plugin |
41
- |-----|------------------|
42
- | 2 | onesignal-vue |
43
- | 3 | [onesignal-vue3](https://github.com/OneSignal/onesignal-vue3) |
41
+ Make sure you install a plugin version compatible with your Vue environment.
44
42
 
43
+ | Vue | OneSignal Plugin |
44
+ | --- | ------------------------------------------------------------- |
45
+ | 2 | onesignal-vue |
46
+ | 3 | [onesignal-vue3](https://github.com/OneSignal/onesignal-vue3) |
45
47
 
46
48
  ---
47
- ## Install
48
-
49
- You can use `yarn` or `npm`.
50
49
 
50
+ ## Install
51
51
 
52
- ### Yarn
52
+ ### npm
53
53
 
54
54
  ```bash
55
- yarn add onesignal-vue
55
+ npm install --save onesignal-vue
56
56
  ```
57
57
 
58
- ### npm
58
+ ### Yarn
59
59
 
60
60
  ```bash
61
- npm install --save onesignal-vue
61
+ yarn add onesignal-vue
62
62
  ```
63
63
 
64
64
  ---
65
+
65
66
  ## Usage
66
67
 
67
68
  ## Plugin setup
69
+
68
70
  ```js
69
- import Vue from 'vue'
70
- import OneSignalVue from 'onesignal-vue'
71
+ import Vue from 'vue';
72
+ import OneSignalVue from 'onesignal-vue';
71
73
 
72
74
  Vue.use(OneSignalVue);
73
75
  ```
@@ -76,88 +78,93 @@ Initialize OneSignal with your `appId` via the `options` parameter:
76
78
 
77
79
  ```js
78
80
  new Vue({
79
- render: h => h(App),
81
+ render: (h) => h(App),
80
82
  beforeMount() {
81
83
  this.$OneSignal.init({ appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' });
82
- }
83
- }).$mount('#app')
84
+ },
85
+ }).$mount('#app');
84
86
  ```
85
87
 
86
88
  The `init` function returns a promise that resolves when OneSignal is loaded.
87
89
 
88
90
  **Examples**
91
+
89
92
  ```js
90
93
  await this.$OneSignal.init({ appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' });
91
94
  // do other stuff
92
95
  ```
93
96
 
94
97
  ```js
95
- this.$OneSignal.init({ appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' }).then(() => {
96
- // do other stuff
97
- });
98
+ this.$OneSignal
99
+ .init({ appId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' })
100
+ .then(() => {
101
+ // do other stuff
102
+ });
98
103
  ```
99
104
 
100
105
  ### Code completion
106
+
101
107
  For code completion to work correctly, make sure you import the plugin (e.g: in child components).
102
108
 
103
109
  ```vue
104
110
  <script>
105
- import OneSignalVue from 'onesignal-vue';
106
111
  export default {
107
112
  name: 'HelloWorld',
108
113
  props: {
109
- msg: String
114
+ msg: String,
110
115
  },
111
116
  beforeCreate() {
112
117
  // Example prompting for notification permission
113
118
  this.$OneSignal.User.PushSubscription.optIn();
114
- }
115
- }
119
+ },
120
+ };
116
121
  </script>
117
122
  ```
118
123
 
119
124
  ### Init Options
125
+
120
126
  You can pass other [options](https://documentation.onesignal.com/v11.0/docs/web-sdk#initializing-the-sdk) to the `init` function. Use these options to configure personalized prompt options, auto-resubscribe, and more.
121
127
 
122
128
  <details>
123
129
  <summary>Expand to see more options</summary>
124
130
 
125
- | Property Name | Type | Description |
126
- | ---------------------------| --------------------- | -------------------------------------------------- |
127
- | `appId` | `string` | The ID of your OneSignal app. |
128
- | `autoRegister` | `boolean` (optional) | Whether or not to automatically register the user. |
129
- | `autoResubscribe` | `boolean` (optional) | Whether or not to automatically resubscribe the user. |
130
- | `path` | `string` (optional) | The path to the OneSignal service worker file. |
131
- | `serviceWorkerPath` | `string` (optional) | The path to the OneSignal service worker script. |
132
- | `serviceWorkerUpdaterPath` | `string` (optional) | The path to the OneSignal service worker updater script. |
133
- | `subdomainName` | `string` (optional) | The subdomain of your OneSignal app. |
134
- | `allowLocalhostAsSecureOrigin` | `boolean` (optional) | Whether or not to allow localhost as a secure origin. |
135
- | `requiresUserPrivacyConsent`| `boolean` (optional) | Whether or not the user's consent is required. |
136
- | `persistNotification` | `boolean` (optional) | Whether or not notifications should persist. |
137
- | `notificationClickHandlerMatch`| `string` (optional) | The URL match pattern for notification clicks. |
138
- | `notificationClickHandlerAction`| `string` (optional)| The action to perform when a notification is clicked. |
139
- | `welcomeNotification` | `object` (optional) | The welcome notification configuration. |
140
- | `notifyButton` | `object` (optional) | The notify button configuration. |
141
- | `promptOptions` | `object` (optional) | Additional options for the subscription prompt. |
142
- | `webhooks` | `object` (optional) | The webhook configuration. |
143
- | `[key: string]` | `any` | Additional properties can be added as needed. |
131
+ | Property Name | Type | Description |
132
+ | -------------------------------- | -------------------- | -------------------------------------------------------- |
133
+ | `appId` | `string` | The ID of your OneSignal app. |
134
+ | `autoRegister` | `boolean` (optional) | Whether or not to automatically register the user. |
135
+ | `autoResubscribe` | `boolean` (optional) | Whether or not to automatically resubscribe the user. |
136
+ | `path` | `string` (optional) | The path to the OneSignal service worker file. |
137
+ | `serviceWorkerPath` | `string` (optional) | The path to the OneSignal service worker script. |
138
+ | `serviceWorkerUpdaterPath` | `string` (optional) | The path to the OneSignal service worker updater script. |
139
+ | `subdomainName` | `string` (optional) | The subdomain of your OneSignal app. |
140
+ | `allowLocalhostAsSecureOrigin` | `boolean` (optional) | Whether or not to allow localhost as a secure origin. |
141
+ | `requiresUserPrivacyConsent` | `boolean` (optional) | Whether or not the user's consent is required. |
142
+ | `persistNotification` | `boolean` (optional) | Whether or not notifications should persist. |
143
+ | `notificationClickHandlerMatch` | `string` (optional) | The URL match pattern for notification clicks. |
144
+ | `notificationClickHandlerAction` | `string` (optional) | The action to perform when a notification is clicked. |
145
+ | `welcomeNotification` | `object` (optional) | The welcome notification configuration. |
146
+ | `notifyButton` | `object` (optional) | The notify button configuration. |
147
+ | `promptOptions` | `object` (optional) | Additional options for the subscription prompt. |
148
+ | `webhooks` | `object` (optional) | The webhook configuration. |
149
+ | `[key: string]` | `any` | Additional properties can be added as needed. |
144
150
 
145
151
  **Service Worker Params**
146
152
  You can customize the location and filenames of service worker assets. You are also able to specify the specific scope that your service worker should control. You can read more [here](https://documentation.onesignal.com/docs/onesignal-service-worker-faq#sdk-parameter-reference-for-service-workers).
147
153
 
148
154
  In this distribution, you can specify the parameters via the following:
149
155
 
150
- | Field | Details |
151
- |----------------------------|------------------------------------------------------------------------------------------------------------------------|
152
- | `serviceWorkerParam` | Use to specify the scope, or the path the service worker has control of. Example: `{ scope: "/js/push/onesignal/" }` |
153
- | `serviceWorkerPath` | The path to the service worker file. |
156
+ | Field | Details |
157
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------- |
158
+ | `serviceWorkerParam` | Use to specify the scope, or the path the service worker has control of. Example: `{ scope: "/js/push/onesignal/" }` |
159
+ | `serviceWorkerPath` | The path to the service worker file. |
154
160
 
155
161
  </details>
156
162
 
157
163
  ---
158
164
 
159
165
  ### Service Worker File
160
- If you haven't done so already, you will need to add the [OneSignal Service Worker file](https://github.com/OneSignal/OneSignal-Website-SDK/files/7585231/OneSignal-Web-SDK-HTTPS-Integration-Files.zip) to your site ([learn more](https://documentation.onesignal.com/docs/web-push-quickstart#step-6-upload-files)).
166
+
167
+ If you haven't done so already, you will need to add the [OneSignal Service Worker file](https://github.com/OneSignal/OneSignal-Website-SDK/files/11480764/OneSignalSDK-v16-ServiceWorker.zip) to your site ([learn more](https://documentation.onesignal.com/docs/web-push-quickstart#step-6-upload-files)).
161
168
 
162
169
  The OneSignal SDK file must be publicly accessible. You can put them in your top-level root or a subdirectory. However, if you are placing the file not on top-level root make sure to specify the path via the service worker params in the init options (see section above).
163
170
 
@@ -165,55 +172,65 @@ The OneSignal SDK file must be publicly accessible. You can put them in your top
165
172
  Visit `https://yoursite.com/OneSignalSDKWorker.js` in the address bar to make sure the files are being served successfully.
166
173
 
167
174
  ---
175
+
168
176
  ### Typescript
177
+
169
178
  This package includes Typescript support.
170
179
 
171
180
  ```ts
172
181
  interface IOneSignalOneSignal {
173
- Slidedown: IOneSignalSlidedown;
174
- Notifications: IOneSignalNotifications;
175
- Session: IOneSignalSession;
176
- User: IOneSignalUser;
177
- Debug: IOneSignalDebug;
178
- login(externalId: string, jwtToken?: string): Promise<void>;
179
- logout(): Promise<void>;
180
- init(options: IInitObject): Promise<void>;
181
- setConsentGiven(consent: boolean): Promise<void>;
182
- setConsentRequired(requiresConsent: boolean): Promise<void>;
182
+ Slidedown: IOneSignalSlidedown;
183
+ Notifications: IOneSignalNotifications;
184
+ Session: IOneSignalSession;
185
+ User: IOneSignalUser;
186
+ Debug: IOneSignalDebug;
187
+ login(externalId: string, jwtToken?: string): Promise<void>;
188
+ logout(): Promise<void>;
189
+ init(options: IInitObject): Promise<void>;
190
+ setConsentGiven(consent: boolean): Promise<void>;
191
+ setConsentRequired(requiresConsent: boolean): Promise<void>;
183
192
  }
184
193
  ```
185
194
 
186
195
  ### OneSignal API
196
+
187
197
  See the official [OneSignal WebSDK reference](https://documentation.onesignal.com/v11.0/docs/web-sdk#initializing-the-sdk) for information on all available SDK functions.
188
198
 
189
199
  ---
200
+
190
201
  ## Advanced Usage
202
+
191
203
  ### Events and Event Listeners
204
+
192
205
  Use listeners to react to OneSignal-related events:
193
206
 
194
207
  ### Notifications Namespace
195
- | Event Name | Callback Argument Type |
196
- |-|-|
197
- |'click' | NotificationClickEvent|
198
- |'foregroundWillDisplay'| NotificationForegroundWillDisplayEvent
199
- | 'dismiss'| NotificationDismissEvent|
200
- |'permissionChange'| boolean|
201
- |'permissionPromptDisplay'| void|
208
+
209
+ | Event Name | Callback Argument Type |
210
+ | ------------------------- | -------------------------------------- |
211
+ | 'click' | NotificationClickEvent |
212
+ | 'foregroundWillDisplay' | NotificationForegroundWillDisplayEvent |
213
+ | 'dismiss' | NotificationDismissEvent |
214
+ | 'permissionChange' | boolean |
215
+ | 'permissionPromptDisplay' | void |
202
216
 
203
217
  ### Slidedown Namespace
204
- | Event Name | Callback Argument Type |
205
- |-|-|
206
- |'slidedownShown' | boolean |
218
+
219
+ | Event Name | Callback Argument Type |
220
+ | ---------------- | ---------------------- |
221
+ | 'slidedownShown' | boolean |
207
222
 
208
223
  ### Push Subscription Namespace
224
+
209
225
  | Event Name | Callback Argument Type |
210
- |-|-|
211
- |'change' | boolean |
226
+ | ---------- | ---------------------- |
227
+ | 'change' | boolean |
212
228
 
213
229
  **Example**
230
+
214
231
  ```js
215
- OneSignal.Notifications.addEventListener('click', (event) => {
216
- console.log("The notification was clicked!", event);
232
+ this.$OneSignal.Notifications.addEventListener('click', (event) => {
233
+ console.log('The notification was clicked!', event);
217
234
  });
218
235
  ```
219
236
 
@@ -231,12 +248,13 @@ Give a ⭐️ if this project helped you!
231
248
 
232
249
  ## OneSignal
233
250
 
234
- * [Website](https://onesignal.com)
235
- * Twitter: [@onesignal](https://twitter.com/onesignal)
236
- * Github: [@OneSignal](https://github.com/OneSignal)
237
- * LinkedIn: [@onesignal](https://linkedin.com/company/onesignal)
251
+ - [Website](https://onesignal.com)
252
+ - Twitter: [@onesignal](https://twitter.com/onesignal)
253
+ - Github: [@OneSignal](https://github.com/OneSignal)
254
+ - LinkedIn: [@onesignal](https://linkedin.com/company/onesignal)
238
255
 
239
256
  ## Discord
257
+
240
258
  Reach out to us via our [Discord server](https://discord.com/invite/EP7gf6Uz7G)!
241
259
 
242
260
  ## 📝 License
@@ -244,5 +262,4 @@ Reach out to us via our [Discord server](https://discord.com/invite/EP7gf6Uz7G)!
244
262
  Copyright © 2022 [OneSignal](https://github.com/OneSignal).<br />
245
263
  This project is [Modified MIT](https://github.com/OneSignal/onesignal-vue/blob/main/LICENSE) licensed.
246
264
 
247
-
248
265
  Enjoy!
package/dist/index.d.ts CHANGED
@@ -13,18 +13,18 @@ declare global {
13
13
  };
14
14
  }
15
15
  }
16
- interface AutoPromptOptions {
16
+ export interface AutoPromptOptions {
17
17
  force?: boolean;
18
18
  forceSlidedownOverNative?: boolean;
19
19
  slidedownPromptOptions?: IOneSignalAutoPromptOptions;
20
20
  }
21
- interface IOneSignalAutoPromptOptions {
21
+ export interface IOneSignalAutoPromptOptions {
22
22
  force?: boolean;
23
23
  forceSlidedownOverNative?: boolean;
24
24
  isInUpdateMode?: boolean;
25
25
  categoryOptions?: IOneSignalCategories;
26
26
  }
27
- interface IOneSignalCategories {
27
+ export interface IOneSignalCategories {
28
28
  positiveUpdateButton: string;
29
29
  negativeUpdateButton: string;
30
30
  savingButtonText: string;
@@ -32,24 +32,24 @@ interface IOneSignalCategories {
32
32
  updateMessage: string;
33
33
  tags: IOneSignalTagCategory[];
34
34
  }
35
- interface IOneSignalTagCategory {
35
+ export interface IOneSignalTagCategory {
36
36
  tag: string;
37
37
  label: string;
38
38
  checked?: boolean;
39
39
  }
40
- type PushSubscriptionNamespaceProperties = {
40
+ export type PushSubscriptionNamespaceProperties = {
41
41
  id: string | null | undefined;
42
42
  token: string | null | undefined;
43
43
  optedIn: boolean;
44
44
  };
45
- type SubscriptionChangeEvent = {
45
+ export type SubscriptionChangeEvent = {
46
46
  previous: PushSubscriptionNamespaceProperties;
47
47
  current: PushSubscriptionNamespaceProperties;
48
48
  };
49
- type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';
50
- type SlidedownEventName = 'slidedownShown';
51
- type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;
52
- interface IOSNotification {
49
+ export type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';
50
+ export type SlidedownEventName = 'slidedownShown';
51
+ export type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;
52
+ export interface IOSNotification {
53
53
  /**
54
54
  * The OneSignal notification id;
55
55
  * - Primary id on OneSignal's REST API and dashboard
@@ -100,7 +100,7 @@ interface IOSNotification {
100
100
  */
101
101
  readonly confirmDelivery: boolean;
102
102
  }
103
- interface IOSNotificationActionButton {
103
+ export interface IOSNotificationActionButton {
104
104
  /**
105
105
  * Any unique identifier to represent which button was clicked. This is typically passed back to the service worker
106
106
  * and host page through events to identify which button was clicked.
@@ -120,44 +120,201 @@ interface IOSNotificationActionButton {
120
120
  */
121
121
  readonly launchURL?: string;
122
122
  }
123
- interface NotificationClickResult {
123
+ export interface NotificationClickResult {
124
124
  readonly actionId?: string;
125
125
  readonly url?: string;
126
126
  }
127
- type NotificationEventTypeMap = {
127
+ export type NotificationEventTypeMap = {
128
128
  'click': NotificationClickEvent;
129
129
  'foregroundWillDisplay': NotificationForegroundWillDisplayEvent;
130
130
  'dismiss': NotificationDismissEvent;
131
131
  'permissionChange': boolean;
132
132
  'permissionPromptDisplay': void;
133
133
  };
134
- interface NotificationForegroundWillDisplayEvent {
134
+ export interface NotificationForegroundWillDisplayEvent {
135
135
  readonly notification: IOSNotification;
136
136
  preventDefault(): void;
137
137
  }
138
- interface NotificationDismissEvent {
138
+ export interface NotificationDismissEvent {
139
139
  notification: IOSNotification;
140
140
  }
141
- interface NotificationClickEvent {
141
+ export interface NotificationClickEvent {
142
142
  readonly notification: IOSNotification;
143
143
  readonly result: NotificationClickResult;
144
144
  }
145
- type UserChangeEvent = {
145
+ export type UserChangeEvent = {
146
146
  current: UserNamespaceProperties;
147
147
  };
148
- type UserNamespaceProperties = {
148
+ export type UserNamespaceProperties = {
149
149
  onesignalId: string | undefined;
150
150
  externalId: string | undefined;
151
151
  };
152
- interface IInitObject {
152
+ export interface IInitObject {
153
153
  appId: string;
154
154
  subdomainName?: string;
155
155
  requiresUserPrivacyConsent?: boolean;
156
- promptOptions?: object;
157
- welcomeNotification?: object;
158
- notifyButton?: object;
156
+ promptOptions?: {
157
+ slidedown: {
158
+ prompts: {
159
+ /**
160
+ * Whether to automatically display the prompt.
161
+ * `true` will display the prompt based on the delay options.
162
+ * `false` will prevent the prompt from displaying until the Slidedowns methods are used.
163
+ */
164
+ autoPrompt: boolean;
165
+ /**
166
+ * Only available for type: category. Up to 10 categories.
167
+ * @example
168
+ * categories: [{ tag: 'local_news', label: 'Local News' }] // The user will be tagged with local_news but will see "Local News" in the prompt.
169
+ */
170
+ categories: {
171
+ /** Should identify the action. */
172
+ tag: string;
173
+ /** What the user will see. */
174
+ label: string;
175
+ }[];
176
+ /**
177
+ * The delay options for the prompt.
178
+ * @example delay: { pageViews: 3, timeDelay: 20 } // The user will not be shown the prompt until 20 seconds after the 3rd page view.
179
+ */
180
+ delay: {
181
+ /** The number of pages a user needs to visit before the prompt is displayed. */
182
+ pageViews?: number;
183
+ /** The number of seconds a user needs to wait before the prompt is displayed.Both options must be satisfied for the prompt to display */
184
+ timeDelay?: number;
185
+ };
186
+ /**
187
+ * The text to display in the prompt.
188
+ */
189
+ text?: {
190
+ /** The callout asking the user to opt-in. Up to 90 characters. */
191
+ actionMessage?: string;
192
+ /** Triggers the opt-in. Up to 15 characters. */
193
+ acceptButton?: string;
194
+ /** Cancels opt-in. Up to 15 characters. */
195
+ cancelMessage?: string;
196
+ /** The message of the confirmation prompt displayed after the email and/or phone number is provided. Up to 90 characters. */
197
+ confirmMessage?: string;
198
+ /** Identifies the email text field. Up to 15 characters. */
199
+ emailLabel?: string;
200
+ /** Cancels the category update. Up to 15 characters. */
201
+ negativeUpdateButton?: string;
202
+ /** Saves the updated category tags. Up to 15 characters. */
203
+ positiveUpdateButton?: string;
204
+ /** Identifies the phone number text field. Up to 15 characters. */
205
+ smsLabel?: string;
206
+ /** A different message shown to subscribers presented the prompt again to update categories. Up to 90 characters. */
207
+ updateMessage?: string;
208
+ };
209
+ /**
210
+ * The type of prompt to display.
211
+ * `push` which is the Slide Prompt without categories.
212
+ * `category` which is the Slide Prompt with categories.
213
+ * `sms` only asks for phone number.
214
+ * `email` only asks for email address.
215
+ * `smsAndEmail` asks for both phone number and email address.
216
+ */
217
+ type: 'push' | 'category' | 'sms' | 'email' | 'smsAndEmail';
218
+ }[];
219
+ };
220
+ };
221
+ welcomeNotification?: {
222
+ /**
223
+ * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.
224
+ */
225
+ disabled?: boolean;
226
+ /**
227
+ * The welcome notification's message. You can localize this to your own language.
228
+ * If left blank or set to blank, the default of 'Thanks for subscribing!' will be used.
229
+ */
230
+ message: string;
231
+ /**
232
+ * The welcome notification's title. You can localize this to your own language. If not set, or left blank, the site's title will be used.
233
+ * Set to one space ' ' to clear the title, although this is not recommended.
234
+ */
235
+ title?: string;
236
+ /**
237
+ * By default, clicking the welcome notification does not open any link.
238
+ * This is recommended because the user has just visited your site and subscribed.
239
+ */
240
+ url: string;
241
+ };
242
+ /**
243
+ * Will enable customization of the notify/subscription bell button.
244
+ */
245
+ notifyButton?: {
246
+ /**
247
+ * A function you define that returns true to show the Subscription Bell, or false to hide it.
248
+ * Typically used the hide the Subscription Bell after the user is subscribed.
249
+ * This function is not re-evaluated on every state change; this function is only evaluated once when the Subscription Bell begins to show.
250
+ */
251
+ displayPredicate?: () => boolean | Promise<boolean>;
252
+ /**
253
+ * Enable the Subscription Bell. The Subscription Bell is otherwise disabled by default.
254
+ */
255
+ enable?: boolean;
256
+ /** Specify CSS-valid pixel offsets using bottom, left, and right. */
257
+ offset?: {
258
+ bottom: string;
259
+ left: string;
260
+ right: string;
261
+ };
262
+ /**
263
+ * If `true`, the Subscription Bell will display an icon that there is 1 unread message.
264
+ * When hovering over the Subscription Bell, the user will see custom text set by message.prenotify.
265
+ */
266
+ prenotify: boolean;
267
+ /** Either `bottom-left` or `bottom-right`. The Subscription Bell will be fixed at this location on your page. */
268
+ position?: 'bottom-left' | 'bottom-right';
269
+ /** Set `false` to hide the 'Powered by OneSignal' text in the Subscription Bell dialog popup. */
270
+ showCredit: boolean;
271
+ /**
272
+ * The Subscription Bell will initially appear at one of these sizes, and then shrink down to size `small` after the user subscribes.
273
+ */
274
+ size?: 'small' | 'medium' | 'large';
275
+ /** Customize the Subscription Bell text. */
276
+ text: {
277
+ 'dialog.blocked.message': string;
278
+ 'dialog.blocked.title': string;
279
+ 'dialog.main.button.subscribe': string;
280
+ 'dialog.main.button.unsubscribe': string;
281
+ 'dialog.main.title': string;
282
+ 'message.action.resubscribed': string;
283
+ 'message.action.subscribed': string;
284
+ 'message.action.subscribing': string;
285
+ 'message.action.unsubscribed': string;
286
+ 'message.prenotify': string;
287
+ 'tip.state.blocked': string;
288
+ 'tip.state.subscribed': string;
289
+ 'tip.state.unsubscribed': string;
290
+ };
291
+ };
159
292
  persistNotification?: boolean;
160
- webhooks?: object;
293
+ webhooks?: {
294
+ /**
295
+ * Enable this setting only if your server has CORS enabled and supports non-simple CORS requests.
296
+ * If this setting is disabled, your webhook will not need CORS to receive data, but it will not receive the custom headers.
297
+ * The simplest option is to leave it disabled.
298
+ * @default false
299
+ */
300
+ cors: boolean;
301
+ /**
302
+ * This event occurs after a notification is clicked.
303
+ * @example https://site.com/hook
304
+ */
305
+ 'notification.clicked'?: string;
306
+ /**
307
+ * This event occurs after a notification is intentionally dismissed by the user (clicking the notification body or one of the notification action buttons does not trigger the dismissed webhook),
308
+ * after a group of notifications are all dismissed (with this notification as part of that group), or after a notification expires on its own time and disappears. This event is supported on Chrome only.
309
+ * @example https://site.com/hook
310
+ */
311
+ 'notification.dismissed'?: string;
312
+ /**
313
+ * This event occurs after a notification is displayed.
314
+ * @example https://site.com/hook
315
+ */
316
+ 'notification.willDisplay'?: string;
317
+ };
161
318
  autoResubscribe?: boolean;
162
319
  autoRegister?: boolean;
163
320
  notificationClickHandlerMatch?: string;
@@ -172,7 +329,7 @@ interface IInitObject {
172
329
  allowLocalhostAsSecureOrigin?: boolean;
173
330
  [key: string]: any;
174
331
  }
175
- interface IOneSignalOneSignal {
332
+ export interface IOneSignalOneSignal {
176
333
  Slidedown: IOneSignalSlidedown;
177
334
  Notifications: IOneSignalNotifications;
178
335
  Session: IOneSignalSession;
@@ -184,7 +341,7 @@ interface IOneSignalOneSignal {
184
341
  setConsentGiven(consent: boolean): Promise<void>;
185
342
  setConsentRequired(requiresConsent: boolean): Promise<void>;
186
343
  }
187
- interface IOneSignalNotifications {
344
+ export interface IOneSignalNotifications {
188
345
  permissionNative: NotificationPermission;
189
346
  permission: boolean;
190
347
  setDefaultUrl(url: string): Promise<void>;
@@ -194,7 +351,7 @@ interface IOneSignalNotifications {
194
351
  addEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
195
352
  removeEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
196
353
  }
197
- interface IOneSignalSlidedown {
354
+ export interface IOneSignalSlidedown {
198
355
  promptPush(options?: AutoPromptOptions): Promise<void>;
199
356
  promptPushCategories(options?: AutoPromptOptions): Promise<void>;
200
357
  promptSms(options?: AutoPromptOptions): Promise<void>;
@@ -203,14 +360,14 @@ interface IOneSignalSlidedown {
203
360
  addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
204
361
  removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
205
362
  }
206
- interface IOneSignalDebug {
363
+ export interface IOneSignalDebug {
207
364
  setLogLevel(logLevel: string): void;
208
365
  }
209
- interface IOneSignalSession {
366
+ export interface IOneSignalSession {
210
367
  sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;
211
368
  sendUniqueOutcome(outcomeName: string): Promise<void>;
212
369
  }
213
- interface IOneSignalUser {
370
+ export interface IOneSignalUser {
214
371
  onesignalId: string | undefined;
215
372
  externalId: string | undefined;
216
373
  PushSubscription: IOneSignalPushSubscription;
@@ -238,7 +395,7 @@ interface IOneSignalUser {
238
395
  setLanguage(language: string): void;
239
396
  getLanguage(): string;
240
397
  }
241
- interface IOneSignalPushSubscription {
398
+ export interface IOneSignalPushSubscription {
242
399
  id: string | null | undefined;
243
400
  token: string | null | undefined;
244
401
  optedIn: boolean | undefined;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACzC,MAAM,qBAAqB,GAAG,6DAA6D,CAAC;AAE5F,sDAAsD;AACtD,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,0EAA0E;AAC1E,mEAAmE;AACnE,kBAAkB;AAClB,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAEpC,MAAM,MAAM,GAAQ,GAAG,CAAC;AAExB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,MAAM,CAAC,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,IAAI,EAAE,CAAC;IAC1D,YAAY,EAAE,CAAC;CAChB;AAED,mBAAmB;AAEnB,SAAS,aAAa;IACpB,uBAAuB,GAAG,IAAI,CAAC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BAAkB;IAC7B,WAAW,EAAE,oBAAoB;IACjC,iBAAiB,EAAE,0BAA0B;IAC7C,gBAAgB,EAAE,yBAAyB;IAC3C,mBAAmB,EAAE,4BAA4B;CACjD,CAAC;AAEF,MAAM,sBAAsB,GAA4B;IACvD,IAAI,gBAAgB,qBAA6B,OAAO,MAAA,MAAA,MAAA,MAAM,CAAC,SAAS,0CAAE,aAAa,0CAAE,gBAAgB,mCAAI,SAAS,CAAC,CAAC,CAAC;IACzH,IAAI,UAAU,qBAAc,OAAO,MAAA,MAAA,MAAA,MAAM,CAAC,SAAS,0CAAE,aAAa,0CAAE,UAAU,mCAAI,KAAK,CAAC,CAAC,CAAC;IAC1F,aAAa,EAAE,0BAA0B;IACzC,eAAe,EAAE,4BAA4B;IAC7C,eAAe;IACf,iBAAiB,EAAE,8BAA8B;IACjD,gBAAgB,EAAE,6BAA6B;IAC/C,mBAAmB,EAAE,gCAAgC;CACrD,CAAC;AAEF,MAAM,kBAAkB,GAAwB;IAC/C,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE,eAAe;IACvB,IAAI;IACJ,eAAe,EAAE,wBAAwB;IACzC,kBAAkB,EAAE,2BAA2B;IAC/C,SAAS,EAAE,kBAAkB;IAC7B,aAAa,EAAE,sBAAsB;IACrC,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,cAAc;CACrB,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,OAAO,CAAC,GAAkB;QACxB,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,kBAAyC,CAAC;IACvE,CAAC;CACF,CAAA;AAED,eAAe,kBAAkB,CAAC"}
package/index.ts CHANGED
@@ -121,16 +121,16 @@ const isPushSupported = (): boolean => {
121
121
  return isPushNotificationsSupported();
122
122
  }
123
123
 
124
- interface AutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; slidedownPromptOptions?: IOneSignalAutoPromptOptions; }
125
- interface IOneSignalAutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; isInUpdateMode?: boolean; categoryOptions?: IOneSignalCategories; }
126
- interface IOneSignalCategories { positiveUpdateButton: string; negativeUpdateButton: string; savingButtonText: string; errorButtonText: string; updateMessage: string; tags: IOneSignalTagCategory[]; }
127
- interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; }
128
- type PushSubscriptionNamespaceProperties = { id: string | null | undefined; token: string | null | undefined; optedIn: boolean; };
129
- type SubscriptionChangeEvent = { previous: PushSubscriptionNamespaceProperties; current: PushSubscriptionNamespaceProperties; };
130
- type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';
131
- type SlidedownEventName = 'slidedownShown';
132
- type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;
133
- interface IOSNotification {
124
+ export interface AutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; slidedownPromptOptions?: IOneSignalAutoPromptOptions; }
125
+ export interface IOneSignalAutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; isInUpdateMode?: boolean; categoryOptions?: IOneSignalCategories; }
126
+ export interface IOneSignalCategories { positiveUpdateButton: string; negativeUpdateButton: string; savingButtonText: string; errorButtonText: string; updateMessage: string; tags: IOneSignalTagCategory[]; }
127
+ export interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; }
128
+ export type PushSubscriptionNamespaceProperties = { id: string | null | undefined; token: string | null | undefined; optedIn: boolean; };
129
+ export type SubscriptionChangeEvent = { previous: PushSubscriptionNamespaceProperties; current: PushSubscriptionNamespaceProperties; };
130
+ export type NotificationEventName = 'click' | 'foregroundWillDisplay' | 'dismiss' | 'permissionChange' | 'permissionPromptDisplay';
131
+ export type SlidedownEventName = 'slidedownShown';
132
+ export type OneSignalDeferredLoadedCallback = (onesignal: IOneSignalOneSignal) => void;
133
+ export interface IOSNotification {
134
134
  /**
135
135
  * The OneSignal notification id;
136
136
  * - Primary id on OneSignal's REST API and dashboard
@@ -192,7 +192,7 @@ interface IOSNotification {
192
192
  readonly confirmDelivery: boolean;
193
193
  }
194
194
 
195
- interface IOSNotificationActionButton {
195
+ export interface IOSNotificationActionButton {
196
196
  /**
197
197
  * Any unique identifier to represent which button was clicked. This is typically passed back to the service worker
198
198
  * and host page through events to identify which button was clicked.
@@ -213,12 +213,12 @@ interface IOSNotificationActionButton {
213
213
  readonly launchURL?: string;
214
214
  }
215
215
 
216
- interface NotificationClickResult {
216
+ export interface NotificationClickResult {
217
217
  readonly actionId?: string;
218
218
  readonly url?: string;
219
219
  }
220
220
 
221
- type NotificationEventTypeMap = {
221
+ export type NotificationEventTypeMap = {
222
222
  'click': NotificationClickEvent;
223
223
  'foregroundWillDisplay': NotificationForegroundWillDisplayEvent;
224
224
  'dismiss': NotificationDismissEvent;
@@ -226,37 +226,219 @@ type NotificationEventTypeMap = {
226
226
  'permissionPromptDisplay': void;
227
227
  };
228
228
 
229
- interface NotificationForegroundWillDisplayEvent {
229
+ export interface NotificationForegroundWillDisplayEvent {
230
230
  readonly notification: IOSNotification;
231
231
  preventDefault(): void;
232
232
  }
233
233
 
234
- interface NotificationDismissEvent {
234
+ export interface NotificationDismissEvent {
235
235
  notification: IOSNotification;
236
236
  }
237
237
 
238
- interface NotificationClickEvent {
238
+ export interface NotificationClickEvent {
239
239
  readonly notification: IOSNotification;
240
240
  readonly result: NotificationClickResult;
241
241
  }
242
242
 
243
- type UserChangeEvent = {
243
+ export type UserChangeEvent = {
244
244
  current: UserNamespaceProperties;
245
245
  };
246
- type UserNamespaceProperties = {
246
+ export type UserNamespaceProperties = {
247
247
  onesignalId: string | undefined;
248
248
  externalId: string | undefined;
249
249
  };
250
250
 
251
- interface IInitObject {
251
+ export interface IInitObject {
252
252
  appId: string;
253
253
  subdomainName?: string;
254
254
  requiresUserPrivacyConsent?: boolean;
255
- promptOptions?: object;
256
- welcomeNotification?: object;
257
- notifyButton?: object;
255
+ promptOptions?: {
256
+ slidedown: {
257
+ prompts: {
258
+ /**
259
+ * Whether to automatically display the prompt.
260
+ * `true` will display the prompt based on the delay options.
261
+ * `false` will prevent the prompt from displaying until the Slidedowns methods are used.
262
+ */
263
+ autoPrompt: boolean;
264
+
265
+ /**
266
+ * Only available for type: category. Up to 10 categories.
267
+ * @example
268
+ * categories: [{ tag: 'local_news', label: 'Local News' }] // The user will be tagged with local_news but will see "Local News" in the prompt.
269
+ */
270
+ categories: {
271
+ /** Should identify the action. */
272
+ tag: string;
273
+
274
+ /** What the user will see. */
275
+ label: string;
276
+ }[];
277
+
278
+ /**
279
+ * The delay options for the prompt.
280
+ * @example delay: { pageViews: 3, timeDelay: 20 } // The user will not be shown the prompt until 20 seconds after the 3rd page view.
281
+ */
282
+ delay: {
283
+ /** The number of pages a user needs to visit before the prompt is displayed. */
284
+ pageViews?: number;
285
+
286
+ /** The number of seconds a user needs to wait before the prompt is displayed.Both options must be satisfied for the prompt to display */
287
+ timeDelay?: number;
288
+ };
289
+
290
+ /**
291
+ * The text to display in the prompt.
292
+ */
293
+ text?: {
294
+ /** The callout asking the user to opt-in. Up to 90 characters. */
295
+ actionMessage?: string;
296
+
297
+ /** Triggers the opt-in. Up to 15 characters. */
298
+ acceptButton?: string;
299
+
300
+ /** Cancels opt-in. Up to 15 characters. */
301
+ cancelMessage?: string;
302
+
303
+ /** The message of the confirmation prompt displayed after the email and/or phone number is provided. Up to 90 characters. */
304
+ confirmMessage?: string;
305
+
306
+ /** Identifies the email text field. Up to 15 characters. */
307
+ emailLabel?: string;
308
+
309
+ /** Cancels the category update. Up to 15 characters. */
310
+ negativeUpdateButton?: string;
311
+
312
+ /** Saves the updated category tags. Up to 15 characters. */
313
+ positiveUpdateButton?: string;
314
+
315
+ /** Identifies the phone number text field. Up to 15 characters. */
316
+ smsLabel?: string;
317
+
318
+ /** A different message shown to subscribers presented the prompt again to update categories. Up to 90 characters. */
319
+ updateMessage?: string;
320
+ };
321
+
322
+ /**
323
+ * The type of prompt to display.
324
+ * `push` which is the Slide Prompt without categories.
325
+ * `category` which is the Slide Prompt with categories.
326
+ * `sms` only asks for phone number.
327
+ * `email` only asks for email address.
328
+ * `smsAndEmail` asks for both phone number and email address.
329
+ */
330
+ type: 'push' | 'category' | 'sms' | 'email' | 'smsAndEmail';
331
+ }[];
332
+ };
333
+ };
334
+ welcomeNotification?: {
335
+ /**
336
+ * Disables sending a welcome notification to new site visitors. If you want to disable welcome notifications, this is the only option you need.
337
+ */
338
+ disabled?: boolean;
339
+
340
+ /**
341
+ * The welcome notification's message. You can localize this to your own language.
342
+ * If left blank or set to blank, the default of 'Thanks for subscribing!' will be used.
343
+ */
344
+ message: string;
345
+
346
+ /**
347
+ * The welcome notification's title. You can localize this to your own language. If not set, or left blank, the site's title will be used.
348
+ * Set to one space ' ' to clear the title, although this is not recommended.
349
+ */
350
+ title?: string;
351
+
352
+ /**
353
+ * By default, clicking the welcome notification does not open any link.
354
+ * This is recommended because the user has just visited your site and subscribed.
355
+ */
356
+ url: string;
357
+ };
358
+
359
+ /**
360
+ * Will enable customization of the notify/subscription bell button.
361
+ */
362
+ notifyButton?: {
363
+ /**
364
+ * A function you define that returns true to show the Subscription Bell, or false to hide it.
365
+ * Typically used the hide the Subscription Bell after the user is subscribed.
366
+ * This function is not re-evaluated on every state change; this function is only evaluated once when the Subscription Bell begins to show.
367
+ */
368
+ displayPredicate?: () => boolean | Promise<boolean>;
369
+
370
+ /**
371
+ * Enable the Subscription Bell. The Subscription Bell is otherwise disabled by default.
372
+ */
373
+ enable?: boolean;
374
+
375
+ /** Specify CSS-valid pixel offsets using bottom, left, and right. */
376
+ offset?: { bottom: string; left: string; right: string };
377
+
378
+ /**
379
+ * If `true`, the Subscription Bell will display an icon that there is 1 unread message.
380
+ * When hovering over the Subscription Bell, the user will see custom text set by message.prenotify.
381
+ */
382
+ prenotify: boolean;
383
+
384
+ /** Either `bottom-left` or `bottom-right`. The Subscription Bell will be fixed at this location on your page. */
385
+ position?: 'bottom-left' | 'bottom-right';
386
+
387
+ /** Set `false` to hide the 'Powered by OneSignal' text in the Subscription Bell dialog popup. */
388
+ showCredit: boolean;
389
+
390
+ /**
391
+ * The Subscription Bell will initially appear at one of these sizes, and then shrink down to size `small` after the user subscribes.
392
+ */
393
+ size?: 'small' | 'medium' | 'large';
394
+
395
+ /** Customize the Subscription Bell text. */
396
+ text: {
397
+ 'dialog.blocked.message': string;
398
+ 'dialog.blocked.title': string;
399
+ 'dialog.main.button.subscribe': string;
400
+ 'dialog.main.button.unsubscribe': string;
401
+ 'dialog.main.title': string;
402
+ 'message.action.resubscribed': string;
403
+ 'message.action.subscribed': string;
404
+ 'message.action.subscribing': string;
405
+ 'message.action.unsubscribed': string;
406
+ 'message.prenotify': string;
407
+ 'tip.state.blocked': string;
408
+ 'tip.state.subscribed': string;
409
+ 'tip.state.unsubscribed': string;
410
+ };
411
+ };
412
+
258
413
  persistNotification?: boolean;
259
- webhooks?: object;
414
+ webhooks?: {
415
+ /**
416
+ * Enable this setting only if your server has CORS enabled and supports non-simple CORS requests.
417
+ * If this setting is disabled, your webhook will not need CORS to receive data, but it will not receive the custom headers.
418
+ * The simplest option is to leave it disabled.
419
+ * @default false
420
+ */
421
+ cors: boolean;
422
+
423
+ /**
424
+ * This event occurs after a notification is clicked.
425
+ * @example https://site.com/hook
426
+ */
427
+ 'notification.clicked'?: string;
428
+
429
+ /**
430
+ * This event occurs after a notification is intentionally dismissed by the user (clicking the notification body or one of the notification action buttons does not trigger the dismissed webhook),
431
+ * after a group of notifications are all dismissed (with this notification as part of that group), or after a notification expires on its own time and disappears. This event is supported on Chrome only.
432
+ * @example https://site.com/hook
433
+ */
434
+ 'notification.dismissed'?: string;
435
+
436
+ /**
437
+ * This event occurs after a notification is displayed.
438
+ * @example https://site.com/hook
439
+ */
440
+ 'notification.willDisplay'?: string;
441
+ };
260
442
  autoResubscribe?: boolean;
261
443
  autoRegister?: boolean;
262
444
  notificationClickHandlerMatch?: string;
@@ -270,7 +452,7 @@ interface IInitObject {
270
452
  [key: string]: any;
271
453
  }
272
454
 
273
- interface IOneSignalOneSignal {
455
+ export interface IOneSignalOneSignal {
274
456
  Slidedown: IOneSignalSlidedown;
275
457
  Notifications: IOneSignalNotifications;
276
458
  Session: IOneSignalSession;
@@ -282,7 +464,7 @@ interface IOneSignalOneSignal {
282
464
  setConsentGiven(consent: boolean): Promise<void>;
283
465
  setConsentRequired(requiresConsent: boolean): Promise<void>;
284
466
  }
285
- interface IOneSignalNotifications {
467
+ export interface IOneSignalNotifications {
286
468
  permissionNative: NotificationPermission;
287
469
  permission: boolean;
288
470
  setDefaultUrl(url: string): Promise<void>;
@@ -292,7 +474,7 @@ interface IOneSignalNotifications {
292
474
  addEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
293
475
  removeEventListener<K extends NotificationEventName>(event: K, listener: (obj: NotificationEventTypeMap[K]) => void): void;
294
476
  }
295
- interface IOneSignalSlidedown {
477
+ export interface IOneSignalSlidedown {
296
478
  promptPush(options?: AutoPromptOptions): Promise<void>;
297
479
  promptPushCategories(options?: AutoPromptOptions): Promise<void>;
298
480
  promptSms(options?: AutoPromptOptions): Promise<void>;
@@ -301,14 +483,14 @@ interface IOneSignalSlidedown {
301
483
  addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
302
484
  removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
303
485
  }
304
- interface IOneSignalDebug {
486
+ export interface IOneSignalDebug {
305
487
  setLogLevel(logLevel: string): void;
306
488
  }
307
- interface IOneSignalSession {
489
+ export interface IOneSignalSession {
308
490
  sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;
309
491
  sendUniqueOutcome(outcomeName: string): Promise<void>;
310
492
  }
311
- interface IOneSignalUser {
493
+ export interface IOneSignalUser {
312
494
  onesignalId: string | undefined;
313
495
  externalId: string | undefined;
314
496
  PushSubscription: IOneSignalPushSubscription;
@@ -330,7 +512,7 @@ interface IOneSignalUser {
330
512
  setLanguage(language: string): void;
331
513
  getLanguage(): string;
332
514
  }
333
- interface IOneSignalPushSubscription {
515
+ export interface IOneSignalPushSubscription {
334
516
  id: string | null | undefined;
335
517
  token: string | null | undefined;
336
518
  optedIn: boolean | undefined;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "onesignal-vue",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Vue OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!",
5
- "author": "rgomezp",
5
+ "type": "module",
6
6
  "contributors": [
7
7
  {
8
8
  "name": "Rodrigo Gomez-Palacio"
@@ -13,9 +13,9 @@
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "scripts": {
16
- "lint": "./node_modules/.bin/eslint . --ext .ts",
17
- "build": "yarn run lint && tsc",
18
- "prepare": "yarn run build"
16
+ "lint": "eslint . --ext .ts",
17
+ "build": "npm run lint && tsc",
18
+ "prepare": "npm run build"
19
19
  },
20
20
  "dependencies": {
21
21
  "vue": "^2.6.14"
package/tsconfig.json CHANGED
@@ -13,7 +13,6 @@
13
13
  "noImplicitThis": true,
14
14
  "noImplicitAny": false,
15
15
  "strictNullChecks": false,
16
- "suppressImplicitAnyIndexErrors": true,
17
16
  "noUnusedLocals": true,
18
17
  "noUnusedParameters": true,
19
18
  "allowSyntheticDefaultImports": true,
package/.eslintrc.js DELETED
@@ -1,44 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- browser: true,
5
- es6: true,
6
- node: true,
7
- },
8
- settings: {
9
- "import/resolver": {
10
- node: {
11
- paths: ["src"],
12
- extensions: [
13
- ".js",
14
- ".ts",
15
- ],
16
- },
17
- },
18
- },
19
- globals: {
20
- Atomics: 'readonly',
21
- SharedArrayBuffer: 'readonly',
22
- },
23
- parser: '@typescript-eslint/parser',
24
- parserOptions: {
25
- ecmaVersion: 2018,
26
- sourceType: 'module',
27
- },
28
- plugins: [
29
- '@typescript-eslint',
30
- ],
31
- extends: [
32
- 'plugin:@typescript-eslint/recommended',
33
- ],
34
- rules: {
35
- "prefer-destructuring": 0,
36
- "no-param-reassign": 0,
37
- "import/extensions": 0,
38
- "dot-notation": 0,
39
- "no-continue": 0,
40
- "no-unused-vars": "off",
41
- "@typescript-eslint/no-unused-vars": ["error"],
42
- "no-prototype-builtins": "warn",
43
- },
44
- };