@cero-base/cero 0.8.6 → 0.8.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cero-base/cero",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "The ideal p2p API — everything is a handle, handles contain refs, refs contain rows.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -78,7 +78,7 @@
78
78
  "test": "ls test/*.test.js | xargs -P1 -n1 brittle-node"
79
79
  },
80
80
  "dependencies": {
81
- "@cero-base/core": "^0.8.6",
81
+ "@cero-base/core": "^0.8.7",
82
82
  "b4a": "^1.8.1",
83
83
  "bare-abort-controller": "^1.1.2",
84
84
  "bare-crypto": "^1.14.1",
package/src/index.js CHANGED
@@ -188,24 +188,25 @@ export async function restore(me, phrase) {
188
188
  })
189
189
  }
190
190
 
191
- Object.assign(cero, {
192
- t,
193
- put,
194
- set,
195
- get,
196
- del,
197
- count,
198
- watch,
199
- call,
200
- open,
201
- before,
202
- after,
203
- peek,
204
- restore,
205
- schema,
206
- bind,
207
- define
208
- })
191
+ // Facade: expose the operators + helpers as properties on `cero` too, so both
192
+ // `import { define }` and `cero.define(...)` work. Explicit assignments (not
193
+ // `Object.assign`) so tsc reflects them onto the `cero` namespace in the .d.ts.
194
+ cero.t = t
195
+ cero.put = put
196
+ cero.set = set
197
+ cero.get = get
198
+ cero.del = del
199
+ cero.count = count
200
+ cero.watch = watch
201
+ cero.call = call
202
+ cero.open = open
203
+ cero.before = before
204
+ cero.after = after
205
+ cero.peek = peek
206
+ cero.restore = restore
207
+ cero.schema = schema
208
+ cero.bind = bind
209
+ cero.define = define
209
210
  cero._internal = internal
210
211
  // A bare function is shorthand for a behavior-only extension: `{ setup: fn }`.
211
212
  // Accepts both `use(a, b)` and `use([a, b])` (and a mix) for easier composition.
package/types/index.d.ts CHANGED
@@ -26,6 +26,22 @@
26
26
  */
27
27
  export function cero(dir: string, spec: any, opts?: CeroOpts): Promise<Handle>;
28
28
  export namespace cero {
29
+ export { t };
30
+ export { put };
31
+ export { set };
32
+ export { get };
33
+ export { del };
34
+ export { count };
35
+ export { watch };
36
+ export { call };
37
+ export { open };
38
+ export { before };
39
+ export { after };
40
+ export { peek };
41
+ export { restore };
42
+ export { schema };
43
+ export { bind };
44
+ export { define };
29
45
  export { internal as _internal };
30
46
  export function use(...exts: any[]): number;
31
47
  }
@@ -97,6 +113,21 @@ export type CeroOpts = {
97
113
  recoveryTimeout?: number;
98
114
  };
99
115
  import { Handle } from './handle/index.js';
116
+ import { t } from './lib/spec.js';
117
+ import { put } from './lib/operators.js';
118
+ import { set } from './lib/operators.js';
119
+ import { get } from './lib/operators.js';
120
+ import { del } from './lib/operators.js';
121
+ import { count } from './lib/operators.js';
122
+ import { watch } from './lib/operators.js';
123
+ import { call } from './lib/operators.js';
124
+ import { open } from './lib/operators.js';
125
+ import { before } from './lib/operators.js';
126
+ import { after } from './lib/operators.js';
127
+ import { peek } from './lib/operators.js';
128
+ import { schema } from './lib/spec.js';
129
+ import { bind } from './lib/operators.js';
130
+ import { define } from './lib/operators.js';
100
131
  import { internal } from './lib/internal.js';
101
132
  import { Ref } from './handle/index.js';
102
133
  import { Local } from './local/index.js';