Files
DefinitelyTyped/types
Simon WernerandAndy 3efa86f7a2 Fix issue with stampit when using TS to check JavaScript (#27478)
* Fix issue with stampit when using TS to check JavaScript

**Caveat: This has not been tested within a TypeScript library.***  My knowledge of TypeScript is limited, so this has not been tested.  hence, I suggest @lummish and/or @koresar review this PR.

## What it's fixing

Currently I get the following error with the vanilla stampit example below, it applies to the `const Fighter = stampit(Character(...` line and TypeScript highlights the problem across the whole function:

```sh
Expected 0-1 arguments, but got 2
```

Example taken from main stampit example. 
```JavaScript
import stampit from 'stampit';

const Character = stampit({
  props: {
    name: null,
    health: 100,
  },
  init({ name = this.name }) {
    this.name = name;
  },
});

const Fighter = stampit(Character, {
  props: {
    stamina: 100,
  },
  init({ stamina = this.stamina }) {
    this.stamina = stamina;
  },
  methods: {
    fight() {
      console.log(`${this.name} takes a mighty swing!`);
      this.stamina--;
    },
  },
});
```

* Make stampit() more generic

As discussed with @koresar.
2018-07-23 08:28:08 -07:00
..
2018-06-28 09:28:52 +02:00
2018-06-29 11:12:29 +02:00
2018-07-16 11:09:10 -07:00
2018-07-15 12:43:32 -07:00
2018-07-05 11:01:33 -07:00
2018-06-28 07:40:44 +10:00
2018-07-05 09:55:19 -07:00
2018-07-15 12:47:32 -07:00
2018-07-12 10:06:40 -07:00
2018-07-20 18:20:00 -07:00
2018-06-29 13:14:16 -04:00
2018-06-29 10:04:36 +02:00
2018-06-29 16:27:16 +01:00
2018-06-28 13:20:40 +05:30
2018-06-29 15:04:36 +02:00
2018-07-15 12:31:54 -07:00
2018-06-29 01:02:45 -04:00
2018-07-12 10:07:17 -07:00
2018-07-12 09:40:09 -07:00
2018-06-28 14:25:15 +01:00
2018-07-03 09:53:16 -07:00