Below you can find the reference for DocLayer's AppConfig type. This type is used in the internal app.config.ts file and provides an overview of all available configuration options. You can use it to extend or override your application's configuration in your own app.config.ts file.
You can refer to the exported types, which are available for use throughout your application. All of them can be accessed from the @vuehouse/dl/types entrypoint.
AppConfig
The primary configuration container used within the modules's app.config.ts. AppConfig provides generics that are forwarded to DocLayerConfig in order to distinguish between configuration defined in the module itself and configuration in your final application.
/** * All the DocLayer module-specific configuration. * * Intended for use in the `app.config.ts` of the DocLayer app. * Can be extended by the user as needed with `defineDoclayerAppConfig` macro. * * @see {@link defineDoclayerAppConfig} * @see {@link NuxtUI} * @template Refer to {@link DocLayerConfig} */export type AppConfig< KeysToMakeOptional extends DocLayerConfigKeys = DocLayerConfigKeys, IsOptional extends boolean = true, IsModule extends boolean = true,> = Prettify<{ /** * DocLayer configuration. * * @see {@link configuration} * @see {@link DocLayerConfig} */ dl: Prettify<DocLayerConfig<KeysToMakeOptional, IsOptional, IsModule>>; /** * Nuxt UI configuration options. * * Represents the structure for customizing Nuxt UI components. * Narrows the default configuration for better type inference. * * @see {@link https://ui.nuxt.com/docs/getting-started} */ ui: NuxtUI;}>;type DocLayerConfigKeys = keyof DocLayerConfig;DocLayerConfig
The main configuration type for DocLayer. It uses the KeyPartial utility type to allow control over which properties are required or optional for both module and application configurations. This approach helps distinguish between settings that must be provided by the module versus those expected from the application.
/** * DocLayer config. Contains all module-specific configuration. * * Intended for use in the `dl` property of the `AppConfig` (`app.config.ts`). * * @template KeysToMakeOptional - Specific keys to be made required or optional based on the `IsOptional` condition. * @template IsOptional - Whether all properties are required (`true`) or optional (`false`). * @template IsModule - Whether to determine if the configuration comes from the module or the application. * @see {@link AppConfig} */type DocLayerConfig< KeysToMakeOptional extends DocLayerConfigKeys = '_meta', IsOptional extends boolean = true, IsModule extends boolean = true,> = KeyPartial< { /** * DocLayer adapters. * * These are used to extend internal functionalities (not static). * * @see {@link adapters} * @see {@link Adapters} */ adapters?: Adapters & AdapterRecord; /** * DocLayer component(s) configuration. * * @see {@link components} * @see {@link Components} */ components: Components; /** * Transformers used across the app. * Can be used to transform code blocks or content before rendering. * * @see {@link dlTransformers} */ transformers: Transformers; /** * Map of content document paths. * Mapped by the collection, used within the `DlLink` component. * * Required if `DlLink` component is used. * * @default undefined * @see {@link PathMap} * @see {@link dlPathMap} */ pathMap: PathMap; /** * Application internal UI config. */ ui: Partial<{ /** * Color mode. * * @default "dark" * @see {@link dlUiColorMode} */ colorMode: 'dark' | 'light' | 'system'; /** * Defines header visibility on the Landing Page. * * @default true * @see {@link dlUiHeader} */ header: boolean; /** * Header logo path. * The default path is relative to the `public` directory. * Replace logo with the same name and extension to avoid changing this configuration. * * @default "/logo.webp" * @see {@link dlUiHeaderLogoPath} */ headerLogoPath: string; /** * Header logo width. Defined in rem's. * * @default "[x]rem" * @see {@link css variables} * @see {@link dlUiHeaderLogoWidth} */ headerLogoWidth: `${string}rem` | 'auto'; /** * Header logo height. Defined in rem's. * * @default "[x]rem" * @see {@link css variables} * @see {@link dlIiHeaderLogoHeight} */ headerLogoHeight: `${string}rem` | 'auto'; /** * Header navigation icons size. Defined in rem's. * * @default "[x]rem" * @see {@link css variables} * @see {@link dlUiHeaderIconSize} */ headerIconSize: `${string}rem`; /** * Whether to reverse order of the Header icons. * * @default undefined * @see {@link dlUiHeaderIconReverse} */ headerIconsReverse: boolean; /** * Whether to reverse order of the Header links. * * @default undefined * @see {@link dlUiHeaderNavReverse} */ headerNavReverse: boolean; /** * Whether to reverse order of the Footer links. * * @default undefined * @see {@link dlUiFooterNavReverse} */ footerNavRevers: boolean; /** * Whether to truncates page navigation title. * * @default true * @see {@link dlUiTruncatePageNavigationTitle} */ truncatePageNavigationTitle: boolean; /** * Whether to truncates page navigation description. * * @default true * @see {@link dlUiTruncatePageNavigationDescription} */ truncatePageNavigationDescription: boolean; }>; /** * Header navigation (middle section) links. * * @see {@link dlHeaderNav} */ headerNav: { links: NavLinks; }; /** * Header right-side navigation icons (links). * * @see {@link dlHeaderIcons} */ headerIcons: { links: Exclude<NavLink, '_overwrite'>[]; }; /** * Footer navigation links. * * @see {@link dlFooterNav} */ footerNav: { links: NavLinks; }; /** * Options exposed to interact with dedicated plugin handling the LLMs Module. * * @see {@link nuxtLLMs} * @see {@link dlLLMs} * @see {@link https://github.com/nuxt-content/nuxt-llms/blob/main/src/runtime/types.ts#L21} */ llms: LLMOptions; /** * SEO metadata. * * @see {@link dlMeta} * @see {@link defining metadata} * @see {@link https://nuxt.com/docs/4.x/api/composables/use-head} */ meta: Record< 'title' | 'description' | 'keywords' | 'author' | 'robots' | 'tag' | 'locale' | `og:${string}`, string >; /** * Schema.org metadata. * * @see {@link dlSchemaOrg} * @see {@link defining metadata} * @see {@link https://nuxt.com/modules/schema-org} * @see {@link https://schema.org} */ schemaOrg: SchemaOrg; /** * Global static data that can be used within the content Markdown (`.md`) files. * * Use `$doc.customProperty` to retrieve the data. * * @see {@link dlInDocData} */ inDocData: Record<string, Primitive | PrimitiveRecord<any>>; }, KeysToMakeOptional, IsOptional>;Adapters
The DocLayer Adapters interface defines built-in adapters and can be extended to type your own custom adapters within the global AppConfig. This allows you to add or override adapter typings as needed for your application. It's not necessary tho, as new and custom adapter interface will be inferred automatically.
/** Adapter(s) interface. */export interface Adapters { /** * Newsletter adapter. * * Adapter dedicated to handle newsletter subscriptions for the `DlNewsletter` component. */ newsletter?: AdapterInputProvider<{ config: Record<string, string>; input: { email: string } }, AdapterResponse>; /** * Analytics adapter. * * Adapter dedicated to handle analytics within the application. */ analytics?: AdapterInputProvider<{ config: Record<string, string>; input: undefined }, AdapterResponse>; /** * Assistant adapter. * * Used when Search Assistant `model.type` is `'remote'`. Receives retrieved `{ prompt, context }`. * * @see {@link https://doclayer.dev/docs/search/configuration#assistantmodeltyperemote} */ assistant?: AdapterInputProvider< { config: Record<string, string>; input: { prompt: string; context: string } }, PromptAsyncDataResponse['data'] >;}/** * List of built-in DocLayer adapter types. * * Can be extended with the custom adapter types as needed. * Used to identify supported integrations adapters. */export type AdapterID = | 'newsletter-resend' | 'newsletter-substack' | 'newsletter-custom' | 'assistant-custom' | 'analytics-google' | 'analytics-posthog' | 'analytics-custom' | 'csm-custom' | `${string}-custom`;/** * Default adapter context record. */type AdapterContextInput = Record<string, string> | undefined;type AdapterContextRecord<Input extends AdapterContextInput = AdapterContextInput> = { config: Record<string, string>; input: Input;};/** * Context object passed to a DocLayer adapter, containing both the adapter's configuration * and the runtime input. The `config` field provides the static configuration for the adapter instance, * and the `input` field contains runtime data (such as user-submitted form fields). * * @see {@link https://doclayer.dev/docs/adapters} */export type AdapterContext<T extends AdapterContextRecord = AdapterContextRecord> = { config: Prettify<AdapterConfig<T>>; input: AdapterContextRecord<T['input']>['input'];};/** * Global configuration object for a DocLayer adapter. * Record of string values (e.g., API keys, inbox addresses, etc.). * Optionally, the configuration can include a `body` function, which takes a `AdapterContext` * and outputs a string (commonly used for serializing payloads such as JSON strings). * * @see {@link https://doclayer.dev/docs/adapters} */export type AdapterConfig<T extends AdapterContextRecord = AdapterContextRecord<T['input']>> = T['config'] & { body?: AdapterRequestBody<T>;};/** * Represents the API Request body function for an adapter. * It's a callback getting the adapter context and returning the API Request body. * * @param context - Adapter context. * @returns API Request body. * @see {@link https://doclayer.dev/docs/adapters} */export type AdapterRequestBody<T extends AdapterContext<AdapterContextRecord> = AdapterContextRecord> = (context: { input: AdapterContext<T>['input']; config: Prettify<Omit<AdapterContext<T>['config'], 'body'>>;}) => string;/** * Data structured response returned by an adapter. */export type AdapterResponse = Record<string, unknown> & object;/** * Return type of `defineDoclayerAdapter`. * * Kept as an interface so declaration emit can name it from the macro return type without call-site helpers. */export interface AdapterInfer<Context extends AdapterContext = AdapterContext, Response = AdapterResponse> { ( name: AdapterType, config: AdapterConfig<Context> & Partial<Pick<AdapterContext<Context>['config'], 'body'>>, ): ( useAsyncData: AsyncData<Response, NuxtError | undefined>, input?: Context['input'] | Record<keyof Context['input'], string>, ) => import('nuxt/app').AsyncData<Response, import('nuxt/app').NuxtError | undefined>;}/** * Sets universal record for the custom adapter. */type AdapterRecord = Record<string, ReturnType<AdapterInfer>>;/** * Input inference for adapter(s). * * Since the adapter is loaded through the application, and the module uses a general type, * the module can't infer the config and input types properly. To correctly type components * that use adapters, it's necessary to predefine the config and input types here. * * Within the application the adapter interface is inferred properly providing user-defined adapter types. * * @see {@link https://doclayer.dev/docs/adapters#building-a-new-adapter} */type AdapterInputProvider<Context extends AdapterContext, Response = AdapterResponse> = ReturnType< AdapterInfer<Context, Response>>;Components
Global configuration options for built-in components. As for now, only DlCode can be globally configured. More components to come.
export type Components = Partial<{ /** * `DlCode` component configuration. * * @see {@link global configuration} */ DlCode: Partial<{ /** * File extension to icon mapping. * * @see {@link nuxtIcon} * @see {@link extensionIcons} * @see {@link https://icon-sets.iconify.design} */ extensionIcons: Record<string, string>; /** * Shiki highlighter options. * Web bundle is used by default. * * The configuration has been slightly adjusted for improved integration with `CodeHighlighter`. * * @see {@link Highlighter} * @see {@link https://shiki.style/guide/install#usage} */ highlighter: Prettify<Highlighter>; /** * Maximum (initial) height of the component's container. * * @default "[x]rem" */ maxHeight: `${string}rem`; /** * Whether to lazy-load the component. * * @default false */ lazy: boolean; }>;}>;Highlighter
Custom highlighter configuration, transformed to Shiki options.
import type { BundledLanguage, BundledTheme } from 'shiki/bundle/web';export type Highlighter = Prettify<{ /** * Languages loaded to be pares. * * @see {@link https://shiki.style/languages#languages} */ langs: BundledLanguage[]; /** * Theme definition for light & dark mode. * * @see {@link https://shiki.style/themes} */ themes: { light: BundledTheme; dark: BundledTheme; };}>;Transformers
Code and content transformers used to process data before rendering.
export type Transformers = Partial<{ /** * Code blocks transformer. Used by the `DlCode` component and Shiki highlighter. * * Default: Escaping code closed within `[[ esc ]]...[[ /esc ]]` tags (spaces added to avoid escaping). * * @param code - Code (AST string) to transform. * @returns Transformed code. */ code: (code: string) => string; /** * Content transformer(s). Used to transform content before and after rendering. * Used by the `utilCodeTransformer` utility and `contentTransform` Module. * * @param content - Content object to transform (`post` & `pre`). * @returns Transformed content. */ content: { /** * Transforms Markdown string with given mods; before generating it to AST. * * @param content - Markdown to transform. * @returns Transformed Markdown. */ pre: (content: string) => string; /** * Transforms AST string with given mods; before rendering to HTML. * * @param content - AST to transform. * @returns Transformed AST. * @see {@link #utilCodeTransformer} */ post: (content: string) => string; };}>;PathMap
A registry that maps content paths to their corresponding markers.
export type PathMapKey = `${string}`;export type PathMapUrl = `/${string}` | `/${string}/` | `https://${string}` | `https://${string}/`;export type PathMapRecord = Record<PathMapKey, PathMapUrl>;export type PathMapCustomRecord = | { /** * Path special key, used with `DlLink` component. * * @example `$docs-getting-started` | `$tailwind` */ marker: keyof typeof import('#build/doclayer/path-map.json') | '$local'; /** * Path label, used with `DlLink` component. */ label: string; /** * Path URL, used with `DlLink`. * * It restricts only internal paths or external links with `https`. * The `http://` is not allowed due to potential security issues. * The final URL is resolved with `useURLResolver` composable. * * @see {@link useURLResolver} */ url: PathMapUrl; } | { marker: PathMapKey; label: string; url: PathMapUrl };export type PathMap = (keyof typeof import('#build/doclayer/path-map.json') | PathMapCustomRecord)[];As you may notice, the PathMap type infers its possible values from a specially generated path-map.json file. This file is created at build and runtime to map content paths to their markers. This integration enables the TypeScript compiler to provide autocompletion and suggestions for existing content pages that you can use within your content or navigation.
SchemaOrg
Global configuration for the Schema.org Module.
export type SchemaOrg = Partial<{ /** * Predefined language. * Accordingly to the BCP 47 standard. * * @see {@link https://www.rfc-editor.org/info/bcp47} * @example 'en', 'de', 'es' */ inLanguage: `${Letter}${Letter}`; /** * Publisher data. * * @see {@link https://schema.org/publisher} */ publisher: { /** * Publisher type. Either `Organization` or `Person`. */ '@type': 'Organization' | 'Person'; /** * Publisher name. */ name: string; /** * Publisher website URL. * Validated to the `https` protocol. */ url: `https://${string}`; };}>;NuxtUI
Nuxt UI component-based global configuration. Used to customize the appearance and behavior of certain UI elements within the application.
import type { AppConfigInput } from '@nuxt/schema';type NuxtUI = { /** * Base configuration for the UI container element. */ container: Record<'base', string>; /** * Toast variants customization. */ toast: { variants: { color: Record<'success', Record<'icon' | 'progress', string>>; }; };} & AppConfigInput['ui'];The Nuxt UI configuration is set to reasonable defaults, but if you use new components and want to change their configuration globally, this is the property to update.
