Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: fix index.cjs types #15387

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions core/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@
*/
'use strict';

/** @type {import('./index.js')['default']} */
/**
* @typedef ExportType
* @property {import('./index.js')['startFlow']} startFlow
* @property {import('./index.js')['navigation']} navigation
* @property {import('./index.js')['startTimespan']} startTimespan
* @property {import('./index.js')['snapshot']} snapshot
*/

/** @type {import('./index.js')['default'] & ExportType} */
const lighthouse = async function lighthouse(...args) {
const {default: lighthouse} = await import('./index.js');
return lighthouse(...args);
};

/** @type {import('./index.js')['startFlow']} */
const startFlow = async function startFlow(...args) {
lighthouse.startFlow = async function startFlow(...args) {
const {startFlow} = await import('./index.js');
return startFlow(...args);
};

/** @type {import('./index.js')['navigation']} */
const navigation = async function navigation(...args) {
lighthouse.navigation = async function navigation(...args) {
const {navigation} = await import('./index.js');
return navigation(...args);
};

/** @type {import('./index.js')['startTimespan']} */
const startTimespan = async function startTimespan(...args) {
lighthouse.startTimespan = async function startTimespan(...args) {
const {startTimespan} = await import('./index.js');
return startTimespan(...args);
};

/** @type {import('./index.js')['snapshot']} */
const snapshot = async function snapshot(...args) {
lighthouse.snapshot = async function snapshot(...args) {
const {snapshot} = await import('./index.js');
return snapshot(...args);
};

module.exports = lighthouse;
module.exports.startFlow = startFlow;
module.exports.navigation = navigation;
module.exports.startTimespan = startTimespan;
module.exports.snapshot = snapshot;
Loading