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

StyleMap overview

This module implements a map of ContextStyler’s (see


Table of contents


Constructors

make

Constructor

Signature

export declare const make: (params: MTypes.Data<Type>) => Type

Destructors

get

Returns the ValueBasedStyler associated with partName which identifies a part of a stringified value. Returns ASContextStyler.none if partName is not present in self.

Signature

export declare const get: (partName: string) => MTypes.OneArgFunction<Type, PPValueBasedStyler.Type>

id

Returns the id property of self

Signature

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

styles

Returns the styles property of self

Signature

export declare const styles: MTypes.OneArgFunction<Type, Styles.Type>

Equivalences

equivalence

Equivalence

Signature

export declare const equivalence: Equivalence.Equivalence<Type>

Guards

has

Type guard

Signature

export declare const has: (u: unknown) => u is Type

Instances

darkMode

StyleMap instance for ansi dark mode

Signature

export declare const darkMode: Type

none

StyleMap instance that doesn’t apply any formatting (uses the none ContextStyler of the ansi-styles library for all parts to be formatted)

Signature

export declare const none: Type

Models

Styles (namespace)

Namespace that represents a map of ValueBasedStyler’s

Type (interface)

Type of a Styles

Signature

export interface Type extends HashMap.HashMap<string, PPValueBasedStyler.Type> {}

Type (interface)

Interface that represents a StyleMap

Signature

export interface Type extends Equal.Equal, MInspectable.Inspectable, Pipeable.Pipeable {
  /** Id of this StyleMap instance. Useful for equality and debugging. */
  readonly id: string
  /** Map of Sttyle's to be applied to the different parts of the value to stringify */
  readonly styles: Styles.Type

  /** @internal */
  readonly [_TypeId]: _TypeId
}

moduleTag

Module tag

Signature

export declare const moduleTag: "@parischap/pretty-print/StyleMap/"