Skip to content

chore(deps): bump laravel-echo from 1.16.1 to 1.17.0 #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/runtime/composables/useEcho.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type Echo from 'laravel-echo'
import type { SupportedBroadcaster } from '../types'
import { useNuxtApp } from '#app'

export const useEcho = (): Echo => {
export const useEcho = (): Echo<SupportedBroadcaster> => {
const { $echo } = useNuxtApp()

return $echo as Echo
return $echo as Echo<SupportedBroadcaster>
}
4 changes: 2 additions & 2 deletions src/runtime/plugin.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import type { ChannelAuthorizationData } from 'pusher-js/types/src/core/auth/opt
import { type ConsolaInstance, createConsola } from 'consola'
import type { FetchOptions } from 'ofetch'
import { useEchoConfig } from './composables/useEchoConfig'
import type { Authentication, ModuleOptions } from './types'
import type { Authentication, ModuleOptions, SupportedBroadcaster } from './types'
import { createError, defineNuxtPlugin, useCookie } from '#app'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Pusher = (PusherPkg as any).default || PusherPkg

declare global {
interface Window {
Echo: Echo
Echo: Echo<SupportedBroadcaster>
Pusher: typeof Pusher
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/runtime/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type SupportedBroadcaster = 'reverb' | 'pusher'

export interface Authentication {
/**
* The base URL of Laravel application.
Expand Down Expand Up @@ -36,7 +38,7 @@ export interface ModuleOptions {
* The Laravel broadcaster type to use.
* @default 'reverb'
*/
broadcaster: 'reverb' | 'pusher'
broadcaster: SupportedBroadcaster
/**
* The host to connect to WebSocket.
* @default 'localhost'
Expand Down