From 81f510adeb30886ea9c7569ff6d0a6e147a00047 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 7 Dec 2025 15:33:44 +0100 Subject: [PATCH] Manually update to bcd@7.1.24 --- baselines/dom.generated.d.ts | 421 ++++++++++++++++++++++++++++- baselines/ts5.5/dom.generated.d.ts | 421 ++++++++++++++++++++++++++++- baselines/ts5.6/dom.generated.d.ts | 421 ++++++++++++++++++++++++++++- baselines/ts5.9/dom.generated.d.ts | 421 ++++++++++++++++++++++++++++- inputfiles/patches/html.kdl | 9 + package-lock.json | 24 +- src/build/patches.ts | 41 ++- 7 files changed, 1719 insertions(+), 39 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index c96bb81bd..1b64b3c20 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -1257,11 +1257,59 @@ interface MutationObserverInit { subtree?: boolean; } +interface NavigateEventInit extends EventInit { + canIntercept?: boolean; + destination: NavigationDestination; + downloadRequest?: string | null; + formData?: FormData | null; + hasUAVisualTransition?: boolean; + hashChange?: boolean; + info?: any; + navigationType?: NavigationType; + signal: AbortSignal; + sourceElement?: Element | null; + userInitiated?: boolean; +} + +interface NavigationCurrentEntryChangeEventInit extends EventInit { + from: NavigationHistoryEntry; + navigationType?: NavigationType | null; +} + +interface NavigationInterceptOptions { + focusReset?: NavigationFocusReset; + handler?: NavigationInterceptHandler; + precommitHandler?: NavigationPrecommitHandler; + scroll?: NavigationScrollBehavior; +} + +interface NavigationNavigateOptions extends NavigationOptions { + history?: NavigationHistoryBehavior; + state?: any; +} + +interface NavigationOptions { + info?: any; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } +interface NavigationReloadOptions extends NavigationOptions { + state?: any; +} + +interface NavigationResult { + committed?: Promise; + finished?: Promise; +} + +interface NavigationUpdateCurrentEntryOptions { + state: any; +} + interface NotificationOptions { badge?: string; body?: string; @@ -6982,6 +7030,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/empty-cells) */ emptyCells: string; + /** + * The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/field-sizing) + */ + fieldSizing: string; /** * The **`fill`** CSS property defines how SVG text content and the interior canvas of SVG shapes are filled or painted. If present, it overrides the element's fill attribute. * @@ -8050,6 +8104,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-try-order) */ positionTryOrder: string; + /** + * The position-visibility CSS property enables conditionally hiding an anchor-positioned element depending on, for example, whether it is overflowing its containing element or the viewport. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-visibility) + */ + positionVisibility: string; /** * The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. * @@ -11989,6 +12049,12 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) */ readonly URL: string; + /** + * The **`activeViewTransition`** read-only property of the Document interface returns a ViewTransition instance representing the view transition currently active on the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeViewTransition) + */ + readonly activeViewTransition: ViewTransition | null; /** * Returns or sets the color of an active link in the document body. A link is active during the time between mousedown and mouseup events. * @deprecated @@ -12408,6 +12474,8 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve createEvent(eventInterface: "MessageEvent"): MessageEvent; createEvent(eventInterface: "MouseEvent"): MouseEvent; createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "NavigateEvent"): NavigateEvent; + createEvent(eventInterface: "NavigationCurrentEntryChangeEvent"): NavigationCurrentEntryChangeEvent; createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent; createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent; @@ -21544,7 +21612,7 @@ declare var KeyframeEffect: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/LargestContentfulPaint) */ -interface LargestContentfulPaint extends PerformanceEntry { +interface LargestContentfulPaint extends PerformanceEntry, PaintTimingMixin { /** * The **`element`** read-only property of the LargestContentfulPaint interface returns an object representing the Element that is the largest contentful paint. * @@ -23559,6 +23627,182 @@ declare var NamedNodeMap: { new(): NamedNodeMap; }; +/** + * The **`NavigateEvent`** interface of the Navigation API is the event object for the navigate event, which fires when any type of navigation is initiated (this includes usage of History API features like History.go()). NavigateEvent provides access to information about that navigation, and allows developers to intercept and control the navigation handling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent) + */ +interface NavigateEvent extends Event { + /** + * The **`canIntercept`** read-only property of the NavigateEvent interface returns true if the navigation can be intercepted and have its URL rewritten, or false otherwise + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/canIntercept) + */ + readonly canIntercept: boolean; + /** + * The **`destination`** read-only property of the NavigateEvent interface returns a NavigationDestination object representing the destination being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/destination) + */ + readonly destination: NavigationDestination; + /** + * The **`downloadRequest`** read-only property of the NavigateEvent interface returns the filename of the file requested for download, in the case of a download navigation (e.g., an or element with a download attribute), or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/downloadRequest) + */ + readonly downloadRequest: string | null; + /** + * The **`formData`** read-only property of the NavigateEvent interface returns the FormData object representing the submitted data in the case of a POST form submission, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/formData) + */ + readonly formData: FormData | null; + /** + * The **`hasUAVisualTransition`** read-only property of the NavigateEvent interface returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hasUAVisualTransition) + */ + readonly hasUAVisualTransition: boolean; + /** + * The **`hashChange`** read-only property of the NavigateEvent interface returns true if the navigation is a fragment navigation (i.e., to a fragment identifier in the same document), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hashChange) + */ + readonly hashChange: boolean; + /** + * The **`info`** read-only property of the NavigateEvent interface returns the info data value passed by the initiating navigation operation (e.g., Navigation.back(), or Navigation.navigate()), or undefined if no info data was passed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/info) + */ + readonly info: any; + /** + * The **`navigationType`** read-only property of the NavigateEvent interface returns the type of the navigation — push, reload, replace, or traverse. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/navigationType) + */ + readonly navigationType: NavigationType; + /** + * The **`signal`** read-only property of the NavigateEvent interface returns an AbortSignal, which will become aborted if the navigation is cancelled (e.g., by the user pressing the browser's "Stop" button, or another navigation starting and thus cancelling the ongoing one). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/signal) + */ + readonly signal: AbortSignal; + /** + * The **`sourceElement`** read-only property of the NavigateEvent interface returns an Element object representing the initiating element, in cases where the navigation was initiated by an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/sourceElement) + */ + readonly sourceElement: Element | null; + /** + * The **`userInitiated`** read-only property of the NavigateEvent interface returns true if the navigation was initiated by the user (e.g., by clicking a link, submitting a form, or pressing the browser's "Back"/"Forward" buttons), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/userInitiated) + */ + readonly userInitiated: boolean; + /** + * The **`intercept()`** method of the NavigateEvent interface intercepts this navigation, turning it into a same-document navigation to the destination URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/intercept) + */ + intercept(options?: NavigationInterceptOptions): void; + /** + * The **`scroll()`** method of the NavigateEvent interface can be called to manually trigger the browser-driven scrolling behavior that occurs in response to the navigation, if you want it to happen before the navigation handling has completed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/scroll) + */ + scroll(): void; +} + +declare var NavigateEvent: { + prototype: NavigateEvent; + new(type: string, eventInitDict: NavigateEventInit): NavigateEvent; +}; + +/** + * The **`Navigation`** interface of the Navigation API allows control over all navigation actions for the current window in one central place, including initiating navigations programmatically, examining navigation history entries, and managing navigations as they happen. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation) + */ +interface Navigation extends EventTarget { + /** + * The **`activation`** read-only property of the Navigation interface returns a NavigationActivation object containing information about the most recent cross-document navigation, which "activated" this Document. The property will stay constant during same-document navigations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/activation) + */ + readonly activation: NavigationActivation | null; + /** + * The **`canGoBack`** read-only property of the Navigation interface returns true if it is possible to navigate backwards in the navigation history (i.e., the currentEntry is not the first one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoBack) + */ + readonly canGoBack: boolean; + /** + * The **`canGoForward`** read-only property of the Navigation interface returns true if it is possible to navigate forwards in the navigation history (i.e., the currentEntry is not the last one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoForward) + */ + readonly canGoForward: boolean; + /** + * The **`currentEntry`** read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/currentEntry) + */ + readonly currentEntry: NavigationHistoryEntry | null; + /** + * The **`transition`** read-only property of the Navigation interface returns a NavigationTransition object representing the status of an in-progress navigation, which can be used to track it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/transition) + */ + readonly transition: NavigationTransition | null; + /** + * The **`back()`** method of the Navigation interface navigates backwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/back) + */ + back(options?: NavigationOptions): NavigationResult; + /** + * The **`entries()`** method of the Navigation interface returns an array of NavigationHistoryEntry objects representing all existing history entries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/entries) + */ + entries(): NavigationHistoryEntry[]; + /** + * The **`forward()`** method of the Navigation interface navigates forwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/forward) + */ + forward(options?: NavigationOptions): NavigationResult; + /** + * The **`navigate()`** method of the Navigation interface navigates to a specific URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/navigate) + */ + navigate(url: string | URL, options?: NavigationNavigateOptions): NavigationResult; + /** + * The **`reload()`** method of the Navigation interface reloads the current URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/reload) + */ + reload(options?: NavigationReloadOptions): NavigationResult; + /** + * The **`traverseTo()`** method of the Navigation interface navigates to the NavigationHistoryEntry identified by the given key. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/traverseTo) + */ + traverseTo(key: string, options?: NavigationOptions): NavigationResult; + /** + * The **`updateCurrentEntry()`** method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/updateCurrentEntry) + */ + updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void; +} + +declare var Navigation: { + prototype: Navigation; + new(): Navigation; +}; + /** * The **`NavigationActivation`** interface of the Navigation API represents a recent cross-document navigation. It contains the navigation type and outgoing and inbound document history entries. * @@ -23590,6 +23834,80 @@ declare var NavigationActivation: { new(): NavigationActivation; }; +/** + * The **`NavigationCurrentEntryChangeEvent`** interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent) + */ +interface NavigationCurrentEntryChangeEvent extends Event { + /** + * The **`from`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the NavigationHistoryEntry that was navigated from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the type of the navigation that resulted in the change. The property may be null if the change occurs due to Navigation.updateCurrentEntry(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/navigationType) + */ + readonly navigationType: NavigationType | null; +} + +declare var NavigationCurrentEntryChangeEvent: { + prototype: NavigationCurrentEntryChangeEvent; + new(type: string, eventInitDict: NavigationCurrentEntryChangeEventInit): NavigationCurrentEntryChangeEvent; +}; + +/** + * The **`NavigationDestination`** interface of the Navigation API represents the destination being navigated to in the current navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination) + */ +interface NavigationDestination { + /** + * The **`id`** read-only property of the NavigationDestination interface returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/id) + */ + readonly id: string; + /** + * The **`index`** read-only property of the NavigationDestination interface returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/index) + */ + readonly index: number; + /** + * The **`key`** read-only property of the NavigationDestination interface returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/key) + */ + readonly key: string; + /** + * The **`sameDocument`** read-only property of the NavigationDestination interface returns true if the navigation is to the same document as the current Document value, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/sameDocument) + */ + readonly sameDocument: boolean; + /** + * The **`url`** read-only property of the NavigationDestination interface returns the URL being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/url) + */ + readonly url: string; + /** + * The **`getState()`** method of the NavigationDestination interface returns a clone of the developer-supplied state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/getState) + */ + getState(): any; +} + +declare var NavigationDestination: { + prototype: NavigationDestination; + new(): NavigationDestination; +}; + interface NavigationHistoryEntryEventMap { "dispose": Event; } @@ -23649,6 +23967,25 @@ declare var NavigationHistoryEntry: { new(): NavigationHistoryEntry; }; +/** + * The **`NavigationPrecommitController`** interface of the Navigation API defines redirect behavior for a navigation precommit handler. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController) + */ +interface NavigationPrecommitController { + /** + * The **`redirect()`** method of the NavigationPrecommitController interface redirects the browser to a specified URL and specifies history behavior and any desired state information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController/redirect) + */ + redirect(url: string | URL, options?: NavigationNavigateOptions): void; +} + +declare var NavigationPrecommitController: { + prototype: NavigationPrecommitController; + new(): NavigationPrecommitController; +}; + /** * The **`NavigationPreloadManager`** interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. * Available only in secure contexts. @@ -23687,6 +24024,38 @@ declare var NavigationPreloadManager: { new(): NavigationPreloadManager; }; +/** + * The **`NavigationTransition`** interface of the Navigation API represents an ongoing navigation, that is, a navigation that hasn't yet reached the navigatesuccess or navigateerror stage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) + */ +interface NavigationTransition { + readonly committed: Promise; + /** + * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/finished) + */ + readonly finished: Promise; + /** + * The **`from`** read-only property of the NavigationTransition interface returns the NavigationHistoryEntry that the transition is coming from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationTransition interface returns the type of the ongoing navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/navigationType) + */ + readonly navigationType: NavigationType; +} + +declare var NavigationTransition: { + prototype: NavigationTransition; + new(): NavigationTransition; +}; + /** * The **`Navigator`** interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. * @@ -24829,6 +25198,11 @@ declare var PageTransitionEvent: { new(type: string, eventInitDict?: PageTransitionEventInit): PageTransitionEvent; }; +interface PaintTimingMixin { + readonly paintTime: DOMHighResTimeStamp; + readonly presentationTime: DOMHighResTimeStamp | null; +} + /** * The **`PannerNode`** interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone. * @@ -25344,6 +25718,7 @@ interface Performance extends EventTarget { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/eventCounts) */ readonly eventCounts: EventCounts; + readonly interactionCount: number; /** * The legacy **`Performance.navigation`** read-only property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource. * @deprecated @@ -25769,7 +26144,7 @@ declare var PerformanceObserverEntryList: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming) */ -interface PerformancePaintTiming extends PerformanceEntry { +interface PerformancePaintTiming extends PerformanceEntry, PaintTimingMixin { toJSON(): any; } @@ -28666,6 +29041,19 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/download) */ download: string; + /** + * The **`hreflang`** property of the SVGAElement interface returns a string indicating the language of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/hreflang) + */ + hreflang: string; + /** + * The **`ping`** property of the SVGAElement interface returns a string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/ping) + */ + ping: string; + referrerPolicy: string; /** * The **`rel`** property of the SVGAElement returns a string reflecting the value of the rel attribute of the SVG element. * @@ -28685,6 +29073,12 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/target) */ readonly target: SVGAnimatedString; + /** + * The **`type`** property of the SVGAElement interface returns a string indicating the MIME type of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/type) + */ + type: string; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -39062,6 +39456,12 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/name) */ name: string; + /** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ + readonly navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -40749,6 +41149,14 @@ interface MutationCallback { (mutations: MutationRecord[], observer: MutationObserver): void; } +interface NavigationInterceptHandler { + (): void | PromiseLike; +} + +interface NavigationPrecommitHandler { + (controller: NavigationPrecommitController): void | PromiseLike; +} + interface NotificationPermissionCallback { (permission: NotificationPermission): void; } @@ -41230,6 +41638,12 @@ declare var menubar: BarProp; */ /** @deprecated */ declare const name: void; +/** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ +declare var navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -42067,6 +42481,9 @@ type MediaKeysRequirement = "not-allowed" | "optional" | "required"; type MediaSessionAction = "nexttrack" | "pause" | "play" | "previoustrack" | "seekbackward" | "seekforward" | "seekto" | "skipad" | "stop"; type MediaSessionPlaybackState = "none" | "paused" | "playing"; type MediaStreamTrackState = "ended" | "live"; +type NavigationFocusReset = "after-transition" | "manual"; +type NavigationHistoryBehavior = "auto" | "push" | "replace"; +type NavigationScrollBehavior = "after-transition" | "manual"; type NavigationTimingType = "back_forward" | "navigate" | "reload"; type NavigationType = "push" | "reload" | "replace" | "traverse"; type NotificationDirection = "auto" | "ltr" | "rtl"; diff --git a/baselines/ts5.5/dom.generated.d.ts b/baselines/ts5.5/dom.generated.d.ts index fc1d93ece..0d7b1f118 100644 --- a/baselines/ts5.5/dom.generated.d.ts +++ b/baselines/ts5.5/dom.generated.d.ts @@ -1254,11 +1254,59 @@ interface MutationObserverInit { subtree?: boolean; } +interface NavigateEventInit extends EventInit { + canIntercept?: boolean; + destination: NavigationDestination; + downloadRequest?: string | null; + formData?: FormData | null; + hasUAVisualTransition?: boolean; + hashChange?: boolean; + info?: any; + navigationType?: NavigationType; + signal: AbortSignal; + sourceElement?: Element | null; + userInitiated?: boolean; +} + +interface NavigationCurrentEntryChangeEventInit extends EventInit { + from: NavigationHistoryEntry; + navigationType?: NavigationType | null; +} + +interface NavigationInterceptOptions { + focusReset?: NavigationFocusReset; + handler?: NavigationInterceptHandler; + precommitHandler?: NavigationPrecommitHandler; + scroll?: NavigationScrollBehavior; +} + +interface NavigationNavigateOptions extends NavigationOptions { + history?: NavigationHistoryBehavior; + state?: any; +} + +interface NavigationOptions { + info?: any; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } +interface NavigationReloadOptions extends NavigationOptions { + state?: any; +} + +interface NavigationResult { + committed?: Promise; + finished?: Promise; +} + +interface NavigationUpdateCurrentEntryOptions { + state: any; +} + interface NotificationOptions { badge?: string; body?: string; @@ -6972,6 +7020,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/empty-cells) */ emptyCells: string; + /** + * The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/field-sizing) + */ + fieldSizing: string; /** * The **`fill`** CSS property defines how SVG text content and the interior canvas of SVG shapes are filled or painted. If present, it overrides the element's fill attribute. * @@ -8040,6 +8094,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-try-order) */ positionTryOrder: string; + /** + * The position-visibility CSS property enables conditionally hiding an anchor-positioned element depending on, for example, whether it is overflowing its containing element or the viewport. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-visibility) + */ + positionVisibility: string; /** * The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. * @@ -11978,6 +12038,12 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) */ readonly URL: string; + /** + * The **`activeViewTransition`** read-only property of the Document interface returns a ViewTransition instance representing the view transition currently active on the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeViewTransition) + */ + readonly activeViewTransition: ViewTransition | null; /** * Returns or sets the color of an active link in the document body. A link is active during the time between mousedown and mouseup events. * @deprecated @@ -12397,6 +12463,8 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve createEvent(eventInterface: "MessageEvent"): MessageEvent; createEvent(eventInterface: "MouseEvent"): MouseEvent; createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "NavigateEvent"): NavigateEvent; + createEvent(eventInterface: "NavigationCurrentEntryChangeEvent"): NavigationCurrentEntryChangeEvent; createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent; createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent; @@ -21520,7 +21588,7 @@ declare var KeyframeEffect: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/LargestContentfulPaint) */ -interface LargestContentfulPaint extends PerformanceEntry { +interface LargestContentfulPaint extends PerformanceEntry, PaintTimingMixin { /** * The **`element`** read-only property of the LargestContentfulPaint interface returns an object representing the Element that is the largest contentful paint. * @@ -23535,6 +23603,182 @@ declare var NamedNodeMap: { new(): NamedNodeMap; }; +/** + * The **`NavigateEvent`** interface of the Navigation API is the event object for the navigate event, which fires when any type of navigation is initiated (this includes usage of History API features like History.go()). NavigateEvent provides access to information about that navigation, and allows developers to intercept and control the navigation handling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent) + */ +interface NavigateEvent extends Event { + /** + * The **`canIntercept`** read-only property of the NavigateEvent interface returns true if the navigation can be intercepted and have its URL rewritten, or false otherwise + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/canIntercept) + */ + readonly canIntercept: boolean; + /** + * The **`destination`** read-only property of the NavigateEvent interface returns a NavigationDestination object representing the destination being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/destination) + */ + readonly destination: NavigationDestination; + /** + * The **`downloadRequest`** read-only property of the NavigateEvent interface returns the filename of the file requested for download, in the case of a download navigation (e.g., an or element with a download attribute), or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/downloadRequest) + */ + readonly downloadRequest: string | null; + /** + * The **`formData`** read-only property of the NavigateEvent interface returns the FormData object representing the submitted data in the case of a POST form submission, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/formData) + */ + readonly formData: FormData | null; + /** + * The **`hasUAVisualTransition`** read-only property of the NavigateEvent interface returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hasUAVisualTransition) + */ + readonly hasUAVisualTransition: boolean; + /** + * The **`hashChange`** read-only property of the NavigateEvent interface returns true if the navigation is a fragment navigation (i.e., to a fragment identifier in the same document), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hashChange) + */ + readonly hashChange: boolean; + /** + * The **`info`** read-only property of the NavigateEvent interface returns the info data value passed by the initiating navigation operation (e.g., Navigation.back(), or Navigation.navigate()), or undefined if no info data was passed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/info) + */ + readonly info: any; + /** + * The **`navigationType`** read-only property of the NavigateEvent interface returns the type of the navigation — push, reload, replace, or traverse. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/navigationType) + */ + readonly navigationType: NavigationType; + /** + * The **`signal`** read-only property of the NavigateEvent interface returns an AbortSignal, which will become aborted if the navigation is cancelled (e.g., by the user pressing the browser's "Stop" button, or another navigation starting and thus cancelling the ongoing one). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/signal) + */ + readonly signal: AbortSignal; + /** + * The **`sourceElement`** read-only property of the NavigateEvent interface returns an Element object representing the initiating element, in cases where the navigation was initiated by an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/sourceElement) + */ + readonly sourceElement: Element | null; + /** + * The **`userInitiated`** read-only property of the NavigateEvent interface returns true if the navigation was initiated by the user (e.g., by clicking a link, submitting a form, or pressing the browser's "Back"/"Forward" buttons), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/userInitiated) + */ + readonly userInitiated: boolean; + /** + * The **`intercept()`** method of the NavigateEvent interface intercepts this navigation, turning it into a same-document navigation to the destination URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/intercept) + */ + intercept(options?: NavigationInterceptOptions): void; + /** + * The **`scroll()`** method of the NavigateEvent interface can be called to manually trigger the browser-driven scrolling behavior that occurs in response to the navigation, if you want it to happen before the navigation handling has completed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/scroll) + */ + scroll(): void; +} + +declare var NavigateEvent: { + prototype: NavigateEvent; + new(type: string, eventInitDict: NavigateEventInit): NavigateEvent; +}; + +/** + * The **`Navigation`** interface of the Navigation API allows control over all navigation actions for the current window in one central place, including initiating navigations programmatically, examining navigation history entries, and managing navigations as they happen. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation) + */ +interface Navigation extends EventTarget { + /** + * The **`activation`** read-only property of the Navigation interface returns a NavigationActivation object containing information about the most recent cross-document navigation, which "activated" this Document. The property will stay constant during same-document navigations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/activation) + */ + readonly activation: NavigationActivation | null; + /** + * The **`canGoBack`** read-only property of the Navigation interface returns true if it is possible to navigate backwards in the navigation history (i.e., the currentEntry is not the first one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoBack) + */ + readonly canGoBack: boolean; + /** + * The **`canGoForward`** read-only property of the Navigation interface returns true if it is possible to navigate forwards in the navigation history (i.e., the currentEntry is not the last one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoForward) + */ + readonly canGoForward: boolean; + /** + * The **`currentEntry`** read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/currentEntry) + */ + readonly currentEntry: NavigationHistoryEntry | null; + /** + * The **`transition`** read-only property of the Navigation interface returns a NavigationTransition object representing the status of an in-progress navigation, which can be used to track it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/transition) + */ + readonly transition: NavigationTransition | null; + /** + * The **`back()`** method of the Navigation interface navigates backwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/back) + */ + back(options?: NavigationOptions): NavigationResult; + /** + * The **`entries()`** method of the Navigation interface returns an array of NavigationHistoryEntry objects representing all existing history entries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/entries) + */ + entries(): NavigationHistoryEntry[]; + /** + * The **`forward()`** method of the Navigation interface navigates forwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/forward) + */ + forward(options?: NavigationOptions): NavigationResult; + /** + * The **`navigate()`** method of the Navigation interface navigates to a specific URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/navigate) + */ + navigate(url: string | URL, options?: NavigationNavigateOptions): NavigationResult; + /** + * The **`reload()`** method of the Navigation interface reloads the current URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/reload) + */ + reload(options?: NavigationReloadOptions): NavigationResult; + /** + * The **`traverseTo()`** method of the Navigation interface navigates to the NavigationHistoryEntry identified by the given key. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/traverseTo) + */ + traverseTo(key: string, options?: NavigationOptions): NavigationResult; + /** + * The **`updateCurrentEntry()`** method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/updateCurrentEntry) + */ + updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void; +} + +declare var Navigation: { + prototype: Navigation; + new(): Navigation; +}; + /** * The **`NavigationActivation`** interface of the Navigation API represents a recent cross-document navigation. It contains the navigation type and outgoing and inbound document history entries. * @@ -23566,6 +23810,80 @@ declare var NavigationActivation: { new(): NavigationActivation; }; +/** + * The **`NavigationCurrentEntryChangeEvent`** interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent) + */ +interface NavigationCurrentEntryChangeEvent extends Event { + /** + * The **`from`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the NavigationHistoryEntry that was navigated from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the type of the navigation that resulted in the change. The property may be null if the change occurs due to Navigation.updateCurrentEntry(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/navigationType) + */ + readonly navigationType: NavigationType | null; +} + +declare var NavigationCurrentEntryChangeEvent: { + prototype: NavigationCurrentEntryChangeEvent; + new(type: string, eventInitDict: NavigationCurrentEntryChangeEventInit): NavigationCurrentEntryChangeEvent; +}; + +/** + * The **`NavigationDestination`** interface of the Navigation API represents the destination being navigated to in the current navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination) + */ +interface NavigationDestination { + /** + * The **`id`** read-only property of the NavigationDestination interface returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/id) + */ + readonly id: string; + /** + * The **`index`** read-only property of the NavigationDestination interface returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/index) + */ + readonly index: number; + /** + * The **`key`** read-only property of the NavigationDestination interface returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/key) + */ + readonly key: string; + /** + * The **`sameDocument`** read-only property of the NavigationDestination interface returns true if the navigation is to the same document as the current Document value, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/sameDocument) + */ + readonly sameDocument: boolean; + /** + * The **`url`** read-only property of the NavigationDestination interface returns the URL being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/url) + */ + readonly url: string; + /** + * The **`getState()`** method of the NavigationDestination interface returns a clone of the developer-supplied state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/getState) + */ + getState(): any; +} + +declare var NavigationDestination: { + prototype: NavigationDestination; + new(): NavigationDestination; +}; + interface NavigationHistoryEntryEventMap { "dispose": Event; } @@ -23625,6 +23943,25 @@ declare var NavigationHistoryEntry: { new(): NavigationHistoryEntry; }; +/** + * The **`NavigationPrecommitController`** interface of the Navigation API defines redirect behavior for a navigation precommit handler. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController) + */ +interface NavigationPrecommitController { + /** + * The **`redirect()`** method of the NavigationPrecommitController interface redirects the browser to a specified URL and specifies history behavior and any desired state information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController/redirect) + */ + redirect(url: string | URL, options?: NavigationNavigateOptions): void; +} + +declare var NavigationPrecommitController: { + prototype: NavigationPrecommitController; + new(): NavigationPrecommitController; +}; + /** * The **`NavigationPreloadManager`** interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. * Available only in secure contexts. @@ -23663,6 +24000,38 @@ declare var NavigationPreloadManager: { new(): NavigationPreloadManager; }; +/** + * The **`NavigationTransition`** interface of the Navigation API represents an ongoing navigation, that is, a navigation that hasn't yet reached the navigatesuccess or navigateerror stage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) + */ +interface NavigationTransition { + readonly committed: Promise; + /** + * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/finished) + */ + readonly finished: Promise; + /** + * The **`from`** read-only property of the NavigationTransition interface returns the NavigationHistoryEntry that the transition is coming from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationTransition interface returns the type of the ongoing navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/navigationType) + */ + readonly navigationType: NavigationType; +} + +declare var NavigationTransition: { + prototype: NavigationTransition; + new(): NavigationTransition; +}; + /** * The **`Navigator`** interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. * @@ -24805,6 +25174,11 @@ declare var PageTransitionEvent: { new(type: string, eventInitDict?: PageTransitionEventInit): PageTransitionEvent; }; +interface PaintTimingMixin { + readonly paintTime: DOMHighResTimeStamp; + readonly presentationTime: DOMHighResTimeStamp | null; +} + /** * The **`PannerNode`** interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone. * @@ -25320,6 +25694,7 @@ interface Performance extends EventTarget { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/eventCounts) */ readonly eventCounts: EventCounts; + readonly interactionCount: number; /** * The legacy **`Performance.navigation`** read-only property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource. * @deprecated @@ -25745,7 +26120,7 @@ declare var PerformanceObserverEntryList: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming) */ -interface PerformancePaintTiming extends PerformanceEntry { +interface PerformancePaintTiming extends PerformanceEntry, PaintTimingMixin { toJSON(): any; } @@ -28642,6 +29017,19 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/download) */ download: string; + /** + * The **`hreflang`** property of the SVGAElement interface returns a string indicating the language of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/hreflang) + */ + hreflang: string; + /** + * The **`ping`** property of the SVGAElement interface returns a string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/ping) + */ + ping: string; + referrerPolicy: string; /** * The **`rel`** property of the SVGAElement returns a string reflecting the value of the rel attribute of the SVG element. * @@ -28660,6 +29048,12 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/target) */ readonly target: SVGAnimatedString; + /** + * The **`type`** property of the SVGAElement interface returns a string indicating the MIME type of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/type) + */ + type: string; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -39036,6 +39430,12 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/name) */ name: string; + /** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ + readonly navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -40723,6 +41123,14 @@ interface MutationCallback { (mutations: MutationRecord[], observer: MutationObserver): void; } +interface NavigationInterceptHandler { + (): void | PromiseLike; +} + +interface NavigationPrecommitHandler { + (controller: NavigationPrecommitController): void | PromiseLike; +} + interface NotificationPermissionCallback { (permission: NotificationPermission): void; } @@ -41204,6 +41612,12 @@ declare var menubar: BarProp; */ /** @deprecated */ declare const name: void; +/** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ +declare var navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -42041,6 +42455,9 @@ type MediaKeysRequirement = "not-allowed" | "optional" | "required"; type MediaSessionAction = "nexttrack" | "pause" | "play" | "previoustrack" | "seekbackward" | "seekforward" | "seekto" | "skipad" | "stop"; type MediaSessionPlaybackState = "none" | "paused" | "playing"; type MediaStreamTrackState = "ended" | "live"; +type NavigationFocusReset = "after-transition" | "manual"; +type NavigationHistoryBehavior = "auto" | "push" | "replace"; +type NavigationScrollBehavior = "after-transition" | "manual"; type NavigationTimingType = "back_forward" | "navigate" | "reload"; type NavigationType = "push" | "reload" | "replace" | "traverse"; type NotificationDirection = "auto" | "ltr" | "rtl"; diff --git a/baselines/ts5.6/dom.generated.d.ts b/baselines/ts5.6/dom.generated.d.ts index 743813310..d560cde05 100644 --- a/baselines/ts5.6/dom.generated.d.ts +++ b/baselines/ts5.6/dom.generated.d.ts @@ -1254,11 +1254,59 @@ interface MutationObserverInit { subtree?: boolean; } +interface NavigateEventInit extends EventInit { + canIntercept?: boolean; + destination: NavigationDestination; + downloadRequest?: string | null; + formData?: FormData | null; + hasUAVisualTransition?: boolean; + hashChange?: boolean; + info?: any; + navigationType?: NavigationType; + signal: AbortSignal; + sourceElement?: Element | null; + userInitiated?: boolean; +} + +interface NavigationCurrentEntryChangeEventInit extends EventInit { + from: NavigationHistoryEntry; + navigationType?: NavigationType | null; +} + +interface NavigationInterceptOptions { + focusReset?: NavigationFocusReset; + handler?: NavigationInterceptHandler; + precommitHandler?: NavigationPrecommitHandler; + scroll?: NavigationScrollBehavior; +} + +interface NavigationNavigateOptions extends NavigationOptions { + history?: NavigationHistoryBehavior; + state?: any; +} + +interface NavigationOptions { + info?: any; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } +interface NavigationReloadOptions extends NavigationOptions { + state?: any; +} + +interface NavigationResult { + committed?: Promise; + finished?: Promise; +} + +interface NavigationUpdateCurrentEntryOptions { + state: any; +} + interface NotificationOptions { badge?: string; body?: string; @@ -6979,6 +7027,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/empty-cells) */ emptyCells: string; + /** + * The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/field-sizing) + */ + fieldSizing: string; /** * The **`fill`** CSS property defines how SVG text content and the interior canvas of SVG shapes are filled or painted. If present, it overrides the element's fill attribute. * @@ -8047,6 +8101,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-try-order) */ positionTryOrder: string; + /** + * The position-visibility CSS property enables conditionally hiding an anchor-positioned element depending on, for example, whether it is overflowing its containing element or the viewport. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-visibility) + */ + positionVisibility: string; /** * The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. * @@ -11986,6 +12046,12 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) */ readonly URL: string; + /** + * The **`activeViewTransition`** read-only property of the Document interface returns a ViewTransition instance representing the view transition currently active on the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeViewTransition) + */ + readonly activeViewTransition: ViewTransition | null; /** * Returns or sets the color of an active link in the document body. A link is active during the time between mousedown and mouseup events. * @deprecated @@ -12405,6 +12471,8 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve createEvent(eventInterface: "MessageEvent"): MessageEvent; createEvent(eventInterface: "MouseEvent"): MouseEvent; createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "NavigateEvent"): NavigateEvent; + createEvent(eventInterface: "NavigationCurrentEntryChangeEvent"): NavigationCurrentEntryChangeEvent; createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent; createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent; @@ -21541,7 +21609,7 @@ declare var KeyframeEffect: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/LargestContentfulPaint) */ -interface LargestContentfulPaint extends PerformanceEntry { +interface LargestContentfulPaint extends PerformanceEntry, PaintTimingMixin { /** * The **`element`** read-only property of the LargestContentfulPaint interface returns an object representing the Element that is the largest contentful paint. * @@ -23556,6 +23624,182 @@ declare var NamedNodeMap: { new(): NamedNodeMap; }; +/** + * The **`NavigateEvent`** interface of the Navigation API is the event object for the navigate event, which fires when any type of navigation is initiated (this includes usage of History API features like History.go()). NavigateEvent provides access to information about that navigation, and allows developers to intercept and control the navigation handling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent) + */ +interface NavigateEvent extends Event { + /** + * The **`canIntercept`** read-only property of the NavigateEvent interface returns true if the navigation can be intercepted and have its URL rewritten, or false otherwise + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/canIntercept) + */ + readonly canIntercept: boolean; + /** + * The **`destination`** read-only property of the NavigateEvent interface returns a NavigationDestination object representing the destination being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/destination) + */ + readonly destination: NavigationDestination; + /** + * The **`downloadRequest`** read-only property of the NavigateEvent interface returns the filename of the file requested for download, in the case of a download navigation (e.g., an or element with a download attribute), or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/downloadRequest) + */ + readonly downloadRequest: string | null; + /** + * The **`formData`** read-only property of the NavigateEvent interface returns the FormData object representing the submitted data in the case of a POST form submission, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/formData) + */ + readonly formData: FormData | null; + /** + * The **`hasUAVisualTransition`** read-only property of the NavigateEvent interface returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hasUAVisualTransition) + */ + readonly hasUAVisualTransition: boolean; + /** + * The **`hashChange`** read-only property of the NavigateEvent interface returns true if the navigation is a fragment navigation (i.e., to a fragment identifier in the same document), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hashChange) + */ + readonly hashChange: boolean; + /** + * The **`info`** read-only property of the NavigateEvent interface returns the info data value passed by the initiating navigation operation (e.g., Navigation.back(), or Navigation.navigate()), or undefined if no info data was passed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/info) + */ + readonly info: any; + /** + * The **`navigationType`** read-only property of the NavigateEvent interface returns the type of the navigation — push, reload, replace, or traverse. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/navigationType) + */ + readonly navigationType: NavigationType; + /** + * The **`signal`** read-only property of the NavigateEvent interface returns an AbortSignal, which will become aborted if the navigation is cancelled (e.g., by the user pressing the browser's "Stop" button, or another navigation starting and thus cancelling the ongoing one). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/signal) + */ + readonly signal: AbortSignal; + /** + * The **`sourceElement`** read-only property of the NavigateEvent interface returns an Element object representing the initiating element, in cases where the navigation was initiated by an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/sourceElement) + */ + readonly sourceElement: Element | null; + /** + * The **`userInitiated`** read-only property of the NavigateEvent interface returns true if the navigation was initiated by the user (e.g., by clicking a link, submitting a form, or pressing the browser's "Back"/"Forward" buttons), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/userInitiated) + */ + readonly userInitiated: boolean; + /** + * The **`intercept()`** method of the NavigateEvent interface intercepts this navigation, turning it into a same-document navigation to the destination URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/intercept) + */ + intercept(options?: NavigationInterceptOptions): void; + /** + * The **`scroll()`** method of the NavigateEvent interface can be called to manually trigger the browser-driven scrolling behavior that occurs in response to the navigation, if you want it to happen before the navigation handling has completed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/scroll) + */ + scroll(): void; +} + +declare var NavigateEvent: { + prototype: NavigateEvent; + new(type: string, eventInitDict: NavigateEventInit): NavigateEvent; +}; + +/** + * The **`Navigation`** interface of the Navigation API allows control over all navigation actions for the current window in one central place, including initiating navigations programmatically, examining navigation history entries, and managing navigations as they happen. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation) + */ +interface Navigation extends EventTarget { + /** + * The **`activation`** read-only property of the Navigation interface returns a NavigationActivation object containing information about the most recent cross-document navigation, which "activated" this Document. The property will stay constant during same-document navigations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/activation) + */ + readonly activation: NavigationActivation | null; + /** + * The **`canGoBack`** read-only property of the Navigation interface returns true if it is possible to navigate backwards in the navigation history (i.e., the currentEntry is not the first one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoBack) + */ + readonly canGoBack: boolean; + /** + * The **`canGoForward`** read-only property of the Navigation interface returns true if it is possible to navigate forwards in the navigation history (i.e., the currentEntry is not the last one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoForward) + */ + readonly canGoForward: boolean; + /** + * The **`currentEntry`** read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/currentEntry) + */ + readonly currentEntry: NavigationHistoryEntry | null; + /** + * The **`transition`** read-only property of the Navigation interface returns a NavigationTransition object representing the status of an in-progress navigation, which can be used to track it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/transition) + */ + readonly transition: NavigationTransition | null; + /** + * The **`back()`** method of the Navigation interface navigates backwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/back) + */ + back(options?: NavigationOptions): NavigationResult; + /** + * The **`entries()`** method of the Navigation interface returns an array of NavigationHistoryEntry objects representing all existing history entries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/entries) + */ + entries(): NavigationHistoryEntry[]; + /** + * The **`forward()`** method of the Navigation interface navigates forwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/forward) + */ + forward(options?: NavigationOptions): NavigationResult; + /** + * The **`navigate()`** method of the Navigation interface navigates to a specific URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/navigate) + */ + navigate(url: string | URL, options?: NavigationNavigateOptions): NavigationResult; + /** + * The **`reload()`** method of the Navigation interface reloads the current URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/reload) + */ + reload(options?: NavigationReloadOptions): NavigationResult; + /** + * The **`traverseTo()`** method of the Navigation interface navigates to the NavigationHistoryEntry identified by the given key. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/traverseTo) + */ + traverseTo(key: string, options?: NavigationOptions): NavigationResult; + /** + * The **`updateCurrentEntry()`** method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/updateCurrentEntry) + */ + updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void; +} + +declare var Navigation: { + prototype: Navigation; + new(): Navigation; +}; + /** * The **`NavigationActivation`** interface of the Navigation API represents a recent cross-document navigation. It contains the navigation type and outgoing and inbound document history entries. * @@ -23587,6 +23831,80 @@ declare var NavigationActivation: { new(): NavigationActivation; }; +/** + * The **`NavigationCurrentEntryChangeEvent`** interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent) + */ +interface NavigationCurrentEntryChangeEvent extends Event { + /** + * The **`from`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the NavigationHistoryEntry that was navigated from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the type of the navigation that resulted in the change. The property may be null if the change occurs due to Navigation.updateCurrentEntry(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/navigationType) + */ + readonly navigationType: NavigationType | null; +} + +declare var NavigationCurrentEntryChangeEvent: { + prototype: NavigationCurrentEntryChangeEvent; + new(type: string, eventInitDict: NavigationCurrentEntryChangeEventInit): NavigationCurrentEntryChangeEvent; +}; + +/** + * The **`NavigationDestination`** interface of the Navigation API represents the destination being navigated to in the current navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination) + */ +interface NavigationDestination { + /** + * The **`id`** read-only property of the NavigationDestination interface returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/id) + */ + readonly id: string; + /** + * The **`index`** read-only property of the NavigationDestination interface returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/index) + */ + readonly index: number; + /** + * The **`key`** read-only property of the NavigationDestination interface returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/key) + */ + readonly key: string; + /** + * The **`sameDocument`** read-only property of the NavigationDestination interface returns true if the navigation is to the same document as the current Document value, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/sameDocument) + */ + readonly sameDocument: boolean; + /** + * The **`url`** read-only property of the NavigationDestination interface returns the URL being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/url) + */ + readonly url: string; + /** + * The **`getState()`** method of the NavigationDestination interface returns a clone of the developer-supplied state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/getState) + */ + getState(): any; +} + +declare var NavigationDestination: { + prototype: NavigationDestination; + new(): NavigationDestination; +}; + interface NavigationHistoryEntryEventMap { "dispose": Event; } @@ -23646,6 +23964,25 @@ declare var NavigationHistoryEntry: { new(): NavigationHistoryEntry; }; +/** + * The **`NavigationPrecommitController`** interface of the Navigation API defines redirect behavior for a navigation precommit handler. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController) + */ +interface NavigationPrecommitController { + /** + * The **`redirect()`** method of the NavigationPrecommitController interface redirects the browser to a specified URL and specifies history behavior and any desired state information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController/redirect) + */ + redirect(url: string | URL, options?: NavigationNavigateOptions): void; +} + +declare var NavigationPrecommitController: { + prototype: NavigationPrecommitController; + new(): NavigationPrecommitController; +}; + /** * The **`NavigationPreloadManager`** interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. * Available only in secure contexts. @@ -23684,6 +24021,38 @@ declare var NavigationPreloadManager: { new(): NavigationPreloadManager; }; +/** + * The **`NavigationTransition`** interface of the Navigation API represents an ongoing navigation, that is, a navigation that hasn't yet reached the navigatesuccess or navigateerror stage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) + */ +interface NavigationTransition { + readonly committed: Promise; + /** + * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/finished) + */ + readonly finished: Promise; + /** + * The **`from`** read-only property of the NavigationTransition interface returns the NavigationHistoryEntry that the transition is coming from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationTransition interface returns the type of the ongoing navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/navigationType) + */ + readonly navigationType: NavigationType; +} + +declare var NavigationTransition: { + prototype: NavigationTransition; + new(): NavigationTransition; +}; + /** * The **`Navigator`** interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. * @@ -24826,6 +25195,11 @@ declare var PageTransitionEvent: { new(type: string, eventInitDict?: PageTransitionEventInit): PageTransitionEvent; }; +interface PaintTimingMixin { + readonly paintTime: DOMHighResTimeStamp; + readonly presentationTime: DOMHighResTimeStamp | null; +} + /** * The **`PannerNode`** interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone. * @@ -25341,6 +25715,7 @@ interface Performance extends EventTarget { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/eventCounts) */ readonly eventCounts: EventCounts; + readonly interactionCount: number; /** * The legacy **`Performance.navigation`** read-only property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource. * @deprecated @@ -25766,7 +26141,7 @@ declare var PerformanceObserverEntryList: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming) */ -interface PerformancePaintTiming extends PerformanceEntry { +interface PerformancePaintTiming extends PerformanceEntry, PaintTimingMixin { toJSON(): any; } @@ -28663,6 +29038,19 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/download) */ download: string; + /** + * The **`hreflang`** property of the SVGAElement interface returns a string indicating the language of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/hreflang) + */ + hreflang: string; + /** + * The **`ping`** property of the SVGAElement interface returns a string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/ping) + */ + ping: string; + referrerPolicy: string; /** * The **`rel`** property of the SVGAElement returns a string reflecting the value of the rel attribute of the SVG element. * @@ -28682,6 +29070,12 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/target) */ readonly target: SVGAnimatedString; + /** + * The **`type`** property of the SVGAElement interface returns a string indicating the MIME type of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/type) + */ + type: string; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -39059,6 +39453,12 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/name) */ name: string; + /** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ + readonly navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -40746,6 +41146,14 @@ interface MutationCallback { (mutations: MutationRecord[], observer: MutationObserver): void; } +interface NavigationInterceptHandler { + (): void | PromiseLike; +} + +interface NavigationPrecommitHandler { + (controller: NavigationPrecommitController): void | PromiseLike; +} + interface NotificationPermissionCallback { (permission: NotificationPermission): void; } @@ -41227,6 +41635,12 @@ declare var menubar: BarProp; */ /** @deprecated */ declare const name: void; +/** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ +declare var navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -42064,6 +42478,9 @@ type MediaKeysRequirement = "not-allowed" | "optional" | "required"; type MediaSessionAction = "nexttrack" | "pause" | "play" | "previoustrack" | "seekbackward" | "seekforward" | "seekto" | "skipad" | "stop"; type MediaSessionPlaybackState = "none" | "paused" | "playing"; type MediaStreamTrackState = "ended" | "live"; +type NavigationFocusReset = "after-transition" | "manual"; +type NavigationHistoryBehavior = "auto" | "push" | "replace"; +type NavigationScrollBehavior = "after-transition" | "manual"; type NavigationTimingType = "back_forward" | "navigate" | "reload"; type NavigationType = "push" | "reload" | "replace" | "traverse"; type NotificationDirection = "auto" | "ltr" | "rtl"; diff --git a/baselines/ts5.9/dom.generated.d.ts b/baselines/ts5.9/dom.generated.d.ts index ab262d313..b894c0b4a 100644 --- a/baselines/ts5.9/dom.generated.d.ts +++ b/baselines/ts5.9/dom.generated.d.ts @@ -1254,11 +1254,59 @@ interface MutationObserverInit { subtree?: boolean; } +interface NavigateEventInit extends EventInit { + canIntercept?: boolean; + destination: NavigationDestination; + downloadRequest?: string | null; + formData?: FormData | null; + hasUAVisualTransition?: boolean; + hashChange?: boolean; + info?: any; + navigationType?: NavigationType; + signal: AbortSignal; + sourceElement?: Element | null; + userInitiated?: boolean; +} + +interface NavigationCurrentEntryChangeEventInit extends EventInit { + from: NavigationHistoryEntry; + navigationType?: NavigationType | null; +} + +interface NavigationInterceptOptions { + focusReset?: NavigationFocusReset; + handler?: NavigationInterceptHandler; + precommitHandler?: NavigationPrecommitHandler; + scroll?: NavigationScrollBehavior; +} + +interface NavigationNavigateOptions extends NavigationOptions { + history?: NavigationHistoryBehavior; + state?: any; +} + +interface NavigationOptions { + info?: any; +} + interface NavigationPreloadState { enabled?: boolean; headerValue?: string; } +interface NavigationReloadOptions extends NavigationOptions { + state?: any; +} + +interface NavigationResult { + committed?: Promise; + finished?: Promise; +} + +interface NavigationUpdateCurrentEntryOptions { + state: any; +} + interface NotificationOptions { badge?: string; body?: string; @@ -6979,6 +7027,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/empty-cells) */ emptyCells: string; + /** + * The field-sizing CSS property enables you to control the sizing behavior of elements that are given a default preferred size, such as form control elements. This property enables you to override the default sizing behavior, allowing form controls to adjust in size to fit their contents. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/field-sizing) + */ + fieldSizing: string; /** * The **`fill`** CSS property defines how SVG text content and the interior canvas of SVG shapes are filled or painted. If present, it overrides the element's fill attribute. * @@ -8047,6 +8101,12 @@ interface CSSStyleProperties extends CSSStyleDeclarationBase { * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-try-order) */ positionTryOrder: string; + /** + * The position-visibility CSS property enables conditionally hiding an anchor-positioned element depending on, for example, whether it is overflowing its containing element or the viewport. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/position-visibility) + */ + positionVisibility: string; /** * The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device. * @@ -11986,6 +12046,12 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/URL) */ readonly URL: string; + /** + * The **`activeViewTransition`** read-only property of the Document interface returns a ViewTransition instance representing the view transition currently active on the document. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Document/activeViewTransition) + */ + readonly activeViewTransition: ViewTransition | null; /** * Returns or sets the color of an active link in the document body. A link is active during the time between mousedown and mouseup events. * @deprecated @@ -12405,6 +12471,8 @@ interface Document extends Node, DocumentOrShadowRoot, FontFaceSource, GlobalEve createEvent(eventInterface: "MessageEvent"): MessageEvent; createEvent(eventInterface: "MouseEvent"): MouseEvent; createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "NavigateEvent"): NavigateEvent; + createEvent(eventInterface: "NavigationCurrentEntryChangeEvent"): NavigationCurrentEntryChangeEvent; createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; createEvent(eventInterface: "PageRevealEvent"): PageRevealEvent; createEvent(eventInterface: "PageSwapEvent"): PageSwapEvent; @@ -21541,7 +21609,7 @@ declare var KeyframeEffect: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/LargestContentfulPaint) */ -interface LargestContentfulPaint extends PerformanceEntry { +interface LargestContentfulPaint extends PerformanceEntry, PaintTimingMixin { /** * The **`element`** read-only property of the LargestContentfulPaint interface returns an object representing the Element that is the largest contentful paint. * @@ -23556,6 +23624,182 @@ declare var NamedNodeMap: { new(): NamedNodeMap; }; +/** + * The **`NavigateEvent`** interface of the Navigation API is the event object for the navigate event, which fires when any type of navigation is initiated (this includes usage of History API features like History.go()). NavigateEvent provides access to information about that navigation, and allows developers to intercept and control the navigation handling. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent) + */ +interface NavigateEvent extends Event { + /** + * The **`canIntercept`** read-only property of the NavigateEvent interface returns true if the navigation can be intercepted and have its URL rewritten, or false otherwise + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/canIntercept) + */ + readonly canIntercept: boolean; + /** + * The **`destination`** read-only property of the NavigateEvent interface returns a NavigationDestination object representing the destination being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/destination) + */ + readonly destination: NavigationDestination; + /** + * The **`downloadRequest`** read-only property of the NavigateEvent interface returns the filename of the file requested for download, in the case of a download navigation (e.g., an or element with a download attribute), or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/downloadRequest) + */ + readonly downloadRequest: string | null; + /** + * The **`formData`** read-only property of the NavigateEvent interface returns the FormData object representing the submitted data in the case of a POST form submission, or null otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/formData) + */ + readonly formData: FormData | null; + /** + * The **`hasUAVisualTransition`** read-only property of the NavigateEvent interface returns true if the user agent performed a visual transition for this navigation before dispatching this event, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hasUAVisualTransition) + */ + readonly hasUAVisualTransition: boolean; + /** + * The **`hashChange`** read-only property of the NavigateEvent interface returns true if the navigation is a fragment navigation (i.e., to a fragment identifier in the same document), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/hashChange) + */ + readonly hashChange: boolean; + /** + * The **`info`** read-only property of the NavigateEvent interface returns the info data value passed by the initiating navigation operation (e.g., Navigation.back(), or Navigation.navigate()), or undefined if no info data was passed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/info) + */ + readonly info: any; + /** + * The **`navigationType`** read-only property of the NavigateEvent interface returns the type of the navigation — push, reload, replace, or traverse. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/navigationType) + */ + readonly navigationType: NavigationType; + /** + * The **`signal`** read-only property of the NavigateEvent interface returns an AbortSignal, which will become aborted if the navigation is cancelled (e.g., by the user pressing the browser's "Stop" button, or another navigation starting and thus cancelling the ongoing one). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/signal) + */ + readonly signal: AbortSignal; + /** + * The **`sourceElement`** read-only property of the NavigateEvent interface returns an Element object representing the initiating element, in cases where the navigation was initiated by an element. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/sourceElement) + */ + readonly sourceElement: Element | null; + /** + * The **`userInitiated`** read-only property of the NavigateEvent interface returns true if the navigation was initiated by the user (e.g., by clicking a link, submitting a form, or pressing the browser's "Back"/"Forward" buttons), or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/userInitiated) + */ + readonly userInitiated: boolean; + /** + * The **`intercept()`** method of the NavigateEvent interface intercepts this navigation, turning it into a same-document navigation to the destination URL. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/intercept) + */ + intercept(options?: NavigationInterceptOptions): void; + /** + * The **`scroll()`** method of the NavigateEvent interface can be called to manually trigger the browser-driven scrolling behavior that occurs in response to the navigation, if you want it to happen before the navigation handling has completed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigateEvent/scroll) + */ + scroll(): void; +} + +declare var NavigateEvent: { + prototype: NavigateEvent; + new(type: string, eventInitDict: NavigateEventInit): NavigateEvent; +}; + +/** + * The **`Navigation`** interface of the Navigation API allows control over all navigation actions for the current window in one central place, including initiating navigations programmatically, examining navigation history entries, and managing navigations as they happen. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation) + */ +interface Navigation extends EventTarget { + /** + * The **`activation`** read-only property of the Navigation interface returns a NavigationActivation object containing information about the most recent cross-document navigation, which "activated" this Document. The property will stay constant during same-document navigations. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/activation) + */ + readonly activation: NavigationActivation | null; + /** + * The **`canGoBack`** read-only property of the Navigation interface returns true if it is possible to navigate backwards in the navigation history (i.e., the currentEntry is not the first one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoBack) + */ + readonly canGoBack: boolean; + /** + * The **`canGoForward`** read-only property of the Navigation interface returns true if it is possible to navigate forwards in the navigation history (i.e., the currentEntry is not the last one in the history entry list), and false if it is not. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/canGoForward) + */ + readonly canGoForward: boolean; + /** + * The **`currentEntry`** read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/currentEntry) + */ + readonly currentEntry: NavigationHistoryEntry | null; + /** + * The **`transition`** read-only property of the Navigation interface returns a NavigationTransition object representing the status of an in-progress navigation, which can be used to track it. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/transition) + */ + readonly transition: NavigationTransition | null; + /** + * The **`back()`** method of the Navigation interface navigates backwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/back) + */ + back(options?: NavigationOptions): NavigationResult; + /** + * The **`entries()`** method of the Navigation interface returns an array of NavigationHistoryEntry objects representing all existing history entries. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/entries) + */ + entries(): NavigationHistoryEntry[]; + /** + * The **`forward()`** method of the Navigation interface navigates forwards by one entry in the navigation history. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/forward) + */ + forward(options?: NavigationOptions): NavigationResult; + /** + * The **`navigate()`** method of the Navigation interface navigates to a specific URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/navigate) + */ + navigate(url: string | URL, options?: NavigationNavigateOptions): NavigationResult; + /** + * The **`reload()`** method of the Navigation interface reloads the current URL, updating any provided state in the history entries list. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/reload) + */ + reload(options?: NavigationReloadOptions): NavigationResult; + /** + * The **`traverseTo()`** method of the Navigation interface navigates to the NavigationHistoryEntry identified by the given key. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/traverseTo) + */ + traverseTo(key: string, options?: NavigationOptions): NavigationResult; + /** + * The **`updateCurrentEntry()`** method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Navigation/updateCurrentEntry) + */ + updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void; +} + +declare var Navigation: { + prototype: Navigation; + new(): Navigation; +}; + /** * The **`NavigationActivation`** interface of the Navigation API represents a recent cross-document navigation. It contains the navigation type and outgoing and inbound document history entries. * @@ -23587,6 +23831,80 @@ declare var NavigationActivation: { new(): NavigationActivation; }; +/** + * The **`NavigationCurrentEntryChangeEvent`** interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent) + */ +interface NavigationCurrentEntryChangeEvent extends Event { + /** + * The **`from`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the NavigationHistoryEntry that was navigated from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationCurrentEntryChangeEvent interface returns the type of the navigation that resulted in the change. The property may be null if the change occurs due to Navigation.updateCurrentEntry(). + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationCurrentEntryChangeEvent/navigationType) + */ + readonly navigationType: NavigationType | null; +} + +declare var NavigationCurrentEntryChangeEvent: { + prototype: NavigationCurrentEntryChangeEvent; + new(type: string, eventInitDict: NavigationCurrentEntryChangeEventInit): NavigationCurrentEntryChangeEvent; +}; + +/** + * The **`NavigationDestination`** interface of the Navigation API represents the destination being navigated to in the current navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination) + */ +interface NavigationDestination { + /** + * The **`id`** read-only property of the NavigationDestination interface returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/id) + */ + readonly id: string; + /** + * The **`index`** read-only property of the NavigationDestination interface returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/index) + */ + readonly index: number; + /** + * The **`key`** read-only property of the NavigationDestination interface returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/key) + */ + readonly key: string; + /** + * The **`sameDocument`** read-only property of the NavigationDestination interface returns true if the navigation is to the same document as the current Document value, or false otherwise. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/sameDocument) + */ + readonly sameDocument: boolean; + /** + * The **`url`** read-only property of the NavigationDestination interface returns the URL being navigated to. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/url) + */ + readonly url: string; + /** + * The **`getState()`** method of the NavigationDestination interface returns a clone of the developer-supplied state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationDestination/getState) + */ + getState(): any; +} + +declare var NavigationDestination: { + prototype: NavigationDestination; + new(): NavigationDestination; +}; + interface NavigationHistoryEntryEventMap { "dispose": Event; } @@ -23646,6 +23964,25 @@ declare var NavigationHistoryEntry: { new(): NavigationHistoryEntry; }; +/** + * The **`NavigationPrecommitController`** interface of the Navigation API defines redirect behavior for a navigation precommit handler. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController) + */ +interface NavigationPrecommitController { + /** + * The **`redirect()`** method of the NavigationPrecommitController interface redirects the browser to a specified URL and specifies history behavior and any desired state information. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationPrecommitController/redirect) + */ + redirect(url: string | URL, options?: NavigationNavigateOptions): void; +} + +declare var NavigationPrecommitController: { + prototype: NavigationPrecommitController; + new(): NavigationPrecommitController; +}; + /** * The **`NavigationPreloadManager`** interface of the Service Worker API provides methods for managing the preloading of resources in parallel with service worker bootup. * Available only in secure contexts. @@ -23684,6 +24021,38 @@ declare var NavigationPreloadManager: { new(): NavigationPreloadManager; }; +/** + * The **`NavigationTransition`** interface of the Navigation API represents an ongoing navigation, that is, a navigation that hasn't yet reached the navigatesuccess or navigateerror stage. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition) + */ +interface NavigationTransition { + readonly committed: Promise; + /** + * The **`finished`** read-only property of the NavigationTransition interface returns a Promise that fulfills at the same time the navigatesuccess event fires, or rejects at the same time the navigateerror event fires. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/finished) + */ + readonly finished: Promise; + /** + * The **`from`** read-only property of the NavigationTransition interface returns the NavigationHistoryEntry that the transition is coming from. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/from) + */ + readonly from: NavigationHistoryEntry; + /** + * The **`navigationType`** read-only property of the NavigationTransition interface returns the type of the ongoing navigation. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/NavigationTransition/navigationType) + */ + readonly navigationType: NavigationType; +} + +declare var NavigationTransition: { + prototype: NavigationTransition; + new(): NavigationTransition; +}; + /** * The **`Navigator`** interface represents the state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. * @@ -24826,6 +25195,11 @@ declare var PageTransitionEvent: { new(type: string, eventInitDict?: PageTransitionEventInit): PageTransitionEvent; }; +interface PaintTimingMixin { + readonly paintTime: DOMHighResTimeStamp; + readonly presentationTime: DOMHighResTimeStamp | null; +} + /** * The **`PannerNode`** interface defines an audio-processing object that represents the location, direction, and behavior of an audio source signal in a simulated physical space. This AudioNode uses right-hand Cartesian coordinates to describe the source's position as a vector and its orientation as a 3D directional cone. * @@ -25341,6 +25715,7 @@ interface Performance extends EventTarget { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/eventCounts) */ readonly eventCounts: EventCounts; + readonly interactionCount: number; /** * The legacy **`Performance.navigation`** read-only property returns a PerformanceNavigation object representing the type of navigation that occurs in the given browsing context, such as the number of redirections needed to fetch the resource. * @deprecated @@ -25766,7 +26141,7 @@ declare var PerformanceObserverEntryList: { * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformancePaintTiming) */ -interface PerformancePaintTiming extends PerformanceEntry { +interface PerformancePaintTiming extends PerformanceEntry, PaintTimingMixin { toJSON(): any; } @@ -28663,6 +29038,19 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/download) */ download: string; + /** + * The **`hreflang`** property of the SVGAElement interface returns a string indicating the language of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/hreflang) + */ + hreflang: string; + /** + * The **`ping`** property of the SVGAElement interface returns a string that reflects the ping attribute, containing a space-separated list of URLs to which, when the hyperlink is followed, POST requests with the body PING will be sent by the browser (in the background). Typically used for tracking. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/ping) + */ + ping: string; + referrerPolicy: string; /** * The **`rel`** property of the SVGAElement returns a string reflecting the value of the rel attribute of the SVG element. * @@ -28682,6 +29070,12 @@ interface SVGAElement extends SVGGraphicsElement, SVGURIReference { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/target) */ readonly target: SVGAnimatedString; + /** + * The **`type`** property of the SVGAElement interface returns a string indicating the MIME type of the linked resource. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/SVGAElement/type) + */ + type: string; addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; @@ -39059,6 +39453,12 @@ interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandler * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/name) */ name: string; + /** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ + readonly navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -40746,6 +41146,14 @@ interface MutationCallback { (mutations: MutationRecord[], observer: MutationObserver): void; } +interface NavigationInterceptHandler { + (): void | PromiseLike; +} + +interface NavigationPrecommitHandler { + (controller: NavigationPrecommitController): void | PromiseLike; +} + interface NotificationPermissionCallback { (permission: NotificationPermission): void; } @@ -41227,6 +41635,12 @@ declare var menubar: BarProp; */ /** @deprecated */ declare const name: void; +/** + * The **`navigation`** read-only property of the Window interface returns the current window's associated Navigation object. + * + * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/navigation) + */ +declare var navigation: Navigation; /** * The **`Window.navigator`** read-only property returns a reference to the Navigator object, which has methods and properties about the application running the script. * @@ -42064,6 +42478,9 @@ type MediaKeysRequirement = "not-allowed" | "optional" | "required"; type MediaSessionAction = "nexttrack" | "pause" | "play" | "previoustrack" | "seekbackward" | "seekforward" | "seekto" | "skipad" | "stop"; type MediaSessionPlaybackState = "none" | "paused" | "playing"; type MediaStreamTrackState = "ended" | "live"; +type NavigationFocusReset = "after-transition" | "manual"; +type NavigationHistoryBehavior = "auto" | "push" | "replace"; +type NavigationScrollBehavior = "after-transition" | "manual"; type NavigationTimingType = "back_forward" | "navigate" | "reload"; type NavigationType = "push" | "reload" | "replace" | "traverse"; type NotificationDirection = "auto" | "ltr" | "rtl"; diff --git a/inputfiles/patches/html.kdl b/inputfiles/patches/html.kdl index a75b74ef9..c9dc2f6b0 100644 --- a/inputfiles/patches/html.kdl +++ b/inputfiles/patches/html.kdl @@ -16,3 +16,12 @@ interface-mixin WindowEventHandlers { // The unload event is not reliable, consider visibilitychange or pagehide events property onunload deprecated=#true } + +// Blink and Gecko support precommit but BCD is not updated yet +// https://bugzilla.mozilla.org/show_bug.cgi?id=1970123 +interface NavigationPrecommitController exposed=Window { + method redirect exposed=Window +} +interface NavigationTransition { + property committed exposed=Window +} diff --git a/package-lock.json b/package-lock.json index c6b7e89a4..1e119226c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -428,12 +428,11 @@ } }, "node_modules/@mdn/browser-compat-data": { - "version": "7.1.23", - "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.1.23.tgz", - "integrity": "sha512-P+fB5bjkq0RaJ6QtuUPUD2MMNgjYuox48SO5+nBMxbFlEvXyKYSw26le10wSkUw59CJB/BA98gU8IOyKo8urSQ==", + "version": "7.1.24", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-7.1.24.tgz", + "integrity": "sha512-OwgmkZIruyaozidRQ2zbIUeZ0HVdGMG5tSw0kMsB8zosJO6hHR/V9Uw5Jm0RPpF/6JHCO80RTWJJK7d7rClzcw==", "dev": true, - "license": "CC0-1.0", - "peer": true + "license": "CC0-1.0" }, "node_modules/@octokit/auth-token": { "version": "6.0.0", @@ -450,7 +449,6 @@ "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^6.0.0", "@octokit/graphql": "^9.0.3", @@ -859,7 +857,6 @@ "integrity": "sha512-PC0PDZfJg8sP7cmKe6L3QIL8GZwU5aRvUFedqSIpw3B+QjRSUZeeITC2M5XKeMXEzL6wccN196iy3JLwKNvDVA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.48.1", "@typescript-eslint/types": "8.48.1", @@ -1205,7 +1202,6 @@ "integrity": "sha512-/BIVBhqT81bR1lZ+QCB8MHW7o5YJtJS8LoAF+CY6XczC5KdV9Cg+H7qW/3qZV5E3PMz1xgnqgTZ/XojS3uJWgQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "webidl2": "^24.5.0" } @@ -1215,7 +1211,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1621,7 +1616,6 @@ "integrity": "sha512-dKYCMuPO1bmrpuogcjQ8z7ICCH3FP6WmxpwC03yjzGfZhj9fTJg6+bS1+UAplekbN2C+M61UNllGOOoAfGCrdQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -1920,7 +1914,6 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -1981,7 +1974,6 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -3001,7 +2993,8 @@ "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.12.2.tgz", "integrity": "sha512-IEn+pegP1aManZuckezWCO+XZQDplx1366JoVhTpMpBB1sPey/SbveZQUosKiKiGYjg1wH4pMlNgXbCiYgihQA==", "dev": true, - "license": "CC0-1.0" + "license": "CC0-1.0", + "peer": true }, "node_modules/memfs-or-file-map-to-github-branch": { "version": "1.3.0", @@ -3373,7 +3366,6 @@ "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -3625,6 +3617,7 @@ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -3858,7 +3851,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -3916,7 +3908,6 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4004,7 +3995,6 @@ "integrity": "sha512-fxOigKkIem1iAgQ9t4cFOP+kWEA8y6Be/uh50FpJh0FijoeeT/VMrOyJzNLUgjy0rGMEcHeReKDCqj0g9dIe9A==", "dev": true, "license": "W3C", - "peer": true, "engines": { "node": ">= 18" } diff --git a/src/build/patches.ts b/src/build/patches.ts index 05632f318..0441e7c9d 100644 --- a/src/build/patches.ts +++ b/src/build/patches.ts @@ -296,25 +296,38 @@ function handleMethod(child: Node): DeepPartial { } } - // Determine the actual signature object - const signatureObj: DeepPartial = { - param: params, - ...(typeNode - ? handleTyped(typeNode) - : { + const type = typeNode + ? handleTyped(typeNode) + : child.properties?.returns + ? { type: string(child.properties?.returns), subtype: undefined, - }), - }; + } + : null; - let signature: OverridableMethod["signature"]; const signatureIndex = child.properties?.signatureIndex; - if (typeof signatureIndex == "number") { - signature = { [signatureIndex]: signatureObj }; - } else { - signature = [signatureObj]; + if ((params.length || signatureIndex) && !type) { + throw new Error("A method signature requires a type"); + } + + let signature: OverridableMethod["signature"] = []; + if (type) { + // Determine the actual signature object + const signatureObj: DeepPartial = { + param: params, + ...type, + }; + if (typeof signatureIndex == "number") { + signature = { [signatureIndex]: signatureObj }; + } else { + signature = [signatureObj]; + } } - return { name, signature }; + return { + name, + signature, + ...optionalMember("exposed", "string", child.properties.exposed), + }; } /**