diff options
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/client/OperationClient.ts | 8 | ||||
-rw-r--r-- | src/content/controllers/KeymapController.ts | 6 | ||||
-rw-r--r-- | src/content/usecases/KeymapUseCase.ts | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/content/client/OperationClient.ts b/src/content/client/OperationClient.ts index 06077dc..9c72c75 100644 --- a/src/content/client/OperationClient.ts +++ b/src/content/client/OperationClient.ts @@ -2,7 +2,7 @@ import * as operations from '../../shared/operations'; import * as messages from '../../shared/messages'; export default interface OperationClient { - execBackgroundOp(count: number, op: operations.Operation): Promise<void>; + execBackgroundOp(repeat: number, op: operations.Operation): Promise<void>; internalOpenUrl( url: string, newTab?: boolean, background?: boolean, @@ -10,10 +10,10 @@ export default interface OperationClient { } export class OperationClientImpl implements OperationClient { - execBackgroundOp(count: number, op: operations.Operation): Promise<void> { + execBackgroundOp(repeat: number, op: operations.Operation): Promise<void> { return browser.runtime.sendMessage({ type: messages.BACKGROUND_OPERATION, - count, + repeat, operation: op, }); } @@ -23,7 +23,7 @@ export class OperationClientImpl implements OperationClient { ): Promise<void> { return browser.runtime.sendMessage({ type: messages.BACKGROUND_OPERATION, - count: 1, + repeat: 1, operation: { type: operations.INTERNAL_OPEN_URL, url, diff --git a/src/content/controllers/KeymapController.ts b/src/content/controllers/KeymapController.ts index b8069f9..452e3d4 100644 --- a/src/content/controllers/KeymapController.ts +++ b/src/content/controllers/KeymapController.ts @@ -38,7 +38,7 @@ export default class KeymapController { } if (!operations.isNRepeatable(nextOp.op.type)) { - nextOp.count = 1; + nextOp.repeat = 1; } const doFunc = ((op: operations.Operation) => { @@ -91,9 +91,9 @@ export default class KeymapController { // Do not await asynchronous methods to return a boolean immidiately. The // caller requires the synchronous response from the callback to identify // to continue of abandon the event propagations. - this.operationClient.execBackgroundOp(nextOp.count, nextOp.op); + this.operationClient.execBackgroundOp(nextOp.repeat, nextOp.op); } else { - for (let i = 0; i < nextOp.count; ++i) { + for (let i = 0; i < nextOp.repeat; ++i) { doFunc(); } } diff --git a/src/content/usecases/KeymapUseCase.ts b/src/content/usecases/KeymapUseCase.ts index fab13f5..a2e7cc3 100644 --- a/src/content/usecases/KeymapUseCase.ts +++ b/src/content/usecases/KeymapUseCase.ts @@ -36,7 +36,7 @@ export default class KeymapUseCase { } // eslint-disable-next-line max-statements - nextOps(key: Key): { count: number, op: operations.Operation } | null { + nextOps(key: Key): { repeat: number, op: operations.Operation } | null { let sequence = this.repository.enqueueKey(key); let baseSequence = sequence.trimNumericPrefix(); if (baseSequence.length() === 1 && this.blacklistKey(key)) { @@ -53,13 +53,13 @@ export default class KeymapUseCase { sequence.length() === matched[0][0].length()) { // keys are matched with an operation this.repository.clear(); - return { count: 1, op: matched[0][1] }; + return { repeat: 1, op: matched[0][1] }; } else if ( baseMatched.length === 1 && baseSequence.length() === baseMatched[0][0].length()) { // keys are matched with an operation with a numeric prefix this.repository.clear(); - return { count: sequence.repeatCount(), op: baseMatched[0][1] }; + return { repeat: sequence.repeatCount(), op: baseMatched[0][1] }; } else if (matched.length >= 1 || baseMatched.length >= 1) { // keys are matched with an operation's prefix return null; |