UNPKG

@nuxtjs/prismic

Version:

Easily connect your Nuxt application to your content hosted on Prismic

124 lines (121 loc) 3.83 kB
import * as _nuxt_schema from '@nuxt/schema'; import { ClientConfig } from '@prismicio/client'; /** * Prismic Nuxt module options. * * @see {@link https://prismic.io/docs/nuxt} * @see {@link https://prismic.io/docs/technical-reference/nuxtjs-prismic} */ type PrismicModuleOptions = { /** * The Prismic repository name or full Content API endpoint to init the * module's client instance used to fetch content from a Prismic repository * with. * * @example * * ```typescript * // With a repository name * createClient("my-repo") * * // With a full Prismic Content API endpoint * createClient("https://my-repo.cdn.prismic.io/api/v2") * ``` * * @see {@link https://prismic.io/docs/technical-reference/prismicio-client} */ endpoint?: string; /** * The Prismic environment in use by Slice Machine configured through * environment variables. * * @defaultValue `endpoint` value. * * @internal */ environment?: string; /** * Configuration options that determines how content will be queries from the * Prismic repository. * * @see {@link https://prismic.io/docs/technical-reference/prismicio-client} */ clientConfig?: ClientConfig; /** * An optional path to a file exporting a Prismic client instance used to * fetch content from a Prismic repository to configure the module with. * * @remarks * When provided, it takes precedence over the `endpoint` and `clientConfig` * options. * * @see {@link https://prismic.io/docs/technical-reference/prismicio-client} */ client?: string; /** * The path to a file exporting a default link resolver used to resolve links * when route resolvers cannot be used. * * @see {@link https://prismic.io/docs/routes} */ linkResolver?: string; /** * Desired path of the preview page used by Prismic to enter preview session. * * @remarks * `false` can be used to disable the preview page. * * @defaultValue `"/preview"` */ preview?: string | false; /** * Whether to inject Prismic toolbar script. * * @remarks * The toolbar script is required for previews to work. * * @defaultValue `true` */ toolbar?: boolean; /** * Controls which auto-imports are added by the module. * * - `"all"` will add all imports. * - `["vue"]` will add `@nuxtjs/prismic` and `@prismicio/vue` imports. * - `["javascript"]` will add `@prismicio/client` imports. * - `["content"]` will add the `Content` type import. * - `false` will not add any import. * * @defaultValue `["vue"]` * * @experimental */ imports?: false | "all" | ("vue" | "javascript" | "content")[]; /** Options used by Prismic Vue components. */ components?: { /** * The path to a file exporting default components or shorthand definitions * for rich text and table components. * * @see {@link https://prismic.io/docs/fields/rich-text} * @see {@link https://prismic.io/docs/fields/table} */ richTextComponents?: string; }; }; /** * Prismic Nuxt module options. * * @see {@link https://prismic.io/docs/nuxt} * @see {@link https://prismic.io/docs/technical-reference/nuxtjs-prismic} */ type ModuleOptions = PrismicModuleOptions; declare module "@nuxt/schema" { interface PublicRuntimeConfig { /** The Prismic Nuxt module options. */ prismic: PrismicModuleOptions; } } declare const _default: _nuxt_schema.NuxtModule<PrismicModuleOptions, PrismicModuleOptions, false>; export { _default as default }; export type { ModuleOptions, PrismicModuleOptions };