HikidashiElementOptionstype
Host callbacks for a text-tool element. Native events carry the same result or message.
Import it
import type { HikidashiElementOptions } from "@johnmorrisdotca/hikidashi/element";
Also exported from: @johnmorrisdotca/hikidashi/element/define
Definition
type HikidashiElementOptions = {
onChange?: (result: HikidashiResult) => void;
onError?: (detail: {
message: string;
}) => void;
};
Members
| Name | Type | Description |
|---|---|---|
onChange (optional) | ((result: HikidashiResult) => void) | undefined | Called after input or presentation changes, with the result or null. |
onError (optional) | ((detail: { message: string; }) => void) | undefined | Called with a plain message when the input cannot be read. |
Examples
import type { HikidashiElementOptions } from "@johnmorrisdotca/hikidashi/element";
const options: HikidashiElementOptions = { onChange: result => console.log(result) };
console.log(typeof options.onChange);functionWhat it prints (run when this page was built)