UNPKG

use-stomp

Version:

react provider, class decorator, and a hook for websockets using the stomp protocol

39 lines (38 loc) 1.15 kB
import React from 'react'; import { Options } from 'sockjs-client'; export declare type UseStompProviderProps = { /** * HTTP to connect */ url: string; /** * Add console logs for debugging */ debug?: boolean; /** * SockJS Options (https://github.com/sockjs/sockjs-client#sockjs-client-api) */ options?: Options; /** * The request auth header will be passed to the server or agent through the STOMP connection frame */ authHeader?: string; /** * The request header will be passed to the server or agent through the STOMP connection frame */ headers?: Record<string, unknown>; /** * override default parsing of messages */ parseMessage?(channel: string, msg: any): any; /** * override default packaging of messages */ packageMessage?(channel: string, msg: any, optHeaders: any): any; /** * The request header that will be passed when subscribing to the target */ subscribeHeaders?: Record<string, unknown>; }; declare const _default: React.NamedExoticComponent<UseStompProviderProps>; export default _default;