Skip to content

Make the internal helper types of the typings internal - #475

Merged
lehni merged 1 commit into
nextfrom
chore/typings-internals
Oct 15, 2026
Merged

lehni merged 1 commit into
nextfrom
chore/typings-internals

Conversation

@lehni

@lehni lehni commented Oct 15, 2026

Copy link
Copy Markdown

The ES module typings of 4.0 export what they declare export, while the 3.x namespace exported every type. The helper types added for the relation expression parser, the withGraph*() narrowing and the property names aren't meant for users, and are no longer exported:

  • Whitespace, Trim, CountChar, IsBalanced, SplitList, ParseRelationList, ParseRelationString, RelationName, RelationNode, ParseRelationObject
  • WithGraph, WithGraphProperty
  • OptionalInsertPropertyNames, InsertablePropertyNames, RelationPropertyNames, InsertableGraphField, InsertableGraphReference, TypedRelationMappingFor, TypedModelClassSpecifier, PartialModelProps

The unused ItemType is removed. ParseRelationExpression, WithGraphRelations, FetchedRelations, UnnarrowedMethods, WithGraphTreeQueryBuilder and WithResultKind stay exported, as the declarations of inferred withGraph*() queries name them.

The internal checks have consistent names: UnknownExpressionModifiers, ShouldCheckModifiers, HasOnlyLiteralKeys, which also replaces four inline string extends keyof checks, IsSelectAll and HasModels.

Check time

pnpm bench:typings, against next: unchanged.

Tests

No type changes apart from the exports: the declarations emitted for a corpus of inferred queries, in loose and strict mode, are the same, with the removed types written out where they were named. pnpm test:typings passes with TypeScript 7 and 5.8.3.

@lehni
lehni merged commit 8f9a005 into next Oct 15, 2026
5 checks passed
@lehni
lehni deleted the chore/typings-internals branch October 15, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant