pull/15000/head
Rich Harris 1 year ago
parent c69c5d7c25
commit 999a05a3b7

@ -1,3 +1,10 @@
/**
* An [attachment](https://svelte.dev/docs/svelte/@attach) is a function that runs when an element is mounted
* to the DOM, and optionally returns a function that is called when the element is later removed.
*
* It can be attached to an element with an `{@attach ...}` tag, or by spreading an object containing
* a property created with [`createAttachmentKey`](https://svelte.dev/docs/svelte/svelte-attachments#createAttachmentKey).
*/
export interface Attachment {
(element: Element): void | (() => void);
}

@ -625,6 +625,13 @@ declare module 'svelte/animate' {
}
declare module 'svelte/attachments' {
/**
* An [attachment](https://svelte.dev/docs/svelte/@attach) is a function that runs when an element is mounted
* to the DOM, and optionally returns a function that is called when the element is later removed.
*
* It can be attached to an element with an `{@attach ...}` tag, or by spreading an object containing
* a property created with [`createAttachmentKey`](https://svelte.dev/docs/svelte/svelte-attachments#createAttachmentKey).
*/
export interface Attachment {
(element: Element): void | (() => void);
}

Loading…
Cancel
Save