dumi

  • Version 2.4.47
  • Published
  • 3.01 MB
  • 68 dependencies
  • MIT license

Install

npm i dumi
yarn add dumi
pnpm add dumi

Overview

📖 Documentation Generator of React Component

Index

Variables

Functions

Classes

Interfaces

Enums

Type Aliases

Namespaces

Variables

variable AtomRenderer

const AtomRenderer: FC<IAtomRendererProps>;

    variable DumiDemo

    const DumiDemo: FC<IDumiDemoProps>;

      variable DumiDemoGrid

      const DumiDemoGrid: FC<IDumiDemoGridProps>;

        variable DumiPage

        const DumiPage: FC<{ children: ReactNode }>;

          variable Helmet

          const Helmet: any;

            variable history

            const history: {
            [key: string]: any;
            location: Location;
            push(to: string | Record<string, any>): void;
            replace(to: string | Record<string, any>): void;
            listen(listener: (...args: any[]) => void): () => void;
            };
              const Link: any;
                const NavLink: any;

                  variable unistUtilVisit

                  let unistUtilVisit: any;

                    Functions

                    function defineConfig

                    defineConfig: <T extends IDumiUserConfig>(config: T) => T;

                      function getFullDemos

                      getFullDemos: () => Promise<Record<string, IDemoData>>;

                        function getFullRoutesMeta

                        getFullRoutesMeta: () => Promise<Record<string, IRouteMeta>>;

                          function getProjectRoot

                          getProjectRoot: (cwd: string) => string;

                            function getRouteMetaById

                            getRouteMetaById: <T extends { syncOnly?: boolean }>(
                            id: string,
                            opts?: T
                            ) => T extends { syncOnly: true } ? IRouteMeta | undefined : Promise<IRouteMeta>;

                              function getSketchJSON

                              getSketchJSON: (
                              element: Element,
                              opts: Record<string, any>
                              ) => Promise<Record<string, any>>;

                                function matchRoutes

                                matchRoutes: (...args: any[]) => any;

                                  function openCodeSandbox

                                  openCodeSandbox: (data: IPreviewerProps) => void;

                                    function openStackBlitz

                                    openStackBlitz: (data: IPreviewerProps) => void;

                                      function useAppData

                                      useAppData: () => {
                                      [key: string]: any;
                                      clientRoutes: any[];
                                      routes: IRoutesById;
                                      };

                                        function useAtomAssets

                                        useAtomAssets: () => { components: Record<string, AtomComponentAsset> };

                                          function useDemo

                                          useDemo: (id: string) => IDemoData | undefined;

                                            function useFullSidebarData

                                            useFullSidebarData: () => NonNullable<IThemeConfig['sidebar']>;

                                              function useLiveDemo

                                              useLiveDemo: (
                                              id: string,
                                              opts?: { containerRef?: RefObject<HTMLElement>; iframe?: boolean }
                                              ) => {
                                              node: ReactNode;
                                              loading: boolean;
                                              error: Error | null;
                                              setSource: (source: Record<string, string>) => void;
                                              };

                                                function useLocale

                                                useLocale: () => ILocale;

                                                  function useLocation

                                                  useLocation: () => Location & Record<string, any>;

                                                    function useMatchedRoute

                                                    useMatchedRoute: () => IRoutesById[string];

                                                      function useNavData

                                                      useNavData: () => INavItems;

                                                        function useOutlet

                                                        useOutlet: () => any;

                                                          function useParams

                                                          useParams: () => Record<string, string | undefined>;

                                                            function usePrefersColor

                                                            usePrefersColor: () => [
                                                            IColorValue,
                                                            IPrefersColorValue,
                                                            (value: IPrefersColorValue) => void
                                                            ];

                                                              function useRouteData

                                                              useRouteData: () => {
                                                              [key: string]: any;
                                                              route: { [key: string]: any; path?: string; meta?: IRouteMeta };
                                                              };

                                                                function useRouteMeta

                                                                useRouteMeta: () => IRouteMeta;

                                                                  function useSearchParams

                                                                  useSearchParams: () => [URLSearchParams, (...args: any[]) => void];

                                                                    function useSidebarData

                                                                    useSidebarData: () => ISidebarGroup[];

                                                                      function useSiteData

                                                                      useSiteData: () => ISiteContext;

                                                                        function useSiteSearch

                                                                        useSiteSearch: () => {
                                                                        keywords: string;
                                                                        setKeywords: (keywords: string) => void;
                                                                        result: ISearchResult;
                                                                        loading: boolean;
                                                                        load: () => Promise<void>;
                                                                        };

                                                                          function useTabMeta

                                                                          useTabMeta: () => NonNullable<IRouteMeta['tabs']>[number]['meta'] | undefined;

                                                                            Classes

                                                                            class IDumiTechStack

                                                                            abstract class IDumiTechStack {}

                                                                              property name

                                                                              abstract name: string;

                                                                                property runtimeOpts

                                                                                abstract runtimeOpts?: IDumiTechStackRuntimeOpts;

                                                                                  method generateMetadata

                                                                                  abstract generateMetadata: (
                                                                                  asset: ExampleBlockAsset,
                                                                                  opts: {
                                                                                  type: Parameters<IDumiTechStack['transformCode']>[1]['type'];
                                                                                  mdAbsPath: string;
                                                                                  fileAbsPath?: string;
                                                                                  entryPointCode?: string;
                                                                                  }
                                                                                  ) => Promise<ExampleBlockAsset> | ExampleBlockAsset;

                                                                                    method generatePreviewerProps

                                                                                    abstract generatePreviewerProps: (
                                                                                    props: IDumiDemoProps['previewerProps'],
                                                                                    opts: Parameters<NonNullable<IDumiTechStack['generateMetadata']>>[1]
                                                                                    ) =>
                                                                                    | Promise<IDumiDemoProps['previewerProps']>
                                                                                    | IDumiDemoProps['previewerProps'];

                                                                                      method generateSources

                                                                                      abstract generateSources: (
                                                                                      source: Record<string, string>,
                                                                                      opts: Parameters<NonNullable<IDumiTechStack['generateMetadata']>>[1]
                                                                                      ) => Promise<Record<string, string>> | Record<string, string>;

                                                                                        method isSupported

                                                                                        abstract isSupported: (node: Element, lang: string) => boolean;

                                                                                          method onBlockLoad

                                                                                          abstract onBlockLoad: (
                                                                                          args: IDumiTechStackOnBlockLoadArgs
                                                                                          ) => IDumiTechStackOnBlockLoadResult | null;

                                                                                            method transformCode

                                                                                            abstract transformCode: (
                                                                                            raw: string,
                                                                                            opts: { type: 'external' | 'code-block'; fileAbsPath: string }
                                                                                            ) => string;

                                                                                              class PluginManager

                                                                                              class PluginManager {}

                                                                                                method applyPlugins

                                                                                                applyPlugins: (opts: Record<string, any>) => any;

                                                                                                  method create

                                                                                                  static create: (opts: Record<string, any>) => PluginManager;

                                                                                                    Interfaces

                                                                                                    interface IAtomRendererProps

                                                                                                    interface IAtomRendererProps {}

                                                                                                      property processor

                                                                                                      processor?: (
                                                                                                      entity: TypeMap['element'] | TypeMap['function'] | TypeMap['dom'],
                                                                                                      entryExports: Record<string, any>
                                                                                                      ) => any;

                                                                                                        property type

                                                                                                        type: AtomAsset['type'];

                                                                                                          property value

                                                                                                          value: ExamplePresetAsset['value'];

                                                                                                            interface IDumiDemoGridProps

                                                                                                            interface IDumiDemoGridProps {}

                                                                                                              property demoRender

                                                                                                              demoRender?: (item: IDumiDemoProps) => ReactNode;

                                                                                                                property items

                                                                                                                items: IDumiDemoProps[];

                                                                                                                  interface IDumiDemoProps

                                                                                                                  interface IDumiDemoProps {}

                                                                                                                    property demo

                                                                                                                    demo: { id: string; inline?: boolean };

                                                                                                                      property previewerProps

                                                                                                                      previewerProps: Omit<IPreviewerProps, 'asset' | 'children'>;

                                                                                                                        interface IDumiTechStackOnBlockLoadResult

                                                                                                                        interface IDumiTechStackOnBlockLoadResult {}

                                                                                                                          property content

                                                                                                                          content: string;

                                                                                                                            property type

                                                                                                                            type: Required<OnLoadResult>['loader'];

                                                                                                                              interface IDumiTechStackRuntimeOpts

                                                                                                                              interface IDumiTechStackRuntimeOpts {}

                                                                                                                                property compilePath

                                                                                                                                compilePath?: string;

                                                                                                                                  property pluginPath

                                                                                                                                  pluginPath?: string;

                                                                                                                                    property preflightPath

                                                                                                                                    preflightPath?: string;

                                                                                                                                      property rendererPath

                                                                                                                                      rendererPath?: string;

                                                                                                                                        interface IHighlightText

                                                                                                                                        interface IHighlightText {}

                                                                                                                                          property highlighted

                                                                                                                                          highlighted?: boolean;

                                                                                                                                            property text

                                                                                                                                            text: string;

                                                                                                                                              interface INavItem

                                                                                                                                              interface INavItem {}

                                                                                                                                                property activePath

                                                                                                                                                activePath?: string;
                                                                                                                                                  link?: string;

                                                                                                                                                    property order

                                                                                                                                                    order?: number;

                                                                                                                                                      property title

                                                                                                                                                      title: string;

                                                                                                                                                        index signature

                                                                                                                                                        [key: string]: any;

                                                                                                                                                          interface IPreviewerProps

                                                                                                                                                          interface IPreviewerProps {}

                                                                                                                                                            property asset

                                                                                                                                                            asset: ExampleBlockAsset;

                                                                                                                                                              property background

                                                                                                                                                              background?: string;

                                                                                                                                                                property children

                                                                                                                                                                children: ReactNode;

                                                                                                                                                                  property compact

                                                                                                                                                                  compact?: boolean;

                                                                                                                                                                    property debug

                                                                                                                                                                    debug?: boolean;

                                                                                                                                                                      property defaultShowCode

                                                                                                                                                                      defaultShowCode?: boolean;

                                                                                                                                                                        property demoUrl

                                                                                                                                                                        demoUrl: string;

                                                                                                                                                                          property description

                                                                                                                                                                          description?: string;

                                                                                                                                                                            property filename

                                                                                                                                                                            filename?: string;

                                                                                                                                                                              property iframe

                                                                                                                                                                              iframe?: boolean | number;

                                                                                                                                                                                property title

                                                                                                                                                                                title?: string;

                                                                                                                                                                                  property transform

                                                                                                                                                                                  transform?: boolean;

                                                                                                                                                                                    index signature

                                                                                                                                                                                    [key: string]: any;

                                                                                                                                                                                      interface IRouteMeta

                                                                                                                                                                                      interface IRouteMeta {}

                                                                                                                                                                                        property frontmatter

                                                                                                                                                                                        frontmatter: {
                                                                                                                                                                                        title: string;
                                                                                                                                                                                        description?: string;
                                                                                                                                                                                        keywords?: string[];
                                                                                                                                                                                        nav?:
                                                                                                                                                                                        | string
                                                                                                                                                                                        | {
                                                                                                                                                                                        title?: string;
                                                                                                                                                                                        order?: number;
                                                                                                                                                                                        second?: Omit<IRouteMeta['frontmatter']['nav'], 'second'>;
                                                                                                                                                                                        };
                                                                                                                                                                                        group?: string | { title?: string; order?: number };
                                                                                                                                                                                        order?: number;
                                                                                                                                                                                        hero?: {
                                                                                                                                                                                        title?: string;
                                                                                                                                                                                        description?: string;
                                                                                                                                                                                        background?: string;
                                                                                                                                                                                        actions?: { text: string; link: string }[];
                                                                                                                                                                                        [key: string]: any;
                                                                                                                                                                                        };
                                                                                                                                                                                        features?: {
                                                                                                                                                                                        emoji?: string;
                                                                                                                                                                                        title?: string;
                                                                                                                                                                                        link?: string;
                                                                                                                                                                                        description?: string;
                                                                                                                                                                                        [key: string]: any;
                                                                                                                                                                                        }[];
                                                                                                                                                                                        toc?: boolean | 'content' | 'menu';
                                                                                                                                                                                        demo?: {
                                                                                                                                                                                        cols?: number;
                                                                                                                                                                                        tocDepth?: number;
                                                                                                                                                                                        };
                                                                                                                                                                                        atomId?: string;
                                                                                                                                                                                        filename?: string;
                                                                                                                                                                                        lastUpdated?: number;
                                                                                                                                                                                        debug?: boolean;
                                                                                                                                                                                        sidebar?: boolean;
                                                                                                                                                                                        [key: string]: any;
                                                                                                                                                                                        };

                                                                                                                                                                                          property tabs

                                                                                                                                                                                          tabs?: {
                                                                                                                                                                                          key: string;
                                                                                                                                                                                          title?: string;
                                                                                                                                                                                          titleIntlId?: string;
                                                                                                                                                                                          components: {
                                                                                                                                                                                          default: ReactComponentType;
                                                                                                                                                                                          Extra: ReactComponentType;
                                                                                                                                                                                          Action: ReactComponentType;
                                                                                                                                                                                          };
                                                                                                                                                                                          meta: {
                                                                                                                                                                                          frontmatter: Omit<
                                                                                                                                                                                          IRouteMeta['frontmatter'],
                                                                                                                                                                                          'description' | 'keywords' | 'nav' | 'group' | 'hero' | 'features'
                                                                                                                                                                                          >;
                                                                                                                                                                                          toc: IRouteMeta['toc'];
                                                                                                                                                                                          texts: IRouteMeta['texts'];
                                                                                                                                                                                          [key: string]: any;
                                                                                                                                                                                          };
                                                                                                                                                                                          }[];

                                                                                                                                                                                            property texts

                                                                                                                                                                                            texts: {
                                                                                                                                                                                            type?: 'content';
                                                                                                                                                                                            value: string;
                                                                                                                                                                                            paraId: number;
                                                                                                                                                                                            tocIndex?: number;
                                                                                                                                                                                            }[];

                                                                                                                                                                                              property toc

                                                                                                                                                                                              toc: { id: string; depth: number; title: string; _debug_demo?: boolean }[];

                                                                                                                                                                                                interface ISearchNavResult

                                                                                                                                                                                                interface ISearchNavResult {}

                                                                                                                                                                                                  property hints

                                                                                                                                                                                                  hints: {
                                                                                                                                                                                                  type: 'page' | 'title' | 'demo' | 'content';
                                                                                                                                                                                                  link: string;
                                                                                                                                                                                                  priority: number;
                                                                                                                                                                                                  pageTitle: string;
                                                                                                                                                                                                  highlightTitleTexts: IHighlightText[];
                                                                                                                                                                                                  highlightTexts: IHighlightText[];
                                                                                                                                                                                                  }[];

                                                                                                                                                                                                    property priority

                                                                                                                                                                                                    priority: number;

                                                                                                                                                                                                      property title

                                                                                                                                                                                                      title?: string;

                                                                                                                                                                                                        interface ISidebarGroup

                                                                                                                                                                                                        interface ISidebarGroup {}

                                                                                                                                                                                                          property children

                                                                                                                                                                                                          children: ISidebarItem[];

                                                                                                                                                                                                            property title

                                                                                                                                                                                                            title?: string;

                                                                                                                                                                                                              index signature

                                                                                                                                                                                                              [key: string]: any;

                                                                                                                                                                                                                interface ISidebarItem

                                                                                                                                                                                                                interface ISidebarItem {}

                                                                                                                                                                                                                  property frontmatter

                                                                                                                                                                                                                  frontmatter?: IRouteMeta['frontmatter'];
                                                                                                                                                                                                                    link: string;

                                                                                                                                                                                                                      property order

                                                                                                                                                                                                                      order?: number;

                                                                                                                                                                                                                        property title

                                                                                                                                                                                                                        title: string;

                                                                                                                                                                                                                          index signature

                                                                                                                                                                                                                          [key: string]: any;

                                                                                                                                                                                                                            interface ISiteContext

                                                                                                                                                                                                                            interface ISiteContext {}

                                                                                                                                                                                                                              property components

                                                                                                                                                                                                                              components: Record<string, AtomComponentAsset>;

                                                                                                                                                                                                                                property demos

                                                                                                                                                                                                                                demos: Record<string, IDemoData>;

                                                                                                                                                                                                                                  property entryExports

                                                                                                                                                                                                                                  entryExports: Record<string, any>;

                                                                                                                                                                                                                                    property historyType

                                                                                                                                                                                                                                    historyType: 'browser' | 'hash' | 'memory';

                                                                                                                                                                                                                                      property hostname

                                                                                                                                                                                                                                      hostname?: string;

                                                                                                                                                                                                                                        property loading

                                                                                                                                                                                                                                        loading: boolean;

                                                                                                                                                                                                                                          property locales

                                                                                                                                                                                                                                          locales: ILocalesConfig;

                                                                                                                                                                                                                                            property pkg

                                                                                                                                                                                                                                            pkg: Record<string, any>;

                                                                                                                                                                                                                                              property setLoading

                                                                                                                                                                                                                                              setLoading: (status: boolean) => void;

                                                                                                                                                                                                                                                property themeConfig

                                                                                                                                                                                                                                                themeConfig: IThemeConfig;

                                                                                                                                                                                                                                                  index signature

                                                                                                                                                                                                                                                  [key: string]: any;

                                                                                                                                                                                                                                                    interface IThemeConfig

                                                                                                                                                                                                                                                    interface IThemeConfig {}
                                                                                                                                                                                                                                                      editLink?: boolean | string;

                                                                                                                                                                                                                                                        property footer

                                                                                                                                                                                                                                                        footer?: string | false;

                                                                                                                                                                                                                                                          property lastUpdated

                                                                                                                                                                                                                                                          lastUpdated?: boolean;
                                                                                                                                                                                                                                                            logo?: string | false;

                                                                                                                                                                                                                                                              property name

                                                                                                                                                                                                                                                              name?: string;

                                                                                                                                                                                                                                                                property nav

                                                                                                                                                                                                                                                                nav?: IUserNavValue | NavWithMode<IUserNavValue>;

                                                                                                                                                                                                                                                                  property nprogress

                                                                                                                                                                                                                                                                  nprogress?: boolean;

                                                                                                                                                                                                                                                                    property prefersColor

                                                                                                                                                                                                                                                                    prefersColor: {
                                                                                                                                                                                                                                                                    default: 'light' | 'dark' | 'auto';
                                                                                                                                                                                                                                                                    switch: boolean;
                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                      property showLineNum

                                                                                                                                                                                                                                                                      showLineNum?: boolean;

                                                                                                                                                                                                                                                                        property sidebar

                                                                                                                                                                                                                                                                        sidebar?: Record<string, ISidebarGroup[]>;
                                                                                                                                                                                                                                                                          socialLinks?: { [key in SocialTypes]?: string };
                                                                                                                                                                                                                                                                            sourceLink?: boolean | string;

                                                                                                                                                                                                                                                                              index signature

                                                                                                                                                                                                                                                                              [key: string]: any;

                                                                                                                                                                                                                                                                                Enums

                                                                                                                                                                                                                                                                                enum ApplyPluginsType

                                                                                                                                                                                                                                                                                enum ApplyPluginsType {
                                                                                                                                                                                                                                                                                add = 'add',
                                                                                                                                                                                                                                                                                modify = 'modify',
                                                                                                                                                                                                                                                                                event = 'event',
                                                                                                                                                                                                                                                                                compose = 'compose',
                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                  member add

                                                                                                                                                                                                                                                                                  add = 'add'

                                                                                                                                                                                                                                                                                    member compose

                                                                                                                                                                                                                                                                                    compose = 'compose'

                                                                                                                                                                                                                                                                                      member event

                                                                                                                                                                                                                                                                                      event = 'event'

                                                                                                                                                                                                                                                                                        member modify

                                                                                                                                                                                                                                                                                        modify = 'modify'

                                                                                                                                                                                                                                                                                          Type Aliases

                                                                                                                                                                                                                                                                                          type AgnosticComponentModule

                                                                                                                                                                                                                                                                                          type AgnosticComponentModule = { default?: any; [key: string]: any };

                                                                                                                                                                                                                                                                                            type AgnosticComponentType

                                                                                                                                                                                                                                                                                            type AgnosticComponentType =
                                                                                                                                                                                                                                                                                            | Promise<AgnosticComponentModule>
                                                                                                                                                                                                                                                                                            | AgnosticComponentModule;

                                                                                                                                                                                                                                                                                              type IApi

                                                                                                                                                                                                                                                                                              type IApi = IUmiApi & {
                                                                                                                                                                                                                                                                                              config: IDumiConfig & { [key: string]: any };
                                                                                                                                                                                                                                                                                              userConfig: IDumiUserConfig;
                                                                                                                                                                                                                                                                                              service: IUmiApi['service'] & {
                                                                                                                                                                                                                                                                                              themeData: any;
                                                                                                                                                                                                                                                                                              atomParser: any;
                                                                                                                                                                                                                                                                                              };
                                                                                                                                                                                                                                                                                              registerTechStack: (fn: () => IDumiTechStack) => void;
                                                                                                                                                                                                                                                                                              modifyTheme: IModify<any, null>;
                                                                                                                                                                                                                                                                                              addContentTab: (fn: () => any) => void;
                                                                                                                                                                                                                                                                                              modifyAssetsMetadata: IModify<AssetsPackage, null>;
                                                                                                                                                                                                                                                                                              getAssetsMetadata?: () => Promise<AssetsPackage>;
                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                type IColorValue

                                                                                                                                                                                                                                                                                                type IColorValue = 'light' | 'dark';

                                                                                                                                                                                                                                                                                                  type IDemoCancelableFn

                                                                                                                                                                                                                                                                                                  type IDemoCancelableFn = (
                                                                                                                                                                                                                                                                                                  canvas: HTMLElement,
                                                                                                                                                                                                                                                                                                  component: AgnosticComponentModule
                                                                                                                                                                                                                                                                                                  ) => (() => void) | Promise<() => void>;

                                                                                                                                                                                                                                                                                                    type IDemoCompileFn

                                                                                                                                                                                                                                                                                                    type IDemoCompileFn = (code: string, opts: { filename: string }) => Promise<string>;

                                                                                                                                                                                                                                                                                                      type IDemoData

                                                                                                                                                                                                                                                                                                      type IDemoData = {
                                                                                                                                                                                                                                                                                                      component: ReactComponentType | AgnosticComponentType;
                                                                                                                                                                                                                                                                                                      asset: IPreviewerProps['asset'];
                                                                                                                                                                                                                                                                                                      routeId: string;
                                                                                                                                                                                                                                                                                                      context?: Record<string, unknown>;
                                                                                                                                                                                                                                                                                                      renderOpts?: {
                                                                                                                                                                                                                                                                                                      compile?: IDemoCompileFn;
                                                                                                                                                                                                                                                                                                      renderer?: IDemoCancelableFn;
                                                                                                                                                                                                                                                                                                      preflight?: IDemoPreflightFn;
                                                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                                                                                        type IDemoPreflightFn

                                                                                                                                                                                                                                                                                                        type IDemoPreflightFn = (component: AgnosticComponentModule) => Promise<void>;

                                                                                                                                                                                                                                                                                                          type IDumiConfig

                                                                                                                                                                                                                                                                                                          type IDumiConfig = Omit<IUmiConfig, 'locales'> & IDumiExtendsConfig;

                                                                                                                                                                                                                                                                                                            type IDumiTechStackOnBlockLoadArgs

                                                                                                                                                                                                                                                                                                            type IDumiTechStackOnBlockLoadArgs = OnLoadArgs & {
                                                                                                                                                                                                                                                                                                            entryPointCode: string;
                                                                                                                                                                                                                                                                                                            filename: string;
                                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                                              type IDumiUserConfig

                                                                                                                                                                                                                                                                                                              type IDumiUserConfig = Subset<Omit<IDumiConfig, 'locales'>> & {
                                                                                                                                                                                                                                                                                                              locales?:
                                                                                                                                                                                                                                                                                                              | Exclude<IDumiConfig['locales'][0], { base: string }>[]
                                                                                                                                                                                                                                                                                                              | Omit<Exclude<IDumiConfig['locales'][0], { suffix: string }>, 'base'>[];
                                                                                                                                                                                                                                                                                                              [key: string]: any;
                                                                                                                                                                                                                                                                                                              };

                                                                                                                                                                                                                                                                                                                type ILocale

                                                                                                                                                                                                                                                                                                                type ILocale =
                                                                                                                                                                                                                                                                                                                | (IBasicLocale & { base: string })
                                                                                                                                                                                                                                                                                                                | (IBasicLocale & { suffix: string });

                                                                                                                                                                                                                                                                                                                  type ILocalesConfig

                                                                                                                                                                                                                                                                                                                  type ILocalesConfig = ILocale[];

                                                                                                                                                                                                                                                                                                                    type INavItems

                                                                                                                                                                                                                                                                                                                    type INavItems = (INavItem & { children?: INavItem[] })[];

                                                                                                                                                                                                                                                                                                                      type IPrefersColorValue

                                                                                                                                                                                                                                                                                                                      type IPrefersColorValue = IColorValue | 'auto';

                                                                                                                                                                                                                                                                                                                        type IRoutesById

                                                                                                                                                                                                                                                                                                                        type IRoutesById = Record<
                                                                                                                                                                                                                                                                                                                        string,
                                                                                                                                                                                                                                                                                                                        {
                                                                                                                                                                                                                                                                                                                        path?: string;
                                                                                                                                                                                                                                                                                                                        parentId?: string;
                                                                                                                                                                                                                                                                                                                        meta?: IRouteMeta;
                                                                                                                                                                                                                                                                                                                        id: string;
                                                                                                                                                                                                                                                                                                                        redirect?: string;
                                                                                                                                                                                                                                                                                                                        [key: string]: any;
                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                          type ISearchResult

                                                                                                                                                                                                                                                                                                                          type ISearchResult = ISearchNavResult[];

                                                                                                                                                                                                                                                                                                                            type IUserNavItem

                                                                                                                                                                                                                                                                                                                            type IUserNavItem = Pick<INavItem, 'title' | 'link' | 'activePath'>;

                                                                                                                                                                                                                                                                                                                              type IUserNavItems

                                                                                                                                                                                                                                                                                                                              type IUserNavItems = (IUserNavItem & { children?: IUserNavItem[] })[];

                                                                                                                                                                                                                                                                                                                                type IUserNavMode

                                                                                                                                                                                                                                                                                                                                type IUserNavMode = 'override' | 'append' | 'prepend';

                                                                                                                                                                                                                                                                                                                                  type IUserNavValue

                                                                                                                                                                                                                                                                                                                                  type IUserNavValue = IUserNavItems | Record<string, IUserNavItems>;
                                                                                                                                                                                                                                                                                                                                    type NavWithMode<T extends IUserNavValue> = {
                                                                                                                                                                                                                                                                                                                                    mode: IUserNavMode;
                                                                                                                                                                                                                                                                                                                                    value: T;
                                                                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                                                                      type SocialTypes

                                                                                                                                                                                                                                                                                                                                      type SocialTypes =
                                                                                                                                                                                                                                                                                                                                      | 'github'
                                                                                                                                                                                                                                                                                                                                      | 'weibo'
                                                                                                                                                                                                                                                                                                                                      | 'twitter'
                                                                                                                                                                                                                                                                                                                                      | 'x'
                                                                                                                                                                                                                                                                                                                                      | 'gitlab'
                                                                                                                                                                                                                                                                                                                                      | 'facebook'
                                                                                                                                                                                                                                                                                                                                      | 'zhihu'
                                                                                                                                                                                                                                                                                                                                      | 'yuque'
                                                                                                                                                                                                                                                                                                                                      | 'linkedin';

                                                                                                                                                                                                                                                                                                                                        Namespaces

                                                                                                                                                                                                                                                                                                                                        namespace *.svg

                                                                                                                                                                                                                                                                                                                                        module '*.svg' {}

                                                                                                                                                                                                                                                                                                                                          variable ReactComponent

                                                                                                                                                                                                                                                                                                                                          const ReactComponent: React.FunctionComponent<any>;

                                                                                                                                                                                                                                                                                                                                            variable src

                                                                                                                                                                                                                                                                                                                                            const src: string;

                                                                                                                                                                                                                                                                                                                                              namespace dumi/theme/builtins/*

                                                                                                                                                                                                                                                                                                                                              module 'dumi/theme/builtins/*' {}

                                                                                                                                                                                                                                                                                                                                                variable component

                                                                                                                                                                                                                                                                                                                                                const component: ComponentType<any>;

                                                                                                                                                                                                                                                                                                                                                  namespace dumi/theme/builtins/SourceCode

                                                                                                                                                                                                                                                                                                                                                  module 'dumi/theme/builtins/SourceCode' {}

                                                                                                                                                                                                                                                                                                                                                    variable SourceCode

                                                                                                                                                                                                                                                                                                                                                    const SourceCode: ComponentType<ISourceCodeProps>;

                                                                                                                                                                                                                                                                                                                                                      interface ISourceCodeProps

                                                                                                                                                                                                                                                                                                                                                      interface ISourceCodeProps {}

                                                                                                                                                                                                                                                                                                                                                        property children

                                                                                                                                                                                                                                                                                                                                                        children?: string;

                                                                                                                                                                                                                                                                                                                                                          property extra

                                                                                                                                                                                                                                                                                                                                                          extra?: ReactNode;

                                                                                                                                                                                                                                                                                                                                                            property lang

                                                                                                                                                                                                                                                                                                                                                            lang?: string;

                                                                                                                                                                                                                                                                                                                                                              property textarea

                                                                                                                                                                                                                                                                                                                                                              textarea?: ReactNode;

                                                                                                                                                                                                                                                                                                                                                                index signature

                                                                                                                                                                                                                                                                                                                                                                [key: string]: any;

                                                                                                                                                                                                                                                                                                                                                                  namespace dumi/theme/slots/*

                                                                                                                                                                                                                                                                                                                                                                  module 'dumi/theme/slots/*' {}

                                                                                                                                                                                                                                                                                                                                                                    variable component

                                                                                                                                                                                                                                                                                                                                                                    const component: ComponentType<any>;

                                                                                                                                                                                                                                                                                                                                                                      namespace dumi/theme/slots/ContentTabs

                                                                                                                                                                                                                                                                                                                                                                      module 'dumi/theme/slots/ContentTabs' {}

                                                                                                                                                                                                                                                                                                                                                                        variable ContentTabs

                                                                                                                                                                                                                                                                                                                                                                        const ContentTabs: ComponentType<IContentTabsProps>;

                                                                                                                                                                                                                                                                                                                                                                          interface IContentTabsProps

                                                                                                                                                                                                                                                                                                                                                                          interface IContentTabsProps {}

                                                                                                                                                                                                                                                                                                                                                                            property onChange

                                                                                                                                                                                                                                                                                                                                                                            onChange: (tab?: NonNullable<IContentTabs>[0]) => void;

                                                                                                                                                                                                                                                                                                                                                                              property tabKey

                                                                                                                                                                                                                                                                                                                                                                              tabKey: string | null;

                                                                                                                                                                                                                                                                                                                                                                                property tabs

                                                                                                                                                                                                                                                                                                                                                                                tabs: IContentTabs;

                                                                                                                                                                                                                                                                                                                                                                                  namespace dumi/theme/slots/SourceCodeEditor

                                                                                                                                                                                                                                                                                                                                                                                  module 'dumi/theme/slots/SourceCodeEditor' {}

                                                                                                                                                                                                                                                                                                                                                                                    variable SourceCodeEditor

                                                                                                                                                                                                                                                                                                                                                                                    const SourceCodeEditor: ComponentType<ISourceCodeEditorProps>;

                                                                                                                                                                                                                                                                                                                                                                                      interface ISourceCodeEditorProps

                                                                                                                                                                                                                                                                                                                                                                                      interface ISourceCodeEditorProps extends Omit<ISourceCodeProps, 'children'> {}

                                                                                                                                                                                                                                                                                                                                                                                        property extra

                                                                                                                                                                                                                                                                                                                                                                                        extra?: ReactNode;

                                                                                                                                                                                                                                                                                                                                                                                          property initialValue

                                                                                                                                                                                                                                                                                                                                                                                          initialValue: string;

                                                                                                                                                                                                                                                                                                                                                                                            property onChange

                                                                                                                                                                                                                                                                                                                                                                                            onChange?: (code: string) => void;

                                                                                                                                                                                                                                                                                                                                                                                              property onTranspile

                                                                                                                                                                                                                                                                                                                                                                                              onTranspile?: (
                                                                                                                                                                                                                                                                                                                                                                                              args: { err: Error; code?: null } | { err?: null; code: string }
                                                                                                                                                                                                                                                                                                                                                                                              ) => void;

                                                                                                                                                                                                                                                                                                                                                                                                Package Files (5)

                                                                                                                                                                                                                                                                                                                                                                                                Dependencies (68)

                                                                                                                                                                                                                                                                                                                                                                                                Dev Dependencies (35)

                                                                                                                                                                                                                                                                                                                                                                                                Peer Dependencies (2)

                                                                                                                                                                                                                                                                                                                                                                                                Badge

                                                                                                                                                                                                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/dumi.

                                                                                                                                                                                                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/dumi)
                                                                                                                                                                                                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/dumi"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>