refactor: folders/files to group dsp logic
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { DSPState as DSP408State, Meters as DSP408Meters } from './features/dsp408/types';
|
||||
|
||||
export type DSPStatus = 'connected' | 'connecting' | 'disconnected';
|
||||
|
||||
export type NotificationType = 'success' | 'error' | 'warning';
|
||||
export type Notification = {
|
||||
id: number;
|
||||
message: string;
|
||||
type: NotificationType;
|
||||
removing?: boolean;
|
||||
};
|
||||
|
||||
export type AppPage = 'home' | 'add-dsp' | 'view-dsp' | 'credits';
|
||||
|
||||
type DSPDefaultParameters = {
|
||||
ip: string;
|
||||
defaultPort: number;
|
||||
device_id: number;
|
||||
};
|
||||
|
||||
export type DSPTypes = 'DSP408' | 'DSP204';
|
||||
|
||||
export const DSP_DEFAULT_PARAMETERS: Record<DSPTypes, DSPDefaultParameters> = {
|
||||
DSP408: { ip: '192.168.49.30', defaultPort: 9761, device_id: 1 },
|
||||
DSP204: { ip: '192.168.49.30', defaultPort: 94, device_id: 1 },
|
||||
};
|
||||
|
||||
interface DSPBase {
|
||||
id: number;
|
||||
name: string;
|
||||
ip: string;
|
||||
port: number;
|
||||
deviceId: number;
|
||||
demo: boolean;
|
||||
|
||||
status: DSPStatus;
|
||||
|
||||
pollingPaused: boolean;
|
||||
}
|
||||
|
||||
export type DSP408 = DSPBase & {
|
||||
type: 'DSP408';
|
||||
state: DSP408State;
|
||||
meters: DSP408Meters;
|
||||
};
|
||||
|
||||
export type DSP204 = DSPBase & {
|
||||
type: 'DSP204';
|
||||
state: null;
|
||||
meters: null;
|
||||
};
|
||||
|
||||
export type DSP = DSP408 | DSP204;
|
||||
Reference in New Issue
Block a user