pkts
v0.2.1
Published
Typescript tools for Pebble
Downloads
77
Readme
PebbleKit.ts
A modern Pebble app boilerplate using TypeScript.
When building PebbleRail, I wanted to be able to use modern web tooling to write my PebbleKit JS app. That app performs a lot of data fetching and communication with the watch. However, the engine used in the Pebble app (and Core Devices app) targets something close to ES5.
This project adds a JS build step similar to what you would find in a modern web project, but with a focus on targeting the PebbleKit JS engine. Meaning you can use modern JS/TS features without worrying about compatability.
Also provided are modern wrappers around PKJS functions, available under the PebbleTS namespace.
How to use
- Run
npx pkts initin your Pebble project - Install dependencies
npm install - Build your app like normal,
pebble buildwill compile your TypeScript and your Pebble app
Available types
readyandappmessageeventssendAppMessagegetTimelineTokenshowSimpleNotficationOnPebble
Tested JS/TS features
- async/await
- Promises
- String templates
- Arrow functions
- Array/object spreading
Contributing
The PKJS type definitions are incomplete are incomplete as I have only typed what is used in PebbleRail.
If you are using this in your own project and find yourself expanding the definitions, please contribute your changes back to this project so the community can benefit!
