mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-09 18:35:32 +00:00
Add capabilities argument to WorkerInternalModel constructor.
This commit is contained in:
parent
f07c715d06
commit
b2becde2ae
3 changed files with 10 additions and 5 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -33,6 +33,6 @@
|
|||
* The Dummy Model that returns nonsensical, but predictable results.
|
||||
*/
|
||||
LMLayerWorker.models.DummyModel = class DummyModel implements WorkerInternalModel {
|
||||
constructor() {
|
||||
constructor(capabilities: Capabilities) {
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue