mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
style: lint fix
This commit is contained in:
parent
0078731ee4
commit
4f60b5424d
@ -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'
|
||||
```
|
||||
|
||||
@ -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 }
|
||||
```
|
||||
|
||||
**示例:**
|
||||
|
||||
@ -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`
|
||||
|
||||
@ -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
|
||||
|
||||
@ -68,11 +68,11 @@ export default defineUserConfig({
|
||||
/**
|
||||
* 资源链接替换配置
|
||||
*/
|
||||
type ReplaceAssetsPluginOptions =
|
||||
| Replacement
|
||||
| ReplacementRule
|
||||
| ReplacementRule[]
|
||||
| ReplaceAssetsOptions
|
||||
type ReplaceAssetsPluginOptions
|
||||
= | Replacement
|
||||
| ReplacementRule
|
||||
| ReplacementRule[]
|
||||
| ReplaceAssetsOptions
|
||||
|
||||
/**
|
||||
* - `string`:拼接在原始资源链接的前面
|
||||
|
||||
@ -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}
|
||||
|
||||
@ -16,7 +16,7 @@ const activeFileTreeNode = inject<Ref<string>>('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)
|
||||
|
||||
|
||||
@ -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 extends Base, Base = string> =
|
||||
| Union
|
||||
| (Base & { zz_IGNORE_ME?: never })
|
||||
export type LiteralUnion<Union extends Base, Base = string>
|
||||
= | Union
|
||||
| (Base & { zz_IGNORE_ME?: never })
|
||||
|
||||
@ -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
|
||||
|
||||
@ -12,8 +12,8 @@ export interface ReplaceAssetsOptions {
|
||||
media?: Replacement
|
||||
}
|
||||
|
||||
export type ReplaceAssetsPluginOptions =
|
||||
| Replacement
|
||||
| ReplacementRule
|
||||
| ReplacementRule[]
|
||||
| ReplaceAssetsOptions
|
||||
export type ReplaceAssetsPluginOptions
|
||||
= | Replacement
|
||||
| ReplacementRule
|
||||
| ReplacementRule[]
|
||||
| ReplaceAssetsOptions
|
||||
|
||||
@ -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'
|
||||
|
||||
|
||||
@ -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: [] }
|
||||
}
|
||||
|
||||
@ -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 }
|
||||
|
||||
/**
|
||||
* 图标
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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'
|
||||
|
||||
/**
|
||||
* 文章版权协议
|
||||
|
||||
@ -4,9 +4,9 @@ import type { ThemeBadge, ThemeIcon } from '../common/index.js'
|
||||
* 主题内部使用的已解析的导航项
|
||||
* @internal
|
||||
*/
|
||||
export type ResolvedNavItem =
|
||||
| ResolvedNavItemWithLink
|
||||
| ResolvedNavItemWithChildren
|
||||
export type ResolvedNavItem
|
||||
= | ResolvedNavItemWithLink
|
||||
| ResolvedNavItemWithChildren
|
||||
|
||||
/**
|
||||
* 主题内部使用的已解析的导航子项
|
||||
|
||||
@ -3,17 +3,17 @@
|
||||
*
|
||||
* @see [copied from issue](https://github.com/microsoft/TypeScript/issues/29729#issuecomment-471566609)
|
||||
*/
|
||||
export type LiteralUnion<Union extends Base, Base = string> =
|
||||
| Union
|
||||
| (Base & { zz_IGNORE_ME?: never })
|
||||
export type LiteralUnion<Union extends Base, Base = string>
|
||||
= | Union
|
||||
| (Base & { zz_IGNORE_ME?: never })
|
||||
|
||||
type UnionToIntersection<U> =
|
||||
(U extends any ? (k: U) => void : never) extends (k: infer I) => void
|
||||
type UnionToIntersection<U>
|
||||
= (U extends any ? (k: U) => void : never) extends (k: infer I) => void
|
||||
? I
|
||||
: never
|
||||
|
||||
export type UnionToTuple<T> =
|
||||
UnionToIntersection<
|
||||
export type UnionToTuple<T>
|
||||
= UnionToIntersection<
|
||||
T extends any ? () => T : never
|
||||
> extends () => infer R
|
||||
? [...UnionToTuple<Exclude<T, R>>, R]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user