Skip to content

Commit

Permalink
fix: missing type in UserComponentConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
prevwong committed May 20, 2021
1 parent 0a126ac commit 3da530a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/interfaces/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import React from 'react';

import { QueryMethods } from '../editor/query';

type UserComponentConfig<T> = {
export type UserComponentConfig<T> = {
displayName: string;
rules: Partial<NodeRules>;
related: Partial<NodeRelated>;
props: Partial<T>;
custom: Record<string, any>;
isCanvas: boolean;

// TODO: Deprecate
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/createNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

import { getRandomNodeId } from './getRandomNodeId';

import { Node, FreshNode } from '../interfaces';
import { Node, FreshNode, UserComponentConfig } from '../interfaces';
import {
defaultElementProps,
Element,
Expand Down Expand Up @@ -89,7 +89,7 @@ export function createNode(
}

// TODO: use UserComponentConfig type
const userComponentConfig = actualType.craft as any;
const userComponentConfig = actualType.craft as UserComponentConfig<any>;

if (userComponentConfig) {
node.data.displayName =
Expand Down

0 comments on commit 3da530a

Please sign in to comment.