File tree 1 file changed +15
-17
lines changed
packages/documentation/copy/en/handbook-v2 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -160,23 +160,21 @@ Now `xPos` and `yPos` are both definitely present within the body of `paintShape
160
160
161
161
> Note that there is currently no way to place type annotations within destructuring patterns.
162
162
> This is because the following syntax already means something different in JavaScript.
163
-
164
- ``` ts twoslash
165
- // @noImplicitAny: false
166
- // @errors: 2552 2304
167
- interface Shape {}
168
- declare function render(x : unknown );
169
- // ---cut---
170
- function draw({ shape : Shape , xPos : number = 100 /* ...*/ }) {
171
- render (shape );
172
- render (xPos );
173
- }
174
- ```
175
-
176
- In an object destructuring pattern, ` shape: Shape ` means "grab the property ` shape ` and redefine it locally as a variable named ` Shape ` .
177
- Likewise ` xPos: number ` creates a variable named ` number ` whose value is based on the parameter's ` xPos ` .
178
-
179
- Using [ mapping modifiers] ( /docs/handbook/2/mapped-types.html#mapping-modifiers ) , you can remove ` optional ` attributes.
163
+ >
164
+ > ``` ts twoslash
165
+ > // @noImplicitAny: false
166
+ > // @errors: 2552 2304
167
+ > interface Shape {}
168
+ > declare function render(x : unknown );
169
+ > // ---cut---
170
+ > function draw({ shape : Shape , xPos : number = 100 /* ...*/ }) {
171
+ > render (shape );
172
+ > render (xPos );
173
+ > }
174
+ > ` ` `
175
+ >
176
+ > In an object destructuring pattern, ` shape : Shape ` means "grab the property ` shape ` and redefine it locally as a variable named ` Shape ` .
177
+ > Likewise ` xPos : number ` creates a variable named ` number ` whose value is based on the parameter's ` xPos ` .
180
178
181
179
### ` readonly ` Properties
182
180
You can’t perform that action at this time.
0 commit comments