Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / src / new-forms / typings.ts
Size: Mime:
// @note @circular
import { InputState } from './inputs/InputState'

export interface ValidatorMeta {
  input: InputState
  // form: FormState
}

export type Value = string | number | boolean

export type Type =
  | 'checkbox'
  | 'password'
  | 'color'
  | 'date'
  | 'text'
  | 'number'
  // ^ are main
  | 'search'
  | 'range'
  | 'tel'
  | 'email'
  | 'url'

export type ValidatorFunction = (
  value: Value,
  meta?: ValidatorMeta
) => boolean | string

// | ValueType[] | { [key: string]: ValueType }
export type SerializerFunction<ValueType = any> = (
  inputState: InputState
) => { [key: string]: ValueType }

export interface SerializedObj {
  [key: string]: string
}

export { ThemedOuterStyledProps } from 'styleh-components'
import { StyledComponentClass } from 'styleh-components'
export type StylehComponent<Props> = StyledComponentClass<Props, any>

export interface AnyObj {
  [key: string]: any
}

// @thought for CommonState
// interface IValidatable {}
// interface ISerializable {}
// interface IMergable {}
// interface IIdentifiable {}