mindcache 1.0.1 → 2.0.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.
- package/dist/cloud/index.d.mts +45 -0
- package/dist/cloud/index.d.ts +45 -0
- package/dist/cloud/index.js +1313 -0
- package/dist/cloud/index.js.map +1 -0
- package/dist/cloud/index.mjs +1310 -0
- package/dist/cloud/index.mjs.map +1 -0
- package/dist/index-CFJtj3DL.d.mts +279 -0
- package/dist/index-CFJtj3DL.d.ts +279 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1303 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1299 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +36 -27
- package/LICENSE +0 -21
- package/README.md +0 -53
- package/lib/index.d.ts +0 -90
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -1030
- package/lib/index.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../index-CFJtj3DL.mjs';
|
|
2
|
+
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../index-CFJtj3DL.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connect a MindCache instance to the cloud for real-time sync.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { MindCache } from 'mindcache';
|
|
10
|
+
* import { connectCloud } from 'mindcache/cloud';
|
|
11
|
+
*
|
|
12
|
+
* const mc = new MindCache();
|
|
13
|
+
* const adapter = connectCloud(mc, {
|
|
14
|
+
* projectId: 'my-project',
|
|
15
|
+
* instanceId: 'main',
|
|
16
|
+
* apiKey: 'mc_live_xxxxx'
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // Now mc is synced with the cloud!
|
|
20
|
+
* mc.set_value('name', 'Alice');
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function connectCloud(mc: MindCache, config: CloudConfig): CloudAdapter;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new MindCache instance that's already connected to the cloud.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { createCloudMindCache } from 'mindcache/cloud';
|
|
30
|
+
*
|
|
31
|
+
* const mc = createCloudMindCache({
|
|
32
|
+
* projectId: 'my-project',
|
|
33
|
+
* instanceId: 'main',
|
|
34
|
+
* apiKey: 'mc_live_xxxxx'
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Ready to use with cloud sync!
|
|
38
|
+
* mc.set_value('name', 'Alice');
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare function createCloudMindCache(config: CloudConfig): MindCache & {
|
|
42
|
+
adapter: CloudAdapter;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { CloudAdapter, CloudConfig, connectCloud, createCloudMindCache };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../index-CFJtj3DL.js';
|
|
2
|
+
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../index-CFJtj3DL.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Connect a MindCache instance to the cloud for real-time sync.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { MindCache } from 'mindcache';
|
|
10
|
+
* import { connectCloud } from 'mindcache/cloud';
|
|
11
|
+
*
|
|
12
|
+
* const mc = new MindCache();
|
|
13
|
+
* const adapter = connectCloud(mc, {
|
|
14
|
+
* projectId: 'my-project',
|
|
15
|
+
* instanceId: 'main',
|
|
16
|
+
* apiKey: 'mc_live_xxxxx'
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // Now mc is synced with the cloud!
|
|
20
|
+
* mc.set_value('name', 'Alice');
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare function connectCloud(mc: MindCache, config: CloudConfig): CloudAdapter;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new MindCache instance that's already connected to the cloud.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { createCloudMindCache } from 'mindcache/cloud';
|
|
30
|
+
*
|
|
31
|
+
* const mc = createCloudMindCache({
|
|
32
|
+
* projectId: 'my-project',
|
|
33
|
+
* instanceId: 'main',
|
|
34
|
+
* apiKey: 'mc_live_xxxxx'
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Ready to use with cloud sync!
|
|
38
|
+
* mc.set_value('name', 'Alice');
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
declare function createCloudMindCache(config: CloudConfig): MindCache & {
|
|
42
|
+
adapter: CloudAdapter;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export { CloudAdapter, CloudConfig, connectCloud, createCloudMindCache };
|