Skip to main content Link Search Menu Expand Document (external link)

StringifiedValue overview

Type that represents the output of the stringification process of a value. It is in fact an alias for an array of ASText’s (see Text.ts in @parischap/ansi-styles). Each elament of the array represents a line of the stringified value. There must always be at least one line. But that line may contain en empty text.


Table of contents


Constructors

fromStringifiedProperties

Builds a StringifiedValue from a StringifiedProperties

Signature

export declare const fromStringifiedProperties: MTypes.OneArgFunction<PPStringifiedProperties.Type, Type>

fromText

Builds a StringifiedValue from a Text

Signature

export declare const fromText: MTypes.OneArgFunction<ASText.Type, Type>

Destructors

toAnsiString

Returns the ANSI string corresponding to self

Signature

export declare const toAnsiString: (sep?: any) => MTypes.OneArgFunction<Type, string>

toLength

Returns the length of self

Signature

export declare const toLength: MTypes.OneArgFunction<Type, number>

toUnstyledStrings

Returns the stringq corresponding to self without any styling

Signature

export declare const toUnstyledStrings: MTypes.OneArgFunction<Type, MTypes.OverOne<string>>

Equivalences

equivalence

Equivalence for StringifiedValue’s. To be removed when Equal.equals will handle Arrays properly (from Effect 4.0 onwards)

Signature

export declare const equivalence: Equivalence.Equivalence<Type>

Instances

empty

Empty StringifiedValue instance

Signature

export declare const empty: Type

Models

Type (interface)

Type that represents a StringifiedValue

Signature

export interface Type extends MTypes.OverOne<ASText.Type> {}

Predicates

isEmpty

Returns true if self is empty.

Signature

export declare const isEmpty: Predicate.Predicate<Type>

isNotEmpty

Returns true if self is not empty.

Signature

export declare const isNotEmpty: Predicate.Predicate<Type>

Utils

addLineAfter

Returns a copy of self with a new line at the end

Signature

export declare const addLineAfter: (line: ASText.Type) => MTypes.OneArgFunction<Type>

addLineBefore

Returns a copy of self with a new line at the start

Signature

export declare const addLineBefore: (line: ASText.Type) => MTypes.OneArgFunction<Type>

appendToLastLine

Returns a copy of self in which text has been appended to the last line

Signature

export declare const appendToLastLine: (text: ASText.Type) => MTypes.OneArgFunction<Type>

prependToAllLines

Returns a copy of self in which text has been prepended to each line

Signature

export declare const prependToAllLines: (text: ASText.Type) => MTypes.OneArgFunction<Type>

prependToFirstLine

Returns a copy of self in which text has been prepended to the first line

Signature

export declare const prependToFirstLine: (text: ASText.Type) => MTypes.OneArgFunction<Type>

prependToTailLines

Returns a copy of self in which text has been prepended to all lines but the first

Signature

export declare const prependToTailLines: (text: ASText.Type) => MTypes.OneArgFunction<Type>

toSingleLine

Returns a single-line version of self

Signature

export declare const toSingleLine: MTypes.OneArgFunction<Type>