Can a custom command overload be done the same way as a function overload? There is no answer to this in the documentation.
For example:
Cypress.Commands.add('navigateAndWaitForApi',
(relativePath: string, apisPath: string[], timeout?: number) => {
let options = {};
if (timeout !== undefined) {
options = { timeout: TIMEOUT };
}
apisPath.forEach((api)=> {
cy.intercept(`/api/${api}`).as(api);
})
cy.visit(`/${relativePath}`);
cy.wait(apisPath.map(apiPath => `@${apiPath}`), options);
});
Cypress.Commands.add('navigateAndWaitForApi',
(relativePath: string, apiPath: string, timeout?: number) => {
cy.navigateAndWaitForApi(relativePath, [apiPath], timeout);
});