import { ValuesType } from 'utility-types'; export interface FormModel { data: { id: string; type: 'form'; attributes: { 'button-label-next': string; 'button-label-back': string; 'button-label-error': string; 'button-label-sync': string; 'button-label-backto': string; "header-name": string; 'form-id': string; }; relationships: { steps: { data: (StepID | ServiceStepID)[]; }; }; }; included: ModelDetail[]; } export interface StepModel { id: string; type: 'step'; attributes: { text: string; 'button-label-next'?: string; 'button-label-back'?: string; 'button-label-error'?: string; 'button-label-sync'?: string; 'button-label-backto'?: string; }; relationships: { fieldsets: { data: FieldsetID[]; }; presences?: { data?: ConditionID[]; }; }; } export interface FieldsetModel { id: string; type: 'fieldset'; attributes: { legend: string; classes: string; }; relationships: { step: { data: StepID; }; components?: { data?: (ComponentID | BannerID | InfoID)[]; }; presences?: { data?: ConditionID[]; }; 'info-opener'?: { data?: ModalOpenerID; }; }; } export interface TextInputModel { id: string; type: 'text-component'; attributes: { path: string; inline?: boolean; required?: boolean; 'required-error-message'?: string; placeholder: string; keyboard?: string; prefix?: string; maxlength?: number; disabled?: boolean; }; relationships: { label: { data: LabelID; }; fieldset: { data: FieldsetID; }; validations?: { data?: ConditionID[]; }; presences?: { data?: ConditionID[]; }; 'components-to-reset'?: { data?: (ComponentID | FieldsetID)[]; }; }; } export interface LabelModel { id: string; type: 'field-label'; attributes: { text: string; }; } export interface PathValueModel { id: string; type: 'path-value'; attributes: { path: string; }; relationships: { form: { data: { id: string; type: 'form'; }; }; }; } export interface LiteralValueModel { id: string; type: 'literal-value'; attributes: { literal: string; }; } export interface EqConditionModel { id: string; type: 'eq-condition'; attributes?: { 'error-message'?: string; }; relationships: { lhs: { data: ValueID; }; rhs: { data: ValueID; }; }; } export interface NotConditionModel { id: string; type: 'not-condition'; attributes?: { 'error-message'?: string; }; relationships: { condition: { data: ConditionID; }; }; } export interface PatternConditionModel { id: string; type: 'pattern-condition'; attributes: { 'error-message': string; pattern: string; }; relationships: { value: { data: ValueID; }; }; } export interface InArrayCondition { id: string; type: 'in-array-condition'; attributes?: { 'error-message'?: string; }; relationships: { lhs: { data: ValueID; }; rhs: { data: PickID; }; }; } export interface ArrayLiteralValue { id: string; type: 'array-literal-value'; attributes: { array: any[]; }; } export interface AndCondition { id: string; type: 'and-condition'; attributes?: { 'error-message': string; }; relationships: { conditions: { data: ConditionID[]; }; }; } export interface ConditionalValue { id: string; type: 'conditional-value'; relationships: { condition: { data: ConditionID; }; truthy: { data: ValueID; }; falsy: { data: ValueID; }; }; } export interface TruthyCondition { id: string; type: 'truthy-condition'; attributes?: { 'error-message': string; }; relationships: { value: { data: ValueID; }; }; } export interface OrCondition { id: string; type: 'or-condition'; attributes?: { 'error-message': string; }; relationships: { conditions: { data: ConditionID[]; }; }; } export interface NotBlankCondition { id: string; type: 'not-blank-condition'; attributes?: { 'error-message': string; }; relationships: { value: { data: ValueID; }; }; } export interface NumberCondition { id: string; type: 'number-condition'; attributes?: { 'error-message': string; }; relationships: { value: { data: ValueID; }; }; } export interface GtCondition { id: string; type: 'gt-condition'; attributes?: { 'error-message': string; }; relationships: { lhs: { data: ValueID; }; rhs: { data: ValueID; }; }; } export interface LtCondition { id: string; type: 'lt-condition'; attributes?: { 'error-message': string; }; relationships: { lhs: { data: ValueID; }; rhs: { data: ValueID; }; }; } export interface OptionModel { id: string; type: 'option-component'; attributes: { text: string; value: any; }; relationships?: { presences?: { data?: ConditionID[]; }; }; } export interface SelectModel { id: string; type: 'select-component'; attributes: { path: string; inline?: boolean; required?: boolean; 'required-error-message'?: string; placeholder: string; disabled?: boolean; }; relationships: { label: { data: LabelID; }; fieldset: { data: FieldsetID; }; options: { data: OptionID[]; }; validations?: { data?: ConditionID[]; }; presences?: { data?: ConditionID[]; }; 'components-to-reset'?: { data?: (ComponentID | FieldsetID)[]; }; }; } export interface BannerModel { id: string; type: 'intro-component'; attributes: { img?: string; 'requirements-text': string; text: string; title: string; }; relationships: { fieldset: { data: FieldsetID; }; 'info-opener'?: { data?: ModalOpenerID; }; }; } export interface ModalOpenerModel { id: string; type: 'modal-opener'; attributes: { label: 'button' | 'ikon'; 'label-text'?: string; }; relationships: { modal: { data: ModalID; }; }; } export interface ModalModel { id: string; type: 'modal-all-requirements-component' | 'modal-service-status-component'; attributes: { title?: string; 'sub-title'?: string; content: any; }; } export interface InfoModel { id: string; type: 'info-component'; attributes: { entry: string; }; relationships: { fieldset: { data: FieldsetID; }; presences?: { data: ConditionID[]; }; 'info-opener'?: { data?: ModalOpenerID; }; }; } export interface CheckboxGroupModel { id: string; type: 'checkbox-group-component'; attributes: { path: string; required?: boolean; 'required-error-message'?: string; disabled?: boolean; }; relationships: { fieldset: { data: FieldsetID; }; validations?: { data?: ConditionID[]; }; components: { data: CheckboxID[]; }; presences?: { data?: ConditionID[]; }; 'components-to-reset'?: { data?: ComponentID[]; }; }; } export interface CheckBoxModel { id: string; type: 'checkbox-component'; attributes: { value: any; checked?: boolean; }; relationships: { label: { data: LabelID; }; group: { data: CheckboxGroupID; }; presences?: { data?: ConditionID[]; }; }; } export interface CheckedCondition { id: string; type: 'checked-condition'; attributes: { 'error-message'?: string; }; relationships: { component: { data: CheckboxGroupID; }; }; } export interface ServiceStepModel { id: string; type: 'service-step'; attributes: { text: string; 'button-label-next'?: string; 'button-label-back'?: string; 'button-label-error'?: string; 'sequential-mode'?: boolean; 'button-label-sync'?: string; 'button-label-backto'?: string; }; relationships: { fieldsets: { data: FieldsetID[]; }; presences?: { data?: ConditionID[]; }; services: { data: ServiceID[]; }; 'error-handlers': { data: ServiceHandlerID[]; }; }; } export interface OTPServiceModel { id: string; type: 'otp-service'; attributes: { action: 'otpSMSGen' | 'otpSMSValidate' | 'otpSMSGen-resendOTPSMS'; 'country-code': string; 'prd-name': string; 'max-run': string; 'show-resend-timer': string; prefix: string; 'relative-post-url': string; async?: boolean; }; relationships: { form: { data: { id: string; type: 'form'; }; }; 'otp-field': { data: ComponentID; }; 'validate-status-field': { data: PickID; }; 'mobile-no-field': { data: ComponentID; }; 'last-sent-mobile-no-field': { data: PickID; }; 'service-id-field': { data: PickID; }; 'resend-status-field': { data: PickID; }; }; } export interface CheckerServiceModel { id: string; type: 'checker-service'; relationships: { service: { data: ServiceID; }; }; } export interface ServiceHandlerModel { id: string; type: 'service-handler'; relationships: { checker: { data: CheckerServiceID; }; action: { data: ActionShowModalID; }; }; } export interface ActionShowModal { id: string; type: 'action-show-modal'; attributes: { 'not-blocking': boolean; }; relationships: { modal: { data: ModalID; }; }; } export interface ReviewModel { id: string; type: 'review-component'; attributes: { inline?: boolean; editable?: boolean; }; relationships: { label: { data: LabelID; }; fieldset: { data: FieldsetID; }; components: { data: [ComponentID]; }; presences?: { data?: ConditionID[]; }; }; } export interface SelectTextValue { id: string; type: 'select-text-value'; relationships: { component: { data: PickID; }; }; } export declare type ServiceModel = OTPServiceModel; export declare type ComponentModel = TextInputModel | SelectModel | CheckboxGroupModel; export declare type ValueModel = PathValueModel | LiteralValueModel | ArrayLiteralValue | SelectTextValue; export declare type ConditionModel = EqConditionModel | NotConditionModel | PatternConditionModel | InArrayCondition | AndCondition | TruthyCondition | OrCondition | NotBlankCondition | NumberCondition | GtCondition | LtCondition | CheckedCondition; export declare type ModelDetail = StepModel | FieldsetModel | LabelModel | ComponentModel | ValueModel | ConditionModel | ConditionalValue | OptionModel | BannerModel | ModalOpenerModel | ModalModel | InfoModel | CheckBoxModel | ServiceStepModel | ServiceModel | CheckerServiceModel | ServiceHandlerModel | ActionShowModal | ReviewModel; export declare type ModelType = ValuesType>; export declare type PickID = Pick; export declare type ServiceID = PickID; export declare type ComponentID = PickID; export declare type StepID = PickID; export declare type ServiceStepID = PickID; export declare type FieldsetID = PickID; export declare type LabelID = PickID; export declare type ValueID = PickID; export declare type ConditionID = PickID; export declare type OptionID = PickID; export declare type BannerID = PickID; export declare type ModalOpenerID = PickID; export declare type ModalID = PickID; export declare type InfoID = PickID; export declare type CheckboxID = PickID; export declare type CheckboxGroupID = PickID; export declare type CheckerServiceID = PickID; export declare type ServiceHandlerID = PickID; export declare type ActionShowModalID = PickID; export declare type ReviewID = PickID; export declare type ModelID = PickID;