当前位置:网站首页>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 }
边栏推荐
- [target detection] yolov5 Runtong voc2007 data set
- Typescript release 4.8 beta
- Create lib Library in keil and use lib Library
- Pit avoidance: description of null values in in and not in SQL
- Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
- Annexb and avcc are two methods of data segmentation in decoding
- [quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)
- webgl_ Enter the three-dimensional world (1)
- 银行需要搭建智能客服模块的中台能力,驱动全场景智能客服务升级
- 有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?
猜你喜欢
【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
Syntax of generator function (state machine)
使用cpolar建立一个商业网站(2)
【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)
Wechat applet 01
There is a cow, which gives birth to a heifer at the beginning of each year. Each heifer has a heifer at the beginning of each year since the fourth year. Please program how many cows are there in the
[quick start for Digital IC Validation] 26. Ahb - sramc (6) for system verilog project practice (Basic Points of APB Protocol)
[server data recovery] data recovery case of raid failure of a Dell server
#HPDC智能基座人才发展峰会随笔
Zhongang Mining: Fluorite continues to lead the growth of new energy market
随机推荐
OpenGL common functions
【数字IC验证快速入门】26、SystemVerilog项目实践之AHB-SRAMC(6)(APB协议基本要点)
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
从 1.5 开始搭建一个微服务框架链路追踪 traceId
Asynchronous application of generator function
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
What are PV and UV? pv、uv
[deep learning] image hyperspectral experiment: srcnn/fsrcnn
What are the safest securities trading apps
Whether runnable can be interrupted
Keil5 does not support online simulation of STM32 F0 series
HPDC smart base Talent Development Summit essay
Getting started with webgl (4)
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
Stm32f103c8t6 PWM drive steering gear (sg90)
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
unnamed prototyped parameters not allowed when body is present
Getting started with webgl (2)
【數字IC驗證快速入門】26、SystemVerilog項目實踐之AHB-SRAMC(6)(APB協議基本要點)