mirror of
https://github.com/HeyPuter/puter.git
synced 2026-10-05 03:18:30 +00:00
chore: update typedefs and fix dbkv issue (#1840)
* chore: update typedefs * fix:dbkv decr
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
import type { Actor } from "./auth/Actor";
|
||||
import type { Actor } from './auth/Actor';
|
||||
|
||||
export class SUService {
|
||||
_construct(): void;
|
||||
get_system_actor(): Promise<any>;
|
||||
get_system_actor(): Promise<Actor>;
|
||||
sudo<T>(callback: () => Promise<T>): Promise<T>;
|
||||
sudo<T>(actorOrCallback: Actor, callback: () => Promise<T>): Promise<T>;
|
||||
}
|
||||
@@ -309,8 +309,8 @@ export class DBKVStore {
|
||||
return currVal as T extends { '': number } ? number : RecursiveRecord<number>;
|
||||
}
|
||||
|
||||
async decr(...params: Parameters<typeof DBKVStore.prototype.incr>): ReturnType<typeof DBKVStore.prototype.incr> {
|
||||
return await this.incr(...params);
|
||||
async decr({ key, pathAndAmountMap }: Parameters<typeof DBKVStore.prototype.incr>[0]): ReturnType<typeof DBKVStore.prototype.incr> {
|
||||
return await this.incr({ key, pathAndAmountMap: Object.fromEntries(Object.entries(pathAndAmountMap).map(([k, v]) => [k, -v])) });
|
||||
}
|
||||
|
||||
async #expireat(key: string, timestamp: number){
|
||||
|
||||
Reference in New Issue
Block a user