Skip to content

Commit

Permalink
chore: More restrictive type for initProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
ramedina86 committed Sep 30, 2024
1 parent ac02d74 commit 3237d8a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/ui/src/builder/useComponentActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) {
type: string,
parentId: Component["id"],
position?: number,
initProperties?: Partial<Omit<Component, 'id' | 'type' | 'parent' | 'content' | 'handlers' | 'position'>>,
initProperties?: Partial<
Omit<
Component,
"id" | "type" | "parent" | "content" | "handlers" | "position"
>
>,
) {
const newId = generateNewComponentId();
const definition = wf.getComponentDefinition(type);
Expand Down Expand Up @@ -162,7 +167,12 @@ export function useComponentActions(wf: Core, ssbm: BuilderManager) {
type: string,
parentId: Component["id"],
position?: number,
initProperties?: Partial<Component>,
initProperties?: Partial<
Omit<
Component,
"id" | "type" | "parent" | "content" | "handlers" | "position"
>
>,
): Component["id"] {
const component = createComponent(
type,
Expand Down

0 comments on commit 3237d8a

Please sign in to comment.