dumi
- Version 2.4.47
- Published
- 3.01 MB
- 68 dependencies
- MIT license
Install
npm i dumiyarn add dumipnpm add dumiOverview
📖 Documentation Generator of React Component
Index
Variables
Functions
- defineConfig()
- getFullDemos()
- getFullRoutesMeta()
- getProjectRoot()
- getRouteMetaById()
- getSketchJSON()
- matchRoutes()
- openCodeSandbox()
- openStackBlitz()
- useAppData()
- useAtomAssets()
- useDemo()
- useFullSidebarData()
- useLiveDemo()
- useLocale()
- useLocation()
- useMatchedRoute()
- useNavData()
- useOutlet()
- useParams()
- usePrefersColor()
- useRouteData()
- useRouteMeta()
- useSearchParams()
- useSidebarData()
- useSiteData()
- useSiteSearch()
- useTabMeta()
Classes
Interfaces
Enums
Type Aliases
- AgnosticComponentModule
- AgnosticComponentType
- IApi
- IColorValue
- IDemoCancelableFn
- IDemoCompileFn
- IDemoData
- IDemoPreflightFn
- IDumiConfig
- IDumiTechStackOnBlockLoadArgs
- IDumiUserConfig
- ILocale
- ILocalesConfig
- INavItems
- IPrefersColorValue
- IRoutesById
- ISearchResult
- IUserNavItem
- IUserNavItems
- IUserNavMode
- IUserNavValue
- NavWithMode
- SocialTypes
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;};variable Link
const Link: any;variable NavLink
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 {}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 {}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;property link
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 {}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'];property link
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 {}property editLink
editLink?: boolean | string;property footer
footer?: string | false;property lastUpdated
lastUpdated?: boolean;property logo
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[]>;property socialLinks
socialLinks?: { [key in SocialTypes]?: string };property sourceLink
sourceLink?: boolean | string;index signature
[key: string]: any;Enums
enum ApplyPluginsType
enum ApplyPluginsType { add = 'add', modify = 'modify', event = 'event', compose = 'compose',}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
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 {}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)
- @ant-design/icons-svg
- @makotot/ghostui
- @stackblitz/sdk
- @swc/core
- @types/hast
- @types/mdast
- @umijs/bundler-utils
- @umijs/core
- @umijs/utils
- animated-scroll-to
- classnames
- codesandbox-import-utils
- comlink
- copy-to-clipboard
- deepmerge
- dumi-afx-deps
- dumi-assets-types
- enhanced-resolve
- estree-util-to-js
- estree-util-visit
- file-system-cache
- github-slugger
- hast-util-is-element
- hast-util-raw
- hast-util-to-estree
- hast-util-to-string
- heti
- hosted-git-info
- html-to-text
- html2sketch
- js-yaml
- lodash.throttle
- mdast-util-find-and-replace
- mdast-util-to-string
- nprogress
- pluralize
- prism-react-renderer
- prism-themes
- prismjs
- raw-loader
- rc-motion
- rc-tabs
- rc-tooltip
- rc-tree
- rc-util
- react-copy-to-clipboard
- react-error-boundary
- react-intl
- react-loading-skeleton
- react-simple-code-editor
- rehype-autolink-headings
- rehype-remove-comments
- rehype-stringify
- remark-directive
- remark-frontmatter
- remark-gfm
- remark-parse
- remark-rehype
- sass
- sitemap
- sucrase
- umi
- unified
- unist-util-visit
- unist-util-visit-parents
- url
- v8-compile-cache
- vfile
Dev Dependencies (35)
- @commitlint/cli
- @commitlint/config-conventional
- @types/github-slugger
- @types/highlight-words-core
- @types/hosted-git-info
- @types/js-yaml
- @types/lodash.throttle
- @types/node
- @types/pluralize
- @types/prismjs
- @types/react
- @types/react-copy-to-clipboard
- @types/react-dom
- @typescript/native-preview
- @umijs/lint
- @umijs/plugins
- dumi-theme-mobile
- eslint
- esno
- fast-glob
- father
- git-repo-info
- highlight-words-core
- husky
- lint-staged
- prettier
- prettier-plugin-organize-imports
- prettier-plugin-packagejson
- react
- react-dom
- stylelint
- ts-node
- typescript
- vitest
- zx
Peer Dependencies (2)
Badge
To add a badge like this oneto 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[](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>
- Updated .
Package analyzed in 5341 ms. - Missing or incorrect documentation? Open an issue for this package.
