Skip to content

Add TypeScript type declarations#23

Merged
hellcp merged 8 commits into
pebble-dev:mainfrom
Mearman:types
May 21, 2026
Merged

Add TypeScript type declarations#23
hellcp merged 8 commits into
pebble-dev:mainfrom
Mearman:types

Conversation

@Mearman
Copy link
Copy Markdown

@Mearman Mearman commented Apr 19, 2026

Adds curated index.d.ts shipping with the package, covering the full public API including dynamic patterns (ClayEvents mixin, manipulator binding) that tsc --allowJs cannot infer. Includes CI validation.

Mearman added 8 commits May 21, 2026 22:31
Provide TypeScript ambient declarations for 'message_keys' (Pebble SDK
module) and './tmp/config-page.html' (build artefact) so tsc can resolve
these imports when generating .d.ts files.
Configures tsc --allowJs --emitDeclarationOnly to generate per-file
.d.ts reference output in dist-types/ from the library source files.
Hand-curated index.d.ts covering Clay, ClayConfig, ClayItem, ClayEvents,
manipulators, and all supporting types. Necessary because tsc cannot
infer the ClayEvents mixin or dynamically-bound manipulator methods.
All types are exported via the Clay namespace.
Exercises the full public API surface — constructor, instance/static
methods, ClayConfig/ClayItem event methods, manipulator methods,
namespace-exported types, and customFn this-context.
Adds typescript 6.0.2 as a devDependency. Sets "types": "index.d.ts"
in package.json. Adds build:types and check:types scripts.
Validates index.d.ts against test/type-checks.ts as part of the default
gulp build. Reference declaration generation via build:types remains
available as a separate manual step.
Add dist-types/ to .gitignore (build artefact). Whitelist index.d.ts
in .npmignore so type declarations ship with the package.
Runs npm run check:types on push and PR to main, matching the existing
lint/test/build workflow pattern.
Copilot AI review requested due to automatic review settings May 21, 2026 20:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@hellcp hellcp merged commit 7512b64 into pebble-dev:main May 21, 2026
4 checks passed
@Mearman
Copy link
Copy Markdown
Author

Mearman commented May 21, 2026

actually forgot I'd done this. thanks for merging @hellcp

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.

3 participants