Module

Halogen.Typewriter

Package
purescript-halogen-typewriter
Repository
qwbarch/halogen-typewriter

#Input Source

type Input :: (Type -> Type) -> Typetype Input m = { cursor :: ComponentHTML Action () m, cursorDelay :: Milliseconds, deleteDelay :: Milliseconds, initialMode :: Mode, jitter :: Effect Number, pauseDelay :: Milliseconds, typeDelay :: Milliseconds, words :: List String }

Configuration to initialize 'typewriter'.

#State Source

type State :: (Type -> Type) -> Typetype State m = { cursor :: ComponentHTML Action () m, cursorDelay :: Milliseconds, cursorHidden :: Boolean, deleteDelay :: Milliseconds, initialMode :: Mode, jitter :: Effect Number, mode :: Mode, outputText :: String, pauseDelay :: Milliseconds, running :: Boolean, typeDelay :: Milliseconds, words :: List String }

Internal state for 'typewriter'.

#Mode Source

data Mode

Current typewriter mode.

Constructors

  • Typing

    The typewriter is currently typing letters.

  • Deleting

    The typewriter is currently deleting letters.

Instances

#Action Source

data Action

Internal actions for 'typewriter'.

Constructors

  • Initialize

    Start the 'typewriter'. This should only be invoked internally. Running this on your own has unintended consequences.

  • UpdateState

    Update the typewriter's state.

  • UpdateCursor

    Update the typewriter's cursor visibility.

#defaultTypewriter Source

defaultTypewriter :: forall m. Input m

Default typewriter 'Input' parameters.

#Output Source

data Output

Possible outputs for 'typewriter'.

Constructors

#typewriter Source

typewriter :: forall q m. MonadAff m => Component q (Input m) Output m

Typewriter component. For more info on how to use this as a child component, see here: https://purescript-halogen.github.io/purescript-halogen/guide/05-Parent-Child-Components.html