import * as tfrpc from '/tfrpc.js'; tfrpc.register(async function getIdentities() { return ssb.getIdentities(); }); tfrpc.register(async function createID(id) { return await ssb.createIdentity(); }); tfrpc.register(async function getPrivateKey(id) { return bip39Words(await ssb.getPrivateKey(id)); }); tfrpc.register(async function addID(id) { return await ssb.addIdentity(bip39Bytes(id)); }); tfrpc.register(async function deleteID(id) { return await ssb.deleteIdentity(id); }); tfrpc.register(async function getThemes() { // TODO return ['solarized', 'gruvbox', 'light']; }); tfrpc.register(async function getTheme() { // TODO return 'gruvbox'; }); tfrpc.register(async function setTheme() { // TODO console.warn('setTheme called - not implemented'); return null; }); tfrpc.register(async function reload() { await main(); }); async function main() { // Get body.html const body = utf8Decode(await getFile('body.html')); // Build the document const document = `
${body} `; // Send it to the browser app.setDocument(document); } main();