settings.js 790 B

1234567891011121314151617181920212223242526272829303132
  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 {Arg, RetVal, generateActorSpec} = require("devtools/shared/protocol");
  6. const settingsSpec = generateActorSpec({
  7. typeName: "settings",
  8. methods: {
  9. getSetting: {
  10. request: { value: Arg(0) },
  11. response: { value: RetVal("json") }
  12. },
  13. setSetting: {
  14. request: { name: Arg(0), value: Arg(1) },
  15. response: {}
  16. },
  17. getAllSettings: {
  18. request: {},
  19. response: { value: RetVal("json") }
  20. },
  21. clearUserSetting: {
  22. request: { name: Arg(0) },
  23. response: {}
  24. }
  25. },
  26. });
  27. exports.settingsSpec = settingsSpec;