@graffy/core 0.16.20-alpha.7 → 0.16.20-alpha.8

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 (2) hide show
  1. package/package.json +3 -3
  2. package/types/index.d.ts +15 -9
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/core",
3
3
  "description": "The main module for Graffy, a library for intuitive real-time data APIs.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.16.20-alpha.7",
5
+ "version": "0.16.20-alpha.8",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
- "@graffy/common": "0.16.20-alpha.7",
20
- "@graffy/stream": "0.16.20-alpha.7",
19
+ "@graffy/common": "0.16.20-alpha.8",
20
+ "@graffy/stream": "0.16.20-alpha.8",
21
21
  "debug": "^4.3.7"
22
22
  }
23
23
  }
package/types/index.d.ts CHANGED
@@ -7,7 +7,11 @@ export type AnyObject = Record<string, any>;
7
7
  type AnyFunction = (...args: any[]) => any;
8
8
 
9
9
  // biome-ignore lint/suspicious/noExplicitAny: Keys can be anything.
10
- type Key = any;
10
+ export type Key = any;
11
+ export type RangeKey =
12
+ | { $all: boolean }
13
+ | { $first: number }
14
+ | { $last: number };
11
15
 
12
16
  // biome-ignore lint/suspicious/noExplicitAny: Any value is for results.
13
17
  type AnyValue = any;
@@ -36,14 +40,16 @@ export default class Graffy<S> {
36
40
  options?: GraffyReadOptions,
37
41
  ): Promise<ReadResult<S, Q>>;
38
42
 
39
- // Generic one, when the path is not known at compile time.
40
- // Should we have this?
41
- //
42
- // read<Q extends AnyProjection>(
43
- // path: string | Key[],
44
- // projection: Q,
45
- // options?: GraffyReadOptions,
46
- // ): Promise<BlindReadResult<Q>>;
43
+ // Generic mode, when the path is not known at compile time, but projection is.
44
+ read<Q extends AnyProjection>(
45
+ path: string | Key[],
46
+ projection: Q,
47
+ options?: GraffyReadOptions,
48
+ ): Promise<BlindReadResult<Q>>;
49
+
50
+ // Consider also:
51
+ // 1. Read when path is known at compile time but projection is not?
52
+ // 2. Read when neither path nor projection is known at compile time?
47
53
 
48
54
  on: AnyFunction;
49
55
  call: AnyFunction;