-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.ts
More file actions
61 lines (54 loc) · 1.92 KB
/
Copy pathbrowser.ts
File metadata and controls
61 lines (54 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* Browser entry point for @git-stunts/git-warp.
*
* Re-exports only browser-safe code — no node:crypto, node:stream,
* or @git-stunts/plumbing imports. Use with InMemoryGraphAdapter
* and WebCryptoAdapter for fully in-browser WARP graph operation.
*
* @module browser
*
* @example
* ```js
* import {
* WarpApp,
* InMemoryGraphAdapter,
* WebCryptoAdapter,
* generateWriterId,
* } from '@git-stunts/git-warp/browser';
* import { sha1sync } from '@git-stunts/git-warp/sha1sync';
*
* const adapter = new InMemoryGraphAdapter({ hash: sha1sync });
* const crypto = new WebCryptoAdapter();
* const app = await WarpApp.open({
* persistence: adapter,
* graphName: 'demo',
* writerId: generateWriterId(),
* crypto,
* });
* ```
*/
import { installDefaultRuntimeHostCommitMessageCodec } from './src/application/RuntimeHostCommitMessageCodecDefaults.ts';
installDefaultRuntimeHostCommitMessageCodec();
// Core API
export { default as WarpApp } from './src/domain/WarpApp.ts';
export { default as WarpCore } from './src/domain/WarpCore.ts';
export { default as GraphNode } from './src/domain/entities/GraphNode.ts';
// Browser-compatible adapters
export { default as InMemoryGraphAdapter } from './src/infrastructure/adapters/InMemoryGraphAdapter.ts';
export { default as WebCryptoAdapter } from './src/infrastructure/adapters/WebCryptoAdapter.ts';
// CRDT primitives
export { default as VersionVector } from './src/domain/crdt/VersionVector.ts';
export { default as SyncSecret } from './src/domain/services/sync/SyncSecret.ts';
export type { SyncRateLimitConfig } from './src/domain/services/sync/SyncRateLimiter.ts';
// Errors
export { default as WarpError } from './src/domain/errors/WarpError.ts';
export {
EncryptionError,
ForkError,
QueryError,
StorageError,
TraversalError,
SyncError,
} from './src/domain/errors/index.ts';
// Utilities
export { generateWriterId } from './src/domain/utils/WriterId.ts';