@constl/bohr-db
Version:
Type-safe databases for OrbitDB.
13 lines • 535 B
TypeScript
import { type JSONSchemaType } from "ajv";
import type { SetDatabaseType } from "@orbitdb/set-db";
import type { DBElements } from "./types.ts";
export type TypedSet<T extends DBElements> = Omit<SetDatabaseType, "add" | "del" | "all"> & {
add: (value: T) => Promise<string>;
del: (value: T) => Promise<string>;
all: () => Promise<Set<T>>;
};
export declare const typedSet: <T extends DBElements>({ db, schema, }: {
db: SetDatabaseType;
schema: JSONSchemaType<T>;
}) => TypedSet<T>;
//# sourceMappingURL=set.d.ts.map