MCPcopy Create free account
hub / github.com/Shitanshukumar607/Drawspace / getDefaultForTool

Function getDefaultForTool

context/toolPropertiesStore.ts:112–133  ·  view source on GitHub ↗
(
  tool: keyof ToolPropertiesMap
)

Source from the content-addressed store, hash-verified

110 * If you add new tools later, add their defaults here.
111 */
112export const getDefaultForTool = (
113 tool: keyof ToolPropertiesMap
114): AnyToolProperties => {
115 switch (tool) {
116 case "pen":
117 return defaultPenProperties;
118 case "eraser":
119 return defaultEraserProperties;
120 case "rectangle":
121 return defaultRectangleProperties;
122 case "ellipse":
123 return defaultEllipseProperties;
124 case "line":
125 return defaultLineProperties;
126 case "arrow":
127 return defaultArrowProperties;
128 // default:
129 // // Fallback — should not happen if selectedToolType matches keys
130 // // eslint-disable-next-line @typescript-eslint/no-explicit-any
131 // return {} as any;
132 }
133};
134
135/**
136 * Store types

Callers 2

buildInitialPropertiesFunction · 0.85
mergeWithDefaultsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected