[{"_path":"/advanced/docsearch","_draft":false,"_partial":false,"_empty":false,"title":"DocSearch","description":"","excerpt":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"DocSearch provides an easy way for Open Source documentations to have an instant search on their websites!"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You probably have seen it in a lot of websites with the "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Cmd+K"}]},{"type":"text","value":" shortcut!"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Websites like "},{"type":"element","tag":"a","props":{"href":"https://nuxtjs.org","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"nuxtjs.org"}]},{"type":"text","value":", "},{"type":"element","tag":"a","props":{"href":"https://vuejs.org","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"vuejs.org"}]},{"type":"text","value":" uses it to provide an instant search to users without any backend!"}]},{"type":"element","tag":"h2","props":{"id":"installation"},"children":[{"type":"text","value":"Installation"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"As DocSearch is an additional feature for "},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxtjs/algolia-module","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"@nuxtjs/algolia-module"}]}]},{"type":"text","value":", it needs two additional dependencies:"}]},{"type":"element","tag":"code-group","props":{},"children":[{"type":"element","tag":"code","props":{"code":"yarn add @docsearch/js @docsearch/css\n","filename":"Yarn","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"yarn add @docsearch/js @docsearch/css\n"}]}]}]},{"type":"element","tag":"code","props":{"code":"npm install @docsearch/js @docsearch/css\n","filename":"NPM","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"npm install @docsearch/js @docsearch/css\n"}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"configuration"},"children":[{"type":"text","value":"Configuration"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can easily configure DocSearch usage via the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"docSearch"}]},{"type":"text","value":" key in the module configuration."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"By default, it is set to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"false"}]},{"type":"text","value":", which disables it and does not ship anything to your Nuxt app bundle."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This key is fully typed and links you to the "},{"type":"element","tag":"a","props":{"href":"https://docsearch.algolia.com/docs/api","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"DocSearch API reference"}]},{"type":"text","value":" for each key."}]},{"type":"element","tag":"code","props":{"code":"// nuxt.config.ts\n{\n algolia: {\n apiKey: 'apiKey',\n applicationId: 'applicationId',\n // DocSearch key is used to configure DocSearch extension.\n docSearch: {\n indexName: 'indexName',\n }\n } \n}\n","language":"javascript"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"// nuxt.config.ts\n{\n algolia: {\n apiKey: 'apiKey',\n applicationId: 'applicationId',\n // DocSearch key is used to configure DocSearch extension.\n docSearch: {\n indexName: 'indexName',\n }\n } \n}\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can find a list of every supported parameters by looking at the type definition ("},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxt-community/algolia-module/tree/main/src/types.ts","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"DocSearchOptions"}]},{"type":"text","value":")."}]},{"type":"element","tag":"h2","props":{"id":"usage"},"children":[{"type":"text","value":"Usage"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can easily add the component anywhere in your app like this:"}]},{"type":"element","tag":"code","props":{"code":"\n","language":"vue"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"options"}]},{"type":"text","value":" key is optional."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The component will try to resolve the configuration by itself via "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"useRuntimeConfig"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to overwrite the config from your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt.config"}]},{"type":"text","value":", you can pass the object via the prop."}]},{"type":"element","tag":"h2","props":{"id":"theming"},"children":[{"type":"text","value":"Theming"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to theme the component, you can use these files as a reference for available variables/classes:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/_variables.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"_variables.css"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/button.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"button.css"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/modal.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"modal.css"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The components gets shipped with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"@docsearch/css"}]},{"type":"text","value":" which is the default theme from "},{"type":"element","tag":"a","props":{"href":"https://algolia.com","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"Algolia"}]},{"type":"text","value":"."}]}]},"body":{"type":"root","children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"DocSearch provides an easy way for Open Source documentations to have an instant search on their websites!"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You probably have seen it in a lot of websites with the "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Cmd+K"}]},{"type":"text","value":" shortcut!"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Websites like "},{"type":"element","tag":"a","props":{"href":"https://nuxtjs.org","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"nuxtjs.org"}]},{"type":"text","value":", "},{"type":"element","tag":"a","props":{"href":"https://vuejs.org","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"vuejs.org"}]},{"type":"text","value":" uses it to provide an instant search to users without any backend!"}]},{"type":"element","tag":"h2","props":{"id":"installation"},"children":[{"type":"text","value":"Installation"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"As DocSearch is an additional feature for "},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxtjs/algolia-module","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"@nuxtjs/algolia-module"}]}]},{"type":"text","value":", it needs two additional dependencies:"}]},{"type":"element","tag":"code-group","props":{},"children":[{"type":"element","tag":"code","props":{"code":"yarn add @docsearch/js @docsearch/css\n","filename":"Yarn","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"yarn add @docsearch/js @docsearch/css"}]}]}]}]}]},{"type":"element","tag":"code","props":{"code":"npm install @docsearch/js @docsearch/css\n","filename":"NPM","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"npm install @docsearch/js @docsearch/css"}]}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"configuration"},"children":[{"type":"text","value":"Configuration"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can easily configure DocSearch usage via the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"docSearch"}]},{"type":"text","value":" key in the module configuration."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"By default, it is set to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"false"}]},{"type":"text","value":", which disables it and does not ship anything to your Nuxt app bundle."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"This key is fully typed and links you to the "},{"type":"element","tag":"a","props":{"href":"https://docsearch.algolia.com/docs/api","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"DocSearch API reference"}]},{"type":"text","value":" for each key."}]},{"type":"element","tag":"code","props":{"code":"// nuxt.config.ts\n{\n algolia: {\n apiKey: 'apiKey',\n applicationId: 'applicationId',\n // DocSearch key is used to configure DocSearch extension.\n docSearch: {\n indexName: 'indexName',\n }\n } \n}\n","language":"javascript"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-08a701"},"children":[{"type":"text","value":"// nuxt.config.ts"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" algolia: {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" apiKey: "}]},{"type":"element","tag":"span","props":{"class":"ct-b40c86"},"children":[{"type":"text","value":"'apiKey'"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" applicationId: "}]},{"type":"element","tag":"span","props":{"class":"ct-b40c86"},"children":[{"type":"text","value":"'applicationId'"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-08a701"},"children":[{"type":"text","value":"// DocSearch key is used to configure DocSearch extension."}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" docSearch: {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" indexName: "}]},{"type":"element","tag":"span","props":{"class":"ct-b40c86"},"children":[{"type":"text","value":"'indexName'"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" } "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can find a list of every supported parameters by looking at the type definition ("},{"type":"element","tag":"a","props":{"href":"https://github.com/nuxt-community/algolia-module/tree/main/src/types.ts","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"DocSearchOptions"}]},{"type":"text","value":")."}]},{"type":"element","tag":"h2","props":{"id":"usage"},"children":[{"type":"text","value":"Usage"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You can easily add the component anywhere in your app like this:"}]},{"type":"element","tag":"code","props":{"code":"\n","language":"vue"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"class":"ct-33dbcf"},"children":[{"type":"text","value":"template"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":">"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" <"}]},{"type":"element","tag":"span","props":{"class":"ct-b5cf1c"},"children":[{"type":"text","value":"AlgoliaDocSearch"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" :"}]},{"type":"element","tag":"span","props":{"class":"ct-b5cf1c"},"children":[{"type":"text","value":"options"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"class":"ct-33dbcf"},"children":[{"type":"text","value":"options"}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":" />"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-c6399a"},"children":[{"type":"text","value":""}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"options"}]},{"type":"text","value":" key is optional."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The component will try to resolve the configuration by itself via "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"useRuntimeConfig"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to overwrite the config from your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"nuxt.config"}]},{"type":"text","value":", you can pass the object via the prop."}]},{"type":"element","tag":"h2","props":{"id":"theming"},"children":[{"type":"text","value":"Theming"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to theme the component, you can use these files as a reference for available variables/classes:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/_variables.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"_variables.css"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/button.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"button.css"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"a","props":{"href":"https://github.com/algolia/docsearch/blob/next/packages/docsearch-css/src/modal.css","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"modal.css"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The components gets shipped with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"@docsearch/css"}]},{"type":"text","value":" which is the default theme from "},{"type":"element","tag":"a","props":{"href":"https://algolia.com","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"Algolia"}]},{"type":"text","value":"."}]},{"type":"element","tag":"style","children":[{"type":"text","value":".ct-b5cf1c{color:#D19A66}.ct-33dbcf{color:#E06C75}.ct-b40c86{color:#98C379}.ct-08a701{color:#7F848E}.ct-c6399a{color:#ABB2BF}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"installation","depth":2,"text":"Installation"},{"id":"configuration","depth":2,"text":"Configuration"},{"id":"usage","depth":2,"text":"Usage"},{"id":"theming","depth":2,"text":"Theming"}]}},"_type":"markdown","_id":"content:2.advanced:3.docsearch.md","_source":"content","_file":"2.advanced/3.docsearch.md","_extension":"md"},{"_path":"/advanced/typescript","_draft":false,"_partial":false,"_empty":false,"title":"Typescript","description":"","excerpt":{"type":"root","children":[{"type":"element","tag":"h2","props":{"id":"typescript"},"children":[{"type":"text","value":"TypeScript"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"To allow for index names auto-completion and search results typings, you may define your indices expected results by extending the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"AlgoliaIndices"}]},{"type":"text","value":" interface as follows:"}]},{"type":"element","tag":"code","props":{"code":"// types.d.ts\nimport '@nuxtjs/algolia'\n\ndeclare module '@nuxtjs/algolia' {\n interface AlgoliaIndices {\n someIndex: {\n foo: string;\n bar: number;\n }\n }\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"// types.d.ts\nimport '@nuxtjs/algolia'\n\ndeclare module '@nuxtjs/algolia' {\n interface AlgoliaIndices {\n someIndex: {\n foo: string;\n bar: number;\n }\n }\n}\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You may then use your Algolia indices and enjoy typed search hits 🔥"}]},{"type":"element","tag":"code","props":{"code":"\n","language":"vue"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"\n"}]}]}]}]},"body":{"type":"root","children":[{"type":"element","tag":"h2","props":{"id":"typescript"},"children":[{"type":"text","value":"TypeScript"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"To allow for index names auto-completion and search results typings, you may define your indices expected results by extending the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"AlgoliaIndices"}]},{"type":"text","value":" interface as follows:"}]},{"type":"element","tag":"code","props":{"code":"// types.d.ts\nimport '@nuxtjs/algolia'\n\ndeclare module '@nuxtjs/algolia' {\n interface AlgoliaIndices {\n someIndex: {\n foo: string;\n bar: number;\n }\n }\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-a271bf"},"children":[{"type":"text","value":"// types.d.ts"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"'@nuxtjs/algolia'"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"declare"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"module"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"'@nuxtjs/algolia'"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"interface"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"AlgoliaIndices"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"someIndex"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":": {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"foo"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"bar"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You may then use your Algolia indices and enjoy typed search hits 🔥"}]},{"type":"element","tag":"code","props":{"code":"\n","language":"vue"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"script"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-221863"},"children":[{"type":"text","value":"lang"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"\"ts\""}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-221863"},"children":[{"type":"text","value":"setup"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":">"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" { "}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"result"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"search"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" } "}]},{"type":"element","tag":"span","props":{"class":"ct-edd4cf"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-0b1eb9"},"children":[{"type":"text","value":"useAlgoliaSearch"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"'someIndex'"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"class":"ct-a271bf"},"children":[{"type":"text","value":"// Auto-completion for index names"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-90a96c"},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-0b1eb9"},"children":[{"type":"text","value":"search"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"({ "}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"query"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"'test'"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" }) "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-a271bf"},"children":[{"type":"text","value":"// @ts-expect-error bar should be a number"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"result"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"class":"ct-ce8b74"},"children":[{"type":"text","value":"value"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"hits"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"["}]},{"type":"element","tag":"span","props":{"class":"ct-221863"},"children":[{"type":"text","value":"0"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":"]."}]},{"type":"element","tag":"span","props":{"class":"ct-10650a"},"children":[{"type":"text","value":"bar"}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-edd4cf"},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"class":"ct-c28dc4"},"children":[{"type":"text","value":"'1'"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"class":"ct-7624ea"},"children":[{"type":"text","value":""}]}]}]}]}]},{"type":"element","tag":"style","children":[{"type":"text","value":".ct-0b1eb9{color:#61AFEF}.ct-edd4cf{color:#56B6C2}.ct-221863{color:#D19A66}.ct-10650a{color:#E06C75}.ct-ce8b74{color:#E5C07B}.ct-c28dc4{color:#98C379}.ct-7624ea{color:#ABB2BF}.ct-90a96c{color:#C678DD}.ct-a271bf{color:#7F848E}"}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"typescript","depth":2,"text":"TypeScript"}]}},"_type":"markdown","_id":"content:2.advanced:4.typescript.md","_source":"content","_file":"2.advanced/4.typescript.md","_extension":"md"}]