diff --git a/packages/core/src/interfaces/nodes.ts b/packages/core/src/interfaces/nodes.ts index 3e6be74f3..96cb2f785 100644 --- a/packages/core/src/interfaces/nodes.ts +++ b/packages/core/src/interfaces/nodes.ts @@ -23,9 +23,9 @@ export type UserComponent = React.ComponentType & { export type NodeId = string; export type NodeEventTypes = 'selected' | 'dragged' | 'hovered'; -export type Node = { +export type Node

= { id: NodeId; - data: NodeData; + data: NodeData

; events: Record; dom: HTMLElement | null; related: Record; @@ -42,7 +42,7 @@ export type NodeRules = { }; export type NodeRelated = Record; -export type NodeData = { +export type NodeData

= { props: Record; type: string | React.ElementType; name: string; diff --git a/packages/core/src/nodes/useInternalNode.ts b/packages/core/src/nodes/useInternalNode.ts index e0b9f3993..ee778aea4 100644 --- a/packages/core/src/nodes/useInternalNode.ts +++ b/packages/core/src/nodes/useInternalNode.ts @@ -7,26 +7,26 @@ import { NodeContext, NodeContextType } from './NodeContext'; import { useInternalEditor } from '../editor/useInternalEditor'; import { Node } from '../interfaces'; -type internalActions = NodeContextType & { +type internalActions

= NodeContextType & { inNodeContext: boolean; actions: { - setProp: (cb: (props: any) => void, throttleRate?: number) => void; + setProp: (cb: (props: P) => void, throttleRate?: number) => void; setCustom: (cb: (custom: any) => void, throttleRate?: number) => void; setHidden: (bool: boolean) => void; }; }; // TODO: Deprecate useInternalNode in favor of useNode -export type useInternalNodeReturnType = S extends null - ? internalActions - : S & internalActions; +export type useInternalNodeReturnType = S extends null + ? internalActions

+ : S & internalActions

; export function useInternalNode(): useInternalNodeReturnType; -export function useInternalNode( - collect?: (node: Node) => S -): useInternalNodeReturnType; -export function useInternalNode( - collect?: (node: Node) => S -): useInternalNodeReturnType { +export function useInternalNode( + collect?: (node: Node

) => S +): useInternalNodeReturnType; +export function useInternalNode( + collect?: (node: Node

) => S +): useInternalNodeReturnType { const context = useContext(NodeContext); invariant(context, ERROR_USE_NODE_OUTSIDE_OF_EDITOR_CONTEXT);