Skip to content

Commit

Permalink
chore: tweak MountOptions docs (#13841)
Browse files Browse the repository at this point in the history
A few wording tweaks, and most importantly mark `events` as deprecated - we don't want to encourage its use.
  • Loading branch information
dummdidumm authored Oct 23, 2024
1 parent 134049f commit 44c8889
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/svelte/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,21 @@ export type MountOptions<Props extends Record<string, any> = Record<string, any>
*/
target: Document | Element | ShadowRoot;
/**
* Optional node inside `target` and when specified, it is used to render the component immediately before it.
* Optional node inside `target`. When specified, it is used to render the component immediately before it.
*/
anchor?: Node;
/**
* Allows the specification of events.
* @deprecated Use callback props instead.
*/
events?: Record<string, (e: any) => any>;
/**
* Used to define context at the component level.
* Can be accessed via `getContext()` at the component level.
*/
context?: Map<any, any>;
/**
* Used to control transition playback on initial render. The default value is `true` to run transitions.
* Whether or not to play transitions on initial render.
* @default true
*/
intro?: boolean;
} & ({} extends Props
Expand Down
8 changes: 5 additions & 3 deletions packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,21 @@ declare module 'svelte' {
*/
target: Document | Element | ShadowRoot;
/**
* Optional node inside `target` and when specified, it is used to render the component immediately before it.
* Optional node inside `target`. When specified, it is used to render the component immediately before it.
*/
anchor?: Node;
/**
* Allows the specification of events.
* @deprecated Use callback props instead.
*/
events?: Record<string, (e: any) => any>;
/**
* Used to define context at the component level.
* Can be accessed via `getContext()` at the component level.
*/
context?: Map<any, any>;
/**
* Used to control transition playback on initial render. The default value is `true` to run transitions.
* Whether or not to play transitions on initial render.
* @default true
*/
intro?: boolean;
} & ({} extends Props
Expand Down

0 comments on commit 44c8889

Please sign in to comment.