@voiceflow/voiceflow-types
Version:
Voiceflow 'voiceflow' project types
27 lines • 1.43 kB
TypeScript
import type { DeepPartialByKey } from '@voiceflow/base-types';
import { ProjectType } from '../constants/index.js';
import type { SupportedProjectType } from '../project/index.js';
import type { ChatPlatformData, ChatSettings, ChatVersion } from './chat/index.js';
import type { VoicePlatformData, VoiceSettings, VoiceVersion } from './voice/index.js';
export * from './base.js';
export * from './chat/index.js';
export * from './voice/index.js';
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