How to use the pxt-core.d.ts function in pxt-core

To help you get started, we’ve selected a few pxt-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 microsoft / pxt / docs / playground-runner.html View on Github external
.then(opts => {
                        opts.fileSystem["main.ts"] = ' ';
                        opts.fileSystem["custom.ts"] = js;
                        opts.fileSystem["pxt-core.d.ts"] = common;
                        opts.fileSystem["pxt-helpers.ts"] = helpers;
                        opts.ast = true;
                        opts.testMode = true;
                        opts.ignoreFileResolutionErrors = true;

                        var resp = pxtc.compile(opts);
                        if (!resp.success) {
                            console.log('error: ', resp);
                            return;
                        }

                        var file = resp.ast.getSourceFile("main.ts");
                        var apiInfo = pxtc.getApiInfo(opts, resp.ast);
                        var blockInfo = pxtc.getBlocksInfo(apiInfo);

                        // Initialize blocks in Blockly

pxt-core

Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors

MIT
Latest version published 4 days ago

Package Health Score

80 / 100
Full package analysis