Skip to content
Merged
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
2 changes: 1 addition & 1 deletion client/src/components/features/mobile-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import clsx from "clsx";

export type MobilePanel = "code" | "compile" | "serial" | "board" | null;

export interface MobileLayoutProps {
interface MobileLayoutProps {
isMobile: boolean;
mobilePanel: MobilePanel;
setMobilePanel: React.Dispatch<React.SetStateAction<MobilePanel>>;
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/features/output-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import clsx from "clsx";
import type { ParserMessage, IOPinRecord } from "@shared/schema";
import type { DebugMessage } from "@/hooks/use-debug-console";

export type OutputTab = "compiler" | "messages" | "registry" | "debug";
type OutputTab = "compiler" | "messages" | "registry" | "debug";

export interface OutputPanelProps {
interface OutputPanelProps {
/* State */
activeOutputTab: OutputTab;
showCompilationOutput: boolean;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const buttonVariants = cva(
},
);

export interface ButtonProps
interface ButtonProps
extends
React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ui/input-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { cn } from "@/lib/utils";
import { SendHorizontal } from "lucide-react";
import { Button } from "@/components/ui/button";

export interface InputGroupProps extends React.InputHTMLAttributes<HTMLInputElement> {
interface InputGroupProps extends React.InputHTMLAttributes<HTMLInputElement> {
onSubmit?: () => void;
inputTestId?: string;
buttonTestId?: string;
Expand Down
5 changes: 1 addition & 4 deletions client/src/hooks/use-compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { useRef, useEffect } from "react";
import type { MutableRefObject } from "react";
import type { SetState } from "./use-compile-and-run";

// original alias kept for compatibility (rare external refs)
export type UseCompileAndRunParams = CompileAndRunParams;

// compilation-only parameters (simulation inputs are injected with no-ops)
export type UseCompilationParams = Omit<
type UseCompilationParams = Omit<
CompileAndRunParams,
|
"serialEventQueueRef"
Expand Down
10 changes: 5 additions & 5 deletions client/src/hooks/use-compile-and-run.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useRef, useState } from "react";

// Local copy of the structured error type returned from backend
export interface CompilationError {
interface CompilationError {
file: string;
line: number;
column: number;
Expand All @@ -16,13 +16,13 @@ import type { IOPinRecord, ParserMessage } from "@shared/schema";
import { useSimulationLifecycle } from "./use-simulation-lifecycle";

// status types
export type CompilationStatus = "ready" | "compiling" | "success" | "error";
type CompilationStatus = "ready" | "compiling" | "success" | "error";

const logger = new Logger("useCompileAndRun");

// reused helpers from previous hooks
export type SimulationStatus = "running" | "stopped" | "paused";
export type CliStatus = "idle" | "compiling" | "success" | "error";
type SimulationStatus = "running" | "stopped" | "paused";
type CliStatus = "idle" | "compiling" | "success" | "error";

export type SetState<T> = (value: T | ((prev: T) => T)) => void;

Expand Down Expand Up @@ -69,7 +69,7 @@ export type CompileAndRunParams = {
startSimulationRef?: MutableRefObject<(() => void) | null>;
};

export interface UseCompileAndRunResult {
interface UseCompileAndRunResult {
/* compilation state & helpers */
compilationStatus: CompilationStatus;
setCompilationStatus: SetState<CompilationStatus>;
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/use-editor-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { useCallback } from "react";
import type { RefObject } from "react";
import type { ToastFn } from "@/hooks/use-toast";

export interface EditorCommandsOptions {
interface EditorCommandsOptions {
toast?: ToastFn;
suppressAutoStopOnce?: () => void;
code?: string;
setCode?: React.Dispatch<React.SetStateAction<string>>;
}

export interface EditorCommandsAPI {
interface EditorCommandsAPI {
undo: () => void;
redo: () => void;
find: () => void;
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/use-file-manager.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useRef, useCallback, useState } from "react";

export type FileEntry = { name: string; content: string };
type FileEntry = { name: string; content: string };

export interface UseFileManagerOptions {
interface UseFileManagerOptions {
tabs?: Array<{ name: string; content: string }>;
onFilesLoaded?: (files: FileEntry[], replaceAll: boolean) => void;
toast?: (params: { title: string; description?: string; variant?: string }) => void;
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/use-pin-state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useEffect, useCallback } from "react";

export interface UsePinStateParams {
interface UsePinStateParams {
resetPinStates: () => void;
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/use-simulation-lifecycle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useRef, useCallback } from "react";

export interface UseSimulationLifecycleOptions {
interface UseSimulationLifecycleOptions {
code: string;
simulationStatus: string;
setSimulationStatus: (s: any) => void;
Expand Down
10 changes: 3 additions & 7 deletions client/src/hooks/use-simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@ import { useRef } from "react";
import { useSimulationControls, UseSimulationControlsParams, SimulationStatus } from "./use-simulation-controls";
import { useSimulationLifecycle } from "./use-simulation-lifecycle";

// re-export types so callers (including tests) can reference them easily
export type {
SimulationStatus,
DebugMessageParams,
} from "./use-simulation-controls";
// re-export types removed (unused exports per knip)

// The hook accepts the same parameters as `useSimulationControls` plus a few
// extras that are required by the lifecycle automation. A parent may also
// provide an optional `startSimulationRef` so it can invoke the start action
// before the hook itself is instantiated (used by the page when wiring up
// the compilation hook).
export type UseSimulationParams = UseSimulationControlsParams & {
type UseSimulationParams = UseSimulationControlsParams & {
startSimulationRef?: React.MutableRefObject<(() => void) | null>;
// forwarded to lifecycle hook
code: string;
Expand All @@ -24,7 +20,7 @@ export type UseSimulationParams = UseSimulationControlsParams & {
hasCompilationErrors?: boolean;
};

export interface UseSimulationResult {
interface UseSimulationResult {
// state values (mirrors useSimulationControls)
simulationStatus: SimulationStatus;
setSimulationStatus: React.Dispatch<React.SetStateAction<SimulationStatus>>;
Expand Down
4 changes: 2 additions & 2 deletions client/src/hooks/use-sketch-analysis.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useMemo } from "react";

export type PinMode = "INPUT" | "OUTPUT" | "INPUT_PULLUP";
type PinMode = "INPUT" | "OUTPUT" | "INPUT_PULLUP";

export interface SketchAnalysisResult {
interface SketchAnalysisResult {
analogPins: number[]; // concrete Arduino pin numbers (A0 -> 14)
varMap: Record<string, number>;
detectedPinModes: Record<number, PinMode>;
Expand Down
2 changes: 1 addition & 1 deletion client/src/hooks/use-sketch-tabs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState, useCallback } from "react";

export interface SketchTab {
interface SketchTab {
id: string;
name: string;
content: string;
Expand Down
4 changes: 1 addition & 3 deletions client/src/lib/compilation-error-state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export type OutputTab = "compiler" | "messages" | "registry" | "debug";

export interface GccCompilationErrorState {
interface GccCompilationErrorState {
cliOutput: string;
hasCompilationErrors: true;
lastCompilationResult: "error";
Expand Down
2 changes: 1 addition & 1 deletion client/src/lib/websocket-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const logger = new Logger("WebSocketManager");
export type ConnectionState = "connecting" | "connected" | "disconnected" | "reconnecting";

// Event types emitted by the manager
export interface WSManagerEvents {
interface WSManagerEvents {
stateChange: (state: ConnectionState) => void;
message: (data: WSMessage) => void;
error: (error: string) => void;
Expand Down
7 changes: 1 addition & 6 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"ignore": [
"server/services/workers/compile-worker.ts",
"tests/MockFactory.ts"
]
}
{}
Loading
Loading