How to use the @capacitor/core.registerWebPlugin function in @capacitor/core

To help you get started, we’ve selected a few @capacitor/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionic-team / capacitor / plugin-template / src / web.ts View on Github external
platforms: ['web']
    });
  }

  async echo(options: { value: string }): Promise<{value: string}> {
    console.log('ECHO', options);
    return options;
  }
}

const MyPlugin = new MyPluginWeb();

export { MyPlugin };

import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(MyPlugin);
github jepiqueau / capacitor-data-storage-sqlite / src / web.ts View on Github external
let results: Array<data>;
    results = await this.mDb.keysvalues();
    for (let i:number = 0;i</data>
github martinkasa / capacitor-secure-storage-plugin / src / web.ts View on Github external
if (key.indexOf(this.PREFIX) === 0) {
        localStorage.removeItem(key);
      }
    }
    return Promise.resolve({ value: true });
  }

  private addPrefix = (key: string) => this.PREFIX + key;
}

const SecureStoragePlugin = new SecureStoragePluginWeb();

export { SecureStoragePlugin };

import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(SecureStoragePlugin);
github martinkasa / capacitor-secure-storage-plugin / dist / esm / web.js View on Github external
get(options) {
        return Promise.resolve({ value: localStorage.getItem(options.key) });
    }
    set(options) {
        localStorage.setItem(options.key, options.value);
        return Promise.resolve({ value: true });
    }
    remove(options) {
        localStorage.removeItem(options.key);
        return Promise.resolve({ value: true });
    }
}
const SecureStoragePlugin = new SecureStoragePluginWeb();
export { SecureStoragePlugin };
import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(SecureStoragePlugin);
//# sourceMappingURL=web.js.map
github moberwasserlechner / capacitor-oauth2 / src / web.ts View on Github external
localStorage.removeItem(WebUtils.getAppId(options));
            resolve();
        });
    }

    private closeWindow() {
        clearInterval(this.intervalId);
        this.windowHandle.close();
    }
}

const OAuth2Client = new OAuth2ClientPluginWeb();

export { OAuth2Client };

registerWebPlugin(OAuth2Client);
github jepiqueau / capacitor-data-storage-sqlite / dist / esm / web.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            let ret = [];
            let results;
            results = yield this.mDb.keysvalues();
            for (let i = 0; i &lt; results.length; i++) {
                let res = { "key": results[i].name, "value": results[i].value };
                ret.push(res);
            }
            return Promise.resolve({ keysvalues: ret });
        });
    }
}
const CapacitorDataStorageSqlite = new CapacitorDataStorageSqliteWeb();
export { CapacitorDataStorageSqlite };
import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(CapacitorDataStorageSqlite);
//# sourceMappingURL=web.js.map