docs(notes): export settings note contract types
Both sides of the bilingual pair compile in one doc-typecheck program; module-scoped (exported) declarations keep the shared identifiers from colliding across the pair.
This commit is contained in:
+2
-2
@@ -2,5 +2,5 @@
|
|||||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||||
# after editing either side, bring the other along and re-record with:
|
# after editing either side, bring the other along and re-record with:
|
||||||
# pnpm run verify-translation-pairing --write
|
# pnpm run verify-translation-pairing --write
|
||||||
2026-07-25-client-settings-locale-theme.md: 25e22c728ea509613c4d7f6cdfcd09faf4685760
|
2026-07-25-client-settings-locale-theme.md: e1245a9e1fac82fb0feb84af7a59945b17fa1daf
|
||||||
2026-07-25-client-settings-locale-theme.zh.md: 9c2457b254aa826291d4c5a4e115e9ba2d391974
|
2026-07-25-client-settings-locale-theme.zh.md: 195b2e5ffa3556dd1b8bf2dd6ec8ae84115fbdb2
|
||||||
|
|||||||
@@ -49,33 +49,33 @@ Section contributions use declaration-aware deferral and do not depend on the cl
|
|||||||
### Service contracts
|
### Service contracts
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type ThemePreference = 'light' | 'dark' | 'system'
|
export type ThemePreference = 'light' | 'dark' | 'system'
|
||||||
|
|
||||||
interface ThemeDefinition {
|
export interface ThemeDefinition {
|
||||||
id: string
|
id: string
|
||||||
colorScheme: 'light' | 'dark'
|
colorScheme: 'light' | 'dark'
|
||||||
tokens: Record<string, string>
|
tokens: Record<string, string>
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ThemeSnapshot {
|
export interface ThemeSnapshot {
|
||||||
preference: ThemePreference
|
preference: ThemePreference
|
||||||
active: ThemeDefinition // system 已解析为具体 light/dark 定义
|
active: ThemeDefinition // system 已解析为具体 light/dark 定义
|
||||||
themes: readonly ThemeDefinition[]
|
themes: readonly ThemeDefinition[]
|
||||||
revision: number
|
revision: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LocaleDefinition {
|
export interface LocaleDefinition {
|
||||||
id: 'zh' | 'en'
|
id: 'zh' | 'en'
|
||||||
label: string
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LocaleSnapshot {
|
export interface LocaleSnapshot {
|
||||||
active: 'zh' | 'en'
|
active: 'zh' | 'en'
|
||||||
locales: readonly LocaleDefinition[]
|
locales: readonly LocaleDefinition[]
|
||||||
revision: number
|
revision: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Events {
|
export interface Events {
|
||||||
/** @param snapshot - Current locale registry snapshot. @mode emit */
|
/** @param snapshot - Current locale registry snapshot. @mode emit */
|
||||||
'locale/change'(snapshot: LocaleSnapshot): void
|
'locale/change'(snapshot: LocaleSnapshot): void
|
||||||
/** @param snapshot - Current theme registry snapshot. @mode emit */
|
/** @param snapshot - Current theme registry snapshot. @mode emit */
|
||||||
|
|||||||
@@ -49,33 +49,33 @@ section contribution 使用 declaration-aware deferral,不依赖 client manife
|
|||||||
### Service contracts
|
### Service contracts
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
type ThemePreference = 'light' | 'dark' | 'system'
|
export type ThemePreference = 'light' | 'dark' | 'system'
|
||||||
|
|
||||||
interface ThemeDefinition {
|
export interface ThemeDefinition {
|
||||||
id: string
|
id: string
|
||||||
colorScheme: 'light' | 'dark'
|
colorScheme: 'light' | 'dark'
|
||||||
tokens: Record<string, string>
|
tokens: Record<string, string>
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ThemeSnapshot {
|
export interface ThemeSnapshot {
|
||||||
preference: ThemePreference
|
preference: ThemePreference
|
||||||
active: ThemeDefinition // system 已解析为具体 light/dark 定义
|
active: ThemeDefinition // system 已解析为具体 light/dark 定义
|
||||||
themes: readonly ThemeDefinition[]
|
themes: readonly ThemeDefinition[]
|
||||||
revision: number
|
revision: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LocaleDefinition {
|
export interface LocaleDefinition {
|
||||||
id: 'zh' | 'en'
|
id: 'zh' | 'en'
|
||||||
label: string
|
label: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LocaleSnapshot {
|
export interface LocaleSnapshot {
|
||||||
active: 'zh' | 'en'
|
active: 'zh' | 'en'
|
||||||
locales: readonly LocaleDefinition[]
|
locales: readonly LocaleDefinition[]
|
||||||
revision: number
|
revision: number
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Events {
|
export interface Events {
|
||||||
/** @param snapshot - Current locale registry snapshot. @mode emit */
|
/** @param snapshot - Current locale registry snapshot. @mode emit */
|
||||||
'locale/change'(snapshot: LocaleSnapshot): void
|
'locale/change'(snapshot: LocaleSnapshot): void
|
||||||
/** @param snapshot - Current theme registry snapshot. @mode emit */
|
/** @param snapshot - Current theme registry snapshot. @mode emit */
|
||||||
|
|||||||
Reference in New Issue
Block a user