import { ComponentPlatform } from '../../../core/src/index.ts'; import { Form } from '../../../../forms/src/index.ts'; import { Container } from '@webprovisions/platform'; import { default as React } from 'react'; import { ContactMethodProps } from './ui'; export type ReactComponentImport = Promise<{ default: React.FunctionComponent; }>; export type Click = (e: React.MouseEvent, cm: ContactMethodProps) => void; export type AdapterSettings = { clientName: string; render: string | ReactComponentImport; handleDescription?: (cm: ContactMethodProps) => Promise | string; handleDisabled?: (cm: ContactMethodProps) => Promise | boolean; handleClick?: (cm: ContactMethodProps) => Promise | Click; onEvaluate?: (cm: ContactMethodProps) => Promise
| Form; onValidate?: (cm: ContactMethodProps) => Promise | ValidationResult; onSubmit?: (cm: ContactMethodProps) => Promise | string; onComplete?: (cm: ContactMethodProps) => Promise | void; }; export type ValidationResult = { errors?: { [key: string]: string; }; errorTypes?: { [key: string]: string; }; valid: boolean; }; export declare enum ContactMethodTrackTypes { ContactMethodValidate = "contact-method-validate", ContactMethodComplete = "contact-method-complete" } declare class ContactMethodPlatform { private container; private componentPlatform; private adapters; private subs; static create(container: Container): Promise; handleAdapters(cm: ContactMethodProps): Promise void; renderDefault?: (extraProps?: Partial) => any; htmlParseInstruction?: import('../../../../ui/src/index.ts').HtmlParseInstruction; href?: string; target?: string; disabled?: boolean; action?: (action: string, value: any) => void; dispatch?: import('../../../../ui/src/index.ts').DispatchAction; symbol?: import('../../../core/src/index.ts').Symbol; description?: string; confirmation?: string; guideId?: string; autoFocus?: boolean; }>>; constructor(container: Container, componentPlatform: ComponentPlatform); static getInstance(container: Container, key?: string): Promise; private track; complete(contactMethod: ContactMethodProps): void | Promise; evaluate(contactMethod: ContactMethodProps): Promise; validate(contactMethod: ContactMethodProps): Promise; submit(contactMethod: ContactMethodProps): Promise; create(settings: AdapterSettings): Promise; dispose(): void; } export default ContactMethodPlatform;