@voice-ai-workforce/react
Version:
React components with 3-tier interface modes for voice-controlled workforce applications
50 lines (49 loc) • 2.36 kB
TypeScript
import { VoiceAIConfig, VoiceInterfaceMode, VisibilityConfig, CustomLabels, BusinessContext, CommandDefinition, CommandComplexity, EntityType } from '../../../types/src/types';
/**
* Enhanced hook for components to get their effective visibility configuration and labels
* based on global config, component mode, business context, and overrides
*/
export declare function useVoiceVisibility(config: VoiceAIConfig, componentMode?: VoiceInterfaceMode, componentOverrides?: Partial<VisibilityConfig>, businessContext?: BusinessContext): {
visibility: VisibilityConfig;
labels: CustomLabels;
businessFeatures: {
hasBusinessIntegration: boolean;
hasEntityExtraction: boolean;
hasCommandClassification: boolean;
hasFallbackSupport: boolean;
supportedCommandTypes: CommandComplexity[];
supportedEntityTypes: EntityType[];
businessCapabilities: string[];
};
canHandleBusinessCommands: boolean;
businessName: string;
};
/**
* Resolve business features based on configuration and context
*/
declare function resolveBusinessFeatures(config: VoiceAIConfig, businessContext?: BusinessContext): {
hasBusinessIntegration: boolean;
hasEntityExtraction: boolean;
hasCommandClassification: boolean;
hasFallbackSupport: boolean;
supportedCommandTypes: CommandComplexity[];
supportedEntityTypes: EntityType[];
businessCapabilities: string[];
};
/**
* Utility function to check if a command should be visible based on business context
*/
export declare function shouldShowCommand(command: CommandDefinition, businessFeatures: ReturnType<typeof resolveBusinessFeatures>): boolean;
/**
* Utility function to filter commands based on business capabilities
*/
export declare function filterCommandsByBusinessCapabilities(commands: CommandDefinition[], businessFeatures: ReturnType<typeof resolveBusinessFeatures>): CommandDefinition[];
/**
* Utility function to get business-aware error messages
*/
export declare function getBusinessAwareErrorMessage(errorType: string, businessContext?: BusinessContext): string;
/**
* Utility function to check if voice package can handle a command type
*/
export declare function canVoicePackageHandle(commandComplexity: CommandComplexity, businessFeatures: ReturnType<typeof resolveBusinessFeatures>): boolean;
export {};