Reference · Native flag element
FlagElementEventDetailtype
What hata-load and hata-error carry in detail: the code as asked, and for an error why nothing was drawn.
Import it
import type { FlagElementEventDetail } from "@johnmorrisdotca/hata/element";
Definition
interface FlagElementEventDetail {
code: string;
shape: string;
reason?: string;
}
Members
| Name | Type | Description |
|---|---|---|
code | string | The code, as the |
shape | string | The shape it was drawn at: |
reason (optional) | string | undefined | For |
Examples
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);
}));