webdriver-bidi-permissions.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. /**
  3. * Copyright 2024 Google LLC.
  4. * Copyright (c) Microsoft Corporation.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var __importDefault = (this && this.__importDefault) || function (mod) {
  19. return (mod && mod.__esModule) ? mod : { "default": mod };
  20. };
  21. Object.defineProperty(exports, "__esModule", { value: true });
  22. exports.Permissions = exports.PermissionsCommandSchema = void 0;
  23. /**
  24. * THIS FILE IS AUTOGENERATED by cddlconv 0.1.5.
  25. * Run `node tools/generate-bidi-types.mjs` to regenerate.
  26. * @see https://github.com/w3c/webdriver-bidi/blob/master/index.bs
  27. */
  28. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  29. // @ts-nocheck Some types may be circular.
  30. const zod_1 = __importDefault(require("zod"));
  31. exports.PermissionsCommandSchema = zod_1.default.lazy(() => Permissions.SetPermissionSchema);
  32. var Permissions;
  33. (function (Permissions) {
  34. Permissions.PermissionDescriptorSchema = zod_1.default.lazy(() => zod_1.default.object({
  35. name: zod_1.default.string(),
  36. }));
  37. })(Permissions || (exports.Permissions = Permissions = {}));
  38. (function (Permissions) {
  39. Permissions.PermissionStateSchema = zod_1.default.lazy(() => zod_1.default.enum(['granted', 'denied', 'prompt']));
  40. })(Permissions || (exports.Permissions = Permissions = {}));
  41. (function (Permissions) {
  42. Permissions.SetPermissionSchema = zod_1.default.lazy(() => zod_1.default.object({
  43. method: zod_1.default.literal('permissions.setPermission'),
  44. params: Permissions.SetPermissionParametersSchema,
  45. }));
  46. })(Permissions || (exports.Permissions = Permissions = {}));
  47. (function (Permissions) {
  48. Permissions.SetPermissionParametersSchema = zod_1.default.lazy(() => zod_1.default.object({
  49. descriptor: Permissions.PermissionDescriptorSchema,
  50. state: Permissions.PermissionStateSchema,
  51. origin: zod_1.default.string(),
  52. userContext: zod_1.default.string().optional(),
  53. }));
  54. })(Permissions || (exports.Permissions = Permissions = {}));
  55. //# sourceMappingURL=webdriver-bidi-permissions.js.map