@parischap/pretty-print
Version:
A functional library to pretty-print and treeify objects
122 lines • 3.21 kB
TypeScript
/**
* This module implements a type that takes care of filtering properties when printing non-primitive
* values.
*
* 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, Pipeable, Predicate } from 'effect';
import type * as PPValues from './Values.js';
/**
* Module tag
*
* @category Models
*/
export declare const moduleTag = "@parischap/pretty-print/PropertyFilter/";
declare const _TypeId: unique symbol;
type _TypeId = typeof _TypeId;
/**
* Namespace of a PropertyFilter used as an action
*
* @category Models
*/
export declare namespace Action {
/**
* Type of the action
*
* @category Models
*/
interface Type extends MTypes.OneArgFunction<PPValues.Type> {
}
}
/**
* Type that represents a PropertyFilter.
*
* @category Models
*/
export interface Type extends Action.Type, Equal.Equal, MInspectable.Inspectable, Pipeable.Pipeable {
/** Id of this PropertyFilter instance. Useful for equality and debugging */
readonly id: string;
/** @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: ({ id, action }: {
readonly id: string;
readonly action: Action.Type;
}) => Type;
/**
* Returns the `id` property of `self`
*
* @category Destructors
*/
export declare const id: MTypes.OneArgFunction<Type, string>;
/**
* PropertyFilter instance that removes properties of non-primitive values whose value is not a
* function
*
* @category Instances
*/
export declare const removeNonFunctions: Type;
/**
* PropertyFilter instance that removes properties of non-primitive values whose value is a function
*
* @category Instances
*/
export declare const removeFunctions: Type;
/**
* PropertyFilter instance that removes non-enumerable properties of non-primitive values
*
* @category Instances
*/
export declare const removeNonEnumerables: Type;
/**
* PropertyFilter instance that removes enumerable properties of non-primitive values
*
* @category Instances
*/
export declare const removeEnumerables: Type;
/**
* PropertyFilter instance that removes properties of non-primitive values with a string key
*
* @category Instances
*/
export declare const removeStringKeys: Type;
/**
* PropertyFilter instance that removes properties of non-primitive values with a symbolic key
*
* @category Instances
*/
export declare const removeSymbolicKeys: Type;
/**
* Constructor of a propertyFilter instance that removes properties of non-primitive values whose
* key is:
*
* - A string that does not fulfill `predicate`
* - A symbol
*
* @category Constructors
*/
export declare const removeNotFulfillingKeyPredicateMaker: ({ id, predicate }: {
readonly id: string;
readonly predicate: Predicate.Predicate<string>;
}) => Type;
export {};
//# sourceMappingURL=PropertyFilter.d.ts.map