Debian Codegraph @

type-fest/test-d/literal-to-primitive.ts

raw symbols SCIP
1 import {expectType} from 'tsd';
2 import type {LiteralToPrimitive} from '../index.d.ts';
3
4 // Simple usage
5 declare const numberPrimitive: LiteralToPrimitive<123>;
6 expectType<number>(numberPrimitive);
7
8 const symbol = Symbol('foo');
9
10 // Union
11 declare const kitchenSink: LiteralToPrimitive<123 | 123n | 'hello' | true | undefined | typeof symbol | null | {key: string}>;
12 expectType<number | bigint | string | boolean | undefined | symbol | null>(kitchenSink);