import { type ReadModelKeyFunction } from '../model/model'; import { type Maybe } from '../value/maybe.type'; /** * A string type used as a key in boolean arrays. */ export type BooleanStringKey = string; /** * Boolean represented by an array to describe the current state and reason why. */ export type BooleanStringKeyArray = BooleanKeyArray; /** * Boolean represented by an array to describe the current state and reason why. * * Having any values in the array is considered "true". */ export type BooleanKeyArray = Maybe; /** * Wraps a key reading function to ensure that empty string keys are not used in boolean key arrays. * * @param readKey - The key reading function to wrap * @returns A wrapped key reading function that throws an error if an empty string is used as a key */ export declare function readBooleanKeySafetyWrap(readKey: ReadModelKeyFunction): ReadModelKeyFunction; /** * Checks if a boolean key array evaluates to false (empty or undefined). * * @param value - The boolean key array to check * @returns True if the array is empty or undefined, false otherwise */ export declare function isFalseBooleanKeyArray(value: BooleanKeyArray): boolean; /** * Checks if a boolean key array evaluates to true (has at least one value). * * @param value - The boolean key array to check * @returns True if the array has at least one value, false otherwise */ export declare function isTrueBooleanKeyArray(value: BooleanKeyArray): boolean; /** * Inserts a value into a boolean key array, removing any existing values with the same key. * * @param array - The boolean key array to insert into * @param value - The value to insert * @param readKey - Function to extract the key from a value * @returns A new boolean key array with the value inserted */ export declare function insertIntoBooleanKeyArray(array: BooleanKeyArray, value: T, readKey: ReadModelKeyFunction): BooleanKeyArray; /** * Removes a value from a boolean key array based on its key. * * @param array - The boolean key array to remove from * @param value - The value to remove * @param readKey - Function to extract the key from a value * @returns A new boolean key array with the value removed */ export declare function removeFromBooleanKeyArray(array: BooleanKeyArray, value: T, readKey: ReadModelKeyFunction): BooleanKeyArray; /** * Removes values from a boolean key array that match the specified key. * * @param array - The boolean key array to remove from * @param key - The key to match for removal * @param readKey - Function to extract the key from a value * @returns A new boolean key array with matching values removed */ export declare function removeByKeyFromBooleanKeyArray(array: BooleanKeyArray, key: string, readKey: ReadModelKeyFunction): BooleanKeyArray; /** * Utility type for working with boolean key arrays. */ export type BooleanKeyArrayUtility = ReturnType>; /** * Creates a utility object with functions for working with boolean key arrays. * * @param readKey - Function to extract the key from a value * @returns An object with utility functions for boolean key arrays */ export declare function booleanKeyArrayUtility(readKey: ReadModelKeyFunction): { isFalse: (value: BooleanKeyArray) => boolean; isTrue: (value: BooleanKeyArray) => boolean; set: (array: BooleanKeyArray, value: T, enable?: boolean) => BooleanKeyArray; insert: (array: BooleanKeyArray, value: T) => BooleanKeyArray; remove: (array: BooleanKeyArray, value: T) => BooleanKeyArray; removeByKey: (array: BooleanKeyArray, key: string) => BooleanKeyArray; }; /** * Utility for working with boolean string key arrays. */ export declare const BooleanStringKeyArrayUtility: { isFalse: (value: BooleanKeyArray) => boolean; isTrue: (value: BooleanKeyArray) => boolean; set: (array: BooleanKeyArray, value: string, enable?: boolean) => BooleanKeyArray; insert: (array: BooleanKeyArray, value: string) => BooleanKeyArray; remove: (array: BooleanKeyArray, value: string) => BooleanKeyArray; removeByKey: (array: BooleanKeyArray, key: string) => BooleanKeyArray; };