Skip to content

Commit

Permalink
Fix some typings
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Feb 9, 2024
1 parent 03ae693 commit f984382
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/forms/src/config/elements/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const sequenceConfig: FormElementConfig<SequenceElement> = {
return obj;
},
getChildren(element, elements) {
return (element as SequenceElement).data.elements.map(
return element.data.elements.map(
(elementId: string) => elements[elementId]
);
},
Expand Down
5 changes: 3 additions & 2 deletions packages/forms/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export type FormConfig<T extends FormElement<any> = FormElement<any>> = {
elements: Record<string, FormElementConfig<T>>;
};

export type ConfigElements<Config extends FormConfig> =
keyof Config['elements'];
export type ConfigElements<Config extends FormConfig> = ReturnType<
Config['elements'][keyof Config['elements']]['parseData']
>;

0 comments on commit f984382

Please sign in to comment.