import { Action } from '@ngrx/store'; import { FormGroupState, Unboxed, KeyValue, SetValueAction, NgrxFormControlId } from 'ngrx-forms'; import { FormComponent } from './form-component'; import { DxFormState } from './form-state'; import { FireStoreDocument } from '@digitaix/types'; export declare enum FormsActionTypes { SubmitForm = "[FormComponent] Submit Form", ResetForm = "[FormComponent] Reset Form", SubmitError = "[FormComponent] Submit Error", SubmitSuccessful = "[FormComponent] Submit Successful", SubmitValid = "[FormComponent] Submit Valid", SubmitInvalid = "[FormComponent] Submit Invalid", RemoveFormArrayItem = "[FormComponent] Remove Form Array Item", AddFormArrayItem = "[FormComponent] Add Form Array Item", FormValidationError = "[FormComponent] Form Validation Error", RegisterForm = "[FormComponent] Register Form", RegisterForms = "[FormComponent] Register Forms", SetDocumentId = "[FormComponent] Set Document Id", SetFormData = "[FormComponent] Set Form Data", OpenCreateDialog = "[FormComponent] Open Create Dialog", OpenCreateDialogWithCallBackFormUpdate = "[FormComponent] Open Create Dialog With Call Back Form Update", OpenEditDialog = "[FormComponent] Open Edit Dialog", CreateFormGroupState = "@digitaix/core/forms/CREATE_FORM_GROUP_STATE" } export declare class DxSetValueAction extends SetValueAction { constructor(controlId: NgrxFormControlId, value: T, tracer: string); } export declare class ResetForm implements Action { formId: string; tracer: string; stack?: string; static TYPE: string; readonly type: string; constructor(formId: string, tracer: string, stack?: string); } export declare class CancelForm implements Action { formId: string; tracer: string; stack: string[]; static TYPE: string; readonly type: string; constructor(formId: string, tracer: string, stack?: string[]); } export declare class OpenEditFormInWindow implements Action { formId: string; documentId: string; tracer: string; stack: string[]; static TYPE: string; readonly type: string; constructor(formId: string, documentId: string, tracer: string, stack?: string[]); } export declare class OpenCreateFormInWindow implements Action { formId: string; tracer: string; initial: Partial; stack: string[]; static TYPE: string; readonly type: string; constructor(formId: string, tracer: string, initial?: Partial, stack?: string[]); } export declare class OpenFormInWindow implements Action { formId: string; tracer: string; stack: string[]; static TYPE: string; readonly type: string; constructor(formId: string, tracer: string, stack?: string[]); } export declare class MarkAsPreSubmitted implements Action { formId: string; static TYPE: string; readonly type: string; constructor(formId: string); } export declare class InitForm implements Action { formId: string; static TYPE: string; readonly type: string; constructor(formId: string); } export declare class DestroyForm implements Action { formId: string; static TYPE: string; readonly type: string; constructor(formId: string); } export declare class CreateFormGroupState implements Action { formId: string; initialValue: FormValue; readonly type = FormsActionTypes.CreateFormGroupState; constructor(formId: string, initialValue: FormValue); } export declare class SetFormData implements Action { formId: string; data: F; readonly type = FormsActionTypes.SetFormData; constructor(formId: string, data: F); } export declare class SubmitValid implements Action { formId: string; value: F; collectionPath?: string; readonly type = FormsActionTypes.SubmitValid; constructor(formId: string, value: F, collectionPath?: string); } export declare class SubmitInvalid implements Action { formId: string; value: F; errors: E; readonly type = FormsActionTypes.SubmitInvalid; constructor(formId: string, value: F, errors: E); } export declare class OpenCreateDialogWithCallBackFormUpdate implements Action { formId: string; initial: Partial>; callbackFormId: string; createPath: (value: Result) => Partial>; readonly type = FormsActionTypes.OpenCreateDialogWithCallBackFormUpdate; constructor(formId: string, initial: Partial>, callbackFormId: string, createPath: (value: Result) => Partial>); } export declare class OpenCreateDialog
implements Action { formId: string; initial?: Partial; tracer?: string; readonly type = FormsActionTypes.OpenCreateDialog; constructor(formId: string, initial?: Partial, tracer?: string); } export declare class OpenCreateRoute implements Action { formId: string; initial?: Partial; tracer?: string; static TYPE: string; readonly type: string; constructor(formId: string, initial?: Partial, tracer?: string); } export declare class OpenEditRoute implements Action { formId: string; documentId: string; tracer?: string; static TYPE: string; readonly type: string; constructor(formId: string, documentId: string, tracer?: string); } export declare class OpenEditDialog implements Action { formId: string; documentId: string; tracer?: string; readonly type = FormsActionTypes.OpenEditDialog; constructor(formId: string, documentId: string, tracer?: string); } export declare class RegisterForms implements Action { forms: { [formId: string]: { initial: any; arrayInitial?: any; collectionPath: string; unbox?: (formValue: any) => any; box?: (rawForm: any) => any; validateAndUpdateForm?: (state: FormGroupState) => FormGroupState; editComponent?: new (...args: any[]) => FormComponent; }; }; readonly type = FormsActionTypes.RegisterForms; constructor(forms: { [formId: string]: { initial: any; arrayInitial?: any; collectionPath: string; unbox?: (formValue: any) => any; box?: (rawForm: any) => any; validateAndUpdateForm?: (state: FormGroupState) => FormGroupState; editComponent?: new (...args: any[]) => FormComponent; }; }); } export declare class RegisterForm implements Action { formId: string; payload: Partial>; readonly type = FormsActionTypes.RegisterForm; constructor(formId: string, payload: Partial>); } export declare class RemoveFormArrayItem implements Action { formId: string; path: string; index: number; readonly type = FormsActionTypes.RemoveFormArrayItem; constructor(formId: string, path: string, index: number); } export declare class AddFormArrayItem implements Action { formId: string; path: string; readonly type = FormsActionTypes.AddFormArrayItem; constructor(formId: string, path: string); } export declare class SetDocumentId implements Action { formId: string; documentId: string; readonly type = FormsActionTypes.SetDocumentId; constructor(formId: string, documentId: string); } export declare class FormValidationError implements Action { formId: string; error: any; readonly type = FormsActionTypes.FormValidationError; constructor(formId: string, error: any); } export declare class SubmitError implements Action { formId: string; error: any; readonly type = FormsActionTypes.SubmitError; constructor(formId: string, error: any); } export declare class SubmitSuccessful implements Action { formId: string; result: D; tracer: string; readonly type = FormsActionTypes.SubmitSuccessful; constructor(formId: string, result: D, tracer: string); } export declare type FormsActions = RemoveFormArrayItem | AddFormArrayItem | SubmitSuccessful | OpenCreateDialogWithCallBackFormUpdate | SetDocumentId | OpenCreateDialog | OpenEditDialog | RegisterForm | FormValidationError | RegisterForms | SubmitError;