Skip to content
Closed
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion tsc/internal/bundled/libs/lib.dom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25777,7 +25777,7 @@ declare var NavigationTransition: {
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator)
*/
interface Navigator extends NavigatorAutomationInformation, NavigatorBadge, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorLocks, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {
interface Navigator extends NavigatorAutomationInformation, NavigatorBadge, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorGPU, NavigatorID, NavigatorLanguage, NavigatorNetworkInformation, NavigatorLocks, NavigatorOnLine, NavigatorPlugins, NavigatorStorage {
/**
* The **`clipboard`** read-only property of the Navigator interface returns a Clipboard object used to read and write the clipboard's contents.
* Available only in secure contexts.
Expand Down Expand Up @@ -26005,6 +26005,11 @@ declare var NavigatorLogin: {
new(): NavigatorLogin;
};

interface NavigatorNetworkInformation {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/connection) */
readonly connection: NetworkInformation;
}

interface NavigatorOnLine {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigator/onLine) */
readonly onLine: boolean;
Expand All @@ -26027,6 +26032,16 @@ interface NavigatorStorage {
readonly storage: StorageManager;
}

interface NetworkInformation extends EventTarget {
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/NetworkInformation/type) */
readonly type: ConnectionType;
}

declare var NetworkInformation: {
prototype: NetworkInformation;
new(): NetworkInformation;
};

/**
* The DOM **`Node`** interface is an abstract base class upon which many other DOM API objects are based, thus letting those object types be used similarly and often interchangeably. As an abstract class, there is no such thing as a plain Node object. All objects that implement Node functionality are based on one of its subclasses. Most notable are Document, Element, and DocumentFragment.
*
Expand Down Expand Up @@ -44282,6 +44297,7 @@ type ColorGamut = "p3" | "rec2020" | "srgb";
type ColorSpaceConversion = "default" | "none";
type CompositeOperation = "accumulate" | "add" | "replace";
type CompositeOperationOrAuto = "accumulate" | "add" | "auto" | "replace";
type ConnectionType = "bluetooth" | "cellular" | "ethernet" | "mixed" | "none" | "other" | "unknown" | "wifi";
type CompressionFormat = "deflate" | "deflate-raw" | "gzip";
type CookieSameSite = "lax" | "none" | "strict";
type CredentialMediationRequirement = "conditional" | "optional" | "required" | "silent";
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
//// [tests/cases/compiler/verifyDefaultLib_dom.ts] ////

//// [verifyDefaultLib_dom.ts]
var x: HTMLElement;
var x: HTMLElement;
var connection = navigator.connection;


//// [verifyDefaultLib_dom.js]
"use strict";
var x;
var connection = navigator.connection;
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ var x: HTMLElement;
>x : Symbol(x, Decl(verifyDefaultLib_dom.ts, 0, 3))
>HTMLElement : Symbol(HTMLElement, Decl(lib.dom.d.ts, --, --), Decl(lib.dom.d.ts, --, --))

var connection = navigator.connection;
>connection : Symbol(connection, Decl(verifyDefaultLib_dom.ts, 1, 3))
>navigator.connection : Symbol(NavigatorNetworkInformation.connection, Decl(lib.dom.d.ts, --, --))
>navigator : Symbol(navigator, Decl(lib.dom.d.ts, --, --))
>connection : Symbol(NavigatorNetworkInformation.connection, Decl(lib.dom.d.ts, --, --))

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
var x: HTMLElement;
>x : HTMLElement

var connection = navigator.connection;
>connection : NetworkInformation
>navigator.connection : NetworkInformation
>navigator : Navigator
>connection : NetworkInformation

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion tsc/testdata/tests/cases/compiler/verifyDefaultLib_dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
// @skipDefaultLibCheck: false
// @lib: es2015,es2016,es2017,dom,scripthost

var x: HTMLElement;
var x: HTMLElement;
var connection = navigator.connection;