[string]
denotes aTuple
of type stringstring[]
denotes an array of strings
The correct usage of the Tuple in your case would be:
let type2:WithStringArray2 = {
property: ['someString']
};
See Documentation
More Related Contents:
- Is there a `valueof` similar to `keyof` in TypeScript?
- Generic type to get enum keys as union string in typescript?
- How do I dynamically assign properties to an object in TypeScript?
- What is “not assignable to parameter of type never” error in TypeScript?
- Create a new object from type parameter in generic class
- Is it possible to restrict TypeScript object to contain only properties defined by its class?
- What is the Record type in typescript?
- Is there a way to check for both `null` and `undefined`?
- When I refresh my website I get a 404. This is with Angular2 and firebase
- Extending component decorator with base class decorator
- TypeScript union of string and string literals
- Are strongly-typed functions as parameters possible in TypeScript?
- What does the `is` keyword do in typescript?
- Typescript return type depending on parameter
- How to avoid imports with very long relative paths in Angular 2?
- TypeScript – use correct version of setTimeout (node vs window)
- Is there a way to “extract” the type of TypeScript interface property?
- How to unwrap the type of a Promise?
- Enforce that an array is exhaustive over a union type
- Using latest JavaScript features in TypeScript, such as ES2018
- Circular Type References in TypeScript
- Accessing properties in union types
- How can I remove a wider type from a union type without removing its subtypes in TypeScript?
- TypeScript: Why can’t I assign a valid field of an object with type { a: “a”, b: “b” }
- TypeScript keyof returning specific type
- Generating typescript declaration files from javascript
- How to update TypeScript to latest version with npm?
- What is a TypeScript Map file?
- Typescript: Spread types may only be created from object types
- Why TypeScript lets me add a string and a number? Can I prevent it?