@openpicker/protocol
v0.1.3
Published
Open postMessage protocol for the openpicker CSS element picker — wire types, constants, and selector helpers.
Downloads
111
Maintainers
Readme
@openpicker/protocol
The open OpenPicker postMessage protocol: the wire types, constants, and selector helpers that the browser extension and any client share. Website: openpicker.dev · Docs: docs.openpicker.dev
Most integrations should use @openpicker/sdk,
which wraps this protocol in a friendly client. Depend on this package directly only when building
your own client (another SDK, a different extension, a non-browser bridge) against the same wire
format.
npm install @openpicker/protocolimport {
CHANNEL,
PROTOCOL_VERSION,
isEnvelope,
matchesSelectorConfig,
type PickParams,
type SelectorConfig,
} from "@openpicker/protocol"This package ships:
- Constants —
CHANNEL,PROTOCOL_VERSION. - Envelopes —
RequestEnvelope,ResponseEnvelope,EventEnvelope, and theisEnvelopeguard. - Methods —
MethodMapplus the params/result types (PickParams,PickResult,SelectorConfig, …). - Errors —
ProtocolError,ErrorCode. - Selector helpers —
tokenizeSelector,matchesSelectorConfig, and their token types.
See the protocol spec for the full wire format.
