File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import type Echo from 'laravel-echo'
2+ import type { SupportedBroadcaster } from '../types'
23import { useNuxtApp } from '#app'
34
4- export const useEcho = ( ) : Echo => {
5+ export const useEcho = ( ) : Echo < SupportedBroadcaster > => {
56 const { $echo } = useNuxtApp ( )
67
7- return $echo as Echo
8+ return $echo as Echo < SupportedBroadcaster >
89}
Original file line number Diff line number Diff line change @@ -4,15 +4,15 @@ import type { ChannelAuthorizationData } from 'pusher-js/types/src/core/auth/opt
44import { type ConsolaInstance , createConsola } from 'consola'
55import type { FetchOptions } from 'ofetch'
66import { useEchoConfig } from './composables/useEchoConfig'
7- import type { Authentication , ModuleOptions } from './types'
7+ import type { Authentication , ModuleOptions , SupportedBroadcaster } from './types'
88import { createError , defineNuxtPlugin , useCookie } from '#app'
99
1010// eslint-disable-next-line @typescript-eslint/no-explicit-any
1111const Pusher = ( PusherPkg as any ) . default || PusherPkg
1212
1313declare global {
1414 interface Window {
15- Echo : Echo
15+ Echo : Echo < SupportedBroadcaster >
1616 Pusher : typeof Pusher
1717 }
1818}
Original file line number Diff line number Diff line change 1+ export type SupportedBroadcaster = 'reverb' | 'pusher'
2+
13export interface Authentication {
24 /**
35 * The base URL of Laravel application.
@@ -36,7 +38,7 @@ export interface ModuleOptions {
3638 * The Laravel broadcaster type to use.
3739 * @default 'reverb'
3840 */
39- broadcaster : 'reverb' | 'pusher'
41+ broadcaster : SupportedBroadcaster
4042 /**
4143 * The host to connect to WebSocket.
4244 * @default 'localhost'
You can’t perform that action at this time.
0 commit comments