The following figure defines a type Data that can contain a single field pointing to arbitrary Data:
https://stackoverflow.com/questions/58090665/typescript-what-is-the-type-of-the-object-name-string-string
class aa{
constructor(headers?: string | { [name: string]: string | string[]; }){
}
}
Meaning:
The headers type can be one of two types:
- string An object with a field pointing to a string or an array of strings. The name of the field doesn’t matter, there’s no restriction, as long as the field is a string.
More of Jerry’s original articles can be found at :
Read More:
- Type definition error – one of the causes of type definition errors is WM in Oracle_ Concat function usage
- Latex bracket size control
- Typescript generic source code error
- On the usage of ‘ref.stor.type search’ field in SAP WM movement type
- #error identifier-list parameters may only be used in a function definition
- Quickly create a local typescript running environment.
- The uni app references the vant component and reports an error unclosed bracket when compiling
- Type error: cannot unpack non Iterable non type object appears when starting Bert server in Ubuntu system
- Error: (22,57) Java: type parameter… Mapper is not in the range of type variable M
- Error type referred to is not an annotation type:RedisCache
- Typescript error “Cannot write file xxx because it would overwrite input file
- Solution to errors reported by TES command in vscode – errors reported by typescript command
- org.hibernate.MappingException: invalid override definition
- Solve the problem of error: cannot pass objects of non trivially copyable type ‘STD:: String’ in C / C + +
- [Elasticsearch] es 7.12 Root mapping definition has unsupported parameters: _all
- Function definition is not allowed here
- Error tips:array type has incomplete element type
- array type has an incomplete element type
- Es error mapper of different type, current_ Type “text” solution
- Mybatis integrates Oracle query and reports an error in the datetime type field