From e5e16987392ef4fdf9e3e7fab5e5c3f9ed07317a Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Tue, 15 Jul 2025 14:33:51 -0400 Subject: [PATCH] update $effect namespace --- packages/svelte/src/ambient.d.ts | 7 +++++++ packages/svelte/types/index.d.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/svelte/src/ambient.d.ts b/packages/svelte/src/ambient.d.ts index a1484718cc..7c3b941ed1 100644 --- a/packages/svelte/src/ambient.d.ts +++ b/packages/svelte/src/ambient.d.ts @@ -255,6 +255,13 @@ declare namespace $effect { */ export function pre(fn: () => void | (() => void)): void; + /** + * Returns the number of promises that are pending in the current boundary, not including child boundaries. + * + * https://svelte.dev/docs/svelte/$effect#$effect.pending + */ + export function pending(): number; + /** * The `$effect.tracking` rune is an advanced feature that tells you whether or not the code is running inside a tracking context, such as an effect or inside your template. * diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 60795e6681..d356762a3f 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -3325,6 +3325,13 @@ declare namespace $effect { */ export function pre(fn: () => void | (() => void)): void; + /** + * Returns the number of promises that are pending in the current boundary, not including child boundaries. + * + * https://svelte.dev/docs/svelte/$effect#$effect.pending + */ + export function pending(): number; + /** * The `$effect.tracking` rune is an advanced feature that tells you whether or not the code is running inside a tracking context, such as an effect or inside your template. *