@voiceflow/voiceflow-types
Version:
Voiceflow 'voiceflow' project types
27 lines • 1.37 kB
TypeScript
import type { DeepPartialByKey } from '@voiceflow/base-types';
import { ProjectType } from '../constants';
import type { SupportedProjectType } from '../project';
import type { ChatPlatformData, ChatSettings, ChatVersion } from './chat';
import type { VoicePlatformData, VoiceSettings, VoiceVersion } from './voice';
export * from './base';
export * from './chat';
export * from './voice';
export interface PlatformDataPerType {
[ProjectType.CHAT]: ChatPlatformData;
[ProjectType.VOICE]: VoicePlatformData;
}
export interface SettingsPerType {
[ProjectType.CHAT]: ChatSettings;
[ProjectType.VOICE]: VoiceSettings;
}
export interface VersionPerType {
[ProjectType.CHAT]: ChatVersion;
[ProjectType.VOICE]: VoiceVersion;
}
export type Version = VersionPerType[SupportedProjectType];
export type Settings = SettingsPerType[SupportedProjectType];
export type PlatformData = PlatformDataPerType[SupportedProjectType];
export type Intent = PlatformData['intents'] extends (infer I)[] ? I : never;
export declare const defaultPlatformData: <T extends SupportedProjectType>(type: T, platformData: DeepPartialByKey<PlatformDataPerType[T], 'settings'>) => PlatformDataPerType[T];
export declare const defaultSettings: <T extends SupportedProjectType>(type: T, platformData: Partial<SettingsPerType[T]>) => SettingsPerType[T];
//# sourceMappingURL=index.d.ts.map