1
0
mirror of https://github.com/prometheus/docs.git synced 2026-02-06 00:46:09 +01:00
Files
docs/src/docs-collection-types.ts
2025-05-18 13:41:11 +02:00

54 lines
1.3 KiB
TypeScript

export type LocalDocMetadata = {
type: "local-doc";
};
// TODO: Rename "repo-doc" (and variants) to "external-doc" everywhere.
export type RepoDocMetadata = {
type: "repo-doc";
// These fields are shared for the whole repo, could be factored out.
owner: string;
repo: string;
version: string;
slugPrefix: string;
latestVersion: string;
versionRoot: string;
assetsRoot: string;
};
export type DocMetadata = (LocalDocMetadata | RepoDocMetadata) & {
slug: string;
filePath: string;
title: string;
navIcon?: string;
navTitle?: string;
sortRank: number;
hideInNav?: boolean;
// These fields are only populated during "npm run dev" / "npm run build"
// in docs-collection.ts, as they require run-time object references to the other
// docs in the collection.
parent?: DocMetadata;
children: DocMetadata[];
prev?: DocMetadata;
next?: DocMetadata;
};
export type DocsCollection = {
// "slug" is the path without the leading "/docs/" prefix, so e.g. "introduction/overview"
// or "prometheus/latest/getting_started".
[slug: string]: DocMetadata;
};
export type RepoVersions = {
versions: string[];
latestVersion: string;
ltsVersions: string[];
};
export type AllRepoVersions = {
[owner: string]: {
[repo: string]: RepoVersions;
};
};