Skip to content

Commit eddc14b

Browse files
committed
fix typescript errors
1 parent 89764ac commit eddc14b

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

canvas/src/blocks/value-view/components/ValueRenderer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import cn from "classnames"
2-
import type { BlockData } from "machine-wasm"
2+
import type { InternalBlockData } from "machine-wasm"
33
import { memo } from "react"
44

55
import { bitsToList } from "@/blocks/value-view/utils/bits-to-list"
66
import { flipBit } from "@/blocks/value-view/utils/flip-bit"
77
import { engine } from "@/engine"
88

99
type ValueRendererProps = Pick<
10-
BlockData.ValueView,
10+
InternalBlockData.ValueView,
1111
"visual" | "target" | "offset"
1212
> & { values: number[] }
1313

canvas/src/canvas/utils/addBlock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockData } from "machine-wasm"
1+
import { InternalBlockData } from "machine-wasm"
22

33
import { getDefaultProps } from "@/blocks"
44
import { setupBlock } from "@/blocks"
@@ -22,7 +22,7 @@ export function addBlock<T extends BlockTypes>(type: T, options?: Options<T>) {
2222
if (type === "Machine") {
2323
id = engine.ctx?.add_machine()
2424
} else {
25-
id = engine.ctx?.add_block({ type, ...props } as BlockData)
25+
id = engine.ctx?.add_block({ type, ...props } as InternalBlockData)
2626
}
2727

2828
if (typeof id !== "number") return

canvas/src/engine/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import setup, {
22
Action,
3-
BlockData,
3+
InternalBlockData,
44
CanvasError,
55
Controller,
66
Effect,
@@ -413,7 +413,7 @@ export class CanvasEngine {
413413

414414
updateNodeData(id, data)
415415

416-
engine.ctx.update_block(id, { ...data, type } as BlockData)
416+
engine.ctx.update_block(id, { ...data, type } as InternalBlockData)
417417
engine.ctx.force_tick_block(id)
418418
}
419419

canvas/src/persist/hooks/useSaveState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockData } from "machine-wasm"
1+
import { InternalBlockData } from "machine-wasm"
22
import { useReactFlow } from "reactflow"
33

44
import { getDefaultProps } from "@/blocks"
@@ -65,7 +65,7 @@ export function useSaveState(): SaveStateContext {
6565
engine.ctx?.add_machine_with_id(id)
6666
} else {
6767
const props = { ...getDefaultProps(type), ...nodeProps }
68-
const data = { type, ...props } as BlockData
68+
const data = { type, ...props } as InternalBlockData
6969

7070
engine.ctx?.add_block_with_id(id, data)
7171
}

canvas/src/store/blocks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Draft, produce } from "immer"
22

33
import { isBlock } from "@/blocks"
4-
import { BlockNode, BlockTypeMap, BlockValues } from "@/types/Node"
4+
import { BlockNode, BlockValues } from "@/types/Node"
55

66
import { $nodes } from "./nodes"
77
import { BlockDataByType } from "machine-wasm"

canvas/src/store/remote-values.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BlockData } from "machine-wasm"
1+
import { InternalBlockData } from "machine-wasm"
22
import { atom, computed, map } from "nanostores"
33

44
import { isBlock } from "@/blocks"
@@ -22,7 +22,7 @@ export function updateValueViewers() {
2222
}
2323

2424
export type MemoryRegion = Pick<
25-
BlockData.ValueView,
25+
InternalBlockData.ValueView,
2626
"offset" | "size" | "color"
2727
> & { id: number }
2828

0 commit comments

Comments
 (0)