We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ce22c41 commit cd76666Copy full SHA for cd76666
src/ts/hint/index.ts
@@ -59,8 +59,8 @@ export class Hint {
59
vditor.options.hint.extend.forEach((item) => {
60
if (item.key === this.splitChar) {
61
clearTimeout(this.timeId);
62
- this.timeId = window.setTimeout(() => {
63
- this.genHTML(item.hint(key), key, vditor);
+ this.timeId = window.setTimeout(async () => {
+ this.genHTML(await item.hint(key), key, vditor);
64
}, vditor.options.hint.delay);
65
}
66
});
types/index.d.ts
@@ -537,7 +537,7 @@ interface IHintData {
537
interface IHintExtend {
538
key: string;
539
540
- hint?(value: string): IHintData[];
+ hint?(value: string): IHintData[] | Promise<IHintData[]>;
541
542
543
/** @link https://ld246.com/article/1549638745630#options-hint */
0 commit comments