import { type FactoryWithInput, type Factory, type FactoryWithRequiredInput } from '../getter'; import { type Maybe } from '../value'; import { type TransformStringFunctionConfig } from './transform'; /** * A factory that produces a string value with no input. */ export type StringFactory = Factory; /** * A function that converts a value of type T to a string. */ export type ToStringFunction = FactoryWithRequiredInput; /** * Wraps an existing factory with a {@link ToStringFunction} to produce strings from the factory's output. * * @param factory - the original value factory * @param toStringFunction - function to convert the factory's output to a string * @returns a new factory that produces string values */ export declare function stringFactoryFromFactory(factory: Factory, toStringFunction: ToStringFunction): StringFactory; /** * A factory that returns a string based on the input date. */ export type StringFromDateFactory = FactoryWithInput>; /** * Configuration for creating a {@link StringFromDateFactory}. */ export interface StringFromDateConfig { /** * The number of digits to return from the end of the generated string. * * Is ignored if transformStringConfig.slice is set, or the value is 0. */ readonly takeFromEnd?: number; /** * Optional/additional transformations to apply to the string. */ readonly transformStringConfig?: Maybe; /** * The factory function to generate the initial string from the input date. */ readonly dateToString: FactoryWithRequiredInput; } /** * Creates a factory that returns a string based on the input date. * @param config Configuration for the factory. * @returns A factory that returns a string based on the input date. */ export declare function stringFromDateFactory(config: StringFromDateConfig): StringFromDateFactory; /** * Creates a factory that returns a string based on the Unix timestamp of the input date. * * @param digitsFromEnd The number of digits to return from the end of the generated string. Defaults to 7. * @returns A StringFromDateFactory. */ export declare function stringFromTimeFactory(digitsFromEnd?: number): StringFromDateFactory;