* feat: 添加Prompt模板和Prompt商店支持 * feat: well done --------- Co-authored-by: Redon <790348264@qq.com>
19 lines
429 B
TypeScript
19 lines
429 B
TypeScript
import { ss } from '@/utils/storage'
|
|
|
|
const LOCAL_NAME = 'promptStore'
|
|
|
|
export type PromptList = []
|
|
|
|
export interface PromptStore {
|
|
promptList: PromptList
|
|
}
|
|
|
|
export function getLocalPromptList(): PromptStore {
|
|
const promptStore: PromptStore | undefined = ss.get(LOCAL_NAME)
|
|
return promptStore ?? { promptList: [] }
|
|
}
|
|
|
|
export function setLocalPromptList(promptStore: PromptStore): void {
|
|
ss.set(LOCAL_NAME, promptStore)
|
|
}
|