1
0
mirror of https://github.com/seejohnrun/haste-server.git synced 2025-12-20 08:11:28 +00:00
Files
haste-server/src/lib/document-stores/index.ts
2022-06-06 21:36:48 +02:00

26 lines
508 B
TypeScript

import { BaseStoreConfig } from 'src/types/config'
export type Callback = (data: boolean | string) => void
export abstract class Store {
type: string
expire?: number
constructor(config: BaseStoreConfig) {
this.type = config.type
if (this.expire) {
this.expire = config.expire
}
}
abstract get: (key: string, callback: Callback, skipExpire?: boolean) => void
abstract set: (
key: string,
data: string,
callback: Callback,
skipExpire?: boolean
) => void
}