import type { AutoUpdateOptions } from '@/components/auto-update' import { defineOptionsMetadata } from '@/components/define' import { getComponentSettings } from '@/core/settings' import { getNumberValidator } from '@/core/utils' import { CoreUpdateMethod, RegistryUpdateMethod, PluginUpdateMethod } from './update-method' export const { options: autoUpdateOptions } = getComponentSettings('autoUpdate') export interface DevRecord { name: string originalUrl: string } export const devClientOptionsMetadata = defineOptionsMetadata({ port: { defaultValue: 23333, displayName: '端口', validator: getNumberValidator(1024, 65535), }, coreUpdateMethod: { defaultValue: CoreUpdateMethod.AlwaysReload, displayName: '本体刷新策略', dropdownEnum: CoreUpdateMethod, }, registryUpdateMethod: { defaultValue: RegistryUpdateMethod.PreferInstantStyles, displayName: '功能刷新策略', dropdownEnum: RegistryUpdateMethod, }, pluginUpdateMethod: { // 同本体 defaultValue: PluginUpdateMethod.AlwaysReload, displayName: '插件刷新策略', dropdownEnum: PluginUpdateMethod, }, devRecords: { defaultValue: {} as Record, displayName: '调试模式临时存储', hidden: true, }, })