Skip to content

Commit 44c8889

Browse files
authored
chore: tweak MountOptions docs (#13841)
A few wording tweaks, and most importantly mark `events` as deprecated - we don't want to encourage its use.
1 parent 134049f commit 44c8889

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/svelte/src/index.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,21 @@ export type MountOptions<Props extends Record<string, any> = Record<string, any>
320320
*/
321321
target: Document | Element | ShadowRoot;
322322
/**
323-
* Optional node inside `target` and when specified, it is used to render the component immediately before it.
323+
* Optional node inside `target`. When specified, it is used to render the component immediately before it.
324324
*/
325325
anchor?: Node;
326326
/**
327327
* Allows the specification of events.
328+
* @deprecated Use callback props instead.
328329
*/
329330
events?: Record<string, (e: any) => any>;
330331
/**
331-
* Used to define context at the component level.
332+
* Can be accessed via `getContext()` at the component level.
332333
*/
333334
context?: Map<any, any>;
334335
/**
335-
* Used to control transition playback on initial render. The default value is `true` to run transitions.
336+
* Whether or not to play transitions on initial render.
337+
* @default true
336338
*/
337339
intro?: boolean;
338340
} & ({} extends Props

packages/svelte/types/index.d.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,21 @@ declare module 'svelte' {
317317
*/
318318
target: Document | Element | ShadowRoot;
319319
/**
320-
* Optional node inside `target` and when specified, it is used to render the component immediately before it.
320+
* Optional node inside `target`. When specified, it is used to render the component immediately before it.
321321
*/
322322
anchor?: Node;
323323
/**
324324
* Allows the specification of events.
325+
* @deprecated Use callback props instead.
325326
*/
326327
events?: Record<string, (e: any) => any>;
327328
/**
328-
* Used to define context at the component level.
329+
* Can be accessed via `getContext()` at the component level.
329330
*/
330331
context?: Map<any, any>;
331332
/**
332-
* Used to control transition playback on initial render. The default value is `true` to run transitions.
333+
* Whether or not to play transitions on initial render.
334+
* @default true
333335
*/
334336
intro?: boolean;
335337
} & ({} extends Props

0 commit comments

Comments
 (0)