@storybook/channel-postmessage

  • Version 6.3.7
  • Published
  • 36.9 kB
  • 7 dependencies
  • MIT license

Install

npm i @storybook/channel-postmessage
yarn add @storybook/channel-postmessage
pnpm add @storybook/channel-postmessage

Overview

Storybook PostMessage Channel is a channel for Storybook that can be used when the Storybook Renderer runs inside an iframe or a child window. A channel can be created using the `createChannel` function.

Index

Variables

variable KEY

const KEY: string;

    Functions

    function createChannel

    createChannel: ({ page }: Config) => any;
    • Creates a channel which communicates with an iframe or child window.

    Classes

    class PostmsgTransport

    class PostmsgTransport {}

      constructor

      constructor(config: Config);

        method send

        send: (event: any, options?: any) => Promise<any>;
        • Sends event to the associated window. If the window does not yet exist the event will be stored in a buffer and sent when the window exists.

          Parameter event

        method setHandler

        setHandler: (handler: any) => void;

          Package Files (1)

          Dependencies (7)

          Dev Dependencies (0)

          No dev dependencies.

          Peer Dependencies (0)

          No peer dependencies.

          Badge

          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@storybook/channel-postmessage.

          • Markdown
            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@storybook/channel-postmessage)
          • HTML
            <a href="https://www.jsdocs.io/package/@storybook/channel-postmessage"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>