Repository: sveltejs/svelte
File: packages/svelte/types/index.d.ts (TypeScript)

Code before:
				? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
				: undefined extends EventMap[Type]
					? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
					: [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
		): boolean;
	}

	/**
	 * Defines the options accepted by the `mount()` function.
	 */
	export type MountOptions<Props extends Record<string, any> = Record<string, any>> = {
		/**
		 * Target element where the component will be mounted.
		 */
		target: Document | Element | ShadowRoot;
		/**
		 * 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>;
		/**
		 * Context that can be access via `getContext()` at the component level.
		 */
		context?: Map<any, any>;
		/**
		 * Whether or not to play transitions on initial render.
		 * @default true
		 */
		intro?: boolean;
	} & ({} extends Props
		? {
				/**
				 * Component properties.
				 */
				props?: Props;
			}
		: {
				/**
				 * Component properties.
				 */
				props: Props;
			});
	/**
	 * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
	 * It must be called during the component's initialisation (but doesn't need to live *inside* the component;
	 * it can be called from an external module).
	 *

Review comment (suggestion):
```suggestion
		 * Can be accessed via `getContext()` at the component level.
```

Code after:
				? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
				: undefined extends EventMap[Type]
					? [type: Type, parameter?: EventMap[Type] | null | undefined, options?: DispatchOptions]
					: [type: Type, parameter: EventMap[Type], options?: DispatchOptions]
		): boolean;
	}

	/**
	 * Defines the options accepted by the `mount()` function.
	 */
	export type MountOptions<Props extends Record<string, any> = Record<string, any>> = {
		/**
		 * Target element where the component will be mounted.
		 */
		target: Document | Element | ShadowRoot;
		/**
		 * 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>;
		/**
		 * Can be accessed via `getContext()` at the component level.
		 */
		context?: Map<any, any>;
		/**
		 * Whether or not to play transitions on initial render.
		 * @default true
		 */
		intro?: boolean;
	} & ({} extends Props
		? {
				/**
				 * Component properties.
				 */
				props?: Props;
			}
		: {
				/**
				 * Component properties.
				 */
				props: Props;
			});
	/**
	 * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
	 * It must be called during the component's initialisation (but doesn't need to live *inside* the component;
	 * it can be called from an external module).
	 *