@effect-dynamodb/schema 1.36.0 → 1.37.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 (65) hide show
  1. package/dist/Aggregate.d.ts +19 -11
  2. package/dist/Aggregate.d.ts.map +1 -1
  3. package/dist/Aggregate.js.map +1 -1
  4. package/dist/DynamoModel.d.ts +9 -1
  5. package/dist/DynamoModel.d.ts.map +1 -1
  6. package/dist/DynamoModel.js.map +1 -1
  7. package/dist/DynamoSchema.d.ts +20 -0
  8. package/dist/DynamoSchema.d.ts.map +1 -1
  9. package/dist/DynamoSchema.js +14 -0
  10. package/dist/DynamoSchema.js.map +1 -1
  11. package/dist/Entity.d.ts +153 -21
  12. package/dist/Entity.d.ts.map +1 -1
  13. package/dist/Entity.js +102 -2
  14. package/dist/Entity.js.map +1 -1
  15. package/dist/Errors.d.ts +27 -0
  16. package/dist/Errors.d.ts.map +1 -1
  17. package/dist/Errors.js +24 -0
  18. package/dist/Errors.js.map +1 -1
  19. package/dist/KeyComposer.d.ts +165 -27
  20. package/dist/KeyComposer.d.ts.map +1 -1
  21. package/dist/KeyComposer.js +251 -22
  22. package/dist/KeyComposer.js.map +1 -1
  23. package/dist/ZOrder.d.ts +173 -0
  24. package/dist/ZOrder.d.ts.map +1 -0
  25. package/dist/ZOrder.js +39 -0
  26. package/dist/ZOrder.js.map +1 -0
  27. package/dist/index.d.ts +4 -2
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/AggregateEdges.d.ts +81 -12
  32. package/dist/internal/AggregateEdges.d.ts.map +1 -1
  33. package/dist/internal/AggregateEdges.js +17 -21
  34. package/dist/internal/AggregateEdges.js.map +1 -1
  35. package/dist/internal/AggregateTypes.d.ts +51 -2
  36. package/dist/internal/AggregateTypes.d.ts.map +1 -1
  37. package/dist/internal/CompositeCodec.d.ts +27 -12
  38. package/dist/internal/CompositeCodec.d.ts.map +1 -1
  39. package/dist/internal/CompositeCodec.js +93 -23
  40. package/dist/internal/CompositeCodec.js.map +1 -1
  41. package/dist/internal/EntityConfig.d.ts +12 -9
  42. package/dist/internal/EntityConfig.d.ts.map +1 -1
  43. package/dist/internal/EntityTypes.d.ts +77 -2
  44. package/dist/internal/EntityTypes.d.ts.map +1 -1
  45. package/dist/internal/KeyText136.d.ts +153 -0
  46. package/dist/internal/KeyText136.d.ts.map +1 -0
  47. package/dist/internal/KeyText136.js +357 -0
  48. package/dist/internal/KeyText136.js.map +1 -0
  49. package/dist/internal/NumericKey.d.ts +71 -0
  50. package/dist/internal/NumericKey.d.ts.map +1 -0
  51. package/dist/internal/NumericKey.js +128 -0
  52. package/dist/internal/NumericKey.js.map +1 -0
  53. package/dist/internal/SchemaAccessors.d.ts +6 -5
  54. package/dist/internal/SchemaAccessors.d.ts.map +1 -1
  55. package/dist/internal/SchemaAccessors.js +6 -5
  56. package/dist/internal/SchemaAccessors.js.map +1 -1
  57. package/dist/internal/ZOrderCurve.d.ts +256 -0
  58. package/dist/internal/ZOrderCurve.d.ts.map +1 -0
  59. package/dist/internal/ZOrderCurve.js +630 -0
  60. package/dist/internal/ZOrderCurve.js.map +1 -0
  61. package/dist/internal/ZOrderDimension.d.ts +70 -0
  62. package/dist/internal/ZOrderDimension.d.ts.map +1 -0
  63. package/dist/internal/ZOrderDimension.js +283 -0
  64. package/dist/internal/ZOrderDimension.js.map +1 -0
  65. package/package.json +1 -1
