@storybook/channels
- Version 8.0.9
- Published
- 24.1 kB
- 5 dependencies
- MIT license
Install
npm i @storybook/channels
yarn add @storybook/channels
pnpm add @storybook/channels
Overview
Overview not available.
Index
Functions
Classes
Interfaces
Type Aliases
Functions
function createBrowserChannel
createBrowserChannel: ({ page, extraTransports }: Options) => Channel;
Creates a new browser channel instance.
Parameter options
The options object.
Parameter
{Page} options.page - page identifier.
Parameter
{ChannelTransport[]} [options.extraTransports=[]] - An optional array of extra channel transports.
Returns
{Channel} - The new channel instance.
Classes
class Channel
class Channel {}
constructor
constructor(input: ChannelArgsMulti);
constructor
constructor(input: ChannelArgsSingle);
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;
class PostMessageTransport
class PostMessageTransport implements ChannelTransport {}
constructor
constructor(config: Config);
method send
send: (event: ChannelEvent, 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: ChannelHandler) => void;
class WebsocketTransport
class WebsocketTransport implements ChannelTransport {}
constructor
constructor({ url, onError, page }: WebsocketTransportArgs);
method send
send: (event: any) => void;
method setHandler
setHandler: (handler: ChannelHandler) => void;
Interfaces
interface ChannelEvent
interface ChannelEvent {}
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 (5)
Dev Dependencies (1)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto 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>
- Updated .
Package analyzed in 2879 ms. - Missing or incorrect documentation? Open an issue for this package.