import type { Envelope, EnvelopeKind } from "./types.js"; /** Type guard: is `value` one of the known {@link EnvelopeKind}s? */ export declare function isEnvelopeKind(value: unknown): value is EnvelopeKind; /** * Structural validation of an inbound `postMessage` payload. * * Returns `true` only for objects that carry our exact `channel`, a numeric * `protocol_version`, a known `kind`, a string `component_id`, and — where present * — string-typed `type` / `id` / `error`. Anything else (foreign traffic, spoofed * or malformed frames) fails the guard and is ignored by the caller. */ export declare function isEnvelope(value: unknown): value is Envelope; /** * Parse an arbitrary `postMessage` payload into an {@link Envelope}, or `null` if * it is not a valid frame for our channel. */ export declare function parseEnvelope(value: unknown): Envelope | null; /** Fields the caller supplies when building an outbound envelope. */ export type OutboundEnvelope = Partial> & Pick; /** * Build a fully-formed {@link Envelope}, filling in the constant `channel` and the * supplied protocol version / component id defaults. Only defined optional fields * are included so frames stay minimal and JSON-clean. */ export declare function buildEnvelope(fields: OutboundEnvelope, defaults: { protocolVersion: number; componentId: string; }): Envelope; //# sourceMappingURL=envelope.d.ts.map