jazz-tools 0.10.14 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/.turbo/turbo-build.log +11 -7
  2. package/CHANGELOG.md +31 -0
  3. package/dist/auth/AuthSecretStorage.d.ts +25 -0
  4. package/dist/auth/AuthSecretStorage.d.ts.map +1 -0
  5. package/dist/auth/DemoAuth.d.ts +27 -0
  6. package/dist/auth/DemoAuth.d.ts.map +1 -0
  7. package/dist/auth/InMemoryKVStore.d.ts +9 -0
  8. package/dist/auth/InMemoryKVStore.d.ts.map +1 -0
  9. package/dist/auth/KvStoreContext.d.ts +17 -0
  10. package/dist/auth/KvStoreContext.d.ts.map +1 -0
  11. package/dist/auth/PassphraseAuth.d.ts +35 -0
  12. package/dist/auth/PassphraseAuth.d.ts.map +1 -0
  13. package/dist/{chunk-5YDDEUNX.js → chunk-RTRX7HIO.js} +193 -81
  14. package/dist/chunk-RTRX7HIO.js.map +1 -0
  15. package/dist/coValues/account.d.ts +120 -0
  16. package/dist/coValues/account.d.ts.map +1 -0
  17. package/dist/coValues/coFeed.d.ts +361 -0
  18. package/dist/coValues/coFeed.d.ts.map +1 -0
  19. package/dist/coValues/coList.d.ts +221 -0
  20. package/dist/coValues/coList.d.ts.map +1 -0
  21. package/dist/coValues/coMap.d.ts +500 -0
  22. package/dist/coValues/coMap.d.ts.map +1 -0
  23. package/dist/coValues/coPlainText.d.ts +69 -0
  24. package/dist/coValues/coPlainText.d.ts.map +1 -0
  25. package/dist/coValues/coRichText.d.ts +259 -0
  26. package/dist/coValues/coRichText.d.ts.map +1 -0
  27. package/dist/coValues/deepLoading.d.ts +81 -0
  28. package/dist/coValues/deepLoading.d.ts.map +1 -0
  29. package/dist/coValues/extensions/imageDef.d.ts +17 -0
  30. package/dist/coValues/extensions/imageDef.d.ts.map +1 -0
  31. package/dist/coValues/group.d.ts +67 -0
  32. package/dist/coValues/group.d.ts.map +1 -0
  33. package/dist/coValues/inbox.d.ts +52 -0
  34. package/dist/coValues/inbox.d.ts.map +1 -0
  35. package/dist/coValues/interfaces.d.ts +97 -0
  36. package/dist/coValues/interfaces.d.ts.map +1 -0
  37. package/dist/coValues/profile.d.ts +28 -0
  38. package/dist/coValues/profile.d.ts.map +1 -0
  39. package/dist/coValues/registeredSchemas.d.ts +12 -0
  40. package/dist/coValues/registeredSchemas.d.ts.map +1 -0
  41. package/dist/coValues/schemaUnion.d.ts +79 -0
  42. package/dist/coValues/schemaUnion.d.ts.map +1 -0
  43. package/dist/exports.d.ts +27 -0
  44. package/dist/exports.d.ts.map +1 -0
  45. package/dist/implementation/ContextManager.d.ts +65 -0
  46. package/dist/implementation/ContextManager.d.ts.map +1 -0
  47. package/dist/implementation/activeAccountContext.d.ts +12 -0
  48. package/dist/implementation/activeAccountContext.d.ts.map +1 -0
  49. package/dist/implementation/anonymousJazzAgent.d.ts +7 -0
  50. package/dist/implementation/anonymousJazzAgent.d.ts.map +1 -0
  51. package/dist/implementation/createContext.d.ts +91 -0
  52. package/dist/implementation/createContext.d.ts.map +1 -0
  53. package/dist/implementation/devtoolsFormatters.d.ts +2 -0
  54. package/dist/implementation/devtoolsFormatters.d.ts.map +1 -0
  55. package/dist/implementation/errors.d.ts +2 -0
  56. package/dist/implementation/errors.d.ts.map +1 -0
  57. package/dist/implementation/inspect.d.ts +3 -0
  58. package/dist/implementation/inspect.d.ts.map +1 -0
  59. package/dist/implementation/invites.d.ts +23 -0
  60. package/dist/implementation/invites.d.ts.map +1 -0
  61. package/dist/implementation/refs.d.ts +21 -0
  62. package/dist/implementation/refs.d.ts.map +1 -0
  63. package/dist/implementation/schema.d.ts +72 -0
  64. package/dist/implementation/schema.d.ts.map +1 -0
  65. package/dist/implementation/subscriptionScope.d.ts +33 -0
  66. package/dist/implementation/subscriptionScope.d.ts.map +1 -0
  67. package/dist/implementation/symbols.d.ts +8 -0
  68. package/dist/implementation/symbols.d.ts.map +1 -0
  69. package/dist/index.d.ts +3 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +1 -1
  72. package/dist/internal.d.ts +12 -0
  73. package/dist/internal.d.ts.map +1 -0
  74. package/dist/lib/cache.d.ts +6 -0
  75. package/dist/lib/cache.d.ts.map +1 -0
  76. package/dist/lib/cache.test.d.ts +2 -0
  77. package/dist/lib/cache.test.d.ts.map +1 -0
  78. package/dist/testing.d.ts +41 -0
  79. package/dist/testing.d.ts.map +1 -0
  80. package/dist/testing.js +11 -16
  81. package/dist/testing.js.map +1 -1
  82. package/dist/tests/AuthSecretStorage.test.d.ts +2 -0
  83. package/dist/tests/AuthSecretStorage.test.d.ts.map +1 -0
  84. package/dist/tests/ContextManager.test.d.ts +2 -0
  85. package/dist/tests/ContextManager.test.d.ts.map +1 -0
  86. package/dist/tests/DemoAuth.test.d.ts +2 -0
  87. package/dist/tests/DemoAuth.test.d.ts.map +1 -0
  88. package/dist/tests/PassphraseAuth.test.d.ts +2 -0
  89. package/dist/tests/PassphraseAuth.test.d.ts.map +1 -0
  90. package/dist/tests/account.test.d.ts +2 -0
  91. package/dist/tests/account.test.d.ts.map +1 -0
  92. package/dist/tests/coFeed.test.d.ts +2 -0
  93. package/dist/tests/coFeed.test.d.ts.map +1 -0
  94. package/dist/tests/coList.test.d.ts +2 -0
  95. package/dist/tests/coList.test.d.ts.map +1 -0
  96. package/dist/tests/coMap.test.d.ts +2 -0
  97. package/dist/tests/coMap.test.d.ts.map +1 -0
  98. package/dist/tests/coPlainText.test.d.ts +2 -0
  99. package/dist/tests/coPlainText.test.d.ts.map +1 -0
  100. package/dist/tests/coRichText.test.d.ts +2 -0
  101. package/dist/tests/coRichText.test.d.ts.map +1 -0
  102. package/dist/tests/createContext.test.d.ts +2 -0
  103. package/dist/tests/createContext.test.d.ts.map +1 -0
  104. package/dist/tests/deepLoading.test.d.ts +2 -0
  105. package/dist/tests/deepLoading.test.d.ts.map +1 -0
  106. package/dist/tests/fixtures.d.ts +2 -0
  107. package/dist/tests/fixtures.d.ts.map +1 -0
  108. package/dist/tests/groupsAndAccounts.test.d.ts +2 -0
  109. package/dist/tests/groupsAndAccounts.test.d.ts.map +1 -0
  110. package/dist/tests/inbox.test.d.ts +2 -0
  111. package/dist/tests/inbox.test.d.ts.map +1 -0
  112. package/dist/tests/interfaces.test.d.ts +2 -0
  113. package/dist/tests/interfaces.test.d.ts.map +1 -0
  114. package/dist/tests/invites.test.d.ts +2 -0
  115. package/dist/tests/invites.test.d.ts.map +1 -0
  116. package/dist/tests/schema.test.d.ts +2 -0
  117. package/dist/tests/schema.test.d.ts.map +1 -0
  118. package/dist/tests/schemaUnion.test.d.ts +2 -0
  119. package/dist/tests/schemaUnion.test.d.ts.map +1 -0
  120. package/dist/tests/subscribe.test.d.ts +2 -0
  121. package/dist/tests/subscribe.test.d.ts.map +1 -0
  122. package/dist/tests/testing.test.d.ts +2 -0
  123. package/dist/tests/testing.test.d.ts.map +1 -0
  124. package/dist/tests/utils.d.ts +21 -0
  125. package/dist/tests/utils.d.ts.map +1 -0
  126. package/dist/types.d.ts +52 -0
  127. package/dist/types.d.ts.map +1 -0
  128. package/package.json +8 -7
  129. package/src/coValues/account.ts +69 -11
  130. package/src/coValues/coMap.ts +2 -2
  131. package/src/coValues/coRichText.ts +42 -17
  132. package/src/coValues/group.ts +76 -31
  133. package/src/coValues/inbox.ts +10 -0
  134. package/src/coValues/interfaces.ts +1 -1
  135. package/src/coValues/profile.ts +35 -2
  136. package/src/implementation/ContextManager.ts +63 -15
  137. package/src/implementation/schema.ts +1 -3
  138. package/src/testing.ts +10 -16
  139. package/src/tests/AuthSecretStorage.test.ts +1 -2
  140. package/src/tests/ContextManager.test.ts +27 -14
  141. package/src/tests/PassphraseAuth.test.ts +7 -3
  142. package/src/tests/coMap.test.ts +20 -21
  143. package/src/tests/deepLoading.test.ts +8 -17
  144. package/src/tests/groupsAndAccounts.test.ts +429 -89
  145. package/src/tests/inbox.test.ts +24 -0
  146. package/src/tests/schema.test.ts +45 -5
  147. package/src/tests/utils.ts +7 -3
  148. package/src/types.ts +6 -0
  149. package/tsconfig.json +4 -1
  150. package/dist/chunk-5YDDEUNX.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import type { Account } from "./account.js";
