Module Revery_UI_Components.Input

module Hooks = Revery_UI_Hooks
type state = {
isFocused : bool;
internalValue : string;
cursorPosition : int;
cursorTimer : Revery_Core.Time.t;
}
type textUpdate = {
newString : string;
cursorPosition : int;
}
type cursorUpdate = {
inputString : string;
change : int;
}
type changeEvent = {
value : string;
character : string;
key : Revery_Core.Key.t;
altKey : bool;
ctrlKey : bool;
shiftKey : bool;
superKey : bool;
}
type action =
| CursorPosition of cursorUpdate
| CursorTimer
| SetFocus of bool
| UpdateText of textUpdate
| ResetCursorTimer
val getStringParts : int -> string -> string * string
val getSafeStringBounds : string -> int -> int -> int
val removeCharacterBefore : string -> int -> textUpdate
val removeCharacterAfter : string -> int -> textUpdate
val addCharacter : string -> string -> int -> textUpdate
val reducer : action -> state -> state
val defaultHeight : int
val defaultWidth : int
val inputTextMargin : int
val defaultStyles : [> `BackgroundColor of Color.Rgba'.t | `Border of Revery_UI.Style.Border.t | `Color of Color.Rgba'.t | `Height of int | `Width of int ] list
val component : ?⁠key:Revery_UI.React.Key.t -> ((state Revery_UI.React.Hooks.Reducer.t -> Revery_UI.React.Hooks.Effect.onMount Revery_UI.React.Hooks.Effect.t -> string Revery_UI.React.Hooks.Ref.t -> string Revery_UI.React.Hooks.Effect.t -> unit, unit, state Revery_UI.React.Hooks.Reducer.t -> Revery_UI.React.Hooks.Effect.onMount Revery_UI.React.Hooks.Effect.t -> string Revery_UI.React.Hooks.Ref.t -> string Revery_UI.React.Hooks.Effect.t -> unit, state Revery_UI.React.Hooks.Reducer.t -> Revery_UI.React.Hooks.Effect.onMount Revery_UI.React.Hooks.Effect.t -> string Revery_UI.React.Hooks.Ref.t -> string Revery_UI.React.Hooks.Effect.t -> unit) Brisk_reconciler__.Hooks.t -> (unit, unit, state Revery_UI.React.Hooks.Reducer.t -> Revery_UI.React.Hooks.Effect.onMount Revery_UI.React.Hooks.Effect.t -> string Revery_UI.React.Hooks.Ref.t -> string Revery_UI.React.Hooks.Effect.t -> unit, unit) Brisk_reconciler__.Hooks.t * Revery_UI.React.syntheticElement) -> Revery_UI.React.syntheticElement
val make : style:Revery_UI.Style.allProps list -> autofocus:bool -> placeholder:string -> cursorColor:Revery_Core.Color.t -> placeholderColor:Revery_Core.Color.t -> onChange:(changeEvent -> unit) -> onKeyDown:(Revery_UI.NodeEvents.keyEventParams -> unit) -> value:string option -> unit -> Revery_UI.React.syntheticElement
val createElement : children:'a -> ?⁠style:Revery_UI.Style.allProps list -> ?⁠placeholderColor:Color.Rgba'.t -> ?⁠cursorColor:Color.Rgba'.t -> ?⁠autofocus:bool -> ?⁠placeholder:string -> ?⁠onKeyDown:(Revery_UI.NodeEvents.keyEventParams -> unit) -> ?⁠onChange:(changeEvent -> unit) -> ?⁠value:string -> unit -> Revery_UI.React.syntheticElement