_requestAsPromise(): Promise<void> {
        const existing = this.get();

        let isGranted = result => result === this.GRANTED || result === 0;

        /* Permissions already set */
        var hasPermissions = existing !== this.DEFAULT;

        /* Safari 6+, Chrome 23+ */
        var isModernAPI =
            this._win.Notification && this._win.Notification.requestPermission;

        /* Legacy webkit browsers */
        var isWebkitAPI =
            this._win.webkitNotifications &&
            this._win.webkitNotifications.checkPermission;

        return new Promise((resolvePromise, rejectPromise) => {
            var resolved = false;
            var resolver = result => {
                if (resolved) return;
                resolved = true;
                isGranted(result) ? resolvePromise() : rejectPromise();
            };
            var request;

            if (hasPermissions) {
                resolver(existing);
            } else if (isWebkitAPI) {
                this._win.webkitNotifications.requestPermission(result => {
                    resolver(result);
                });
            } else if (isModernAPI) {
                /* Safari 12+ */
                /* This resolver argument will only be used in Safari */
                /* CHrome, instead, returns a Promise */
                request = this._win.Notification.requestPermission(resolver);
                if (request && request.then) {
                    /* Chrome 23+ */
                    request.then(resolver).catch(rejectPromise);
                }
            } else resolvePromise();
        });
    }
Requests permission for desktop notifications in a promise based way
@return {Promise}