node.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const {
  6. Arg,
  7. RetVal,
  8. generateActorSpec,
  9. types
  10. } = require("devtools/shared/protocol.js");
  11. types.addDictType("imageData", {
  12. // The image data
  13. data: "nullable:longstring",
  14. // The original image dimensions
  15. size: "json"
  16. });
  17. const nodeSpec = generateActorSpec({
  18. typeName: "domnode",
  19. methods: {
  20. getNodeValue: {
  21. request: {},
  22. response: {
  23. value: RetVal("longstring")
  24. }
  25. },
  26. setNodeValue: {
  27. request: { value: Arg(0) },
  28. response: {}
  29. },
  30. getUniqueSelector: {
  31. request: {},
  32. response: {
  33. value: RetVal("string")
  34. }
  35. },
  36. getCssPath: {
  37. request: {},
  38. response: {
  39. value: RetVal("string")
  40. }
  41. },
  42. scrollIntoView: {
  43. request: {},
  44. response: {}
  45. },
  46. getImageData: {
  47. request: {maxDim: Arg(0, "nullable:number")},
  48. response: RetVal("imageData")
  49. },
  50. getEventListenerInfo: {
  51. request: {},
  52. response: {
  53. events: RetVal("json")
  54. }
  55. },
  56. modifyAttributes: {
  57. request: {
  58. modifications: Arg(0, "array:json")
  59. },
  60. response: {}
  61. },
  62. getFontFamilyDataURL: {
  63. request: {font: Arg(0, "string"), fillStyle: Arg(1, "nullable:string")},
  64. response: RetVal("imageData")
  65. }
  66. }
  67. });
  68. exports.nodeSpec = nodeSpec;