Skip to content

Commit 58f1c72

Browse files
committed
added hidden docs
1 parent bbd569e commit 58f1c72

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/dtos/typing-properties.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,3 +252,28 @@ Now all properties will be optional:
252252
name? : string;
253253
}
254254
```
255+
256+
## Hidden types
257+
258+
You can make certain properties of a DTO hidden in TypeScript as such:
259+
260+
```php
261+
class DataObject extends Data
262+
{
263+
public function __construct(
264+
public int $id,
265+
#[Hidden]
266+
public string $hidden,
267+
)
268+
{
269+
}
270+
}
271+
```
272+
273+
This will be transformed into:
274+
275+
```tsx
276+
{
277+
id : number;
278+
}
279+
```

0 commit comments

Comments
 (0)