From 557a2df591ccaefe7d30ccd8be37e99d10d7d82d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 11 Dec 2024 11:29:54 -0500 Subject: [PATCH] add @since tags --- packages/svelte/src/reactivity/window/index.js | 10 ++++++++++ packages/svelte/types/index.d.ts | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/svelte/src/reactivity/window/index.js b/packages/svelte/src/reactivity/window/index.js index 63a9c12d35d7..16e8b7b87b9a 100644 --- a/packages/svelte/src/reactivity/window/index.js +++ b/packages/svelte/src/reactivity/window/index.js @@ -6,6 +6,7 @@ import { set, source } from '../../internal/client/reactivity/sources.js'; /** * `scrollX.current` is a reactive view of `window.scrollX`. On the server it is `undefined`. + * @since 5.11.0 */ export const scrollX = new ReactiveValue( BROWSER ? () => window.scrollX : () => undefined, @@ -14,6 +15,7 @@ export const scrollX = new ReactiveValue( /** * `scrollY.current` is a reactive view of `window.scrollY`. On the server it is `undefined`. + * @since 5.11.0 */ export const scrollY = new ReactiveValue( BROWSER ? () => window.scrollY : () => undefined, @@ -22,6 +24,7 @@ export const scrollY = new ReactiveValue( /** * `innerWidth.current` is a reactive view of `window.innerWidth`. On the server it is `undefined`. + * @since 5.11.0 */ export const innerWidth = new ReactiveValue( BROWSER ? () => window.innerWidth : () => undefined, @@ -30,6 +33,7 @@ export const innerWidth = new ReactiveValue( /** * `innerHeight.current` is a reactive view of `window.innerHeight`. On the server it is `undefined`. + * @since 5.11.0 */ export const innerHeight = new ReactiveValue( BROWSER ? () => window.innerHeight : () => undefined, @@ -38,6 +42,7 @@ export const innerHeight = new ReactiveValue( /** * `outerWidth.current` is a reactive view of `window.outerWidth`. On the server it is `undefined`. + * @since 5.11.0 */ export const outerWidth = new ReactiveValue( BROWSER ? () => window.outerWidth : () => undefined, @@ -46,6 +51,7 @@ export const outerWidth = new ReactiveValue( /** * `outerHeight.current` is a reactive view of `window.outerHeight`. On the server it is `undefined`. + * @since 5.11.0 */ export const outerHeight = new ReactiveValue( BROWSER ? () => window.outerHeight : () => undefined, @@ -54,6 +60,7 @@ export const outerHeight = new ReactiveValue( /** * `screenLeft.current` is a reactive view of `window.screenLeft`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`. + * @since 5.11.0 */ export const screenLeft = new ReactiveValue( BROWSER ? () => window.screenLeft : () => undefined, @@ -76,6 +83,7 @@ export const screenLeft = new ReactiveValue( /** * `screenTop.current` is a reactive view of `window.screenTop`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`. + * @since 5.11.0 */ export const screenTop = new ReactiveValue( BROWSER ? () => window.screenTop : () => undefined, @@ -98,6 +106,7 @@ export const screenTop = new ReactiveValue( /** * `online.current` is a reactive view of `navigator.onLine`. On the server it is `undefined`. + * @since 5.11.0 */ export const online = new ReactiveValue( BROWSER ? () => navigator.onLine : () => undefined, @@ -116,6 +125,7 @@ export const online = new ReactiveValue( * Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level, * on Firefox and Safari it won't. * @type {{ get current(): number }} + * @since 5.11.0 */ export const devicePixelRatio = /* @__PURE__ */ new (class DevicePixelRatio { #dpr = source(BROWSER ? window.devicePixelRatio : undefined); diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 307055e89ae1..206f9931f50c 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -1965,45 +1965,55 @@ declare module 'svelte/reactivity' { declare module 'svelte/reactivity/window' { /** * `scrollX.current` is a reactive view of `window.scrollX`. On the server it is `undefined`. + * @since 5.11.0 */ export const scrollX: ReactiveValue; /** * `scrollY.current` is a reactive view of `window.scrollY`. On the server it is `undefined`. + * @since 5.11.0 */ export const scrollY: ReactiveValue; /** * `innerWidth.current` is a reactive view of `window.innerWidth`. On the server it is `undefined`. + * @since 5.11.0 */ export const innerWidth: ReactiveValue; /** * `innerHeight.current` is a reactive view of `window.innerHeight`. On the server it is `undefined`. + * @since 5.11.0 */ export const innerHeight: ReactiveValue; /** * `outerWidth.current` is a reactive view of `window.outerWidth`. On the server it is `undefined`. + * @since 5.11.0 */ export const outerWidth: ReactiveValue; /** * `outerHeight.current` is a reactive view of `window.outerHeight`. On the server it is `undefined`. + * @since 5.11.0 */ export const outerHeight: ReactiveValue; /** * `screenLeft.current` is a reactive view of `window.screenLeft`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`. + * @since 5.11.0 */ export const screenLeft: ReactiveValue; /** * `screenTop.current` is a reactive view of `window.screenTop`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`. + * @since 5.11.0 */ export const screenTop: ReactiveValue; /** * `online.current` is a reactive view of `navigator.onLine`. On the server it is `undefined`. + * @since 5.11.0 */ export const online: ReactiveValue; /** * `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`. * Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level, * on Firefox and Safari it won't. - * */ + * @since 5.11.0 + */ export const devicePixelRatio: { get current(): number; };