@@ -0,0 +1,128 @@
1
+ /**
2
+ * @internal NumericKey — the key text of a `number` or `bigint` composite.
3
+ *
4
+ * DynamoDB compares sort keys as UTF-8 bytes, so the text must sort in numeric
5
+ * order. Up to 1.36 it was `String(n).padStart(16, "0")` (38 for a bigint),
6
+ * which only sorts non-negative integers below the pad width: `-3` came above
7
+ * `-5`, `10.5` below `3.14`, `1e-7` above `3`, and `1e+21` below `1e16`.
8
+ *
9
+ * `x` is a magnitude `|n|`; `W` is 16 for a number and 38 for a bigint.
10
+ *
11
+ * | value | text | e.g. |
12
+ * |---|---|---|
13
+ * | `0` (and `-0`), integer `x < 10^W` | `pad_W(x)` — the 1.36 bytes | `0000000000000042` |
14
+ * | non-integer `x < 10^W` | `pad_W(int) "." frac` | `0000000000000003.14` |
15
+ * | `x ≥ 10^W` | `":" eee digits` | `:0161` (1e16), `:02112345` (1.2345e21) |
16
+ * | negative, `x < 10^W` | `"-" ~pad_W(int) ["." ~frac] ":"` | `-9999999999999996.85:` (-3.14) |
17
+ * | negative, `x ≥ 10^W` | `"-*" ~eee ~digits ":"` | `-*9838:` (-1e16) |
18
+ * | `Infinity` / `-Infinity` | `";"` / `"-)"` | |
19
+ *
20
+ * `frac` is the fraction digits of the number's shortest round-trip decimal
21
+ * (`String(n)`, written out without an exponent), so `0.1` is `.1`, not the
22
+ * binary value's 55 digits; distinct doubles keep distinct, ordered decimals.
23
+ * `eee` is the 3-digit decimal exponent and `digits` the significant digits
24
+ * without trailing zeros. `~` is the 9's complement of each digit (`.` kept).
25
+ *
26
+ * Why it sorts: within one form, equal-width digit strings compare digit by
27
+ * digit, and a shorter fraction is a prefix of the longer (`3` < `3.14`, since
28
+ * the composed key continues with `#` or ends, both below `.`). Across forms
29
+ * the leading byte decides: `-` < digits < `:` < `;`, and under `-`,
30
+ * `)` < `*` < digits. Negatives complement the magnitude, which reverses its
31
+ * order, and end in `:` (above every digit and `.`) so that, of two negatives
32
+ * where one magnitude's text is a prefix of the other's (`3` and `3.1`), the
33
+ * shorter — the larger value — sorts last.
34
+ *
35
+ * Every byte is above the key delimiter `#` and none is a letter, so casing
36
+ * never changes the text and a composite's text is never cut by `#`.
37
+ *
38
+ * `NaN` has no order and is refused (`[EDD-9096]`, {@link KeyValueError}), as
39
+ * is a bigint of more than 1,000 digits (past the 3-digit exponent).
40
+ *
41
+ * Not part of the public API.
42
+ */
43
+ import { Data, Predicate } from "effect";
44
+ /**
45
+ * A value key composition can't place in sort order: `NaN`, or a bigint of
46
+ * more than 1,000 digits. Thrown synchronously by `serializeValue`; the write
47
+ * paths turn it into a `ValidationError`.
48
+ */
49
+ export class KeyValueError extends Data.TaggedError("KeyValueError") {
50
+ }
51
+ /**
52
+ * Is `u` a {@link KeyValueError}? By its tag, not `instanceof`: two copies of
53
+ * this package (a consumer's and `effect-dynamodb`'s) still agree.
54
+ */
55
+ export const isKeyValueError = (u) => Predicate.isTagged(u, "KeyValueError");
56
+ const refuse = (value, shown, reason) => {
57
+ throw new KeyValueError({
58
+ value,
59
+ reason,
60
+ message: `[EDD-9096] ${shown} can't be composed into a key: ${reason}. ` +
61
+ `Key text must sort in the value's order, and this value has no place in it.`,
62
+ });
63
+ };
64
+ /** Pad width of a `number`'s integer part: the 1.36 width, covering `Number.MAX_SAFE_INTEGER`. */
65
+ const NUMBER_WIDTH = 16;
66
+ /** Pad width of a `bigint`: the 1.36 width, DynamoDB's 38 digits of precision. */
67
+ const BIGINT_WIDTH = 38;
68
+ /** The largest exponent the 3-digit field holds (a `number` reaches 308). */
69
+ const MAX_EXPONENT = 999;
70
+ const POSITIVE_INFINITY = ";";
71
+ const NEGATIVE_INFINITY = "-)";
72
+ /**
73
+ * The shortest round-trip decimal of a positive finite double as significant
74
+ * `digits` (no leading or trailing zeros) and `point`, the number of digits
75
+ * before the decimal point: `x = 0.<digits> × 10^point`. `3.14` is
76
+ * `{ digits: "314", point: 1 }`, `1e-7` is `{ digits: "1", point: -6 }`.
77
+ */
78
+ const decimalOf = (x) => {
79
+ const [mantissa = "", exponent = "0"] = String(x).split("e");
80
+ const [int = "", frac = ""] = mantissa.split(".");
81
+ const all = `${int}${frac}`;
82
+ const significant = all.replace(/^0+/, "");
83
+ return {
84
+ digits: significant.replace(/0+$/, ""),
85
+ point: int.length + Number(exponent) - (all.length - significant.length),
86
+ };
87
+ };
88
+ /** The text of a non-zero magnitude `0.<digits> × 10^point` at pad width `width`. */
89
+ const magnitude = (digits, point, width) => {
90
+ if (point > width)
91
+ return `:${String(point - 1).padStart(3, "0")}${digits}`;
92
+ const int = point <= 0 ? "" : digits.slice(0, point).padEnd(point, "0");
93
+ const frac = `${"0".repeat(Math.max(0, -point))}${digits.slice(Math.max(0, point))}`;
94
+ return `${int.padStart(width, "0")}${frac === "" ? "" : `.${frac}`}`;
95
+ };
96
+ /** 9's complement of every digit; anything else (`.`) is kept. */
97
+ const complement = (text) => text.replace(/[0-9]/g, (digit) => String(9 - Number(digit)));
98
+ /** The text of `-x` from the text of magnitude `x`. */
99
+ const negate = (text) => text.startsWith(":") ? `-*${complement(text.slice(1))}:` : `-${complement(text)}:`;
100
+ /** The key text of a `number`. Throws {@link KeyValueError} (`[EDD-9096]`) for `NaN`. */
101
+ export const encodeNumber = (n) => {
102
+ if (Number.isNaN(n))
103
+ return refuse(n, "NaN", "NaN has no numeric order");
104
+ if (n === Number.POSITIVE_INFINITY)
105
+ return POSITIVE_INFINITY;
106
+ if (n === Number.NEGATIVE_INFINITY)
107
+ return NEGATIVE_INFINITY;
108
+ if (n === 0)
109
+ return "0".repeat(NUMBER_WIDTH);
110
+ const { digits, point } = decimalOf(Math.abs(n));
111
+ const text = magnitude(digits, point, NUMBER_WIDTH);
112
+ return n < 0 ? negate(text) : text;
113
+ };
114
+ /**
115
+ * The key text of a `bigint`. Throws {@link KeyValueError} (`[EDD-9096]`) past
116
+ * 1,000 digits.
117
+ */
118
+ export const encodeBigInt = (n) => {
119
+ if (n === 0n)
120
+ return "0".repeat(BIGINT_WIDTH);
121
+ const abs = (n < 0n ? -n : n).toString();
122
+ if (abs.length - 1 > MAX_EXPONENT) {
123
+ return refuse(n, `A ${abs.length}-digit bigint`, "the key encoding holds at most 1,000 digits");
124
+ }
125
+ const text = magnitude(abs.replace(/0+$/, ""), abs.length, BIGINT_WIDTH);
126
+ return n < 0n ? negate(text) : text;
127
+ };
128
+ //# sourceMappingURL=NumericKey.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericKey.js","sourceRoot":"","sources":["../../src/internal/NumericKey.ts"],"names":[],"mappings":"AA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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;IACxC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,GAAG,YAAY,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,MAAM,eAAe,EAAE,6CAA6C,CAAC,CAAA;IACjG,CAAC;IACD,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;IACxE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AACrC,CAAC,CAAA"}
@@ -115,11 +115,12 @@ export declare const hasEncodingTransformation: (schema: Schema.Top) => boolean;
115
115
  * **Encoded** side is a `string`.
