FlagElementEventDetail型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What hata-load and hata-error carry in detail: the code as asked, and for an error why nothing was drawn.
インポート
import type { FlagElementEventDetail } from "@johnmorrisdotca/hata/element";
定義
interface FlagElementEventDetail {
code: string;
shape: string;
reason?: string;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
code | string | The code, as the |
shape | string | The shape it was drawn at: |
reason (省略可) | string | undefined | For |
例
import type { FlagElementEventDetail } from "@johnmorrisdotca/hata/element";
console.log(document.addEventListener("hata-error", (event) => {
const { code, reason } = (event as CustomEvent<FlagElementEventDetail>).detail;
console.log(code, reason);
}));この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。