main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
697 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { IterationOf } from '../Iteration/IterationOf';
|
---|
| 2 | import { Iteration, IterationMap } from '../Iteration/Iteration';
|
---|
| 3 | /**
|
---|
| 4 | * @hidden
|
---|
| 5 | */
|
---|
| 6 | export 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 | */
|
---|
| 22 | export declare type Negate<N extends number> = N extends unknown ? _Negate<IterationOf<N>>[0] : never;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.