116
116
  *
117
117
  * This is the one shape where key composition must use the Type value rather
118
- * than the encoded one: `KeyComposer.serializeValue` zero-pads numbers and
119
- * bigints so they sort correctly, but treats a string as text. Composing
120
- * `Schema.BigIntFromString`'s encoded `"42"` therefore stored `txn_42` next to
121
- * `txn_100` and `txn_5`, which sorts as 100 < 42 < 5 — a range query returned
122
- * the wrong rows. Composing the Type value `42n` pads it instead.
118
+ * than the encoded one: `KeyComposer.serializeValue` encodes numbers and
119
+ * bigints so their key text sorts in numeric order, but treats a string as
120
+ * text. Composing `Schema.BigIntFromString`'s encoded `"42"` therefore stored
121
+ * `txn_42` next to `txn_100` and `txn_5`, which sorts as 100 < 42 < 5 — a
122
+ * range query returned the wrong rows. Composing the Type value `42n` encodes
123
+ * it instead.
123
124
  *
124
125
  * `SchemaAST.toType` / `toEncoded` are Effect's public AST projections; the
125
126
  * `SchemaAST.test.ts` canary pins the tags this reads.
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaAccessors.d.ts","sourceRoot":"","sources":["../../src/internal/SchemaAccessors.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;AAEnC;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,SAAS,CAAC,GAAG,GAAG,SAAS,KAC7B,SAAS,CAAC,GAAG,GAAG,SAIlB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,CAAC,GAAG,KAAG,QAAQ,GAAG,QAAQ,GAAG,SAS5E,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,qBAAqB,GAAI,KAAK,SAAS,CAAC,GAAG,KAAG,SAAS,CAAC,GAAG,GAAG,SAK1E,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,MAAM,CAAC,GAAG,KAAG,OAC5B,CAAA;AAEnC;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,6BAA6B,GAAI,QAAQ,MAAM,CAAC,GAAG,KAAG,OAMlE,CAAA"}
@@ -194,11 +194,12 @@ export const hasEncodingTransformation = (schema) => schema.ast.encoding !== und
194
194
  * **Encoded** side is a `string`.
