Module

Choku.Common

Package
purescript-choku
Repository
m15a/purescript-choku

The Choku type and its common interface.

#Choku Source

data Choku

The Choku type, simply wrapping a Chalk instance in the Javascript layer.

Instances

#ColorSupportLevel Source

data ColorSupportLevel

Level of color support.

| Level            | Int | Description                           |
| ---------------- | --- | ------------------------------------- |
| `HasNoColors`    |   0 | All colors disabled                   |
| `HasBasicColors` |   1 | Basic color support (16 colors)       |
| `Has256Colors`   |   2 | 256 color support                     |
| `Has16mColors`   |   3 | Truecolor support (16 million colors) |

See also https://github.com/chalk/chalk#chalklevel.

Constructors

Instances

#level Source

level :: Choku -> ColorSupportLevel

Return the color support level of the given chalk.

#mkChoku Source

mkChoku :: ColorSupportLevel -> Choku

Create a new chalk instance with the specified level of color support.

#withChoku Source

withChoku :: String -> Choku -> String

Modify a string with the chalk.

For example,

import Prelude
import Data.Maybe
import Partial.Unsafe
import Choku
let
  chk = unsafePartial $ fromJust (mkChoku 3) # bold # cyan
in
  "hello" `withChoku` chk

produces a bold cyan "hello" string.

#(&|) Source

Operator alias for Choku.Common.withChoku (non-associative / precedence 7)

#withChokuFlipped Source

#(|&) Source

Operator alias for Choku.Common.withChokuFlipped (non-associative / precedence 7)