We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 780059c commit d8b2606Copy full SHA for d8b2606
docs/decorator.md
@@ -251,10 +251,10 @@ inst1.count // 1
251
252
```typescript
253
function functionCallable(
254
- value as any, {kind} as any
255
-) {
+ value:any, {kind}:any
+):any {
256
if (kind === 'class') {
257
- return function (...args) {
+ return function (...args:any) {
258
if (new.target !== undefined) {
259
throw new TypeError('This function can’t be new-invoked');
260
}
@@ -265,10 +265,13 @@ function functionCallable(
265
266
@functionCallable
267
class Person {
268
- constructor(name) {
+ name:string;
269
+ constructor(name:string) {
270
this.name = name;
271
272
273
+
274
+// @ts-ignore
275
const robin = Person('Robin');
276
robin.name // 'Robin'
277
```
0 commit comments