2
+ import type { CoMap } from "./coMap.js";
3
+ import type { Group } from "./group.js";
4
+ /**
5
+ * Regisering schemas into this Record to avoid circular dependencies.
6
+ */
7
+ export declare const RegisteredSchemas: {
8
+ Account: typeof Account;
9
+ Group: typeof Group;
10
+ CoMap: typeof CoMap;
11
+ };
12
+ //# sourceMappingURL=registeredSchemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registeredSchemas.d.ts","sourceRoot":"","sources":["../../src/coValues/registeredSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAS;IACrC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { CoValue, CoValueBase, CoValueClass, CoValueFromRaw } from "../internal.js";
2
+ /**
3
+ * SchemaUnion allows you to create union types of CoValues that can be discriminated at runtime.
4
+ *
5
+ * @categoryDescription Declaration
6
+ * Declare your union types by extending `SchemaUnion.Of(...)` and passing a discriminator function that determines which concrete type to use based on the raw data.
7
+ *
8
+ * ```ts
9
+ * import { SchemaUnion, CoMap } from "jazz-tools";
10
+ *
11
+ * class BaseWidget extends CoMap {
12
+ * type = co.string;
13
+ * }
14
+ *
15
+ * class ButtonWidget extends BaseWidget {
16
+ * type = co.literal("button");
17
+ * label = co.string;
18
+ * }
19
+ *
20
+ * class SliderWidget extends BaseWidget {
21
+ * type = co.literal("slider");
22
+ * min = co.number;
23
+ * max = co.number;
24
+ * }
25
+ *
26
+ * const WidgetUnion = SchemaUnion.Of<BaseWidget>((raw) => {
27
+ * switch (raw.get("type")) {
28
+ * case "button": return ButtonWidget;
29
+ * case "slider": return SliderWidget;
30
+ * default: throw new Error("Unknown widget type");
31
+ * }
32
+ * });
33
+ * ```
34
+ *
35
+ * @category CoValues
36
+ */
37
+ export declare abstract class SchemaUnion extends CoValueBase implements CoValue {
38
+ /**
39
+ * Create a new union type from a discriminator function.
40
+ *
41
+ * The discriminator function receives the raw data and should return the appropriate concrete class to use for that data.
42
+ *
43
+ * When loading a SchemaUnion, the correct subclass will be instantiated based on the discriminator.
44
+ *
45
+ * @param discriminator - Function that determines which concrete type to use
46
+ * @returns A new class that can create/load instances of the union type
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const WidgetUnion = SchemaUnion.Of<BaseWidget>((raw) => {
51
+ * switch (raw.get("type")) {
52
+ * case "button": return ButtonWidget;
53
+ * case "slider": return SliderWidget;
54
+ * default: throw new Error("Unknown widget type");
55
+ * }
56
+ * });
57
+ *
58
+ * const widget = await loadCoValue(WidgetUnion, id, me, {});
59
+ *
60
+ * // You can narrow the returned instance to a subclass by using `instanceof`
61
+ * if (widget instanceof ButtonWidget) {
62
+ * console.log(widget.label);
63
+ * } else if (widget instanceof SliderWidget) {
64
+ * console.log(widget.min, widget.max);
65
+ * }
66
+ * ```
67
+ *
68
+ * @category Declaration
69
+ **/
70
+ static Of<V extends CoValue>(discriminator: (raw: V["_raw"]) => CoValueClass<V> & CoValueFromRaw<V>): CoValueClass<V> & typeof SchemaUnion;
71
+ /**
72
+ * Create an instance from raw data. This is called internally and should not be used directly.
73
+ * Use {@link SchemaUnion.Of} to create a union type instead.
74
+ *
75
+ * @internal
76
+ */
77
+ static fromRaw<V extends CoValue>(this: CoValueClass<V>, raw: V["_raw"]): V;
78
+ }
79
+ //# sourceMappingURL=schemaUnion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaUnion.d.ts","sourceRoot":"","sources":["../../src/coValues/schemaUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,8BAAsB,WAAY,SAAQ,WAAY,YAAW,OAAO;IACtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+BI;IACJ,MAAM,CAAC,EAAE,CAAC,CAAC,SAAS,OAAO,EACzB,aAAa,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GACrE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,WAAW;IAcvC;;;;;OAKG;IAEH,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;CAG5E"}
@@ -0,0 +1,27 @@
1
+ export type { AgentID, CoValueUniqueness, CryptoProvider, InviteSecret, Peer, SessionID, SyncMessage, } from "cojson";
2
+ export type { CoValue, ID } from "./internal.js";
3
+ export { Encoders, co } from "./internal.js";
4
+ export { Inbox, InboxSender } from "./coValues/inbox.js";
5
+ export { Account, isControlledAccount, type AccountClass, type AccountCreationProps, } from "./coValues/account.js";
6
+ export { BinaryCoStream, CoFeed, CoStream, FileStream, } from "./coValues/coFeed.js";
7
+ export { CoList } from "./coValues/coList.js";
8
+ export { CoMap, type CoMapInit } from "./coValues/coMap.js";
9
+ export { CoPlainText, type TextPos } from "./coValues/coPlainText.js";
10
+ export { CoRichText, Marks, type TreeLeaf, type TreeNode, type ResolvedMark, } from "./coValues/coRichText.js";
11
+ export { ImageDefinition } from "./coValues/extensions/imageDef.js";
12
+ export { Group } from "./coValues/group.js";
13
+ export { CoValueBase } from "./coValues/interfaces.js";
14
+ export { Profile } from "./coValues/profile.js";
15
+ export { SchemaUnion } from "./coValues/schemaUnion.js";
16
+ export type { CoValueClass, DeeplyLoaded, DepthsIn } from "./internal.js";
17
+ export { createCoValueObservable, loadCoValue, subscribeToCoValue, } from "./internal.js";
18
+ export { JazzContextManager, type JazzContextManagerAuthProps, } from "./implementation/ContextManager.js";
19
+ export { AuthSecretStorage } from "./auth/AuthSecretStorage.js";
20
+ export { KvStoreContext, type KvStore } from "./auth/KvStoreContext.js";
21
+ export { InMemoryKVStore } from "./auth/InMemoryKVStore.js";
22
+ export { DemoAuth } from "./auth/DemoAuth.js";
23
+ export { PassphraseAuth } from "./auth/PassphraseAuth.js";
24
+ export { createInviteLink, parseInviteLink, consumeInviteLink, } from "./implementation/invites.js";
25
+ export { AnonymousJazzAgent, createAnonymousJazzContext, createJazzContextFromExistingCredentials, createJazzContextForNewAccount, createJazzContext, randomSessionProvider, type AuthResult, type Credentials, type JazzContextWithAccount, } from "./internal.js";
26
+ export type * from "./types.js";
27
+ //# sourceMappingURL=exports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,WAAW,GACZ,MAAM,QAAQ,CAAC;AAEhB,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,E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B,EAC1B,wCAAwC,EACxC,8BAA8B,EAC9B,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AAEvB,mBAAmB,YAAY,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { AgentSecret, LocalNode } from "cojson";
2
+ import { AuthSecretStorage } from "../auth/AuthSecretStorage.js";
3
+ import { KvStore } from "../auth/KvStoreContext.js";
4
+ import { Account } from "../coValues/account.js";
5
+ import { AuthCredentials } from "../types.js";
6
+ import { JazzContextType } from "../types.js";
7
+ import { AnonymousJazzAgent } from "./anonymousJazzAgent.js";
8
+ export type JazzContextManagerAuthProps = {
9
+ credentials?: AuthCredentials;
10
+ newAccountProps?: {
11
+ secret: AgentSecret;
12
+ creationProps: {
13
+ name: string;
14
+ };
15
+ };
16
+ };
17
+ export type JazzContextManagerBaseProps<Acc extends Account> = {
18
+ onAnonymousAccountDiscarded?: (anonymousAccount: Acc) => Promise<void>;
19
+ onLogOut?: () => void | Promise<unknown>;
20
+ };
21
+ type PlatformSpecificAuthContext<Acc extends Account> = {
22
+ me: Acc;
23
+ node: LocalNode;
24
+ logOut: () => Promise<void>;
25
+ done: () => void;
26
+ };
27
+ type PlatformSpecificGuestContext = {
28
+ guest: AnonymousJazzAgent;
29
+ node: LocalNode;
30
+ logOut: () => Promise<void>;
31
+ done: () => void;
32
+ };
33
+ type PlatformSpecificContext<Acc extends Account> = PlatformSpecificAuthContext<Acc> | PlatformSpecificGuestContext;
34
+ export declare class JazzContextManager<Acc extends Account, P extends JazzContextManagerBaseProps<Acc>> {
35
+ protected value: JazzContextType<Acc> | undefined;
36
+ protected context: PlatformSpecificContext<Acc> | undefined;
37
+ protected props: P | undefined;
38
+ protected authSecretStorage: AuthSecretStorage;
39
+ protected keepContextOpen: boolean;
40
+ protected contextPromise: Promise<void> | undefined;
41
+ constructor();
42
+ getKvStore(): KvStore;
43
+ createContext(props: P, authProps?: JazzContextManagerAuthProps): Promise<void>;
44
+ getNewContext(props: P, authProps?: JazzContextManagerAuthProps): Promise<PlatformSpecificContext<Acc>>;
45
+ updateContext(props: P, context: PlatformSpecificContext<Acc>, authProps?: JazzContextManagerAuthProps): Promise<void>;
46
+ propsChanged(props: P): void;
47
+ getCurrentValue(): JazzContextType<Acc> | undefined;
48
+ getAuthSecretStorage(): AuthSecretStorage;
49
+ logOut: () => Promise<void>;
50
+ done: () => void;
51
+ shouldMigrateAnonymousAccount: () => Promise<boolean>;
52
+ /**
53
+ * Authenticates the user with the given credentials
54
+ */
55
+ authenticate: (credentials: AuthCredentials) => Promise<void>;
56
+ register: (accountSecret: AgentSecret, creationProps: {
57
+ name: string;
58
+ }) => Promise<import("../internal.js").ID<Acc>>;
59
+ private handleAnonymousAccountMigration;
60
+ listeners: Set<() => void>;
61
+ subscribe: (callback: () => void) => () => void;
62
+ notify(): void;
63
+ }
64
+ export {};
65
+ //# sourceMappingURL=ContextManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContextManager.d.ts","sourceRoot":"","sources":["../../src/implementation/ContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAmB,MAAM,QAAQ,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAkB,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,eAAe,CAAC,EAAE;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,aAAa,EAAE;YAAE,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C;;IAMpD,UAAU,IAAI,OAAO;IAIf,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,EAAE,2BAA2B;IAwB/D,aAAa,CACjB,KAAK,EAAE,CAAC,EACR,SAAS,CAAC,EAAE,2BAA2B,GACtC,OAAO,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;IAMlC,aAAa,CACjB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,uBAAuB,CAAC,GAAG,CAAC,EACrC,SAAS,CAAC,EAAE,2BAA2B;IA2BzC,YAAY,CAAC,KAAK,EAAE,CAAC;IAKrB,eAAe;IAIf,oBAAoB;IAIpB,MAAM,sBAQJ;IAEF,IAAI,aAMF;IAEF,6BAA6B,yBAU3B;IAEF;;OAEG;IACH,YAAY,gBAAuB,eAAe,mBAiBhD;IAEF,QAAQ,kBACS,WAAW,iBACX;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,+CA6B/B;YAEY,+BAA+B;IA2C7C,SAAS,YAAiB,IAAI,EAAI;IAClC,SAAS,aAAc,MAAM,IAAI,gBAM/B;IAEF,MAAM;CAKP"}
@@ -0,0 +1,12 @@
1
+ import type { Account } from "../coValues/account.js";
2
+ declare class ActiveAccountContext {
3
+ private activeAccount;
4
+ private guestMode;
5
+ set(account: Account | null): void;
6
+ setGuestMode(): void;
7
+ maybeGet(): Account | null;
8
+ get(): Account;
9
+ }
10
+ export type { ActiveAccountContext };
11
+ export declare const activeAccountContext: ActiveAccountContext;
12
+ //# sourceMappingURL=activeAccountContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activeAccountContext.d.ts","sourceRoot":"","sources":["../../src/implementation/activeAccountContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,cAAM,oBAAoB;IACxB,OAAO,CAAC,aAAa,CAAwB;IAC7C,OAAO,CAAC,SAAS,CAAkB;IAEnC,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAK3B,YAAY;IAKZ,QAAQ;IAIR,GAAG;CAaJ;AAED,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAErC,eAAO,MAAM,oBAAoB,sBAA6B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { LocalNode } from "cojson";
2
+ export declare class AnonymousJazzAgent {
3
+ node: LocalNode;
4
+ _type: "Anonymous";
5
+ constructor(node: LocalNode);
6
+ }
7
+ //# sourceMappingURL=anonymousJazzAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anonymousJazzAgent.d.ts","sourceRoot":"","sources":["../../src/implementation/anonymousJazzAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,qBAAa,kBAAkB;IAEV,IAAI,EAAE,SAAS;IADlC,KAAK,cAAwB;gBACV,IAAI,EAAE,SAAS;CACnC"}
@@ -0,0 +1,91 @@
1
+ import { AgentSecret, CryptoProvider, LocalNode, Peer, RawAccountID, SessionID } from "cojson";
2
+ import { AuthSecretStorage } from "../auth/AuthSecretStorage.js";
3
+ import { type Account, type AccountClass } from "../coValues/account.js";
4
+ import type { ID } from "../internal.js";
5
+ import { AuthCredentials, NewAccountProps } from "../types.js";
6
+ import { AnonymousJazzAgent } from "./anonymousJazzAgent.js";
7
+ export type Credentials = {
8
+ accountID: ID<Account>;
9
+ secret: AgentSecret;
10
+ };
11
+ type SessionProvider = (accountID: ID<Account>, crypto: CryptoProvider) => Promise<{
12
+ sessionID: SessionID;
13
+ sessionDone: () => void;
14
+ }>;
15
+ export type AuthResult = {
16
+ type: "existing";
17
+ username?: string;
18
+ credentials: Credentials;
19
+ saveCredentials?: (credentials: Credentials) => Promise<void>;
20
+ onSuccess: () => void;
21
+ onError: (error: string | Error) => void;
22
+ logOut: () => Promise<void>;
23
+ } | {
24
+ type: "new";
25
+ creationProps: {
26
+ name: string;
27
+ anonymous?: boolean;
28
+ other?: Record<string, unknown>;
29
+ };
30
+ initialSecret?: AgentSecret;
31
+ saveCredentials: (credentials: Credentials) => Promise<void>;
32
+ onSuccess: () => void;
33
+ onError: (error: string | Error) => void;
34
+ logOut: () => Promise<void>;
35
+ };
36
+ export declare function randomSessionProvider(accountID: ID<Account>, crypto: CryptoProvider): Promise<{
37
+ sessionID: `${RawAccountID}_session_z${string}` | `sealer_z${string}/signer_z${string}_session_z${string}`;
38
+ sessionDone: () => void;
39
+ }>;
40
+ export type JazzContextWithAccount<Acc extends Account> = {
41
+ node: LocalNode;
42
+ account: Acc;
43
+ done: () => void;
44
+ logOut: () => Promise<void>;
45
+ };
46
+ export type JazzContextWithAgent = {
47
+ agent: AnonymousJazzAgent;
48
+ done: () => void;
49
+ logOut: () => Promise<void>;
50
+ };
51
+ export type JazzContext<Acc extends Account> = JazzContextWithAccount<Acc> | JazzContextWithAgent;
52
+ export declare function createJazzContextFromExistingCredentials<Acc extends Account>({ credentials, peersToLoadFrom, crypto, AccountSchema: PropsAccountSchema, sessionProvider, onLogOut, }: {
53
+ credentials: Credentials;
54
+ peersToLoadFrom: Peer[];
55
+ crypto: CryptoProvider;
56
+ AccountSchema?: AccountClass<Acc>;
57
+ sessionProvider: SessionProvider;
58
+ onLogOut?: () => void;
59
+ }): Promise<JazzContextWithAccount<Acc>>;
60
+ export declare function createJazzContextForNewAccount<Acc extends Account>({ creationProps, initialAgentSecret, peersToLoadFrom, crypto, AccountSchema: PropsAccountSchema, onLogOut, }: {
61
+ creationProps: {
62
+ name: string;
63
+ };
64
+ initialAgentSecret?: AgentSecret;
65
+ peersToLoadFrom: Peer[];
66
+ crypto: CryptoProvider;
67
+ AccountSchema?: AccountClass<Acc>;
68
+ onLogOut?: () => Promise<void>;
69
+ }): Promise<JazzContextWithAccount<Acc>>;
70
+ export declare function createJazzContext<Acc extends Account>(options: {
71
+ credentials?: AuthCredentials;
72
+ newAccountProps?: NewAccountProps;
73
+ peersToLoadFrom: Peer[];
74
+ crypto: CryptoProvider;
75
+ defaultProfileName?: string;
76
+ AccountSchema?: AccountClass<Acc>;
77
+ sessionProvider: SessionProvider;
78
+ authSecretStorage: AuthSecretStorage;
79
+ }): Promise<{
80
+ authSecretStorage: AuthSecretStorage;
81
+ node: LocalNode;
82
+ account: Acc;
83
+ done: () => void;
84
+ logOut: () => Promise<void>;
85
+ }>;
86
+ export declare function createAnonymousJazzContext({ peersToLoadFrom, crypto, }: {
87
+ peersToLoadFrom: Peer[];
88
+ crypto: CryptoProvider;
89
+ }): Promise<JazzContextWithAgent>;
90
+ export {};
91
+ //# sourceMappingURL=createContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createContext.d.ts","sourceRoot":"","sources":["../../src/implementation/createContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGX,cAAc,EACd,SAAS,EACT,IAAI,EAEJ,YAAY,EACZ,SAAS,EACV,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEzE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,KAAK,eAAe,GAAG,CACrB,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,EACtB,MAAM,EAAE,cAAc,KACnB,OAAO,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,WAAW,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAAC;AAEhE,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,UAAU,C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C;IAClC,eAAe,EAAE,IAAI,EAAE,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;;UAvIO,SAAS;;UAET,MAAM,IAAI;YACR,MAAM,OAAO,CAAC,IAAI,CAAC;GAiM5B;AAED,wBAAsB,0BAA0B,CAAC,EAC/C,eAAe,EACf,MAAM,GACP,EAAE;IACD,eAAe,EAAE,IAAI,EAAE,CAAC;IACxB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqBhC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=devtoolsFormatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtoolsFormatters.d.ts","sourceRoot":"","sources":["../../src/implementation/devtoolsFormatters.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export type UnavailableError = "unavailable";
2
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/implementation/errors.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const inspect: unique symbol;
2
+ export type inspect = typeof inspect;
3
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/implementation/inspect.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,eAA2C,CAAC;AAChE,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type InviteSecret } from "cojson";
2
+ import { Account } from "../coValues/account.js";
3
+ import type { CoValue, CoValueClass, ID } from "../internal.js";
4
+ /** @category Invite Links */
5
+ export declare function createInviteLink<C extends CoValue>(value: C, role: "reader" | "writer" | "admin" | "writeOnly", baseURL: string, valueHint?: string): string;
6
+ /** @category Invite Links */
7
+ export declare function parseInviteLink<C extends CoValue>(inviteURL: string): {
8
+ valueID: ID<C>;
9
+ valueHint?: string;
10
+ inviteSecret: InviteSecret;
11
+ } | undefined;
12
+ /** @category Invite Links */
13
+ export declare function consumeInviteLink<V extends CoValue>({ inviteURL, as, forValueHint, invitedObjectSchema, }: {
14
+ inviteURL: string;
15
+ as?: Account;
16
+ forValueHint?: string;
17
+ invitedObjectSchema: CoValueClass<V>;
18
+ }): Promise<{
19
+ valueID: ID<V>;
20
+ valueHint?: string;
21
+ inviteSecret: InviteSecret;
22
+ } | undefined>;
23
+ //# sourceMappingURL=invites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invites.d.ts","sourceRoot":"","sources":["../../src/implementation/invites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,QAAQ,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEhE,6BAA6B;AAC7B,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,OAAO,EAChD,KAAK,EAAE,CAAC,EACR,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,EACjD,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAoBR;AAED,6BAA6B;AAC7B,wBAAgB,eAAe,CAAC,CAAC,SAAS,OAAO,EAC/C,SAAS,EAAE,MAAM,GAEf;IACE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,GACD,SAAS,CAuBZ;AAED,6BAA6B;AAC7B,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,EACnD,SAAS,EACT,EAAoB,EACpB,YAAY,EACZ,mBAAmB,GACpB,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACtC,GAAG,OAAO,CACP;IACE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC5B,GACD,SAAS,CACZ,CAcA"}
@@ -0,0 +1,21 @@
1
+ import { type Account } from "../coValues/account.js";
2
+ import type { AnonymousJazzAgent, CoValue, ID, RefEncoded, UnCo } from "../internal.js";
3
+ export declare class Ref<out V extends CoValue> {
4
+ readonly id: ID<V>;
5
+ readonly controlledAccount: Account | AnonymousJazzAgent;
6
+ readonly schema: RefEncoded<V>;
7
+ constructor(id: ID<V>, controlledAccount: Account | AnonymousJazzAgent, schema: RefEncoded<V>);
8
+ get value(): V | null;
9
+ private loadHelper;
10
+ syncLoad(): V | undefined;
11
+ load(): Promise<V | undefined>;
12
+ accessFrom(fromScopeValue: CoValue, key: string | number | symbol): V | null;
13
+ }
14
+ export declare function makeRefs<Keys extends string | number>(getIdForKey: (key: Keys) => ID<CoValue> | undefined, getKeysWithIds: () => Keys[], controlledAccount: Account | AnonymousJazzAgent, refSchemaForKey: (key: Keys) => RefEncoded<CoValue>): {
15
+ [K in Keys]: Ref<CoValue>;
16
+ } & {
17
+ [Symbol.iterator]: () => IterableIterator<Ref<CoValue>>;
18
+ length: number;
19
+ };
20
+ export type RefIfCoValue<V> = NonNullable<V> extends CoValue ? Ref<UnCo<NonNullable<V>>> : never;
21
+ //# sourceMappingURL=refs.d.ts.map
@@ -0,0 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AAC,EAAE,MAAM,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC;CAChB,CA8CA;AAED,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,SAAS,OAAO,GACxD,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,GACzB,KAAK,CAAC"}
@@ -0,0 +1,72 @@
1
+ import type { JsonValue, RawCoValue } from "cojson";
2
+ import { CojsonInternalTypes } from "cojson";
3
+ import { type CoValue, type CoValueClass, ItemsSym, JazzToolsSymbol } from "../internal.js";
4
+ /** @category Schema definition */
5
+ export declare const Encoders: {
6
+ Date: {
7
+ encode: (value: Date) => string;
8
+ decode: (value: JsonValue) => Date;
9
+ };
10
+ OptionalDate: {
11
+ encode: (value: Date | undefined) => string | null;
12
+ decode: (value: JsonValue) => Date | undefined;
13
+ };
14
+ };
15
+ export type CoMarker = {
16
+ readonly __co: unique symbol;
17
+ };
18
+ /** @category Schema definition */
19
+ export type co<T> = T | (T & CoMarker);
20
+ export type IfCo<C, R> = C extends infer _A | infer B ? B extends CoMarker ? R extends JazzToolsSymbol ? never : R : never : never;
21
+ export type UnCo<T> = T extends co<infer A> ? A : T;
22
+ /** @category Schema definition */
23
+ export declare const co: {
24
+ string: co<string>;
25
+ number: co<number>;
26
+ boolean: co<boolean>;
27
+ null: co<null>;
28
+ Date: co<Date>;
29
+ literal<T extends (string | number | boolean)[]>(..._lit: T): co<T[number]>;
30
+ json<T extends CojsonInternalTypes.CoJsonValue<T>>(): co<T>;
31
+ encoded<T>(arg: Encoder<T>): co<T>;
32
+ ref: typeof ref;
33
+ items: ItemsSym;
34
+ optional: {
35
+ ref: typeof optionalRef;
36
+ json<T extends CojsonInternalTypes.CoJsonValue<T>>(): co<T | undefined>;
37
+ encoded<T>(arg: OptionalEncoder<T>): co<T | undefined>;
38
+ string: co<string | undefined>;
39
+ number: co<number | undefined>;
40
+ boolean: co<boolean | undefined>;
41
+ null: co<null | undefined>;
42
+ Date: co<Date | undefined>;
43
+ literal<T extends (string | number | boolean)[]>(..._lit: T): co<T[number] | undefined>;
44
+ };
45
+ };
46
+ declare function optionalRef<C extends CoValueClass>(arg: C | ((_raw: InstanceType<C>["_raw"]) => C)): co<InstanceType<C> | null | undefined>;
47
+ declare function ref<C extends CoValueClass>(arg: C | ((_raw: InstanceType<C>["_raw"]) => C), options?: never): co<InstanceType<C> | null>;
48
+ declare function ref<C extends CoValueClass>(arg: C | ((_raw: InstanceType<C>["_raw"]) => C), options: {
49
+ optional: true;
50
+ }): co<InstanceType<C> | null | undefined>;
51
+ export type JsonEncoded = "json";
52
+ export type EncodedAs<V> = {
53
+ encoded: Encoder<V> | OptionalEncoder<V>;
54
+ };
55
+ export type RefEncoded<V extends CoValue> = {
56
+ ref: CoValueClass<V> | ((raw: RawCoValue) => CoValueClass<V>);
57
+ optional: boolean;
58
+ };
59
+ export declare function isRefEncoded<V extends CoValue>(schema: Schema): schema is RefEncoded<V>;
60
+ export declare function instantiateRefEncoded<V extends CoValue>(schema: RefEncoded<V>, raw: RawCoValue): V;
61
+ export type Schema = JsonEncoded | RefEncoded<CoValue> | EncodedAs<any>;
62
+ export type SchemaFor<Field> = NonNullable<Field> extends CoValue ? RefEncoded<NonNullable<Field>> : NonNullable<Field> extends JsonValue ? JsonEncoded : EncodedAs<NonNullable<Field>>;
63
+ export type Encoder<V> = {
64
+ encode: (value: V) => JsonValue;
65
+ decode: (value: JsonValue) => V;
66
+ };
67
+ export type OptionalEncoder<V> = Encoder<V> | {
68
+ encode: (value: V | undefined) => JsonValue;
69
+ decode: (value: JsonValue) => V | undefined;
70
+ };
71
+ export {};
72
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/implementation/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UA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AAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC;IAChC,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,CAAC;CACjC,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,CAAC,IACzB,OAAO,CAAC,CAAC,CAAC,GACV;IACE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,KAAK,SAAS,CAAC;IAC5C,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS,CAAC;CAC7C,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { RawCoValue } from "cojson";
2
+ import { type Account } from "../coValues/account.js";
3
+ import type { AnonymousJazzAgent, CoValue, CoValueClass, CoValueFromRaw, ID } from "../internal.js";
4
+ export declare const subscriptionsScopes: WeakMap<CoValue, SubscriptionScope<any>>;
5
+ export declare class SubscriptionScope<Root extends CoValue> {
6
+ scopeID: string;
7
+ subscriber: Account | AnonymousJazzAgent;
8
+ entries: Map<ID<CoValue>, {
9
+ state: "loading";
10
+ immediatelyUnsub?: boolean;
11
+ } | {
12
+ state: "loaded";
13
+ rawUnsub: () => void;
14
+ }>;
15
+ rootEntry: {
16
+ state: "loaded";
17
+ value: RawCoValue;
18
+ rawUnsub: () => void;
19
+ };
20
+ scheduleUpdate: () => void;
21
+ scheduledUpdate: boolean;
22
+ cachedValues: {
23
+ [id: ID<CoValue>]: CoValue;
24
+ };
25
+ parents: {
26
+ [id: ID<CoValue>]: Set<ID<CoValue>>;
27
+ };
28
+ constructor(root: Root, rootSchema: CoValueClass<Root> & CoValueFromRaw<Root>, onUpdate: (newRoot: Root, scope: SubscriptionScope<Root>) => void);
29
+ onRefAccessedOrSet(fromId: ID<CoValue>, accessedOrSetId: ID<CoValue> | undefined): void;
30
+ invalidate(id: ID<CoValue>, fromChild?: ID<CoValue>, seen?: Set<ID<CoValue>>): void;
31
+ unsubscribeAll: () => void;
32
+ }
33
+ //# sourceMappingURL=subscriptionScope.d.ts.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,CAAC,EACnB,eAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,SAAS;IA4C1C,UAAU,CACR,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EACf,SAAS,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EACvB,IAAI,GAAE,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,CAAa;IAYpC,cAAc,aASZ;CACH"}
@@ -0,0 +1,8 @@
1
+ export type JazzToolsSymbol = SchemaInit | ItemsSym | MembersSym;
2
+ export declare const SchemaInit = "$SchemaInit$";
3
+ export type SchemaInit = typeof SchemaInit;
4
+ export declare const ItemsSym = "$items$";
5
+ export type ItemsSym = typeof ItemsSym;
6
+ export declare const MembersSym = "$members$";
7
+ export type MembersSym = typeof MembersSym;
8
+ //# sourceMappingURL=symbols.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbols.d.ts","sourceRoot":"","sources":["../../src/implementation/symbols.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE,eAAO,MAAM,UAAU,iBAAiB,CAAC;AACzC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC;AAE3C,eAAO,MAAM,QAAQ,YAAY,CAAC;AAClC,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC;AAEvC,eAAO,MAAM,UAAU,cAAc,CAAC;AACtC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./exports.js";
2
+ export { MAX_RECOMMENDED_TX_SIZE, cojsonInternals } from "cojson";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC"}
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  parseInviteLink,
36
36
  randomSessionProvider,
