doc: add JSDoc for open
This commit is contained in:
parent
f46e3f3ca9
commit
768a606684
13
src/index.js
13
src/index.js
@ -13,6 +13,10 @@ import Firefox from './browser/firefox.js';
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
/**
|
||||
* @typedef {'chrome'|'chrome_canary'|'chromium'|'edge'|'firefox'|'firefox_nightly'} Browser
|
||||
*/
|
||||
|
||||
const browserPaths = ({
|
||||
win32: process.platform === 'win32' && {
|
||||
chrome: join(process.env.PROGRAMFILES, 'Google', 'Chrome', 'Application', 'chrome.exe'),
|
||||
@ -104,6 +108,15 @@ const startBrowser = async (url, { windowSize, forceBrowser }) => {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Open a new Gluon window.
|
||||
*
|
||||
* @param {string} url - URL to load in the browser.
|
||||
* @param {Object} options - Optional further options.
|
||||
* @param {Function} [options.onLoad] - This function is evaluated in the web context once loaded.
|
||||
* @param {Browser} [options.forceBrowser] - Force window to use a certain browser.
|
||||
* @returns {any} - Instance of a Gluon window.
|
||||
*/
|
||||
export const open = async (url, { windowSize, onLoad, forceBrowser } = {}) => {
|
||||
log('starting browser...');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user