测试一下record

This commit is contained in:
Kane Wang 2023-03-09 18:17:29 +08:00
parent 7454b97e65
commit 94cf7bbe65
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
/*
* @Author: Kane
* @Date: 2023-03-09 17:04:12
* @LastEditors: Kane
* @FilePath: /ts-practice/src/type.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
type K = (number | string);
type T = string | number | boolean;
type R = Record<K, T>;
const test: R = {
x: 2,
a: 1,
b: true,
1: 2,
};