mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
types: add types for database abstration layer (#10762)
* types: add types for database abstration layer Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com> * types: fix more type dependent return value cases Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com> * types: make INodeBBDatabaseBackend implement the five major interface set Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com> * update types * update type names * add reverse for options in processSortedSet * add getSortedSetMembersWithScores and getSortedSetsMembersWithScores --------- Signed-off-by: steve <29133953+stevefan1999-personal@users.noreply.github.com>
This commit is contained in:
35
types/database/string.d.ts
vendored
Normal file
35
types/database/string.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import { ObjectType, RedisStyleMatchString } from './index'
|
||||
|
||||
export interface Item {
|
||||
delete(key: string): Promise<void>
|
||||
|
||||
deleteAll(keys: string[]): Promise<void>
|
||||
|
||||
exists(key: string): Promise<boolean>
|
||||
|
||||
exists(key: string[]): Promise<boolean[]>
|
||||
|
||||
expire(key: string, seconds: number): Promise<void>
|
||||
|
||||
expireAt(key: string, timestampInSeconds: number): Promise<void>
|
||||
|
||||
get(key: string): Promise<string | null>
|
||||
|
||||
increment(key: string): Promise<number>
|
||||
|
||||
pexpire(key: string, ms: number): Promise<void>
|
||||
|
||||
pexpireAt(key: string, timestampInMs: number): Promise<void>
|
||||
|
||||
pttl(key: string): Promise<number>
|
||||
|
||||
rename(oldkey: string, newkey: string): Promise<void>
|
||||
|
||||
scan(params: { match: RedisStyleMatchString }): Promise<string[]>
|
||||
|
||||
set(key: string, value: string): Promise<void>
|
||||
|
||||
ttl(key: string): Promise<number>
|
||||
|
||||
type(key: string): Promise<ObjectType | null>
|
||||
}
|
||||
Reference in New Issue
Block a user