37
37
  subscribeToCoValue
38
- } from "./chunk-5YDDEUNX.js";
38
+ } from "./chunk-RTRX7HIO.js";
39
39
 
40
40
  // src/index.ts
41
41
  import { MAX_RECOMMENDED_TX_SIZE, cojsonInternals } from "cojson";
@@ -0,0 +1,12 @@
1
+ export * from "./coValues/interfaces.js";
2
+ export * from "./implementation/inspect.js";
3
+ export * from "./implementation/symbols.js";
4
+ export * from "./coValues/deepLoading.js";
5
+ export * from "./implementation/anonymousJazzAgent.js";
6
+ export * from "./implementation/errors.js";
7
+ export * from "./implementation/refs.js";
8
+ export * from "./implementation/schema.js";
9
+ export * from "./implementation/subscriptionScope.js";
10
+ export * from "./implementation/createContext.js";
11
+ import "./implementation/devtoolsFormatters.js";
12
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AAEtD,cAAc,mCAAmC,CAAC;AAElD,OAAO,wCAAwC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { RawCoValue } from "cojson";
2
+ import { CoValue } from "../internal.js";
3
+ export declare const coValuesCache: {
4
+ get: <V extends CoValue>(raw: RawCoValue, compute: () => V) => V;
5
+ };
6
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/lib/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAIzC,eAAO,MAAM,aAAa;UAClB,CAAC,SAAS,OAAO,OAAO,UAAU,WAAW,MAAM,CAAC;CAS3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cache.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.test.d.ts","sourceRoot":"","sources":["../../src/lib/cache.test.ts"],"names":[],"mappings":""}