/** The protocol type that holds your message types and their schema. */ export declare type Protoframe = Record>; export declare type ProtoframeEntry> = { body: B; response?: R; }; /** Enumerates all valid types of messages defined in a given protocol. */ export declare type ProtoframeMessageType

= string & keyof P; /** Enumerates the `body` and `response` entry keys for each message. */ export declare type ProtoframeEntryType

> = string & keyof Protoframe[T]; /** * A type reference to the body or response type of a given message for a * protocol. If we have a simple protocol: * * ``` * type MyProtocol = { * get: { * body: { key: string; } * } * } * ``` * * Then the type `ProtoframeEntryPropType` references * type: `{ key: string }`. */ export declare type ProtoframeEntryPropType

, E extends ProtoframeEntryType> = P[T][E]; /** A specialization of `ProtoframeEntryPropType` on the `body` key. */ export declare type ProtoframeMessageBody

> = ProtoframeEntryPropType; /** A specialization of `ProtoframeEntryPropType` on the `response` key. */ export declare type ProtoframeMessageResponse

> = ProtoframeEntryPropType; /** * A protocol definition. This is used to include value `type` which namespaces * communication across an iframe. */ export interface ProtoframeDescriptor<_P extends Protoframe> { type: string; } /** An internal payload body for a protocol message going between windows. */ export interface ProtoframePayloadBody

> { type: string; id: string; body: ProtoframeMessageBody; } /** An internal payload response for a protocol message going between windows. */ export interface ProtoframePayloadResponse

> { type: string; id: string; response: ProtoframeMessageResponse; } /** An internal enumerator for ask and tell actions. Used to namespace messages. */ export declare type ProtoframeAction = 'ask' | 'tell';