remove typescript warnings
This commit is contained in:
parent
7f4594e9eb
commit
c0a07eb6cd
@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
handle.on("change", ({ doc }) => {
|
handle.on("change", ({ doc }: { doc: AppDocument | undefined }) => {
|
||||||
if (doc) {
|
if (doc) {
|
||||||
console.log("Document changed:", doc.shapes); // Debug log
|
console.log("Document changed:", doc.shapes); // Debug log
|
||||||
// it looks like Svelte is clever enough to make only the necessary DOM changes
|
// it looks like Svelte is clever enough to make only the necessary DOM changes
|
||||||
@ -85,12 +85,12 @@
|
|||||||
{#if shape.type === "circle"}
|
{#if shape.type === "circle"}
|
||||||
<Circle
|
<Circle
|
||||||
{...shape}
|
{...shape}
|
||||||
handleDragStart={(e, shape) => handleDragStart(e, shape)}
|
handleDragStart={(e: MouseEvent, shape: Shape) => handleDragStart(e, shape)}
|
||||||
/>
|
/>
|
||||||
{:else if shape.type === "triangle"}
|
{:else if shape.type === "triangle"}
|
||||||
<Triangle
|
<Triangle
|
||||||
{...shape}
|
{...shape}
|
||||||
handleDragStart={(e, shape) => handleDragStart(e, shape)}
|
handleDragStart={(e: MouseEvent, shape: Shape) => handleDragStart(e, shape)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
const { id, coordinates, color, handleDragStart } = $props<{
|
const { id, coordinates, color, handleDragStart } = $props();
|
||||||
id: string;
|
|
||||||
coordinates: [number, number, number, number, number, number];
|
|
||||||
color: string;
|
|
||||||
handleDragStart: (e: MouseEvent, shape: any) => void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
let points = $state('');
|
let points = $state('');
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
points = coordinates
|
points = coordinates
|
||||||
.map(p => `${p.x},${p.y}`)
|
.map((p: { x: any; y: any; }) => `${p.x},${p.y}`)
|
||||||
.join(" ");
|
.join(" ");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user