Comments (4)
Hi @innocenzi,
We have this same challenge, but I prefer the way it is solved in https://github.com/spatie/laravel-data/pull/79/files. Instead of replacing all nullable or optional parameters with undefined
, I would rather have it explicit by using a special Undefined
class.
from typescript-transformer.
In this PR, the Undefined
type is added for the purpose of explicitly creating that type instead of using a null
union right? Honestly seems a bit overkill since I'm not sure when you would like to have a null
union at all.
But to be honest I'm fine with anything as long as I can generate { property?: Type }
interfaces/types.
from typescript-transformer.
Maybe it would be cool if we added an annotation for such types? Like #[Undefinable]
? Laravel data version 2 then would have support for this build in by using a union Undefined
type.
I would accept such a PR, because at the moment I don't have the time to built it 😬
from typescript-transformer.
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
from typescript-transformer.
Related Issues (20)
- PHP enums still not transformed correctly HOT 2
- Using the transformer without artisan
- Make transform of Enums to types or to native enums configurable on class level (using an attribute) HOT 1
- There should be a "Transformer order matters!" warning in the docs HOT 1
- missing dependencies? HOT 2
- Broken link in the docs
- Generating Record-like types HOT 1
- i am using this packge but unable to transform the php class into typeScript HOT 1
- Feature request: Make namespace in ts file optional HOT 1
- Transformed 0 PHP types to TypeScript HOT 1
- Configure fallbackvalues other then any HOT 1
- [BUG] Unresolved array-key type HOT 1
- how to include specific private properties HOT 1
- Pick up the `DataCollectionOf` attribute from spatie/laravel-data HOT 1
- ArrayShapes HOT 2
- Update to PHP-Parser 5.0 HOT 1
- Backslashes are removed from enum values when using ::class notation.
- No default/clean install possible due to PHP-parser version conflict HOT 1
- v3, some expected date? 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-transformer.