@popclip/types
v2.6208.0
Published
TypeScript definitions for PopClip extensions.
Readme
popclip-types
TypeScript definitions for PopClip extensions.
Published to npm as @popclip/types, and served at
https://www.popclip.app/dev/popclip.d.ts.
Layout
popclip.d.ts is generated by concatenating the files in src/, in order.
Edit the files in src/, not the generated file.
| File | Contents |
| ------------------------- | ---------------------------------------------------------------- |
| src/00-header.d.ts | File header: what the file is, recommended tsconfig |
| src/10-runtime.d.ts | The popclip, util and pasteboard globals and related types |
| src/20-module.d.ts | defineExtension(), Extension, Action, options, require |
| src/30-config.d.ts | The static config format (hidden from the generated API docs) |
| src/40-environment.d.ts | Buffer, Blob, URL, XMLHttpRequest, timers, and the rest |
Every declaration is ambient and global, so the files need no imports and the
build is a plain concatenation. The generated popclip.d.ts is committed, so
that the package and the website always have it.
Commands
npm run build # regenerate popclip.d.ts from src/
npm run check # build, then type check the resultThe HTML API reference is generated by the pcweb build and served at https://www.popclip.app/dev/api/.
Versioning
Versions are <generation>.<PopClip build>.<edit>. The middle number is the
PopClip build the definitions describe; bump the last for edits that do not
correspond to a new build. The generation is bumped for breaking changes. The
build script writes the version into the file header.
Publishing
Set the version in package.json, add a CHANGELOG.md entry, run
npm run check, and commit. Then:
npm login
npm publish