Skip to content

Commit a7b19c3

Browse files
authored
fix: rename mapping back to Commands (#264)
1 parent 39100c9 commit a7b19c3

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

out/gen/mapping.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type * as Bidi from './main.js';
22
import type * as BidiPermissions from './permissions.js';
33
import type * as BidiBluetooth from './web-bluetooth.js';
4-
export interface CommandMapping {
4+
export interface Commands {
55
'bluetooth.disableSimulation': {
66
params: BidiBluetooth.Bluetooth.DisableSimulationParameters;
77
returnType: Bidi.EmptyResult;

out/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as BidiBluetooth from './gen/web-bluetooth.js';
99
export * from './gen/main.js';
1010
export * from './gen/permissions.js';
1111
export * from './gen/web-bluetooth.js';
12-
export type {CommandMapping} from './gen/mapping.js';
12+
export * from './gen/mapping.js';
1313
type ExternalSpecCommand<T> = {
1414
id: Bidi.JsUint;
1515
} & T;

out/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ Object.defineProperty(exports, '__esModule', {value: true});
3838
__exportStar(require('./gen/main.js'), exports);
3939
__exportStar(require('./gen/permissions.js'), exports);
4040
__exportStar(require('./gen/web-bluetooth.js'), exports);
41+
__exportStar(require('./gen/mapping.js'), exports);

src/gen/mapping.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type * as Bidi from './main.js';
22
import type * as BidiPermissions from './permissions.js';
33
import type * as BidiBluetooth from './web-bluetooth.js';
44

5-
export interface CommandMapping {
5+
export interface Commands {
66
'bluetooth.disableSimulation': {
77
params: BidiBluetooth.Bluetooth.DisableSimulationParameters;
88
returnType: Bidi.EmptyResult;

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export * from './gen/main.js';
1212
export * from './gen/permissions.js';
1313
export * from './gen/web-bluetooth.js';
1414

15-
export type {CommandMapping} from './gen/mapping.js';
15+
export * from './gen/mapping.js';
1616

1717
type ExternalSpecCommand<T> = {
1818
// id is defined by the main WebDriver BiDi spec and extension specs do

test-d/webdriver-bidi-protocol.test-d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import {Event, Command, CommandMapping} from '..';
7+
import {Event, Command, Commands} from '..';
88

99
function sendCommand(command: Command) {}
1010
function handleEvent(event: Event) {}
11-
function sendCommandMultipleArgs<T extends keyof CommandMapping>(
11+
function sendCommandMultipleArgs<T extends keyof Commands>(
1212
method: T,
13-
params: CommandMapping[T]['params'],
14-
): {result: CommandMapping[T]['returnType']} {
13+
params: Commands[T]['params'],
14+
): {result: Commands[T]['returnType']} {
1515
throw new Error('Not implemented');
1616
}
1717

tools/generateCommandMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ for (const spec of specs) {
129129
}
130130

131131
const mapInterface = generatedFile.addInterface({
132-
name: 'CommandMapping',
132+
name: 'Commands',
133133
isExported: true,
134134
});
135135

0 commit comments

Comments
 (0)