UNPKG

@parischap/pretty-print

Version:
99 lines 2.71 kB
/** * This module implements a map of ContextStyler's (see * * @parischap/ansi-styles/ContextStyler.ts). These ContextStyler's are used to style the different parts of a * stringified value. * * With the make function, you can define your own instances if the provided ones don't suit your * needs. */ import { MInspectable, MTypes } from '@parischap/effect-lib'; import { Equal, Equivalence, HashMap, Pipeable } from 'effect'; import * as PPValueBasedStyler from './ValueBasedStyler.js'; /** * Module tag * * @category Models */ export declare const moduleTag = "@parischap/pretty-print/StyleMap/"; declare const _TypeId: unique symbol; type _TypeId = typeof _TypeId; /** * Namespace that represents a map of ValueBasedStyler's * * @category Models */ export declare namespace Styles { /** * Type of a Styles * * @category Models */ interface Type extends HashMap.HashMap<string, PPValueBasedStyler.Type> { } } /** * Interface that represents a StyleMap * * @category Models */ 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; } /** * Type guard * * @category Guards */ export declare const has: (u: unknown) => u is Type; /** * Equivalence * * @category Equivalences */ export declare const equivalence: Equivalence.Equivalence<Type>; /** * Constructor * * @category Constructors */ export declare const make: (params: MTypes.Data<Type>) => Type; /** * Returns the `id` property of `self` * * @category Destructors */ export declare const id: MTypes.OneArgFunction<Type, string>; /** * Returns the `styles` property of `self` * * @category Destructors */ export declare const styles: MTypes.OneArgFunction<Type, Styles.Type>; /** * Returns the ValueBasedStyler associated with `partName` which identifies a part of a stringified * value. Returns `ASContextStyler.none` if `partName` is not present in `self`. * * @category Destructors */ export declare const get: (partName: string) => MTypes.OneArgFunction<Type, PPValueBasedStyler.Type>; /** * StyleMap instance for ansi dark mode * * @category Instances */ export declare const darkMode: Type; /** * StyleMap instance that doesn't apply any formatting (uses the none ContextStyler of the * ansi-styles library for all parts to be formatted) * * @category Instances */ export declare const none: Type; export {}; //# sourceMappingURL=StyleMap.d.ts.map