UNPKG

697 BTypeScriptView Raw
1import { IterationOf } from '../Iteration/IterationOf';
2import { Iteration, IterationMap } from '../Iteration/Iteration';
3/**
4 * @hidden
5 */
6export declare type _Negate<N extends Iteration> = IterationMap[N[4]];
7/**
8 * Negate a [[Number]]
9 * @param N to negate
10 * @returns `string | number | boolean`
11 * @example
12 * ```ts
13 * import {N} from 'ts-toolbelt'
14 *
15 * type test0 = N.Negate<'-10'> // '10'
16 * type test1 = N.Negate<'10'> // '-10'
17 * type test2 = N.Negate<'10', 's'> // '-10'
18 * type test3 = N.Negate<'10', 'n'> // -10
19 * type test4 = N.Negate<'-100'> // string
20 * ```
21 */
22export declare type Negate<N extends number> = N extends unknown ? _Negate<IterationOf<N>>[0] : never;