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 1
1
import type Echo from 'laravel-echo'
2
+ import type { SupportedBroadcaster } from '../types'
2
3
import { useNuxtApp } from '#app'
3
4
4
- export const useEcho = ( ) : Echo => {
5
+ export const useEcho = ( ) : Echo < SupportedBroadcaster > => {
5
6
const { $echo } = useNuxtApp ( )
6
7
7
- return $echo as Echo
8
+ return $echo as Echo < SupportedBroadcaster >
8
9
}
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
4
4
import { type ConsolaInstance , createConsola } from 'consola'
5
5
import type { FetchOptions } from 'ofetch'
6
6
import { useEchoConfig } from './composables/useEchoConfig'
7
- import type { Authentication , ModuleOptions } from './types'
7
+ import type { Authentication , ModuleOptions , SupportedBroadcaster } from './types'
8
8
import { createError , defineNuxtPlugin , useCookie } from '#app'
9
9
10
10
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11
11
const Pusher = ( PusherPkg as any ) . default || PusherPkg
12
12
13
13
declare global {
14
14
interface Window {
15
- Echo : Echo
15
+ Echo : Echo < SupportedBroadcaster >
16
16
Pusher : typeof Pusher
17
17
}
18
18
}
Original file line number Diff line number Diff line change
1
+ export type SupportedBroadcaster = 'reverb' | 'pusher'
2
+
1
3
export interface Authentication {
2
4
/**
3
5
* The base URL of Laravel application.
@@ -36,7 +38,7 @@ export interface ModuleOptions {
36
38
* The Laravel broadcaster type to use.
37
39
* @default 'reverb'
38
40
*/
39
- broadcaster : 'reverb' | 'pusher'
41
+ broadcaster : SupportedBroadcaster
40
42
/**
41
43
* The host to connect to WebSocket.
42
44
* @default 'localhost'
You can’t perform that action at this time.
0 commit comments