@tscircuit/pcb-viewer 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -33,15 +33,34 @@ type EditTraceHintEvent = {
33
33
  };
34
34
  type EditEvent = EditComponentLocationEvent | EditTraceHintEvent;
35
35
 
36
+ interface State {
37
+ selected_layer: LayerRef;
38
+ in_edit_mode: boolean;
39
+ in_move_footprint_mode: boolean;
40
+ in_draw_trace_mode: boolean;
41
+ is_moving_component: boolean;
42
+ is_drawing_trace: boolean;
43
+ is_showing_rats_nest: boolean;
44
+ selectLayer: (layer: LayerRef) => void;
45
+ setEditMode: (mode: "off" | "move_footprint" | "draw_trace") => void;
46
+ setIsMovingComponent: (is_moving: boolean) => void;
47
+ setIsDrawingTrace: (is_drawing: boolean) => void;
48
+ setIsShowingRatsNest: (is_showing: boolean) => void;
49
+ }
50
+ type StateProps = {
51
+ [key in keyof State]: State[key] extends boolean ? boolean : never;
52
+ };
53
+
36
54
  type Props = {
37
55
  children?: any;
38
56
  soup?: any;
39
57
  height?: number;
40
58
  allowEditing?: boolean;
41
59
  editEvents?: EditEvent[];
60
+ initialState?: Partial<StateProps>;
42
61
  onEditEventsChanged?: (editEvents: EditEvent[]) => void;
43
62
  };
44
- declare const PCBViewer: ({ children, soup, height, allowEditing, editEvents: editEventsProp, onEditEventsChanged, }: Props) => react_jsx_runtime.JSX.Element;
63
+ declare const PCBViewer: ({ children, soup, height, initialState, allowEditing, editEvents: editEventsProp, onEditEventsChanged, }: Props) => react_jsx_runtime.JSX.Element;
45
64
 
46
65
  declare const applyEditEvents: (soup: AnySoupElement[], edit_events: EditEvent[]) => AnySoupElement[];
47
66