/* global document, grist, window */ grist.ready(); function readDoc() { const api = grist.rpc.getStub("GristDocAPI@grist", grist.checkers.GristDocAPI); const placeholder = document.getElementById('placeholder'); const fallback = setTimeout(() => { placeholder.innerHTML = '
no joy
'; }, 1000); api.listTables() .then(tables => { clearTimeout(fallback); placeholder.innerHTML = `
${JSON.stringify(tables)}
`; }); } window.onload = readDoc;