highlighters.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. Option,
  8. RetVal,
  9. generateActorSpec
  10. } = require("devtools/shared/protocol");
  11. const highlighterSpec = generateActorSpec({
  12. typeName: "highlighter",
  13. methods: {
  14. showBoxModel: {
  15. request: {
  16. node: Arg(0, "domnode"),
  17. region: Option(1),
  18. hideInfoBar: Option(1),
  19. hideGuides: Option(1),
  20. showOnly: Option(1),
  21. onlyRegionArea: Option(1)
  22. }
  23. },
  24. hideBoxModel: {
  25. request: {}
  26. },
  27. pick: {},
  28. pickAndFocus: {},
  29. cancelPick: {}
  30. }
  31. });
  32. exports.highlighterSpec = highlighterSpec;
  33. const customHighlighterSpec = generateActorSpec({
  34. typeName: "customhighlighter",
  35. methods: {
  36. release: {
  37. release: true
  38. },
  39. show: {
  40. request: {
  41. node: Arg(0, "domnode"),
  42. options: Arg(1, "nullable:json")
  43. },
  44. response: {
  45. value: RetVal("nullable:boolean")
  46. }
  47. },
  48. hide: {
  49. request: {}
  50. },
  51. finalize: {
  52. oneway: true
  53. }
  54. }
  55. });
  56. exports.customHighlighterSpec = customHighlighterSpec;