/** * Node type utilities for FlowDrop * Handles dynamic node type resolution based on NodeMetadata. * * This module provides utilities for: * - Resolving which node type to use based on metadata and config * - Getting available node types for a given metadata * - Creating config schema properties for node type selection * * Works with both built-in types and custom registered types. */ import type { NodeType, NodeMetadata } from '../types/index.js'; /** * Gets the SvelteFlow component name for a given NodeType. * Uses the node component registry to resolve types. * * @param nodeType - The node type identifier * @returns The component name to use */ export declare function getComponentNameForNodeType(nodeType: NodeType | string): string; /** * Gets the available node types for a given NodeMetadata. * Priority: supportedTypes > type > "default" * * @param metadata - The node metadata * @returns Array of available node type identifiers */ export declare function getAvailableNodeTypes(metadata: NodeMetadata): (NodeType | string)[]; /** * Gets the primary (default) node type for a given NodeMetadata. * This is used when no specific type is configured by the user. * * @param metadata - The node metadata * @returns The primary node type */ export declare function getPrimaryNodeType(metadata: NodeMetadata): NodeType | string; /** * Determines the appropriate node type based on configuration and metadata. * * Priority: * 1. configNodeType (if valid for this metadata) * 2. metadata.type (if valid) * 3. First supportedType * 4. "default" * * @param metadata - The node metadata * @param configNodeType - Optional type from user config * @returns The resolved node type */ export declare function resolveNodeType(metadata: NodeMetadata, configNodeType?: string): NodeType | string; /** * Gets the SvelteFlow component name for resolved node type. * This is the main function used by UniversalNode to determine which component to render. * * @param metadata - The node metadata * @param configNodeType - Optional type from user config * @returns The component name to use */ export declare function resolveComponentName(metadata: NodeMetadata, configNodeType?: string): string; /** * Validates if a node type is supported by the given metadata. * * @param metadata - The node metadata * @param nodeType - The type to check * @returns true if the type is supported */ export declare function isNodeTypeSupported(metadata: NodeMetadata, nodeType: NodeType | string): boolean; /** * Gets oneOf options for node type configuration. * Used in config schemas to show available options with labels. * * This function combines: * - Types specified in metadata.supportedTypes * - Registered custom types (optionally filtered) * * @param metadata - The node metadata * @param includeCustomTypes - Whether to include registered custom types * @returns Array of oneOf items with const (type value) and title (display name) */ export declare function getNodeTypeOneOfOptions(metadata: NodeMetadata, includeCustomTypes?: boolean): Array<{ const: string; title: string; }>; /** * Creates a nodeType config property that respects supportedTypes. * This replaces hardcoded enum values in config schemas. * * Uses JSON Schema `oneOf` pattern with `const`/`title` for labeled options, * which is the standard approach supported by form components. * * @param metadata - The node metadata * @param defaultType - Optional default type override * @returns Config schema property object with oneOf for labeled options */ export declare function createNodeTypeConfigProperty(metadata: NodeMetadata, defaultType?: NodeType | string): { type: "string"; title: string; description: string; default: string; oneOf: { const: string; title: string; }[]; }; /** * Check if a type string represents a valid registered or built-in type. * * @param type - The type to check * @returns true if the type is valid */ export declare function isValidNodeType(type: string): boolean; /** * Get all available node types (built-in + registered). * * @returns Array of all valid node type identifiers */ export declare function getAllNodeTypes(): string[];