/** * Increments a string that ends with a number, or appends a number if none exists * @param str - The string or number to increment * @param firstAppend - The separator/number to use when no number exists (default: ' 1') * @returns The incremented string * * @example * ```ts * stringIncr('Hello world 42') // => 'Hello world 43' * stringIncr('Hello world') // => 'Hello world 1' * stringIncr('Hello world', '-1') // => 'Hello world-1' * stringIncr(42) // => '43' * ``` */ declare function stringIncr(str: string | number, firstAppend?: string | number): string; /** * Decrements a string that ends with a number, removing it when reaching 1 or 0 * @param str - The string or number to decrement * @param removeSeparator - Optional separator to remove when number reaches 1 or 0 (not applied when number > 1) * @returns The decremented string, or the base string when the number reaches 1 or below * * @example * ```ts * stringDecr('Hello world 42') // => 'Hello world 41' * stringDecr('Hello world 2') // => 'Hello world 1' * stringDecr('Hello world 1') // => 'Hello world' * stringDecr('Hello world-1') // => 'Hello world-' * stringDecr('Hello world-1', '-') // => 'Hello world' * * // removeSeparator only applies when number reaches 1 or 0 * stringDecr('Hello world-42', '-') // => 'Hello world-41' (separator kept) * stringDecr('Hello world-2', '-') // => 'Hello world-1' (separator kept) * stringDecr('Hello world-1', '-') // => 'Hello world' (separator removed) * * stringDecr('Hello world#1', '#') // => 'Hello world' * stringDecr(42) // => '41' * stringDecr(0) // => '-1' * ``` */ declare function stringDecr(str: string | number, removeSeparator?: string): string; export { stringDecr, stringIncr };