-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser.d.ts
More file actions
42 lines (38 loc) · 1.07 KB
/
browser.d.ts
File metadata and controls
42 lines (38 loc) · 1.07 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
/**
* Browser entry point for @git-stunts/git-warp.
*
* Re-exports only browser-safe code — no node:crypto, node:stream,
* or @git-stunts/plumbing imports.
*/
export { default as WarpGraph } from './index';
export {
GraphNode,
InMemoryGraphAdapter,
WebCryptoAdapter,
EncryptionError,
ForkError,
QueryError,
StorageError,
TraversalError,
SyncError,
} from './index';
/**
* Base error class for all WARP domain errors.
*/
export class WarpError extends Error {
readonly name: string;
readonly code: string;
readonly context: Record<string, unknown>;
constructor(message: string, options?: { code?: string; context?: Record<string, unknown> });
}
/**
* Creates an empty VersionVector (Map<string, number>).
*/
export function createVersionVector(): Map<string, number>;
/**
* Generates a new canonical writer ID.
*
* @param options - Options with optional custom RNG for testing
* @returns A canonical writer ID (e.g., 'w_0123456789abcdefghjkmnpqrs')
*/
export function generateWriterId(options?: { randomBytes?: (n: number) => Uint8Array }): string;