import { createAction } from '@reduxjs/toolkit'; import type { BulkDownloadCompleteEvent, BulkDownloadFailedEvent, BulkDownloadStartedEvent, DownloadCancelledEvent, DownloadCompleteEvent, DownloadErrorEvent, DownloadProgressEvent, DownloadStartedEvent, InvocationCompleteEvent, InvocationDenoiseProgressEvent, InvocationErrorEvent, InvocationStartedEvent, ModelInstallCancelledEvent, ModelInstallCompleteEvent, ModelInstallDownloadProgressEvent, ModelInstallDownloadsCompleteEvent, ModelInstallErrorEvent, ModelInstallStartedEvent, ModelLoadCompleteEvent, ModelLoadStartedEvent, QueueItemStatusChangedEvent, } from 'services/events/types'; const createSocketAction = (name: string) => createAction(`socket/${name}`); export const socketConnected = createSocketAction('Connected'); export const socketDisconnected = createSocketAction('Disconnected'); export const socketInvocationStarted = createSocketAction('InvocationStartedEvent'); export const socketInvocationComplete = createSocketAction('InvocationCompleteEvent'); export const socketInvocationError = createSocketAction('InvocationErrorEvent'); export const socketGeneratorProgress = createSocketAction( 'InvocationDenoiseProgressEvent' ); export const socketModelLoadStarted = createSocketAction('ModelLoadStartedEvent'); export const socketModelLoadComplete = createSocketAction('ModelLoadCompleteEvent'); export const socketDownloadStarted = createSocketAction('DownloadStartedEvent'); export const socketDownloadProgress = createSocketAction('DownloadProgressEvent'); export const socketDownloadComplete = createSocketAction('DownloadCompleteEvent'); export const socketDownloadCancelled = createSocketAction('DownloadCancelledEvent'); export const socketDownloadError = createSocketAction('DownloadErrorEvent'); export const socketModelInstallStarted = createSocketAction('ModelInstallStartedEvent'); export const socketModelInstallDownloadProgress = createSocketAction( 'ModelInstallDownloadProgressEvent' ); export const socketModelInstallDownloadsComplete = createSocketAction( 'ModelInstallDownloadsCompleteEvent' ); export const socketModelInstallComplete = createSocketAction('ModelInstallCompleteEvent'); export const socketModelInstallError = createSocketAction('ModelInstallErrorEvent'); export const socketModelInstallCancelled = createSocketAction('ModelInstallCancelledEvent'); export const socketQueueItemStatusChanged = createSocketAction('QueueItemStatusChangedEvent'); export const socketBulkDownloadStarted = createSocketAction('BulkDownloadStartedEvent'); export const socketBulkDownloadComplete = createSocketAction('BulkDownloadCompleteEvent'); export const socketBulkDownloadError = createSocketAction('BulkDownloadFailedEvent');