Skip to content

Commit 1c082a5

Browse files
committed
types
1 parent a60ba2a commit 1c082a5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/svelte/types/index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,22 @@ declare function $inspect<T extends any[]>(
27772777
*/
27782778
declare function $host<El extends HTMLElement = HTMLElement>(): El;
27792779

2780+
/**
2781+
* Creates a lazy object or array property binding, similar to that of a getter/setter. If passed
2782+
* a single argument, the lazy property binding with be read-only.
2783+
*
2784+
* ```svelte
2785+
* let count = $state(0);
2786+
* let double = $derived(count * 2);
2787+
*
2788+
* let object = {
2789+
* count: $lazy(count, value => count = value),
2790+
* double: $lazy(double),
2791+
* };
2792+
* ```
2793+
*
2794+
* https://svelte-5-preview.vercel.app/docs/runes#$lazy
2795+
*/
27802796
declare function $lazy<V>(value: V, setter: (value: V) => unknown): V;
27812797

27822798
//# sourceMappingURL=index.d.ts.map

0 commit comments

Comments
 (0)