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. *