53 lines
1.4 KiB
JavaScript
53 lines
1.4 KiB
JavaScript
// Metro module 1916 (f1917).
|
|
import { Runtime } from "./Module1917";
|
|
import { KV_RAW } from "./Module1909";
|
|
export class Host {
|
|
constructor() {
|
|
return {
|
|
__proto__: new.target.prototype
|
|
};
|
|
}
|
|
static open(database, c13320_1) {
|
|
return Runtime.executeAsync("database_open", (a0) => {
|
|
let invalidateDisabledHandles = c13320_1?.invalidateDisabledHandles;
|
|
if (invalidateDisabledHandles == null) {
|
|
invalidateDisabledHandles = false;
|
|
}
|
|
return KV_RAW.databaseOpen(a0, {
|
|
database,
|
|
invalidateDisabledHandles
|
|
});
|
|
});
|
|
}
|
|
static openSyncUnsafe(a0, a1) {
|
|
let invalidateDisabledHandles = a1?.invalidateDisabledHandles;
|
|
if (invalidateDisabledHandles == null) {
|
|
invalidateDisabledHandles = false;
|
|
}
|
|
return KV_RAW.databaseOpen(null, {
|
|
database: a0,
|
|
invalidateDisabledHandles
|
|
}, {
|
|
synchronous: true
|
|
});
|
|
}
|
|
static delete(database2) {
|
|
return Runtime.executeAsync("database_delete", (a0) => KV_RAW.databaseDelete(a0, {
|
|
database: database2
|
|
}));
|
|
}
|
|
static async list() {
|
|
let c24700_0;
|
|
c24700_0 = void 0;
|
|
return (await Runtime.executeAsync("database_list", (a0) => KV_RAW.databaseList(a0))).map((item) => item.data);
|
|
}
|
|
static optimize(aggressive) {
|
|
return Runtime.executeAsync("database_optimize", (a0) => KV_RAW.databaseOptimize(a0, {
|
|
aggressive
|
|
}));
|
|
}
|
|
static raise(a0) {
|
|
KV_RAW.raise(a0);
|
|
}
|
|
}
|