mirror of
https://github.com/sindresorhus/type-fest.git
synced 2026-01-25 14:57:30 +00:00
21 lines
556 B
TypeScript
21 lines
556 B
TypeScript
import {expectType} from 'tsd';
|
|
import {type ObjectValue} from '../../source/internal';
|
|
|
|
type ObjectT = {
|
|
string: string;
|
|
0: number;
|
|
'1': number;
|
|
};
|
|
|
|
declare const normal: ObjectValue<ObjectT, 'string'>;
|
|
expectType<string>(normal);
|
|
|
|
declare const test0: ObjectValue<ObjectT, 0>;
|
|
expectType<number>(test0);
|
|
declare const teststring0: ObjectValue<ObjectT, '0'>;
|
|
expectType<number>(teststring0);
|
|
declare const test1: ObjectValue<ObjectT, 1>;
|
|
expectType<number>(test1);
|
|
declare const teststring1: ObjectValue<ObjectT, '1'>;
|
|
expectType<number>(teststring1);
|