feat: 2.0.0 beta release

This commit is contained in:
2025-08-14 23:55:04 +02:00
parent 2eba1475c5
commit fab3476515
71 changed files with 2171 additions and 8936 deletions

25
src/broadcast.ts Normal file
View File

@@ -0,0 +1,25 @@
import type { Document, WithId } from "./types.ts";
export const BroadcastChannel =
globalThis.BroadcastChannel ??
class BroadcastChannelMock {
onmessage?: any;
postMessage() {}
close() {}
};
export type StorageBroadcast<TSchema extends Document = Document> =
| {
name: string;
type: "insertOne" | "updateOne";
data: WithId<TSchema>;
}
| {
name: string;
type: "insertMany" | "updateMany" | "remove";
data: WithId<TSchema>[];
}
| {
name: string;
type: "flush";
};