diff --git a/docs/notes/theme/guide/components/npm-badge.md b/docs/notes/theme/guide/components/npm-badge.md index 5e0465d8..fa8602b6 100644 --- a/docs/notes/theme/guide/components/npm-badge.md +++ b/docs/notes/theme/guide/components/npm-badge.md @@ -87,19 +87,19 @@ npm 包名,为空则从 `repo` 中获取 ### Types ```ts -type NpmBadgeType = +type NpmBadgeType // github - | 'source' // github source - | 'stars' // github stars - | 'forks' // github forks - | 'license' // github license + = | 'source' // github source + | 'stars' // github stars + | 'forks' // github forks + | 'license' // github license // npm - | 'version' // npm version - | 'dt' // alias d18m - | 'd18m' // npm downloads last 18 months - | 'dw' // npm downloads weekly - | 'dm' // npm downloads monthly - | 'dy' // npm downloads yearly + | 'version' // npm version + | 'dt' // alias d18m + | 'd18m' // npm downloads last 18 months + | 'dw' // npm downloads weekly + | 'dm' // npm downloads monthly + | 'dy' // npm downloads yearly type NpmBadgeTheme = 'flat' | 'flat-square' | 'plastic' | 'for-the-badge' | 'social' ``` diff --git a/docs/notes/theme/guide/custom/home.md b/docs/notes/theme/guide/custom/home.md index 5696f0e9..8e5cf045 100644 --- a/docs/notes/theme/guide/custom/home.md +++ b/docs/notes/theme/guide/custom/home.md @@ -180,15 +180,15 @@ interface TintPlateObj { g: { value: number, offset: number } b: { value: number, offset: number } } -type TintPlate = - | number // 210 - | string // '210,210,210' => red,green,blue +type TintPlate + = | number // 210 + | string // '210,210,210' => red,green,blue // { r: { value: 220, offset: 36 }, g: { value: 220, offset: 36 }, b: { value: 220, offset: 36 } } - | TintPlate + | TintPlate // { light: 210, dark: 20 } // { light: '210,210,210', dark: '20,20,20' } - | { light: number | string, dark: number | string } - | { light: TintPlate, dark: TintPlate } + | { light: number | string, dark: number | string } + | { light: TintPlate, dark: TintPlate } ``` **示例:** @@ -453,10 +453,10 @@ interface PlumeThemeHomeTextImage extends PlumeHomeConfigBase { list: (string | { title?: string, description?: string })[] } -type PlumeThemeImage = - | string - | { src: string, alt?: string } - | { dark: string, light: string, alt?: string } +type PlumeThemeImage + = | string + | { src: string, alt?: string } + | { dark: string, light: string, alt?: string } ``` **示例:** @@ -533,10 +533,10 @@ interface PlumeThemeHomeProfile extends PlumeHomeConfigBase { circle?: boolean } -type PlumeThemeImage = - | string - | { src: string, alt?: string } - | { dark: string, light: string, alt?: string } +type PlumeThemeImage + = | string + | { src: string, alt?: string } + | { dark: string, light: string, alt?: string } ``` **示例:** diff --git a/docs/notes/theme/guide/features/copyright.md b/docs/notes/theme/guide/features/copyright.md index 76bfe6ee..dff98155 100644 --- a/docs/notes/theme/guide/features/copyright.md +++ b/docs/notes/theme/guide/features/copyright.md @@ -105,15 +105,15 @@ export default defineUserConfig({ **配置类型:** ```ts -export type CopyrightLicense = - | 'CC-BY-4.0' - | 'CC-BY-SA-4.0' - | 'CC-BY-NC-4.0' - | 'CC-BY-NC-SA-4.0' - | 'CC-BY-ND-4.0' - | 'CC-BY-NC-ND-4.0' - | 'CC0' - | string +export type CopyrightLicense + = | 'CC-BY-4.0' + | 'CC-BY-SA-4.0' + | 'CC-BY-NC-4.0' + | 'CC-BY-NC-SA-4.0' + | 'CC-BY-ND-4.0' + | 'CC-BY-NC-ND-4.0' + | 'CC0' + | string /** * - 配置为 `true` 时,默认为 `CC-BY-4.0` diff --git a/docs/notes/theme/guide/features/icon.md b/docs/notes/theme/guide/features/icon.md index 635ca279..069f7ff1 100644 --- a/docs/notes/theme/guide/features/icon.md +++ b/docs/notes/theme/guide/features/icon.md @@ -68,18 +68,18 @@ export default defineUserConfig({ - 提供商为 `fontawesome` 时默认为 `'fas'`,可选值如下: ```ts - type FontAwesomePrefix = - | 'fas' | 's' // fa-solid fa-name - | 'far' | 'r' // fa-regular fa-name - | 'fal' | 'l' // fa-light fa-name - | 'fat' | 't' // fa-thin fa-name - | 'fads' | 'ds' // fa-duotone fa-solid fa-name - | 'fass' | 'ss' // fa-sharp fa-solid fa-name - | 'fasr' | 'sr' // fa-sharp fa-regular fa-name - | 'fasl' | 'sl' // fa-sharp fa-light fa-name - | 'fast' | 'st' // fa-sharp fa-thin fa-name - | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name - | 'fab' | 'b' // fa-brands fa-name + type FontAwesomePrefix + = | 'fas' | 's' // fa-solid fa-name + | 'far' | 'r' // fa-regular fa-name + | 'fal' | 'l' // fa-light fa-name + | 'fat' | 't' // fa-thin fa-name + | 'fads' | 'ds' // fa-duotone fa-solid fa-name + | 'fass' | 'ss' // fa-sharp fa-solid fa-name + | 'fasr' | 'sr' // fa-sharp fa-regular fa-name + | 'fasl' | 'sl' // fa-sharp fa-light fa-name + | 'fast' | 'st' // fa-sharp fa-thin fa-name + | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name + | 'fab' | 'b' // fa-brands fa-name ``` ### assets diff --git a/docs/notes/theme/guide/features/replace-assets.md b/docs/notes/theme/guide/features/replace-assets.md index ea3cb2ff..b4cf6442 100644 --- a/docs/notes/theme/guide/features/replace-assets.md +++ b/docs/notes/theme/guide/features/replace-assets.md @@ -68,11 +68,11 @@ export default defineUserConfig({ /** * 资源链接替换配置 */ -type ReplaceAssetsPluginOptions = - | Replacement - | ReplacementRule - | ReplacementRule[] - | ReplaceAssetsOptions +type ReplaceAssetsPluginOptions + = | Replacement + | ReplacementRule + | ReplacementRule[] + | ReplaceAssetsOptions /** * - `string`:拼接在原始资源链接的前面 diff --git a/docs/notes/theme/guide/markdown/icons.md b/docs/notes/theme/guide/markdown/icons.md index b26fe5d8..3c332dcb 100644 --- a/docs/notes/theme/guide/markdown/icons.md +++ b/docs/notes/theme/guide/markdown/icons.md @@ -338,18 +338,18 @@ interface IconOptions { type FontAwesomeAssetBuiltin = 'fontawesome' | 'fontawesome-with-brands' -type FontAwesomePrefix = - | 'fas' | 's' // fa-solid fa-name - | 'far' | 'r' // fa-regular fa-name - | 'fal' | 'l' // fa-light fa-name - | 'fat' | 't' // fa-thin fa-name - | 'fads' | 'ds' // fa-duotone fa-solid fa-name - | 'fass' | 'ss' // fa-sharp fa-solid fa-name - | 'fasr' | 'sr' // fa-sharp fa-regular fa-name - | 'fasl' | 'sl' // fa-sharp fa-light fa-name - | 'fast' | 'st' // fa-sharp fa-thin fa-name - | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name - | 'fab' | 'b' // fa-brands fa-name +type FontAwesomePrefix + = | 'fas' | 's' // fa-solid fa-name + | 'far' | 'r' // fa-regular fa-name + | 'fal' | 'l' // fa-light fa-name + | 'fat' | 't' // fa-thin fa-name + | 'fads' | 'ds' // fa-duotone fa-solid fa-name + | 'fass' | 'ss' // fa-sharp fa-solid fa-name + | 'fasr' | 'sr' // fa-sharp fa-regular fa-name + | 'fasl' | 'sl' // fa-sharp fa-light fa-name + | 'fast' | 'st' // fa-sharp fa-thin fa-name + | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name + | 'fab' | 'b' // fa-brands fa-name ``` [在 **Fontawesome** 中,图标通过 families + styles 控制样式,**查看详情**](https://docs.fontawesome.com/web/add-icons/how-to#setting-different-families--styles){.read-more} diff --git a/plugins/plugin-md-power/src/client/components/FileTreeNode.vue b/plugins/plugin-md-power/src/client/components/FileTreeNode.vue index c84b4592..55b6ff6e 100644 --- a/plugins/plugin-md-power/src/client/components/FileTreeNode.vue +++ b/plugins/plugin-md-power/src/client/components/FileTreeNode.vue @@ -16,7 +16,7 @@ const activeFileTreeNode = inject>('active-file-tree-node', ref('')) const onNodeClick = inject< (filename: string, type: 'file' | 'folder') => void ->('on-file-tree-node-click', () => {}) + >('on-file-tree-node-click', () => {}) const active = ref(props.expanded) diff --git a/plugins/plugin-md-power/src/shared/icon.ts b/plugins/plugin-md-power/src/shared/icon.ts index 63f4f984..475bb8cf 100644 --- a/plugins/plugin-md-power/src/shared/icon.ts +++ b/plugins/plugin-md-power/src/shared/icon.ts @@ -67,21 +67,21 @@ export interface IconifyProvider extends IconProviderBase { export type FontAwesomeAssetBuiltIn = 'fontawesome' | 'fontawesome-with-brands' export type IconAssetLink = `//${string}` | `//${string}` | `https://${string}` | `http://${string}` -export type FontAwesomePrefix = - | 'fas' | 's' // fa-solid fa-name - | 'far' | 'r' // fa-regular fa-name - | 'fal' | 'l' // fa-light fa-name - | 'fat' | 't' // fa-thin fa-name - | 'fads' | 'ds' // fa-duotone fa-solid fa-name - | 'fass' | 'ss' // fa-sharp fa-solid fa-name - | 'fasr' | 'sr' // fa-sharp fa-regular fa-name - | 'fasl' | 'sl' // fa-sharp fa-light fa-name - | 'fast' | 'st' // fa-sharp fa-thin fa-name - | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name - | 'fab' | 'b' // fa-brands fa-name +export type FontAwesomePrefix + = | 'fas' | 's' // fa-solid fa-name + | 'far' | 'r' // fa-regular fa-name + | 'fal' | 'l' // fa-light fa-name + | 'fat' | 't' // fa-thin fa-name + | 'fads' | 'ds' // fa-duotone fa-solid fa-name + | 'fass' | 'ss' // fa-sharp fa-solid fa-name + | 'fasr' | 'sr' // fa-sharp fa-regular fa-name + | 'fasl' | 'sl' // fa-sharp fa-light fa-name + | 'fast' | 'st' // fa-sharp fa-thin fa-name + | 'fasds' | 'sds' // fa-sharp-duotone fa-solid fa-name + | 'fab' | 'b' // fa-brands fa-name export type IconifyPrefix = 'material-symbols' | 'material-symbols-light' | 'ic' | 'mdi' | 'mdi-light' | 'line-md' | 'solar' | 'tabler' | 'hugeicons' | 'mingcute' | 'ri' | 'mynaui' | 'iconamoon' | 'iconoir' | 'lucide' | 'lucide-lab' | 'uil' | 'tdesign' | 'si' | 'bx' | 'bxs' | 'majesticons' | 'gg' | 'flowbite' | 'basil' | 'pixelarticons' | 'pixel' | 'akar-icons' | 'ci' | 'proicons' | 'typcn' | 'meteor-icons' | 'prime' | 'circum' | 'fe' | 'eos-icons' | 'bitcoin-icons' | 'humbleicons' | 'uim' | 'uit' | 'uis' | 'gridicons' | 'mi' | 'cuida' | 'weui' | 'duo-icons' | 'svg-spinners' | 'lets-icons' | 'mage' | 'stash' | 'lineicons' | 'icon-park-outline' | 'icon-park-solid' | 'icon-park-twotone' | 'jam' | 'guidance' | 'carbon' | 'ion' | 'famicons' | 'ant-design' | 'lsicon' | 'gravity-ui' | 'cil' | 'ep' | 'charm' | 'quill' | 'bytesize' | 'bi' | 'rivet-icons' | 'nimbus' | 'formkit' | 'fluent' | 'ph' | 'teenyicons' | 'clarity' | 'ix' | 'octicon' | 'memory' | 'system-uicons' | 'radix-icons' | 'zondicons' | 'uiw' | 'maki' | 'codex' | 'ei' | 'heroicons' | 'pepicons-pop' | 'pepicons-print' | 'pepicons-pencil' | 'f7' | 'pajamas' | 'garden' | 'streamline' | 'fa6-solid' | 'fa6-regular' | 'picon' | 'ooui' | 'oui' | 'nrk' | 'qlementine-icons' | 'fluent-color' | 'icon-park' | 'marketeq' | 'vscode-icons' | 'codicon' | 'material-icon-theme' | 'file-icons' | 'devicon' | 'devicon-plain' | 'catppuccin' | 'skill-icons' | 'unjs' | 'simple-icons' | 'logos' | 'cib' | 'fa6-brands' | 'bxl' | 'nonicons' | 'arcticons' | 'cbi' | 'brandico' | 'entypo-social' | 'token' | 'token-branded' | 'cryptocurrency' | 'cryptocurrency-color' | 'openmoji' | 'twemoji' | 'noto' | 'fluent-emoji' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'noto-v1' | 'emojione' | 'emojione-monotone' | 'emojione-v1' | 'fxemoji' | 'streamline-emojis' | 'circle-flags' | 'flag' | 'flagpack' | 'cif' | 'gis' | 'map' | 'geo' | 'game-icons' | 'fad' | 'academicons' | 'wi' | 'meteocons' | 'healthicons' | 'medical-icon' | 'covid' | 'la' | 'eva' | 'dashicons' | 'flat-color-icons' | 'entypo' | 'foundation' | 'raphael' | 'icons8' | 'iwwa' | 'gala' | 'heroicons-outline' | 'heroicons-solid' | 'fa-solid' | 'fa-regular' | 'fa-brands' | 'fa' | 'fluent-mdl2' | 'fontisto' | 'icomoon-free' | 'subway' | 'oi' | 'wpf' | 'simple-line-icons' | 'et' | 'el' | 'vaadin' | 'grommet-icons' | 'whh' | 'si-glyph' | 'zmdi' | 'ls' | 'bpmn' | 'flat-ui' | 'vs' | 'topcoat' | 'il' | 'websymbol' | 'fontelico' | 'ps' | 'feather' | 'mono-icons' | 'pepicons' -export type LiteralUnion = - | Union - | (Base & { zz_IGNORE_ME?: never }) +export type LiteralUnion + = | Union + | (Base & { zz_IGNORE_ME?: never }) diff --git a/plugins/plugin-md-power/src/shared/repl.ts b/plugins/plugin-md-power/src/shared/repl.ts index 276c6042..e0ef3f03 100644 --- a/plugins/plugin-md-power/src/shared/repl.ts +++ b/plugins/plugin-md-power/src/shared/repl.ts @@ -1,11 +1,11 @@ import type { BuiltinTheme, ThemeRegistration } from 'shiki' -export type ThemeOptions = - | BuiltinTheme - | { - light: BuiltinTheme - dark: BuiltinTheme - } +export type ThemeOptions + = | BuiltinTheme + | { + light: BuiltinTheme + dark: BuiltinTheme + } export interface ReplOptions { theme?: ThemeOptions diff --git a/plugins/plugin-replace-assets/src/options.ts b/plugins/plugin-replace-assets/src/options.ts index 85c69199..b5af567d 100644 --- a/plugins/plugin-replace-assets/src/options.ts +++ b/plugins/plugin-replace-assets/src/options.ts @@ -12,8 +12,8 @@ export interface ReplaceAssetsOptions { media?: Replacement } -export type ReplaceAssetsPluginOptions = - | Replacement - | ReplacementRule - | ReplacementRule[] - | ReplaceAssetsOptions +export type ReplaceAssetsPluginOptions + = | Replacement + | ReplacementRule + | ReplacementRule[] + | ReplaceAssetsOptions diff --git a/theme/src/client/features/composables/npm-badge.ts b/theme/src/client/features/composables/npm-badge.ts index b0a52595..14fe2b98 100644 --- a/theme/src/client/features/composables/npm-badge.ts +++ b/theme/src/client/features/composables/npm-badge.ts @@ -7,19 +7,19 @@ const BADGE_URL = 'https://img.shields.io' const GITHUB_URL = 'https://github.com' const NPM_URL = 'https://www.npmjs.com/package' -export type NpmBadgeType = +export type NpmBadgeType // github - | 'source' // github source - | 'stars' // github stars - | 'forks' // github forks - | 'license' // github license + = | 'source' // github source + | 'stars' // github stars + | 'forks' // github forks + | 'license' // github license // npm - | 'version' // npm version - | 'dt' // alias d18m - | 'd18m' // npm downloads last 18 months - | 'dw' // npm downloads weekly - | 'dm' // npm downloads monthly - | 'dy' // npm downloads yearly + | 'version' // npm version + | 'dt' // alias d18m + | 'd18m' // npm downloads last 18 months + | 'dw' // npm downloads weekly + | 'dm' // npm downloads monthly + | 'dy' // npm downloads yearly export type NpmBadgeTheme = 'flat' | 'flat-square' | 'plastic' | 'for-the-badge' | 'social' diff --git a/theme/src/node/loadConfig/compiler.ts b/theme/src/node/loadConfig/compiler.ts index 6d12c567..dd43b3bb 100644 --- a/theme/src/node/loadConfig/compiler.ts +++ b/theme/src/node/loadConfig/compiler.ts @@ -9,9 +9,9 @@ import { hash } from '../utils/index.js' export async function compiler(configPath?: string, ): Promise<{ - config: ThemeConfig - dependencies: string[] - }> { + config: ThemeConfig + dependencies: string[] +}> { if (!configPath) { return { config: {}, dependencies: [] } } diff --git a/theme/src/shared/common/base.ts b/theme/src/shared/common/base.ts index ebd1e1ca..5dae07b6 100644 --- a/theme/src/shared/common/base.ts +++ b/theme/src/shared/common/base.ts @@ -1,10 +1,10 @@ /** * 图片 */ -export type ThemeImage = - | string - | { src: string, alt?: string, width?: string | number, height?: string | number } - | { dark: string, light: string, alt?: string, width?: string | number, height?: string | number } +export type ThemeImage + = | string + | { src: string, alt?: string, width?: string | number, height?: string | number } + | { dark: string, light: string, alt?: string, width?: string | number, height?: string | number } /** * 图标 diff --git a/theme/src/shared/common/social.ts b/theme/src/shared/common/social.ts index bc49c954..ed5e1f41 100644 --- a/theme/src/shared/common/social.ts +++ b/theme/src/shared/common/social.ts @@ -12,26 +12,26 @@ export interface SocialLink { */ export type SocialLinkIcon = SocialLinkIconUnion | { svg: string, name?: string } -export type SocialLinkIconUnion = - | 'discord' - | 'facebook' - | 'github' - | 'instagram' - | 'linkedin' - | 'mastodon' - | 'npm' - | 'slack' - | 'twitter' - | 'x' - | 'youtube' - | 'qq' - | 'weibo' - | 'bilibili' - | 'gitlab' - | 'docker' - | 'juejin' - | 'zhihu' - | 'douban' - | 'steam' - | 'stackoverflow' - | 'xbox' +export type SocialLinkIconUnion + = | 'discord' + | 'facebook' + | 'github' + | 'instagram' + | 'linkedin' + | 'mastodon' + | 'npm' + | 'slack' + | 'twitter' + | 'x' + | 'youtube' + | 'qq' + | 'weibo' + | 'bilibili' + | 'gitlab' + | 'docker' + | 'juejin' + | 'zhihu' + | 'douban' + | 'steam' + | 'stackoverflow' + | 'xbox' diff --git a/theme/src/shared/features/copyright.ts b/theme/src/shared/features/copyright.ts index 3e8ddd4e..7b941c04 100644 --- a/theme/src/shared/features/copyright.ts +++ b/theme/src/shared/features/copyright.ts @@ -3,14 +3,14 @@ import type { LiteralUnion } from '../utils.js' /** * 内置支持的版权协议 */ -export type KnownCopyrightLicense = - | 'CC-BY-4.0' - | 'CC-BY-SA-4.0' - | 'CC-BY-NC-4.0' - | 'CC-BY-NC-SA-4.0' - | 'CC-BY-ND-4.0' - | 'CC-BY-NC-ND-4.0' - | 'CC0' +export type KnownCopyrightLicense + = | 'CC-BY-4.0' + | 'CC-BY-SA-4.0' + | 'CC-BY-NC-4.0' + | 'CC-BY-NC-SA-4.0' + | 'CC-BY-ND-4.0' + | 'CC-BY-NC-ND-4.0' + | 'CC0' /** * 文章版权协议 diff --git a/theme/src/shared/resolved/navbar.ts b/theme/src/shared/resolved/navbar.ts index 8765b1e9..fc6824c0 100644 --- a/theme/src/shared/resolved/navbar.ts +++ b/theme/src/shared/resolved/navbar.ts @@ -4,9 +4,9 @@ import type { ThemeBadge, ThemeIcon } from '../common/index.js' * 主题内部使用的已解析的导航项 * @internal */ -export type ResolvedNavItem = - | ResolvedNavItemWithLink - | ResolvedNavItemWithChildren +export type ResolvedNavItem + = | ResolvedNavItemWithLink + | ResolvedNavItemWithChildren /** * 主题内部使用的已解析的导航子项 diff --git a/theme/src/shared/utils.ts b/theme/src/shared/utils.ts index 5c5c0cc8..abb1146f 100644 --- a/theme/src/shared/utils.ts +++ b/theme/src/shared/utils.ts @@ -3,17 +3,17 @@ * * @see [copied from issue](https://github.com/microsoft/TypeScript/issues/29729#issuecomment-471566609) */ -export type LiteralUnion = - | Union - | (Base & { zz_IGNORE_ME?: never }) +export type LiteralUnion + = | Union + | (Base & { zz_IGNORE_ME?: never }) -type UnionToIntersection = - (U extends any ? (k: U) => void : never) extends (k: infer I) => void +type UnionToIntersection + = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never -export type UnionToTuple = - UnionToIntersection< +export type UnionToTuple + = UnionToIntersection< T extends any ? () => T : never > extends () => infer R ? [...UnionToTuple>, R]