You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3d2de76
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec): take the two names the finding owes, and decline the third on measurement
Reverts the exploratory fourth name. The blocking finding is
`EngineTransactionInfo` and `EngineTransactionOptions`, both introduced to this
entry by this card's own declarations; those two ship.
The optional leg — `IScopedContext`, leaking off `HookContext.api` since #5945
— is declined here, measured rather than waved off. It needs TWO names, not
one: `IScopedContext.object(name)` returns `IScopedObjectRepository`, so with
the context exported alone `ctx.api.object('deal')` still answered TS2883 on
the repository. And the second name is not free: adding it reorders members
inside object type literals in the unrelated `ui` shard, 330 lines that
`check:api-surface-declarations` reports as "33 reshaped" and asks a reviewer
to rule on. Measured order-only — identical token multiset, identical line
count, generator stable against a fixed dist — but an adjudication in a shard
this card does not touch is its own card, not a rider on a FAIL remediation.
Surface delta vs the merge base: exported names 833 -> 844, no removals, and
`ui.txt` untouched.
Claude-Session: https://claude.ai/code/session_01AmH9bKvGoLjiY86Q4Z3og2
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .changeset/18163-export-hook-api-types.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
'@objectstack/spec': minor
3
3
---
4
4
5
-
`@objectstack/spec/data` now exports the typed hook `ctx.api` face — `HookApi`, `HookObjectApi`, `HookQuery`, `HookCountQuery`, `HookUpdateDoc`, `HookUpdateOptions`, `HookDeleteOptions`, `HookDoc` and `HookDriverPassthroughOptions` — so a metadata app's `*.hook.ts` imports the platform's type instead of hand-declaring one (#18163). The same entry additionally re-exports `EngineTransactionInfo`, `EngineTransactionOptions`, `IScopedContext`and `IScopedObjectRepository`, which its public declarations reference structurally: without them a consumer that imports only `@objectstack/spec/data` and emits declarations answers `TS2883: The inferred type ... cannot be named without a reference to ...`. Type-only re-exports of the declarations `@objectstack/spec/contracts` already publishes, not second declarations.
5
+
`@objectstack/spec/data` now exports the typed hook `ctx.api` face — `HookApi`, `HookObjectApi`, `HookQuery`, `HookCountQuery`, `HookUpdateDoc`, `HookUpdateOptions`, `HookDeleteOptions`, `HookDoc` and `HookDriverPassthroughOptions` — so a metadata app's `*.hook.ts` imports the platform's type instead of hand-declaring one (#18163). The same entry additionally re-exports `EngineTransactionInfo`and `EngineTransactionOptions`, which its public declarations reference structurally: without them a consumer that imports only `@objectstack/spec/data` and emits declarations answers `TS2883: The inferred type ... cannot be named without a reference to ...`. Type-only re-exports of the declarations `@objectstack/spec/contracts` already publishes, not second declarations.
@@ -19,6 +19,6 @@ The platform already implemented this surface; it just never published a type an
19
19
-**Every option shape is DERIVED, not transcribed.** Each is an `Omit`/`Pick` over the `Engine*Options` schemas that the engine's own per-method legal-key sets are pinned against, so a key added to a schema reaches the published type in the same run it reaches the engine's accepted set. `count` is the one shape without the driver pass-through keys, because the engine forwards no bag on that method and rejects them there — engine behaviour no document states, and exactly what a hand-written copy gets wrong.
20
20
-**What is deliberately absent, each for a stated reason**: `context` (the repository injects it and discards a caller's), the `cursor` / `distinct` / `upsert` tombstones, `sudo()` (the #5945 exclusion stands — `Hook.runAs: 'system'` is the declared way to run elevated), and `aggregate` / `execute` / `create` / `deleteById`.
21
21
22
-
Additive only: thirteen new exported names from `./data` (nine new declarations plus four type-only re-exports), no removal and no signature change, so nothing an existing consumer imports moves.
22
+
Additive only: eleven new exported names from `./data` (nine new declarations plus two type-only re-exports), no removal and no signature change, so nothing an existing consumer imports moves.
0 commit comments