Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/components/ConnectionManagerPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
Table,
} from 'reactstrap'

import { ConnectionProfile } from '@server/types'
/*
interface ConnectionProfile {
id: string
name: string
Expand All @@ -58,6 +60,7 @@ interface ConnectionProfile {
playbackSpeed?: number
loopPlayback?: boolean
}
*/

interface ServerConfig {
server: {
Expand Down Expand Up @@ -283,7 +286,7 @@ export const ConnectionManagerPanel: React.FC<ConnectionManagerPanelProps> = ({
const openEditModal = (profileId: string) => {
if (!config?.connections.profiles[profileId]) return

const profile = config.connections.profiles[profileId]
const profile: ConnectionProfile = config.connections.profiles[profileId]
setFormData(profile)
setEditingProfile({ id: profileId, ...profile })
setShowModal(true)
Expand Down
33 changes: 33 additions & 0 deletions src/server-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* 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.
*/

// Re-export server types for use in the web application
export type {
ConnectionProfile,
ConnectionsConfig,
Config,
ConnectionState,
WebSocketMessage,
BroadcastMessage,
ApiResponse,
ConfigurationResponse,
SignalKLoginMessage,
SignalKLoginResponse,
INMEAProvider,
} from '@server/types'

// Additional utility types for the web application
export type ConnectionType = 'serial' | 'network' | 'signalk' | 'socketcan' | 'file'
20 changes: 20 additions & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* 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.
*/

// Central export for all server-side types available to the web application

// Visual Analyzer Server Types
export * from '../server-types'
14 changes: 8 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"include": ["./src/**/*"],
"exclude": ["node_modules", "dist", "server", "test"],
"include": ["./src/**/*", "./server/types.ts"],
"exclude": ["node_modules", "dist", "test"],
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
Expand All @@ -16,7 +16,7 @@
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./ts-build" /* Redirect output structure to the directory. */,
"rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
Expand All @@ -43,9 +43,11 @@
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */

/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
"paths": {
"@server/*": ["server/*"]
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
Expand Down
3 changes: 3 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ module.exports = {
fallback: {
buffer: require.resolve('buffer/'),
},
alias: {
'@server': path.resolve(__dirname, 'server'),
},
},
module: {
rules: [
Expand Down
Loading