diff --git a/.npmignore b/.npmignore index fba3947..9785c97 100644 --- a/.npmignore +++ b/.npmignore @@ -14,6 +14,7 @@ build .env.development.local .env.test.local .env.production.local +.babelrc; npm-debug.log* yarn-debug.log* diff --git a/index.ts b/index.ts index 016e0f1..faf77f1 100644 --- a/index.ts +++ b/index.ts @@ -74,11 +74,32 @@ interface SetEmailOptions { identifierAuthHash?: string; emailAuthHash?: string; interface TagsObject { [key: string]: T; } interface IOneSignalAutoPromptOptions { force?: boolean; forceSlidedownOverNative?: boolean; isInUpdateMode?: boolean; categoryOptions?: IOneSignalCategories; } interface IOneSignalCategories { positiveUpdateButton: string; negativeUpdateButton: string; savingButtonText: string; errorButtonText: string; updateMessage: string; tags: IOneSignalTagCategory[]; } -export interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; } - +interface IOneSignalTagCategory { tag: string; label: string; checked?: boolean; } + + +interface IInitObject { + appId: string; + subdomainName?: string; + requiresUserPrivacyConsent?: boolean; + promptOptions?: Object; + welcomeNotification?: Object; + notifyButton?: Object; + persistNotification?: boolean; + webhooks?: Object; + autoResubscribe?: boolean; + autoRegister?: boolean; + notificationClickHandlerMatch?: string; + notificationClickHandlerAction?: string; + serviceWorkerParam?: { scope: string }; + serviceWorkerPath?: string; + serviceWorkerUpdaterPath?: string; + path?: string; + allowLocalhostAsSecureOrigin?: boolean; + [key: string]: any; +} interface IOneSignal { - init(options?: any): Promise + init(options: IInitObject): Promise on(event: string, listener: Function): void off(event: string, listener: Function): void once(event: string, listener: Function): void @@ -121,7 +142,7 @@ interface IOneSignal { /* O N E S I G N A L A P I */ -function init(options: Object = {}) { +function init(options: IInitObject) { return new Promise(resolve => { if (isOneSignalInitialized) { return; diff --git a/package.json b/package.json index 46a8396..5bc6f58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "onesignal-vue", - "version": "1.0.0-beta2", + "version": "1.0.0-beta3", "description": "Vue OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!", "author": "rgomezp", "contributors": [{ "name": "Rodrigo Gomez-Palacio" }], diff --git a/rollup.config.js b/rollup.config.js index 3ade71b..22a2565 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -34,4 +34,3 @@ export default { commonjs(), ], }; -