index.d.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { b as ChannelTransport, a as Config, d as ChannelHandler, c as ChannelEvent, C as Channel } from '../main-c55d8855.js';
  2. declare const KEY = "storybook-channel";
  3. declare class PostMessageTransport implements ChannelTransport {
  4. private readonly config;
  5. private buffer;
  6. private handler?;
  7. private connected;
  8. constructor(config: Config);
  9. setHandler(handler: ChannelHandler): void;
  10. /**
  11. * Sends `event` to the associated window. If the window does not yet exist
  12. * the event will be stored in a buffer and sent when the window exists.
  13. * @param event
  14. */
  15. send(event: ChannelEvent, options?: any): Promise<any>;
  16. private flush;
  17. private getFrames;
  18. private getCurrentFrames;
  19. private getLocalFrame;
  20. private handleEvent;
  21. }
  22. /**
  23. * @deprecated This export is deprecated. Use `PostMessageTransport` instead. This API will be removed in 8.0.
  24. */
  25. declare const PostmsgTransport: typeof PostMessageTransport;
  26. /**
  27. * @deprecated This function is deprecated. Use the `createBrowserChannel` factory function from `@storybook/channels` instead. This API will be removed in 8.0.
  28. * @param {Config} config - The configuration object.
  29. * @returns {Channel} The channel instance.
  30. */
  31. declare function createChannel({ page }: Config): Channel;
  32. export { KEY, PostMessageTransport, PostmsgTransport, createChannel, createChannel as default };