Skip to content

docs: add type-mapping guide and document missing public APIs#127

Merged
zeevdr merged 1 commit into
mainfrom
docs/125-type-mapping-api-docs
Jun 7, 2026
Merged

docs: add type-mapping guide and document missing public APIs#127
zeevdr merged 1 commit into
mainfrom
docs/125-type-mapping-api-docs

Conversation

@zeevdr

@zeevdr zeevdr commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • The TS SDK reference had no type-mapping guidance, so users could not tell what JS type a value comes back as (time/duration/url/json return as strings) or why large integers throw.
  • Several shipped public APIs were undocumented — typed setters, native-value setMany, getAll, setToken (JWT rotation), and addField (post-start watching). watching.md even described a restriction that addField() already lifts.

Changes

  • docs/configuration.md: new Type Mapping section (Go type -> raw wire string -> TS return/converter, plus the BigInt safe-integer caveat), a Reading and Writing Values section (get/getAll/typed setters/native setMany), and a token-rotation subsection for setToken.
  • docs/watching.md: documented addField() and the add-field-after-start capability; removed the stale restriction.
  • CONTRIBUTING.md: Node 20+ -> 22+ to match package.json engines.

Test plan

  • Docs-only diff. npm run build, npx tsc --noEmit, npm run lint, and the full test suite (255 tests) all pass in the worktree.
  • Every documented signature was verified against source (src/client.ts, src/convert.ts, src/watcher.ts). Two issue-text inaccuracies were corrected to match real behavior: setDuration accepts a duration string (not a duration value), and the BigInt guard throws only for out-of-range integer strings, not large floats.

Closes #125

…oken, addField

Add a Type Mapping section to docs/configuration.md covering the full round
trip: schema/FieldType -> proto TypedValue field -> raw string wire form ->
get() converter -> the TypeScript value returned. Document that time, duration,
url, and json come back as strings (with their canonical string formats), that
converters are limited to String/Number/Boolean, and the safe-integer/BigInt
caveat (the Number converter rejects integer strings outside the safe range).

Document the previously-undocumented public APIs in docs/configuration.md:
typed setters (setNumber, setBool, setTime, setDuration), the native-value
setMany variant, getAll, and setToken (JWT rotation). setDuration is documented
as taking a duration string, matching the source.

Fix docs/watching.md so the lifecycle section correctly describes addField()
and post-start field registration instead of stating a flat restriction.

Bump the Node version floor in CONTRIBUTING.md from 20+ to 22+ to match
package.json engines (>=22).

Closes #125

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone Jun 7, 2026
@zeevdr zeevdr added size: M Moderate — a day or two, clear scope priority: P1 Current milestone work labels Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

Bundle size

Entry Size Budget Status
dist/index.js 101.5 kB 160000

@zeevdr zeevdr merged commit f83dac9 into main Jun 7, 2026
5 checks passed
@zeevdr zeevdr deleted the docs/125-type-mapping-api-docs branch June 7, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P1 Current milestone work size: M Moderate — a day or two, clear scope

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add type-mapping + document typed setters/getAll/setToken

1 participant