| 12345678910111213141516171819202122232425 |
- import { MusicPlayer } from '../types/state';
- interface Action<T extends string = string, P = unknown> {
- type: T;
- payload: P;
- }
- export enum ActionTypeRemote {
- StateSet = 'STATE_SET',
- ClientsUpdated = 'CLIENTS_UPDATED',
- }
- export enum ActionTypeLocal {
- StateSet = 'LOCAL_STATE_SET',
- }
- export type ActionStateSetRemote = Action<ActionTypeRemote.StateSet, MusicPlayer | null>;
- export type ActionStateSetLocal = Action<ActionTypeLocal.StateSet, MusicPlayer>;
- export type ActionClientsUpdated = Action<ActionTypeRemote.ClientsUpdated, string[]>;
- export type LocalAction = ActionStateSetLocal;
- export type RemoteAction = ActionStateSetRemote | ActionClientsUpdated;
- export type AnyAction = LocalAction | RemoteAction;
|