/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import type { MetadataOptions, PluginOptions, CategoryIndexMatcher, DocMetadataBase, VersionMetadata, LoadedVersion } from '@docusaurus/plugin-content-docs'; import type { LoadContext } from '@docusaurus/types'; import type { SidebarsUtils } from './sidebars/utils'; import type { DocFile } from './types'; export declare function readDocFile(versionMetadata: Pick, source: string): Promise; export declare function readVersionDocs(versionMetadata: VersionMetadata, options: Pick): Promise; export type DocEnv = 'production' | 'development'; export declare function processDocMetadata(args: { docFile: DocFile; versionMetadata: VersionMetadata; context: LoadContext; options: MetadataOptions; env: DocEnv; }): Promise; export declare function addDocNavigation({ docs, sidebarsUtils, }: { docs: DocMetadataBase[]; sidebarsUtils: SidebarsUtils; }): LoadedVersion['docs']; /** * The "main doc" is the "version entry point" * We browse this doc by clicking on a version: * - the "home" doc (at '/docs/') * - the first doc of the first sidebar * - a random doc (if no docs are in any sidebar... edge case) */ export declare function getMainDocId({ docs, sidebarsUtils, }: { docs: DocMetadataBase[]; sidebarsUtils: SidebarsUtils; }): string; export declare const isCategoryIndex: CategoryIndexMatcher; /** * `guides/sidebar/autogenerated.md` -> * `'autogenerated', '.md', ['sidebar', 'guides']` */ export declare function toCategoryIndexMatcherParam({ source, sourceDirName, }: Pick): Parameters[0]; export declare function createDocsByIdIndex(docs: Doc[]): { [docId: string]: Doc; };