DefinitelyTyped/types/cropperjs
Don Denton 932727f578 Use partials for setting methods which take options (#24959)
This commit addresses a problem where the following would produce a type
error, even though it was valid code:

```typescript
setCanvasData({left: 23})
```

I have changed the argument type for all of the `setXXX` methods which
accept an object as their argument. In the spec files for cropperjs,
@fengyuanchen uses these objects as partials for setters. So I have
made the type definitions follow that same pattern.

I changed the `cropperjs.CropBoxData` type to act the same way as well.
It looks like  it was changed at some point, I am guessing to allow it
to be used as a partial in the `setCropBoxData` method. Since, like all
the other data structures here, it contains all members when you `get`
it, I have made all members required parts of the object and changed
the setter method to accept a partial.

I hope this all makes sense. Basically, I went from the first line below
to the second.

```typescript
setXXXXX(thing: cropperjs.SomeInterface): void

setXXXXX(thing: Partial<cropperjs.SomeInterface>): void
```

Then I changed `cropperjs.CropBoxData` to fit this new system.
2018-04-17 18:12:42 -07:00
..
cropperjs-tests.ts
index.d.ts Use partials for setting methods which take options (#24959) 2018-04-17 18:12:42 -07:00
tsconfig.json
tslint.json