@storybook/channels

  • Version 6.3.10
  • Published
  • 21.3 kB
  • 3 dependencies
  • MIT license

Install

npm i @storybook/channels
yarn add @storybook/channels
pnpm add @storybook/channels

Overview

Storybook Channel is similar to an EventEmitter. Channels are used with Storybook implementations to send/receive events between the Storybook Manager and the Storybook Renderer.

Index

Classes

class Channel

class Channel {}

    constructor

    constructor({ transport, async }?: ChannelArgs);

      property addPeerListener

      addPeerListener: (eventName: string, listener: Listener) => void;

        property hasTransport

        readonly hasTransport: boolean;

          property isAsync

          readonly isAsync: boolean;

            method addListener

            addListener: (eventName: string, listener: Listener) => void;

              method emit

              emit: (eventName: string, ...args: any) => void;

                method eventNames

                eventNames: () => string[];

                  method last

                  last: (eventName: string) => any;

                    method listenerCount

                    listenerCount: (eventName: string) => number;

                      method listeners

                      listeners: (eventName: string) => Listener[] | undefined;

                        method off

                        off: (eventName: string, listener: Listener) => void;

                          method on

                          on: (eventName: string, listener: Listener) => void;

                            method once

                            once: (eventName: string, listener: Listener) => void;

                              method removeAllListeners

                              removeAllListeners: (eventName?: string) => void;

                                method removeListener

                                removeListener: (eventName: string, listener: Listener) => void;

                                  Interfaces

                                  interface ChannelEvent

                                  interface ChannelEvent {}

                                    property args

                                    args: any[];

                                      property from

                                      from: string;

                                        property type

                                        type: string;

                                          interface ChannelTransport

                                          interface ChannelTransport {}

                                            method send

                                            send: (event: ChannelEvent, options?: any) => void;

                                              method setHandler

                                              setHandler: (handler: ChannelHandler) => void;

                                                interface Listener

                                                interface Listener {}

                                                  call signature

                                                  (...args: any[]): void;

                                                    Type Aliases

                                                    type ChannelHandler

                                                    type ChannelHandler = (event: ChannelEvent) => void;

                                                      Package Files (1)

                                                      Dependencies (3)

                                                      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/channels.

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