onMount() 他のライフサイクルと似てるけど違うやつ。
<script lang="ts">
import type { Action } from "svelte/types/runtime/action";
const myAction: Action = (node, parameter) => {};
</script>
<div use:myAction />
Action 型は 2 つの引数 Element, Parameter を取ります。それぞれ関数の引数 node, parameter に対応。
あとあんまり使わないだろうけど戻り値(update() と destroy() を持つオブジェクト)部分だけの型は ActionReturn 。
前に調べたのに忘れてまた探して見つけたのでここにちゃんとメモしておくよ……。