Add capabilities argument to WorkerInternalModel constructor.

This commit is contained in:
Eddie Antonio Santos 2019-01-08 13:16:04 -07:00
parent f07c715d06
commit b2becde2ae
No known key found for this signature in database
GPG key ID: DD411EA4D9509D87
3 changed files with 10 additions and 5 deletions

View file

@ -8,8 +8,10 @@ var sinon = require('sinon');
var DummyModel = require('../../build/intermediate').models.DummyModel;
describe('LMLayerWorker dummy model', function() {
it('can be instantiated with no arguments', function () {
var model = new DummyModel;
it('can be instantiated with capabilities', function () {
var model = new DummyModel({
maxLeftContextCodeUnits: 64,
});
assert.isObject(model);
});
});

View file

@ -33,6 +33,6 @@
* The Dummy Model that returns nonsensical, but predictable results.
*/
LMLayerWorker.models.DummyModel = class DummyModel implements WorkerInternalModel {
constructor() {
constructor(capabilities: Capabilities) {
}
};

View file

@ -73,6 +73,9 @@ interface WorkerInternalModel {
* Constructors that return worker internal models.
*/
interface WorkerInternalModelConstructor {
// TODO: new should take (cap: Capabilities)
new(): WorkerInternalModel;
/**
* WorkerInternalModel instances are all given the keyboard's
* capabilities.
*/
new(capabilities: Capabilities): WorkerInternalModel;
}