make prsm file format

This commit is contained in:
Boof2015
2026-03-28 12:32:06 -04:00
parent 39e15575ba
commit 60e8b921c0
12 changed files with 1818 additions and 352 deletions
+73
View File
@@ -0,0 +1,73 @@
import type { ScopePopoutStateMap, WindowBounds } from './popout'
import type { ScopeKind } from './scope'
import type { ScopeSettings } from './settings'
export const PROFILE_FILE_FORMAT = 'prism-profile'
export const PROFILE_FILE_VERSION = 1
export const PROFILE_LOCAL_STATE_FORMAT = 'prism-profile-local'
export const PROFILE_LOCAL_STATE_VERSION = 1
export const LEGACY_PROFILE_MIGRATION_VERSION = 1
export const DEFAULT_PROFILE_ID = 'profile_default'
export const DEFAULT_PROFILE_NAME = 'Default'
export interface Profile {
name: string
scopeOrder: ScopeKind[]
hiddenScopes: ScopeKind[]
widthWeights: Record<ScopeKind, number>
scopeSettings: ScopeSettings
scopePopouts: ScopePopoutStateMap
windowBounds?: WindowBounds
}
export interface PrismProfileFileScopePopoutState {
poppedOut: boolean
}
export type PrismProfileFileScopePopoutMap = Record<ScopeKind, PrismProfileFileScopePopoutState>
export interface PrismProfileFileV1 {
format: typeof PROFILE_FILE_FORMAT
version: typeof PROFILE_FILE_VERSION
id: string
name: string
scopeOrder: ScopeKind[]
hiddenScopes: ScopeKind[]
widthWeights: Record<ScopeKind, number>
scopeSettings: ScopeSettings
scopePopouts: PrismProfileFileScopePopoutMap
}
export interface ProfileLocalMetadata {
windowBounds?: WindowBounds
scopePopoutBounds?: Partial<Record<ScopeKind, WindowBounds>>
}
export interface PrismProfileLocalStateV1 {
format: typeof PROFILE_LOCAL_STATE_FORMAT
version: typeof PROFILE_LOCAL_STATE_VERSION
migrationVersion: number
activeProfileId: string | null
profiles: Record<string, ProfileLocalMetadata>
}
export interface ProfileSummary {
id: string
name: string
isDefault: boolean
}
export interface ProfileLibrarySnapshot {
profiles: Record<string, Profile>
activeProfileId: string | null
}
export interface LegacyProfileMigrationPayload {
profiles: Record<string, Profile>
activeProfileId: string | null
}
export interface LegacyProfileMigrationResult {
didMigrate: boolean
snapshot: ProfileLibrarySnapshot
}