UNPKG

@indicafix/types

Version:

useful package for type sharing in different services.

89 lines (88 loc) 2.35 kB
import { QuestionType, QuestionConfig, QuestionCategory, ChartType } from './question'; import { Language } from "./types"; export declare type Variable = { key: string; article: string; value: string; hasArticle: boolean; untranslatable: boolean; }; export interface Questionnaire { id: string; surveyId: string; versionName: string; title: string; openingDescription: string; image: string; inputs: Input; questions: QuestionnaireQuestion[]; demographics: QuestionnaireQuestion[]; indicators: QuestionnaireQuestion[]; topics: QuestionnaireTopic[]; order: QuestionnaireOrder[]; dashboardOrder: QuestionnaireOrder[]; variables: Variable[]; languages: Language[]; language: Language; originalLanguage: string; originalTemplateId: string; originalTemplateName: string; status: QuestionnaireStatus; titleInitialPage: string; bodyInitialPage: string; titleFinishPage: string; bodyFinishPage: string; color: string; allowMultipleAnswers: boolean; isAnswerIdentifiable: boolean; createdAt: Date; updatedAt: Date; } export declare type QuestionnaireI18n = Omit<Questionnaire, 'languages'> & { locale: string; questionnaireId: string; }; export declare enum QuestionnaireStatus { pending = "pending", finished = "finished", inTranslation = "in translation", translated = "translated" } export declare type Input = { [key: string]: string; }; export declare type QuestionnaireQuestion = { id: string; libraryId?: string; type: QuestionType; text: string; isEditable: boolean; config: QuestionConfig; chartType: ChartType; createdAt: Date; updatedAt: Date; __v: number; dependency?: QuestionnaireQuestionDependency; leap?: QuestionnaireQuestionLeap; }; declare type QuestionnaireQuestionDependency = { parentQuestionId: string; parentOptionId: string; }; declare type QuestionnaireQuestionLeap = { destinationQuestionId?: string; optionId?: string; }; export declare type QuestionnaireOrder = { id: string; entityId: string; type: QuestionCategory; }; export interface QuestionnaireTopic { id: string; topicId: string; inputs: Input; questions: QuestionnaireQuestion[]; __v: number; } export {};