@@ -65,7 +65,6 @@ export default class LeanplumInternal {
6565 this . getFileUrl . bind ( this ) ,
6666 )
6767
68- private _email : string
6968 private _deviceName : string
7069 private _deviceModel : string
7170 private _systemName : string
@@ -74,7 +73,7 @@ export default class LeanplumInternal {
7473
7574 constructor ( private wnd : Window ) {
7675 this . _browserDetector = new BrowserDetector ( wnd )
77- this . _events . on ( 'navigationChange' , ( url ) => {
76+ this . _events . on ( 'navigationChange' , ( url : string ) => {
7877 let prevented = false
7978 this . _events . emit ( 'openUrl' , {
8079 preventDefault : ( ) => prevented = true ,
@@ -95,10 +94,6 @@ export default class LeanplumInternal {
9594 this . _lpRequest . apiPath = apiPath
9695 }
9796
98- setEmail ( email : string ) : void {
99- this . _email = email
100- }
101-
10297 /**
10398 * Sets the network timeout.
10499 * @param {number } seconds The timeout in seconds.
@@ -234,7 +229,7 @@ export default class LeanplumInternal {
234229 this . createRequest ( Constants . METHODS . GET_VARS , args , {
235230 queued : false ,
236231 sendNow : true ,
237- response : ( response ) => {
232+ response : ( response : Array < Object > ) => {
238233 const getVarsResponse = this . _lpRequest . getLastResponse ( response )
239234 const isSuccess = this . _lpRequest . isResponseSuccess ( getVarsResponse )
240235 if ( isSuccess ) {
@@ -310,7 +305,7 @@ export default class LeanplumInternal {
310305 this . createRequest ( Constants . METHODS . START , args , {
311306 queued : true ,
312307 sendNow : true ,
313- response : ( response ) => {
308+ response : ( response : Array < Object > ) => {
314309 this . _internalState . hasStarted = true
315310 const startResponse = this . _lpRequest . getLastResponse ( response )
316311 const isSuccess = this . _lpRequest . isResponseSuccess ( startResponse )
@@ -565,14 +560,14 @@ Use "npm update leanplum-sdk" or go to https://docs.leanplum.com/reference#javas
565560 */
566561 registerForWebPush ( serviceWorkerUrl ?: string ) : Promise < boolean > {
567562 if ( this . _pushManager . isWebPushSupported ( ) ) {
568- const subscribe = ( isSubscribed ) : Promise < boolean > => {
563+ const subscribe = ( isSubscribed : boolean ) : Promise < boolean > => {
569564 if ( isSubscribed ) {
570565 return Promise . resolve ( true )
571566 }
572567 return this . _pushManager . subscribeUser ( )
573568 }
574569
575- const options = this . _webPushOptions
570+ const options = this . _webPushOptions || { }
576571 const workerUrl = serviceWorkerUrl || options . serviceWorkerUrl
577572 const scope = options && options . scope ? { scope : options . scope } : null
578573
0 commit comments