Skip to main content

Core Types

Language

Supported languages for internationalization.
export const Language = {
  en: 'English',
  zh: 'Chinese',
  ru: 'Russian',
} as const

export type Language = keyof typeof Language
// 'en' | 'zh' | 'ru'
Supported Languages:
  • en - English
  • zh - Chinese (Simplified)
  • ru - Russian

DoomSite

Configuration for multi-site documentation.
export interface DoomSite {
  name: string
  base: string
  version: string
  displayName?: Record<string, string>
  repo?: string
  image?: string
}
name
string
required
Unique identifier for the site
base
string
required
Base URL path for the site
version
string
required
Current version of the documentation
displayName
Record<string, string>
Localized display names for the site (keyed by language code)
repo
string
Repository URL for the documentation source
image
string
Image or icon representing the site

TermItem

Definition for terminology management and translation.
export interface TermItem {
  en: string
  zh?: string
  ru?: string
  description?: string
  badCases?: {
    en?: string[]
    zh?: string[]
    ru?: string[]
  }
}
en
string
required
English term or phrase
zh
string
Chinese translation (defaults to English if not provided)
ru
string
Russian translation (defaults to English if not provided)
description
string
Description of the term and its usage context
badCases
object
Examples of incorrect usage by language

SiteOverrides

Customizable site content that can be overridden per language.
export interface SiteOverridesItem {
  title?: string
  logoText?: string
  terms?: SiteOverridesTerms
}

export type SiteOverrides = {
  [K in Exclude<keyof SiteOverridesItem, 'terms'>]?: Partial<
    Record<Language, SiteOverridesItem[K]>
  >
} & {
  terms?: NamedTerms
}
Usage: Create an overrides.yaml file to customize site content:
title:
  en: My Product Documentation
  zh: 我的产品文档
  ru: Документация моего продукта

logoText:
  en: MyProduct
  zh: 我的产品

terms:
  company:
    en: Acme Corp
    zh: Acme 公司
  product:
    en: Acme Platform
    zh: Acme 平台

K8s Types

Kubernetes resource type definitions for API documentation.
export interface K8sObjectMeta {
  annotations: StringMapper
  name: string
}

export interface K8sTypeMeta {
  apiVersion: string
  kind: string
  metadata: K8sObjectMeta
}

export interface K8sTypeList<T extends K8sTypeMeta> extends K8sTypeMeta {
  items: T[]
}
K8sObjectMeta
Kubernetes object metadata including name and annotations
K8sTypeMeta
Standard Kubernetes type metadata with apiVersion, kind, and metadata
K8sTypeList
Generic list type for Kubernetes resources

Utility Types

StringMapper

Simple key-value string mapping.
export type StringMapper = Record<string, string>

UnversionedVersion

Type for unversioned documentation paths.
export type UnversionedVersion =
  | typeof UNVERSIONED
  | `${typeof UNVERSIONED}-${string}`
// 'unversioned' | 'unversioned-feature-name'

Constants

FALSY_VALUES

Set of values treated as false in configuration.
export const FALSY_VALUES = new Set([
  null,
  undefined,
  '',
  '0',
  'false',
  'no',
  'off',
  'n',
  'f',
])

TRUTHY_VALUES

Set of values treated as true in configuration.
export const TRUTHY_VALUES = new Set(['1', 'true', 'yes', 'on', 'y', 't'])

Translation Keys

Predefined translation keys available throughout the application.
export type Translation = {
  collapse_all: string
  expand_all: string
  crd_no_schema: string
  function: string
  action: string
  view: string
  create: string
  update: string
  delete: string
  // ... and more
}
See the Runtime API for how to use translations in your components.

Type Imports

import type {
  DoomSite,
  Language,
  TermItem,
  SiteOverrides,
  K8sTypeMeta,
  K8sTypeList,
  UnversionedVersion
} from 'doom'

Build docs developers (and LLMs) love