@bigmistqke/typed-lexicons
v0.1.2
Published
Typed lexicons as defined in github.com/bluesky-social/atproto
Maintainers
Readme
@bigmistqke/typed-lexicons
Typed ATProto lexicons for TypeScript. This package provides all lexicon definitions from the bluesky-social/atproto repository as TypeScript modules with full const type inference.
Installation
npm install @bigmistqke/typed-lexicons
# or
pnpm add @bigmistqke/typed-lexiconsUsage
Import lexicons directly by their path:
import post from "@bigmistqke/typed-lexicons/app/bsky/feed/post";
import profile from "@bigmistqke/typed-lexicons/app/bsky/actor/profile";
// Full type inference - TypeScript knows the exact shape
post.id; // "app.bsky.feed.post"
post.defs.main.type; // "record"
post.defs.main.record.properties.text.maxLength; // 3000Each lexicon is exported with as const, giving you precise literal types for all values.
Updating Lexicons
To fetch the latest lexicons from the atproto repository:
pnpm updateThis runs the update script which:
- Sparse-clones the lexicons folder from bluesky-social/atproto
- Converts all JSON lexicon files to TypeScript with
as constassertions - Outputs them to the
lexicons/directory
Available Lexicons
The package includes all official ATProto lexicons organized by namespace:
app/bsky/*- Bluesky app lexicons (posts, profiles, feeds, etc.)com/atproto/*- Core ATProto lexicons (repos, sync, identity, etc.)chat/bsky/*- Bluesky chat lexiconstools/ozone/*- Ozone moderation tool lexicons
License
MIT
