Comments (4)
Duplicate of #19535.
from typescript.
How for need generic type ConcatArray<T>
? I wrote this type locally:
type ConcatArg<RawType> = RawType extends unknown[] ? RawType[] : (RawType | RawType[]);
interface Array<T> {
concat(...items: ConcatArg<T>[]): T[];
}
Is it a acceptable solution?
from typescript.
Is it a acceptable solution?
If it works for you, use it! My interpretation of #36554 is that the TypeScript team probably not interested in adopting such a change unless it's part of a holistic revamp of array typing issues, with consideration given to all users and possible breaking changes.
from typescript.
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
from typescript.
Related Issues (20)
- Refactor type definitions and improve interface organization in types.ts HOT 1
- [question] Is there any library for linking the imported files?
- Uncaught Type assertion between Interface and Class Types can lead to runtime errors HOT 2
- Type unions are previewed out of order HOT 2
- Cannot Move React Class Component To New File HOT 2
- Template types don't resolve in conditional types HOT 7
- [NewErrors] 5.7.0-dev.20240825 vs 5.5.4 HOT 73
- [ServerErrors][JavaScript] 5.7.0-dev.20240825 vs 5.5.4 HOT 8
- [ServerErrors][TypeScript] 5.7.0-dev.20240825 vs 5.5.4 HOT 17
- Inconsistent boolean literal types in objects
- 5.6.1-rc Incorrectly assumes "this" is not nullish even when declared as such
- Allow module resolution Bundler with module NodeNext HOT 10
- Star export from type expression
- 5.6 regression: Array.prototype.reduce type inference regression HOT 7
- 5.6 regression: Inference related regression: Wider covariant inference gets picked over more narrow contravariant one HOT 12
- 5.6 regression: Inference with mixed in type intersection no longer compiles HOT 4
- 5.6 regression: Function inference with multiple T newly chooses less specific type HOT 1
- Isolated declarations quick fix results in redundant type arguments when the RHS is a new expression with explicit type arguments HOT 4
- Remapped property names has wrong completion, error messages and code actions (snippets)
- watchOptions is override by references project's tsconfig if they extends shared base config HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript.