/// import * as React from 'react'; export declare const moduleName: (prefix: string) => (constructor: Function) => void; /** * Deep-merges two objects, overwriting left-hand keys with right-hand keys, unionizing arrays. * * @param {Object} left * @param {Object} right * @return {Object} */ export declare const mergeDeep: (a: unknown, b: unknown) => any; /** * Convenience function for handlers that only update state with fixed values, * i.e. `[FooMessage, state => merge(state, { bar: true })]` becomes * `[FooMessage, replace({ bar: true })]` */ export declare const replace: (arg1: unknown, arg0?: object | undefined) => (b: O2) => import("Object/MergeUp").MergeUpFlat, object, 1, import("Object/OptionalKeys").OptionalKeys>>; /** * Returns the count of offsets that are equal between two arrays. Useful for determining * if one array is the prefix of another, i.e.: * * ``` * compareOffsets([1,2,3], [1,2,3,4,5]) -> true * compareOffsets([1,2,3,5], [1,2,3,4,5]) -> false * ``` * * @param {Array} a 'Prefix' array * @param {Array} b Array to compare against * @return {Boolean} Returns true if `a` is the prefix of `b`. */ export declare const compareOffsets: import("Function/Curry").Curry<(a: any, b: any) => boolean>; /** * Accepts a validator object where the values are functions that return boolean, and * returns a function that accepts an object to check against the validator. * * @example * ``` * getValidationFailures({ foo: is(String), bar: is(Function) }) * ({ foo: "Hello", bar: "not Func" }) -> ["bar"] * ``` */ export declare const getValidationFailures: (spec: { [key: string]: (val: any) => boolean; }) => (x: T) => string[]; /** * Accepts an object of key/function pairs and a pure component function, and returns * a new pure component that will generate and inject new props into the pass component * function. * @param {Object} An object hash of functions used to generate new props * @param {Component} A pure function that returns React DOM * @params {Object} Accepts props passed from parent * @return {Component} Returns a new component that generates new props from passed props * * @example * ``` * const FullName = (props) => ({props.fullName}); * * const Name = withProps( * { * fullName: (props) => `${props.first} ${props.last}` * }, * FullName * ); * * * ``` */ export declare type PropMap = { [K in keyof Generated]: (props: Input) => Generated[K]; }; export declare function withProps(fnMap: PropMap, component: React.StatelessComponent): (props: Input) => React.ReactElement | null; export declare const cloneRecursive: (children: any, newProps: any) => any; export declare const clone: (children: any, newProps: any) => React.ReactElement React.ReactElement React.Component)> | null) | (new (props: any) => React.Component)>[]; export declare const suppressEvent: (e: any) => any; /** * Logs a value with a message and returns the value. Good for inspecting complex * function pipelines. */ export declare const log: import("Function/Curry").Curry<(msg: any, val: any, ...extra: any[]) => any>; /** * Provides a functional interface for catching and handling errors. * * @param {Function} handler A handler function to call when an error is thrown. * @param {Function} fn A function to trap errors on. * @return {Function} Returns a function that, when called, passes its arguments to the * wrapped function. If the call succeeds, the it returns the result * of calling the wrapped function, otherwise returns the result of * passing the error (along with the arguments) to the handler. */ export declare type Trap = (handler: (...args: any[]) => T, fn: (...args: any[]) => U) => (...args: any[]) => T | U; export declare const trap: Trap; /** * Converts a value to an array... unless it's already an array, then it just returns it. */ export declare const toArray: import("ramda").Arity1Fn; /** * Helper functions for reducing effect Maps into a single Map. */ export declare const mergeMap: (first: Map, second: Map) => Map; export declare const mergeMaps: (maps: Map[]) => Map; /** * Safely stringifies a JavaScript value to prevent error-ception. */ export declare const safeStringify: (val: any) => string; /** * Safely parses a JavaScript value to prevent error-ception. */ export declare const safeParse: (val: string) => any | undefined; /** * Maps an `init()` or `update()` return value to the proper format. */ export declare const mapResult: (...a: readonly any[]) => any; export declare const reduceUpdater: (value: any, state: any, msg: any, relay: any) => any; /** * Gets the `name` of a Message instance, or defaults to `{INIT}` for nameless * Messages (ie, those called during container initialization) */ export declare const msgName: (obj: any) => string; /** * Gets the `name` of a Command Message instance. A nameless Command Message * typically indicates an error. */ export declare const cmdName: (obj: any) => string; /** * Gets the `name` of a Container if it exists, or defaults to `{Anonymous * Container}` in cases where an explicit name has not been given. */ export declare const contextContainerName: (obj: any) => string;