docs(console): update console documentation (#28196)

Signed-off-by: Jo Franchetti <jofranchetti@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Jo Franchetti 2025-02-20 20:50:57 +00:00 committed by Ryan Dahl
parent c5ed4541ef
commit 811e375482
2 changed files with 21 additions and 3 deletions

View file

@ -458,7 +458,23 @@ interface DOMStringList {
/** @category Platform */
type BufferSource = ArrayBufferView | ArrayBuffer;
/** @category I/O */
/**
* A global console object that provides methods for logging, debugging, and error reporting.
* The console object provides access to the browser's or runtime's debugging console functionality.
* It allows developers to output text and data for debugging purposes.
*
* @example
* ```typescript
* console.log("Hello, world!");
* console.error("An error occurred");
* console.warn("Warning message");
* console.debug("Debug information");
* ```
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/console
*
* @category I/O
*/
declare var console: Console;
/** @category Events */

View file

@ -5,13 +5,15 @@
/// <reference no-default-lib="true" />
/// <reference lib="esnext" />
/** @category I/O */
/**
* The Console interface provides methods for logging information to the console,
* as well as other utility methods for debugging and inspecting code.
* Methods include logging, debugging, and timing functionality.
* @see https://developer.mozilla.org/en-US/docs/Web/API/console
*
* @category I/O
*/
/** Interface representing the console object that provides methods for logging, debugging, and timing */
interface Console {
/**
* Tests that an expression is true. If not, logs an error message