Repository URL to install this package:
|
Version:
2.6.18 ▾
|
import { ComponentType } from 'react';
import { Serializable } from '@skava/typings';
import { InputState } from '../input/InputState';
import { InputStateComposedType } from '../input/typings';
import { GetInputValueType, KeyValueSpreadType, FormStateType, ObserverFormClassPropertyTypes, ObserverFormClassListType } from './typings';
/**
* === added these 4 fns to split out serializing ===
*/
export declare function toSerialized(serializable: Serializable): string;
export declare function fromInputToSpread(inputData: Serializable): KeyValueSpreadType;
export declare function fromInputToSerializable(input: InputStateComposedType, getInputValue: GetInputValueType): any;
/**
* we pass getInputValue here because it's used as a recursive tail call
* @see http://2ality.com/2015/06/tail-call-optimization.html
*/
export declare function fromInputToSerializedKeyValue(input: InputStateComposedType, getInputValue: GetInputValueType): KeyValueSpreadType;
/**
* @todo - this should be InputState.from
* @description ensure the value is coerced to inputstate
*/
export declare function toInputState(input: InputStateComposedType, index?: number): InputState<any> | InputStateComposedType;
/**
* @todo split
*/
export declare function toClassList(instance: ComponentType & ObserverFormClassPropertyTypes): ObserverFormClassListType;
/**
* @example
* <label for='eh'>
* <?img /> to show an image instead of the input for custom styles
* <input id='eh'/>
* <span|div> children|text
* </label>
*/
export declare const isInputState: (input: any) => input is InputState<any>;
export declare function handleRecursive(state: FormStateType, index: number): void;
export declare function toInputStateAt(state: FormStateType, index: number): InputStateComposedType;