textchecker-element
Version:
Overlay text checker web compoentns.
29 lines (28 loc) • 822 B
TypeScript
import { TextlintResult } from "@textlint/types";
export declare type WorkerReceiveCommand = {
command: "init";
} | {
command: "lint";
};
export declare type WorkerSendCommand = {
command: "lint";
} | {
command: "fix";
};
export declare type AttachTextAreaParams = {
textAreaExt: ".md" | ".txt";
textAreaElement: HTMLTextAreaElement;
workerUrl: string | URL;
/**
* linting debounce timeout millisecond
* default: 200ms
*/
lintingDebounceMs: number;
handlePreLint?: ({ text }: {
text: string;
}) => void;
handlePostLint?: ({ result }: {
result: TextlintResult;
}) => void;
};
export declare const attachTextArea: ({ textAreaElement, textAreaExt, workerUrl, handlePreLint, handlePostLint, lintingDebounceMs }: AttachTextAreaParams) => void;