import { type AnyTuple } from "../common/types/anyTuple"; import { type RemoveKind, type JoinTuple, type TupleHasSpread } from "./types"; /** * Joins array elements into a string. * * **Supported call styles:** * - Classic: `join(array, separator)` → returns a string * - Curried: `join(separator)` → returns a function waiting for the array * * The input array is not mutated. * * ```ts * A.join( * ["alpha", "beta"], * "-", * ); // "alpha-beta" * * pipe( * ["a", "b", "c"], * A.join(""), * ); // "abc" * * A.join( * ["x", "y"], * ":", * ); // "x:y" * ``` * * @remarks * - Tuple inputs preserve their literal joined type * - Uses the same semantics as [`Array.prototype.join`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join) * * @see https://utils.duplojs.dev/en/v1/api/array/join * * @namespace A * */ export declare function join(separator: GenericSeparator): (array: GenericArray) => GenericArray extends AnyTuple ? TupleHasSpread> extends true ? string : JoinTuple, GenericSeparator> : string; export declare function join(array: GenericArray, separator: GenericSeparator): GenericArray extends AnyTuple ? TupleHasSpread> extends true ? string : JoinTuple, GenericSeparator> : string;