docs(ui): add docstring to useInputFieldTemplate

This commit is contained in:
psychedelicious
2025-03-21 09:18:01 +10:00
parent f966fb8b9c
commit 21f346717a

View File

@@ -3,6 +3,15 @@ import type { FieldInputTemplate } from 'features/nodes/types/field';
import { useMemo } from 'react';
import { assert } from 'tsafe';
/**
* Returns the template for a specific input field of a node.
*
* **Note:** This hook will throw an error if the template for the input field is not found.
*
* @param nodeId - The ID of the node.
* @param fieldName - The name of the input field.
* @throws Will throw an error if the template for the input field is not found.
*/
export const useInputFieldTemplate = (nodeId: string, fieldName: string): FieldInputTemplate => {
const template = useNodeTemplate(nodeId);
const fieldTemplate = useMemo(() => {