mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Ember Data Adapter: export default AdapterError (#43563)
* Ember Data Adapter: export default AdapterError
The current types use a named export
```
import { AdapterError } from '@ember-data/adapter/error';
```
compared to what is documented
```
// documented
import AdapterError from '@ember-data/adapter/error';
```
- [x] Use a meaningful title for the pull request. Include the name of the package modified.
- [x] Test the change in your own code. (Compile and run.)
- [ ] Add or edit tests to reflect the change. (Run with `npm test`.)
- [ ] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request).
- [ ] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes).
- [ ] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present).
If changing an existing definition:
- [x] Provide a URL to documentation or source code which provides context for the suggested changes: <279e55c1f6/packages/adapter/addon/error.js (L98)>
* Update error.ts
This commit is contained in:
3
types/ember-data__adapter/error.d.ts
vendored
3
types/ember-data__adapter/error.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
import DS from 'ember-data';
|
||||
|
||||
export import AdapterError = DS.AdapterError;
|
||||
export default DS.AdapterError;
|
||||
|
||||
export import InvalidError = DS.InvalidError;
|
||||
export import UnauthorizedError = DS.UnauthorizedError;
|
||||
export import ForbiddenError = DS.ForbiddenError;
|
||||
|
||||
@@ -22,5 +22,9 @@ class MyInvalid extends InvalidError {
|
||||
}
|
||||
}
|
||||
|
||||
const invalid = new MyInvalid();
|
||||
|
||||
const isInvalid = invalid instanceof AdapterError; // $ExpectType<boolean>
|
||||
|
||||
errorsHashToArray({}); // $ExpectType<any[]>
|
||||
errorsArrayToHash([]); // $ExpectType<{}>
|
||||
|
||||
Reference in New Issue
Block a user