/// import { ConsoleProxy } from "./src/ConsoleProxy"; import { ConsoleLog, WatchTheConsoleOptions, WriteLogOptions } from "./WatchTheConsole.types"; declare global { namespace Cypress { interface Chainable { /** * Get an instance of the WatchTheConsole * * @returns An instance of the WatchTheConsole */ watchTheConsole(): Chainable; /** * Set the WatchTheConsole options. This must be called before a web page is visited. * * @param options Options * @returns The current WatchTheConsole options */ watchTheConsoleOptions(options?: WatchTheConsoleOptions): Chainable; /** * Write the logged console output to a file * * @example cy.writeConsoleLogToFile("./out") => the output file will be "./out/[Description] It.stats.json" * @example cy.writeConsoleLogToFile("./out", { fileName: "file_name" }) => the output file will be "./out/file_name.stats.json" * @example cy.writeConsoleLogToFile("./out", { types: [ConsoleLogType.ConsoleError, ConsoleLogType.Error] }) => write only the * console errors and unhandled JavaScript errors to the output file * @example cy.writeConsoleLogToFile("./out", { filter: (type, ...args) => typeof args[0] === "string" && args[0].startsWith("Custom log:") }) => * filter all console output to include only entries starting with "Custom log:" * * @param outputDir The path for the output folder * @param options Options */ writeConsoleLogToFile(outputDir: string, options?: WriteLogOptions & Partial): Chainable; } } } export declare class WatchTheConsole { private consoleProxy; private _records; private _options; constructor(consoleProxy: ConsoleProxy); /** * console.error */ get error(): ConsoleLog[]; /** * console.info */ get info(): ConsoleLog[]; /** * JavaScript errors */ get jsError(): ConsoleLog[]; /** * console.log */ get log(): ConsoleLog[]; /** * Get the logged console output */ get records(): ConsoleLog[]; /** * console.warn */ get warn(): ConsoleLog[]; private get win(); private cloneConsoleArguments; /** * Set the WatchTheConsole options. This must be called before a web page is visited. * * @param options Options * @returns The current WatchTheConsole options */ setOptions(options?: WatchTheConsoleOptions): WatchTheConsoleOptions; /** * Write the logged console output to a file * * @example writeLogToFile("./out") => the output file will be "./out/Description - It.stats.json" * @example writeLogToFile("./out", { fileName: "file_name" }) => the output file will be "./out/file_name.stats.json" * @example writeLogToFile("./out", { types: [ConsoleLogType.ConsoleError, ConsoleLogType.Error] }) => write only the * console errors and unhandled JavaScript errors to the output file * @example writeLogToFile("./out", { filter: (type, ...args) => typeof args[0] === "string" && args[0].startsWith("Custom log:") }) => * filter all console output to include only entries starting with "Custom log:" * * @param outputDir The path for the output folder * @param options Options */ writeLogToFile(outputDir: string, options?: WriteLogOptions & Partial): Cypress.Chainable; }