| 1 |
import { createServer, IdentityManager, Model } from "miragejs"; |
| 2 |
|
| 3 |
const identityManager = new IdentityManager(); |
| 4 |
|
| 5 |
identityManager.get?.(); // $ExpectType number | undefined |
| 6 |
identityManager.set("id"); // $ExpectType void |
| 7 |
identityManager.inc?.(); // $ExpectType number | undefined |
| 8 |
identityManager.fetch(); // $ExpectType string |
| 9 |
identityManager.reset(); // $ExpectType void |
| 10 |
|
| 11 |
createServer({ |
| 12 |
identityManagers: { |
| 13 |
application: IdentityManager, |
| 14 |
}, |
| 15 |
}); |
| 16 |
|
| 17 |
createServer({ |
| 18 |
models: { |
| 19 |
pet: Model.extend({}), |
| 20 |
}, |
| 21 |
identityManagers: { |
| 22 |
pet: IdentityManager, |
| 23 |
foo: IdentityManager, // $ExpectError |
| 24 |
}, |
| 25 |
}); |