mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 18:55:29 -05:00
Adding JS Types (#1749)
Added types for some exceptions, config objects, and sleep()
This commit is contained in:
@@ -46,7 +46,15 @@ const syntaxError = (type, url, { message }) => {
|
||||
};
|
||||
|
||||
// find the shared config for all py-script elements
|
||||
let config, plugins, parsed, error, type;
|
||||
let config, type;
|
||||
|
||||
/** @type {Promise<any> | undefined} A Promise wrapping any plugins which should be loaded. */
|
||||
let plugins;
|
||||
/** @type {any} The PyScript configuration parsed from the JSON or TOML object*. May be any of the return types of JSON.parse() or toml-j0.4's parse() ( {number | string | boolean | null | object | Array} ) */
|
||||
let parsed;
|
||||
/** @type {SyntaxError | undefined} The error thrown when parsing the PyScript config, if any.*/
|
||||
let error;
|
||||
|
||||
let pyConfig = $("py-config");
|
||||
if (pyConfig) {
|
||||
config = pyConfig.getAttribute("src") || pyConfig.textContent;
|
||||
|
||||
Reference in New Issue
Block a user