DefinitelyTyped/types/carlo/carlo-tests.ts
Adam Dierkens b5e02f4863 Add types for carlo (#33861)
* Add carlo definitions

* Share expose function def

* Use puppeteer-core

* lint
2019-03-14 12:35:50 -07:00

33 lines
731 B
TypeScript

import carlo = require('carlo');
async function main() {
const app = await carlo.launch({
title: 'Test'
});
app.browserForTest();
const window = await app.createWindow({});
window.setBounds({
top: 10,
width: 30
});
}
(async () => {
// Launch the browser.
const app = await carlo.launch();
// Terminate Node.js process on app window closing.
app.on('exit', () => process.exit());
// Tell carlo where your web files are located.
app.serveFolder(__dirname);
// Expose 'env' function in the web environment.
await app.exposeFunction('env', _ => process.env);
// Navigate to the main page of your app.
await app.load('example.html');
})();