1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | Object.defineProperty(exports, "__esModule", { value: true });
|
11 | exports.FactoryManager = void 0;
|
12 | const FactoryModel_1 = require("./FactoryModel");
|
13 |
|
14 |
|
15 |
|
16 | class FactoryManager {
|
17 | constructor() {
|
18 | Object.defineProperty(this, "stubCounter", {
|
19 | enumerable: true,
|
20 | configurable: true,
|
21 | writable: true,
|
22 | value: 1
|
23 | });
|
24 | Object.defineProperty(this, "stubIdCallback", {
|
25 | enumerable: true,
|
26 | configurable: true,
|
27 | writable: true,
|
28 | value: (counter) => counter
|
29 | });
|
30 | }
|
31 | |
32 |
|
33 |
|
34 | getNextId(model) {
|
35 | return this.stubIdCallback(this.stubCounter++, model);
|
36 | }
|
37 | |
38 |
|
39 |
|
40 | define(model, callback) {
|
41 | return new FactoryModel_1.FactoryModel(model, callback, this);
|
42 | }
|
43 | |
44 |
|
45 |
|
46 | stubId(callback) {
|
47 | this.stubIdCallback = callback;
|
48 | }
|
49 | }
|
50 | exports.FactoryManager = FactoryManager;
|