-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: generated files for the Web Bluetooth spec
- Loading branch information
Showing
2 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
113 changes: 113 additions & 0 deletions
113
src/protocol-parser/generated/webdriver-bidi-bluetooth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/** | ||
* Copyright 2024 Google LLC. | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.2. | ||
* Run `node tools/generate-bidi-types.mjs` to regenerate. | ||
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs | ||
*/ | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-nocheck Some types may be circular. | ||
|
||
import z from 'zod'; | ||
|
||
export namespace Bluetooth { | ||
export const RequestDeviceSchema = z.lazy(() => z.string()); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDeviceInfoSchema = z.lazy(() => | ||
z.object({ | ||
id: Bluetooth.RequestDeviceSchema, | ||
name: z.string(), | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDevicePromptSchema = z.lazy(() => z.string()); | ||
} | ||
export namespace Bluetooth { | ||
export const HandleRequestDevicePromptSchema = z.lazy(() => | ||
z.object({ | ||
method: z.literal('bluetooth.handleRequestDevicePrompt'), | ||
params: Bluetooth.HandleRequestDevicePromptParametersSchema, | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const HandleRequestDevicePromptParametersSchema = z.lazy(() => | ||
z | ||
.object({ | ||
context: z.string(), | ||
prompt: Bluetooth.RequestDevicePromptSchema, | ||
}) | ||
.and( | ||
z.union([ | ||
Bluetooth.HandleRequestDevicePromptAcceptParametersSchema, | ||
Bluetooth.HandleRequestDevicePromptCancelParametersSchema, | ||
]) | ||
) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const HandleRequestDevicePromptAcceptParametersSchema = z.lazy(() => | ||
z.object({ | ||
accept: z.literal(true), | ||
device: Bluetooth.RequestDeviceSchema, | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const HandleRequestDevicePromptCancelParametersSchema = z.lazy(() => | ||
z.object({ | ||
accept: z.literal(false), | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDevicePromptOpenedSchema = z.lazy(() => | ||
z.object({ | ||
method: z.literal('bluetooth.requestDevicePromptOpened'), | ||
params: Bluetooth.RequestDevicePromptOpenedParametersSchema, | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDevicePromptOpenedParametersSchema = z.lazy(() => | ||
z.object({ | ||
context: z.string(), | ||
prompt: Bluetooth.RequestDevicePromptSchema, | ||
devices: z.array(Bluetooth.RequestDeviceInfoSchema), | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDevicePromptClosedSchema = z.lazy(() => | ||
z.object({ | ||
method: z.literal('bluetooth.requestDevicePromptClosed'), | ||
params: Bluetooth.RequestDevicePromptClosedParametersSchema, | ||
}) | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export const RequestDevicePromptClosedParametersSchema = z.lazy(() => | ||
z.object({ | ||
context: z.string(), | ||
prompt: Bluetooth.RequestDevicePromptSchema, | ||
}) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/** | ||
* Copyright 2024 Google LLC. | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* THIS FILE IS AUTOGENERATED by cddlconv 0.1.2. | ||
* Run `node tools/generate-bidi-types.mjs` to regenerate. | ||
* @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs | ||
*/ | ||
|
||
export namespace Bluetooth { | ||
export type RequestDevice = string; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDeviceInfo = { | ||
id: Bluetooth.RequestDevice; | ||
name: string; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDevicePrompt = string; | ||
} | ||
export namespace Bluetooth { | ||
export type HandleRequestDevicePrompt = { | ||
method: 'bluetooth.handleRequestDevicePrompt'; | ||
params: Bluetooth.HandleRequestDevicePromptParameters; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type HandleRequestDevicePromptParameters = { | ||
context: string; | ||
prompt: Bluetooth.RequestDevicePrompt; | ||
} & ( | ||
| Bluetooth.HandleRequestDevicePromptAcceptParameters | ||
| Bluetooth.HandleRequestDevicePromptCancelParameters | ||
); | ||
} | ||
export namespace Bluetooth { | ||
export type HandleRequestDevicePromptAcceptParameters = { | ||
accept: true; | ||
device: Bluetooth.RequestDevice; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type HandleRequestDevicePromptCancelParameters = { | ||
accept: false; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDevicePromptOpened = { | ||
method: 'bluetooth.requestDevicePromptOpened'; | ||
params: Bluetooth.RequestDevicePromptOpenedParameters; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDevicePromptOpenedParameters = { | ||
context: string; | ||
prompt: Bluetooth.RequestDevicePrompt; | ||
devices: [...Bluetooth.RequestDeviceInfo[]]; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDevicePromptClosed = { | ||
method: 'bluetooth.requestDevicePromptClosed'; | ||
params: Bluetooth.RequestDevicePromptClosedParameters; | ||
}; | ||
} | ||
export namespace Bluetooth { | ||
export type RequestDevicePromptClosedParameters = { | ||
context: string; | ||
prompt: Bluetooth.RequestDevicePrompt; | ||
}; | ||
} |