UNPKG

@canboat/visual-analyzer

Version:

NMEA 2000 data visualization utility (requires SK Server >= 2.15)

120 lines 3.17 kB
/** * Copyright 2025 Scott Bender (scott@scottbender.net) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { EventEmitter } from 'events'; export interface ConnectionProfile { id?: string; name: string; type: 'serial' | 'network' | 'signalk' | 'socketcan' | 'file'; serialPort?: string; baudRate?: number; deviceType?: 'Actisense' | 'Actisense ASCII' | 'iKonvert' | 'Yacht Devices RAW' | 'NavLink2' | 'SocketCAN'; networkHost?: string; networkPort?: number; networkProtocol?: 'tcp' | 'udp'; signalkUrl?: string; signalkUsername?: string; signalkPassword?: string; socketcanInterface?: string; filePath?: string; playbackSpeed?: number; loopPlayback?: boolean; [key: string]: any; } export interface ConnectionsConfig { activeConnection: string | null; profiles: Record<string, ConnectionProfile>; } export interface Config { port: number; connections: ConnectionsConfig; } export interface ConnectionState { isConnected: boolean; lastUpdate: string; error: string | null; } export interface WebSocketMessage { type: string; subscription?: string; [key: string]: any; } export interface BroadcastMessage { event: string; data?: any; timestamp: string; error?: string; auth?: any; } export interface ApiResponse { success: boolean; message?: string; error?: string; messagesProcessed?: number; transmitted?: number; results?: any[]; } export interface ConfigurationResponse { server: { port: number; }; connections: ConnectionsConfig; connection: { isConnected: boolean; error: string | null; lastUpdate: string; activeProfile: ConnectionProfile | null; }; } export interface SignalKLoginMessage { requestId: string; login: { username: string; password: string; }; } export interface SignalKLoginResponse { requestId: string; statusCode: number; login?: { token: string; }; } export interface SignalKMessage { event?: string; data?: any; requestId?: string; statusCode?: number; login?: { token: string; }; } export interface ServerRequest { type: 'send-n2k' | 'n2k-signalk'; values: string[]; } export interface ServerResponse { error?: string; [key: string]: any; } export interface INMEAProvider extends EventEmitter { options: ConnectionProfile; connect(): Promise<void>; disconnect(): void; sendMessage?(data: any): void; isConnectionActive?(): boolean; getAuthStatus?(): any; } //# sourceMappingURL=types.d.ts.map