UNPKG

@magidoc/plugin-fuse-graphql

Version:

A plugin used to index a GraphQL schema into a Fuse.js search engine.

19 lines (18 loc) 775 B
import type { MarkdownOptions } from '@magidoc/plugin-fuse-markdown'; import Fuse, { type IFuseOptions } from 'fuse.js'; import type { GraphQLSchema } from 'graphql'; import { type SearchResult } from './result'; export type IndexingOptions = { /** * The fuse index to which the indexed markdown document parts will be added. * * You can use the `defaultFuseOptions` function to get a default options object. */ fuse?: Fuse<SearchResult>; /** * The markdown options that are used to extract the markdown parts. */ markdown?: Partial<MarkdownOptions>; }; export declare function defaultFuseOptions(): IFuseOptions<SearchResult>; export declare function index(schema: GraphQLSchema, options?: IndexingOptions): Fuse<SearchResult>;