Skip to content

Commit 21cd0a2

Browse files
committed
add docs
1 parent e487bcc commit 21cd0a2

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

packages/svelte/src/ambient.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ declare namespace $effect {
339339
declare function $props(): any;
340340

341341
declare namespace $props {
342+
/**
343+
* Generates an ID that is unique to the current component instance. When hydrating a server-rendered a component,
344+
* the value will be consistent between server and client.
345+
*
346+
* This is useful for linking elements via attributes like `for` and `aria-labelledby`.
347+
* @since 5.20.0
348+
*/
342349
export function id(): string;
343350

344351
// prevent intellisense from being unhelpful

packages/svelte/types/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,6 +2995,13 @@ declare namespace $effect {
29952995
declare function $props(): any;
29962996

29972997
declare namespace $props {
2998+
/**
2999+
* Generates an ID that is unique to the current component instance. When hydrating a server-rendered a component,
3000+
* the value will be consistent between server and client.
3001+
*
3002+
* This is useful for linking elements via attributes like `for` and `aria-labelledby`.
3003+
* @since 5.20.0
3004+
*/
29983005
export function id(): string;
29993006

30003007
// prevent intellisense from being unhelpful

0 commit comments

Comments
 (0)