docs/.vitepress/theme/components/crossapp/platforms.data.ts

ba4f23d3bab9e2bb3b8efdb22317c8cc8f353ec5
wotaku/docs/.vitepress/theme/components/crossapp/platforms.data.ts history · blame · raw

29 lines · 659 bytes

2 symbols in this file
 1import { aliases } from '../../../configs/markdown/emoji'
 2
 3const PLATFORMS: Record<string, string> = {
 4  and: 'Android',
 5  ios: 'iOS / iPadOS',
 6  win: 'Windows',
 7  app: 'MacOS',
 8  lin: 'Linux',
 9  bsd: 'BSD',
10  cmd: 'CLI / TUI',
11  web: 'Website / Web-based'
12}
13
14export interface PlatformInfo {
15  icon: string
16  label: string
17}
18
19export default {
20  watch: ['../../../configs/markdown/emoji.ts'],
21  load(): Record<string, PlatformInfo> {
22    const result: Record<string, PlatformInfo> = {}
23    for (const [token, label] of Object.entries(PLATFORMS)) {
24      const icon = aliases[token]
25      if (icon) result[token] = { icon, label }
26    }
27    return result
28  }
29}