diff --git a/.changeset/four-balloons-beam.md b/.changeset/four-balloons-beam.md new file mode 100644 index 0000000000..4bb459c6d7 --- /dev/null +++ b/.changeset/four-balloons-beam.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: mark function properties on runes as deprecated for better intellisense diff --git a/packages/svelte/src/ambient.d.ts b/packages/svelte/src/ambient.d.ts index b65346dd7d..0698530fc3 100644 --- a/packages/svelte/src/ambient.d.ts +++ b/packages/svelte/src/ambient.d.ts @@ -62,6 +62,27 @@ declare namespace $state { * @param state The value to snapshot */ export function snapshot(state: T): T; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /** @@ -98,6 +119,27 @@ declare namespace $derived { * https://svelte-5-preview.vercel.app/docs/runes#$derived-by */ export function by(fn: () => T): T; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /** @@ -186,6 +228,27 @@ declare namespace $effect { * https://svelte-5-preview.vercel.app/docs/runes#$effect-root */ export function root(fn: () => void | (() => void)): () => void; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /** diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 7bfdee575c..daff299768 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -2623,6 +2623,27 @@ declare namespace $state { * @param state The value to snapshot */ export function snapshot(state: T): T; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /** @@ -2659,6 +2680,27 @@ declare namespace $derived { * https://svelte-5-preview.vercel.app/docs/runes#$derived-by */ export function by(fn: () => T): T; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /** @@ -2747,6 +2789,27 @@ declare namespace $effect { * https://svelte-5-preview.vercel.app/docs/runes#$effect-root */ export function root(fn: () => void | (() => void)): () => void; + + // prevent intellisense from being unhelpful + /** @deprecated */ + export const apply: never; + /** @deprecated */ + // @ts-ignore + export const arguments: never; + /** @deprecated */ + export const bind: never; + /** @deprecated */ + export const call: never; + /** @deprecated */ + export const caller: never; + /** @deprecated */ + export const length: never; + /** @deprecated */ + export const name: never; + /** @deprecated */ + export const prototype: never; + /** @deprecated */ + export const toString: never; } /**