195
195
  *
196
196
  * This is the one shape where key composition must use the Type value rather
197
- * than the encoded one: `KeyComposer.serializeValue` zero-pads numbers and
198
- * bigints so they sort correctly, but treats a string as text. Composing
199
- * `Schema.BigIntFromString`'s encoded `"42"` therefore stored `txn_42` next to
200
- * `txn_100` and `txn_5`, which sorts as 100 < 42 < 5 — a range query returned
201
- * the wrong rows. Composing the Type value `42n` pads it instead.
197
+ * than the encoded one: `KeyComposer.serializeValue` encodes numbers and
198
+ * bigints so their key text sorts in numeric order, but treats a string as
199
+ * text. Composing `Schema.BigIntFromString`'s encoded `"42"` therefore stored
200
+ * `txn_42` next to `txn_100` and `txn_5`, which sorts as 100 < 42 < 5 — a
201
+ * range query returned the wrong rows. Composing the Type value `42n` encodes
202
+ * it instead.
202
203
  *
203
204
  * `SchemaAST.toType` / `toEncoded` are Effect's public AST projections; the
204
205
  * `SchemaAST.test.ts` canary pins the tags this reads.
@@ -1 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AcG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAkB,EAAW,EAAE,CACvE,MAAM,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAA;AAEnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAAkB,EAAW,EAAE;IAC3E,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC5C,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAClD,OAAO,CACL,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAC/F,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * @internal ZOrderCurve — the algebra behind Z-order sort keys (#171).
3
+ *
4
+ * A declared `sk.zorder` entry, resolved against its field (its kind and
5
+ * storage from the field's schema, `internal/ZOrderDimension.ts`), is bound
6
+ * per entity and field into a {@link BoundDimension}; the bound
7
+ * dimensions of one sort key form a {@link Layout}. This module owns:
8
+ *
9
+ * - quantization: a key-form value → its level (`BoundDimension.quantize`);
10
+ * - the MSB-aligned interleave of unequal widths, and its inverse;
11
+ * - the address as bytes (W bytes, big-endian, right-aligned);
12
+ * - boxes, cells and their relation, BIGMIN / LITMAX (Tropf–Herzog over the
13
+ * layout), the cell-descent `nextInBox` / `prevInBox`, and the capped range
14
+ * planner with gap merging;
15
+ * - prefix segments (length-prefixed, or a truncated FNV-1a-64), `succ`.
16
+ *
17
+ * Everything is a pure function over `bigint` and plain `Uint8Array`s — no
18
+ * Node builtins. Not part of the public API: the signatures and the stored
19
+ * layout stay free to change until the geo follow-up needs them.
20
+ */
21
+ import type { DimensionKind, DimensionSpec } from "../ZOrder.js";
22
+ /**
23
+ * How a dimension's field is stored, resolved from its schema at
24
+ * `Entity.make`. Decides how a key-form value becomes epoch milliseconds, and
25
+ * whether DynamoDB's comparison of the stored attribute agrees with the
26
+ * quantized order.
27
+ */
28
+ export type DimensionStorage =
29
+ /** Stored `N`; key form `number` / `bigint`. */
30
+ {
31
+ readonly _tag: "Number";
32
+ readonly numeric: "number" | "bigint";
33
+ }
34
+ /** Stored `S` (`NumberFromString`, `BigIntFromString`); key form `number` / `bigint`. */
35
+ | {
36
+ readonly _tag: "NumericString";
37
+ readonly numeric: "number" | "bigint";
38
+ }
39
+ /** Stored `N`: epoch milliseconds or seconds. */
40
+ | {
41
+ readonly _tag: "Epoch";
42
+ readonly unit: "epochMs" | "epochSeconds";
43
+ }
44
+ /** Stored `S`: a fixed-format UTC ISO string. */
45
+ | {
46
+ readonly _tag: "UtcIsoString";
47
+ }
48
+ /** Stored `S`: an ISO string with an offset or zone. */
49
+ | {
50
+ readonly _tag: "ZonedIsoString";
51
+ }
52
+ /** Stored `S` / `N` / `BOOL`, compared by equality. */
53
+ | {
54
+ readonly _tag: "Literal";
55
+ }
56
+ /** Stored `S`, raw UTF-8. */
57
+ | {
58
+ readonly _tag: "RawString";
59
+ };
60
+ /** A declared dimension bound to an entity's field. */
61
+ export interface BoundDimension {
62
+ readonly spec: DimensionSpec;
63
+ /** The model field name. */
64
+ readonly field: string;
65
+ readonly storage: DimensionStorage;
66
+ readonly bits: number;
67
+ readonly levels: bigint;
68
+ /** The level of a key-form value. Throws {@link ZOrderValueError} (`[EDD-9092]`). */
69
+ readonly quantize: (keyFormValue: unknown) => bigint;
70
+ }
71
+ declare const ZOrderValueError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
72
+ readonly _tag: "ZOrderValueError";
73
+ } & Readonly<A>;
74
+ /**
75
+ * A value a dimension can't quantize: `NaN`, an unparseable date, a value
76
+ * outside a `literals` list. Thrown synchronously by `quantize`; the write
77
+ * paths turn it into a `ValidationError`, `.within()` lets it throw.
78
+ */
79
+ export declare class ZOrderValueError extends ZOrderValueError_base<{
80
+ readonly field: string;
81
+ readonly value: unknown;
82
+ readonly reason: string;
83
+ /** Human-readable description, prefixed with `EDD-9092`. */
84
+ readonly message: string;
85
+ }> {
86
+ }
87
+ /**
88
+ * Is `u` a {@link ZOrderValueError}? By its tag, not `instanceof`: two copies
89
+ * of this package (a consumer's and `effect-dynamodb`'s) still agree.
90
+ */
91
+ export declare const isZOrderValueError: (u: unknown) => u is ZOrderValueError;
92
+ /** The number of levels a declaration maps values onto. */
93
+ export declare const levelsOf: (spec: DimensionSpec) => bigint;
94
+ /** UTF-8 bytes of `text`, as a plain `Uint8Array`. */
95
+ export declare const utf8: (text: string) => Uint8Array;
96
+ /**
97
+ * Epoch milliseconds of a date dimension's key-form value, read by its
98
+ * storage. A `DateTime` or `Date` (a domain value) is accepted as well.
99
+ * `NaN` when the value isn't a date.
100
+ */
101
+ export declare const epochMsOf: (storage: DimensionStorage, value: unknown) => number;
102
+ /** Bind a declaration to a field stored as `storage`. */
103
+ export declare const bindDimension: (spec: DimensionSpec, storage: DimensionStorage) => BoundDimension;
104
+ /** The widest dimension of each kind, in bits (`[EDD-9089]`). */
105
+ export declare const MAX_DIMENSION_BITS: Record<DimensionKind, number>;
106
+ /** The widest address, in bits: 64 bytes (`[EDD-9089]`). */
107
+ export declare const MAX_ADDRESS_BITS = 512;
108
+ /** The interleave of one sort key's bound dimensions. */
109
+ export interface Layout {
110
+ readonly dimensions: ReadonlyArray<BoundDimension>;
111
+ /** B: the address width in bits. */
112
+ readonly bits: number;
113
+ /** W = ceil(B / 8): the address width in bytes. */
114
+ readonly bytes: number;
115
+ /** Address bit j (0 = most significant) → its dimension and that dimension's bit (from LSB). */
116
+ readonly order: ReadonlyArray<{
117
+ readonly dim: number;
118
+ readonly bit: number;
119
+ }>;
120
+ /** Address bit j as a mask. */
121
+ readonly posMask: ReadonlyArray<bigint>;
122
+ /** Every address bit of dimension i. */
123
+ readonly dimMask: ReadonlyArray<bigint>;
124
+ /** The address bits of address bit j's dimension below it. */
125
+ readonly lowerOf: ReadonlyArray<bigint>;
126
+ }
127
+ /**
128
+ * Lay out `dimensions`: each one's most significant bit enters in the first
129
+ * round, so every dimension has coarse control near the top of the address,
130
+ * and declaration order breaks ties within a round.
131
+ */
132
+ export declare const makeLayout: (dimensions: ReadonlyArray<BoundDimension>) => Layout;
133
+ /** The address of one level per dimension. */
134
+ export declare const interleave: (layout: Layout, levels: ReadonlyArray<bigint>) => bigint;
135
+ /** The level per dimension of an address. */
136
+ export declare const deinterleave: (layout: Layout, z: bigint) => Array<bigint>;
137
+ /** `z` as `width` bytes, big-endian, right-aligned. Always a plain, non-empty `Uint8Array`. */
138
+ export declare const toBytes: (z: bigint, width: number) => Uint8Array;
139
+ /** The big-endian integer of `bytes`. */
140
+ export declare const fromBytes: (bytes: Uint8Array) => bigint;
141
+ /** An inclusive run of levels. */
142
+ export type Interval = readonly [bigint, bigint];
143
+ /** Per dimension, its sorted, disjoint intervals: a product of interval lists. */
144
+ export type Box = ReadonlyArray<ReadonlyArray<Interval>>;
145
+ /** Every address: each dimension's whole bit range, as {@link quantizeBounds} leaves an unbounded one. */
146
+ export declare const fullBox: (layout: Layout) => Box;
147
+ /** Is address `z` inside `box`? */
148
+ export declare const inBox: (layout: Layout, box: Box, z: bigint) => boolean;
149
+ /** The addresses sharing the top `d` bits: an axis-aligned sub-box. */
150
+ export interface Cell {
151
+ readonly d: number;
152
+ readonly zlo: bigint;
153
+ /** Per dimension, the levels the cell spans. */
154
+ readonly ranges: ReadonlyArray<Interval>;
155
+ }
156
+ export declare const rootCell: (layout: Layout) => Cell;
157
+ /** The cell's highest address. */
158
+ export declare const zhi: (layout: Layout, cell: Cell) => bigint;
159
+ /** The cell's two halves, in address order. */
160
+ export declare const split: (layout: Layout, cell: Cell) => readonly [Cell, Cell];
161
+ export type Relation = "disjoint" | "contained" | "partial";
162
+ /** How a cell meets a box. A partial cell always holds an in-box address. */
163
+ export declare const relate: (cell: Cell, box: Box) => Relation;
164
+ /**
165
+ * The smallest in-box address greater than `z`, for a single-interval box
166
+ * with corners `zmin` / `zmax` (Tropf–Herzog); `z` itself when it is in the
167
+ * box; `undefined` when no in-box address follows it.
168
+ */
169
+ export declare const bigmin: (layout: Layout, z: bigint, zmin: bigint, zmax: bigint) => bigint | undefined;
170
+ /**
171
+ * The largest in-box address less than `z`, for a single-interval box with
172
+ * corners `zmin` / `zmax`; `z` itself when it is in the box; `undefined` when
173
+ * no in-box address precedes it.
174
+ */
175
+ export declare const litmax: (layout: Layout, z: bigint, zmin: bigint, zmax: bigint) => bigint | undefined;
176
+ /** The box's low and high corners as addresses (its first interval per dimension). */
177
+ export declare const corners: (layout: Layout, box: Box) => {
178
+ readonly zmin: bigint;
179
+ readonly zmax: bigint;
180
+ };
181
+ /** The smallest in-box address at or after `z` (cell descent; any box). */
182
+ export declare const nextInBox: (layout: Layout, box: Box, z: bigint) => bigint | undefined;
183
+ /** The largest in-box address at or before `z` (cell descent; any box). */
184
+ export declare const prevInBox: (layout: Layout, box: Box, z: bigint) => bigint | undefined;
185
+ /** A run of addresses; `exact` when every address in it is in the box. */
186
+ export interface AddressRange {
187
+ readonly lo: bigint;
188
+ readonly hi: bigint;
189
+ readonly exact: boolean;
190
+ }
191
+ /** How far past `maxRanges` the merged count may grow before refinement stops. */
192
+ export declare const REFINE_FACTOR = 4;
193
+ /** The most partial cells one refinement level may hold. */
194
+ export declare const MAX_PLANNER_CELLS = 16384;
195
+ /**
196
+ * Cover `box` with at most `maxRanges` address ranges. Cells are refined level
197
+ * by level; contained cells become exact ranges, partial ones stay open until
198
+ * the merged count passes `refineFactor × maxRanges` (it can only grow, so
199
+ * the exact plan can't fit any more) or a level exceeds
200
+ * {@link MAX_PLANNER_CELLS}. Then the smallest gaps (in addresses; ties at the
201
+ * lowest address) are merged until the cap holds. `exact` when every range
202
+ * holds only in-box addresses.
203
+ */
204
+ export declare const plan: (layout: Layout, box: Box, maxRanges: number, refineFactor?: number) => {
205
+ readonly ranges: ReadonlyArray<AddressRange>;
206
+ readonly exact: boolean;
207
+ };
208
+ /** One dimension's bound, in key form. */
209
+ export type DimensionBound = {
210
+ readonly eq: unknown;
211
+ } | {
212
+ readonly between: readonly [unknown, unknown];
213
+ } | {
214
+ readonly in: ReadonlyArray<unknown>;
215
+ } | {
216
+ readonly gt?: unknown;
217
+ readonly gte?: unknown;
218
+ readonly lt?: unknown;
219
+ readonly lte?: unknown;
220
+ };
221
+ /**
222
+ * The box a set of bounds selects, or `"empty"` when no address can match.
223
+ * Bounds are first compared in the dimension's own order, so an inverted pair
224
+ * (`{ gte: 10, lte: 5 }`, or a pair inverted within one level) is empty rather
225
+ * than a key condition DynamoDB rejects. `literals` ranges follow the declared
226
+ * order; `in` selects members, grouped into runs.
227
+ *
228
+ * A dimension's open upper end — no bound, or one at its top level — runs to
229
+ * the top of its bits, `2^bits - 1`, not `levels - 1`: no stored value is
230
+ * above the top level (`quantize` clamps), so the levels between hold no rows,
231
+ * and a box edge through them would only split cells the planner then has to
232
+ * refine.
233
+ */
234
+ export declare const quantizeBounds: (layout: Layout, bounds: Readonly<Record<string, DimensionBound | undefined>>) => Box | "empty";
235
+ /** FNV-1a, 64-bit, over `bytes`. A stored format: pinned by golden vectors. */
236
+ export declare const fnv1a64: (bytes: Uint8Array) => bigint;
237
+ /**
238
+ * One prefix segment from its key text (already serialised and cased):
239
+ * `u16be(len) ‖ utf8(text)`, where `len` is the byte length; or, with `hash`,
240
+ * the first `hash` bytes (big-endian) of FNV-1a-64 over the same bytes.
241
+ */
242
+ export declare const prefixSegment: (text: string, hash: number | undefined) => Uint8Array;
243
+ /** `parts` end to end, as one plain `Uint8Array`. */
244
+ export declare const concatBytes: (parts: ReadonlyArray<Uint8Array>) => Uint8Array;
245
+ /** Unsigned byte order — DynamoDB's order for `B` keys. */
246
+ export declare const compareBytes: (a: Uint8Array, b: Uint8Array) => number;
247
+ /**
248
+ * The smallest byte string greater than every string starting with `bytes`:
249
+ * trailing `0xFF` bytes dropped, then the last byte incremented. `undefined`
250
+ * when there is none (empty, or all `0xFF`).
251
+ */
252
+ export declare const succ: (bytes: Uint8Array) => Uint8Array | undefined;
253
+ /** `bytes` as `0x…` hex — how `B` key values are shown. */
254
+ export declare const toHex: (bytes: Uint8Array) => string;
255
+ export {};
256
+ //# sourceMappingURL=ZOrderCurve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZOrderCurve.d.ts","sourceRoot":"","sources":["../../src/internal/ZOrderCurve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAgB,aAAa,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAA;AAO5F;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB;AAC1B,gDAAgD;AAC9C;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE;AACpE,yFAAyF;GACvF;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAAE;AAC3E,iDAAiD;GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,CAAA;CAAE;AACvE,iDAAiD;GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;CAAE;AACnC,wDAAwD;GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE;AACrC,uDAAuD;GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE;AAC9B,6BAA6B;GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAAA;AAEl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