@sprucelabs/spruce-heartwood-utils 16.4.0 → 16.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/support/MockRemoteViewControllerFactory.d.ts +3 -2
- package/build/__tests__/support/MockRemoteViewControllerFactory.js +3 -2
- package/build/esm/__tests__/support/MockRemoteViewControllerFactory.d.ts +3 -2
- package/build/esm/__tests__/support/MockRemoteViewControllerFactory.js +3 -2
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ViewControllerMap, ControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
2
|
+
import { RemoteFactoryOptions, RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
3
3
|
export default class MockRemoteViewControllerFactory implements RemoteViewControllerFactory {
|
|
4
4
|
private static instance?;
|
|
5
5
|
private loadedControllers;
|
|
6
6
|
private remoteControllerOptions?;
|
|
7
|
-
|
|
7
|
+
private views;
|
|
8
|
+
constructor(options: RemoteFactoryOptions);
|
|
8
9
|
Controller<N extends keyof ViewControllerMap, O extends ControllerOptions<N>>(_name: N, _options: O): ViewControllerMap[N];
|
|
9
10
|
static reset(): void;
|
|
10
11
|
static getInstance(): MockRemoteViewControllerFactory;
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const test_utils_1 = require("@sprucelabs/test-utils");
|
|
4
4
|
class MockRemoteViewControllerFactory {
|
|
5
|
-
constructor() {
|
|
5
|
+
constructor(options) {
|
|
6
6
|
this.loadedControllers = {};
|
|
7
7
|
MockRemoteViewControllerFactory.instance = this;
|
|
8
|
+
this.views = options.vcFactory;
|
|
8
9
|
}
|
|
9
10
|
Controller(_name, _options) {
|
|
10
11
|
return {};
|
|
@@ -34,7 +35,7 @@ class MockRemoteViewControllerFactory {
|
|
|
34
35
|
async RemoteController(name, options) {
|
|
35
36
|
this.loadedControllers[name] = true;
|
|
36
37
|
this.remoteControllerOptions = options;
|
|
37
|
-
return
|
|
38
|
+
return this.views.Controller(name, options);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
exports.default = MockRemoteViewControllerFactory;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ViewControllerMap, ControllerOptions } from '@sprucelabs/heartwood-view-controllers';
|
|
2
|
-
import { RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
2
|
+
import { RemoteFactoryOptions, RemoteViewControllerFactory } from '../../skillViews/RemoteViewControllerFactory';
|
|
3
3
|
export default class MockRemoteViewControllerFactory implements RemoteViewControllerFactory {
|
|
4
4
|
private static instance?;
|
|
5
5
|
private loadedControllers;
|
|
6
6
|
private remoteControllerOptions?;
|
|
7
|
-
|
|
7
|
+
private views;
|
|
8
|
+
constructor(options: RemoteFactoryOptions);
|
|
8
9
|
Controller<N extends keyof ViewControllerMap, O extends ControllerOptions<N>>(_name: N, _options: O): ViewControllerMap[N];
|
|
9
10
|
static reset(): void;
|
|
10
11
|
static getInstance(): MockRemoteViewControllerFactory;
|
|
@@ -9,9 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { assert } from '@sprucelabs/test-utils';
|
|
11
11
|
export default class MockRemoteViewControllerFactory {
|
|
12
|
-
constructor() {
|
|
12
|
+
constructor(options) {
|
|
13
13
|
this.loadedControllers = {};
|
|
14
14
|
MockRemoteViewControllerFactory.instance = this;
|
|
15
|
+
this.views = options.vcFactory;
|
|
15
16
|
}
|
|
16
17
|
Controller(_name, _options) {
|
|
17
18
|
return {};
|
|
@@ -42,7 +43,7 @@ export default class MockRemoteViewControllerFactory {
|
|
|
42
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
44
|
this.loadedControllers[name] = true;
|
|
44
45
|
this.remoteControllerOptions = options;
|
|
45
|
-
return
|
|
46
|
+
return this.views.Controller(name, options);
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
}
|