import { ss } from '@/utils/storage'

const LOCAL_NAME = 'textStorage'

export interface TextInfo {
  pormat: string
}

export interface TextState {
  textInfo: TextInfo
}

export function defaultSetting(): TextState {
  return {
    pormat: '',
  }
}

export function getLocalState(): TextState {
  const localSetting: TextState | undefined = ss.get(LOCAL_NAME)
  return { ...defaultSetting(), ...localSetting }
}

export function setLocalState(setting: TextState): void {
  ss.set(LOCAL_NAME, setting)
}
