当前位置:网站首页>TS typescript type declaration special declaration field number is handled when the key key
TS typescript type declaration special declaration field number is handled when the key key
2022-07-07 15:47:00 【Sam young】
Numbers are named for keys
const data :{
[key: number]: string} = {
1: 'a',
2: 'b'
}
// data[1] = 'a'
// data[2] = 'b'
When the object key returned by the back end is uncertain
const data :{
[key: string]: string} = {
'xxx': 'a',
'abc': 'b'
}
// data['xxx'] = 'a'
// data['abc'] = 'b'
Common types
export type StringType = NonNullable<string | null | undefined>;
export type NumberType = NonNullable<number | null | undefined>;
export type BooleanType = NonNullable<boolean | null | undefined>;
export type StringNumberType = NonNullable<string | number | null | undefined>;
/** With number As key Of */
export type NumberKey<T = any> = {
[key: number]: T }
/** string As key Of */
export type StringKey<T = any> = {
[key: string]: T }
export type Option = {
label: string; value: string }
边栏推荐
- What are the safest securities trading apps
- Nacos一致性协议 CP/AP/JRaft/Distro协议
- Create lib Library in keil and use lib Library
- [make a boat diary] [shapr3d STL format to gcode]
- Virtual memory, physical memory /ram what
- UE4 exports the picture + text combination diagram through ucanvasrendertarget2d
- Typescript release 4.8 beta
- Cocos uses custom material to display problems
- 【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
- Getting started with webgl (2)
猜你喜欢
Introduction of mongod management database method
2. Heap sort "hard to understand sort"
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
2022全开源企业发卡网修复短网址等BUG_2022企业级多商户发卡平台源码
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
Steps to create P8 certificate and warehousing account
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
Getting started with webgl (4)
Typescript release 4.8 beta
Streaming end, server end, player end
随机推荐
How to deploy the super signature distribution platform system?
Do not use memset to clear floating-point numbers
使用cpolar建立一个商业网站(2)
Annexb and avcc are two methods of data segmentation in decoding
【深度学习】图像超分实验:SRCNN/FSRCNN
Unity之ASE实现全屏风沙效果
STM32F103C8T6 PWM驱动舵机(SG90)
Getting started with webgl (2)
【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
20th anniversary of agile: a failed uprising
Mathematical modeling -- what is mathematical modeling
Matlab experience summary
postman生成时间戳,未来时间戳
Database exception resolution caused by large table delete data deletion
[data mining] visual pattern mining: hog feature + cosine similarity /k-means clustering
VS2005 strange breakpoint is invalid or member variable value cannot be viewed
【搞船日记】【Shapr3D的STL格式转Gcode】
LeetCode3_ Longest substring without duplicate characters
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
[server data recovery] data recovery case of raid failure of a Dell server