vuepress-plugin-full-text-search2
Version:
VuePress v2 plugin that adds full-text search box.
34 lines (30 loc) • 681 B
TypeScript
import { Ref } from 'vue';
import { Page } from '@vuepress/core';
type PageIndex = {
title: Page["title"];
path: Page["path"];
pathLocale: Page["pathLocale"];
contents: PageContent[];
};
type PageContent = {
header: string;
slug: string;
content: string;
};
type Word = {
type: string;
str: string;
};
type Suggestion = {
path: string;
parentPageTitle: string;
title: string;
display: Word[];
page: PageIndex;
content: PageContent | null;
parentPagePriority: number;
priority: number;
};
/** Use suggestions */
declare function useSuggestions(query: Ref<string>): Ref<Suggestion[]>;
export { useSuggestions };