style-sheets.js (1316B)
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 6 const { 7 Arg, 8 RetVal, 9 generateActorSpec, 10 } = require("resource://devtools/shared/protocol.js"); 11 12 const styleSheetsSpec = generateActorSpec({ 13 typeName: "stylesheets", 14 15 events: {}, 16 17 methods: { 18 getTraits: { 19 request: {}, 20 response: { traits: RetVal("json") }, 21 }, 22 addStyleSheet: { 23 request: { 24 text: Arg(0, "string"), 25 fileName: Arg(1, "nullable:string"), 26 }, 27 response: {}, 28 }, 29 toggleDisabled: { 30 request: { resourceId: Arg(0, "string") }, 31 response: { disabled: RetVal("boolean") }, 32 }, 33 getText: { 34 request: { resourceId: Arg(0, "string") }, 35 response: { text: RetVal("longstring") }, 36 }, 37 getStyleSheetIndentation: { 38 request: { resourceId: Arg(0, "string") }, 39 response: { indentation: RetVal("string") }, 40 }, 41 update: { 42 request: { 43 resourceId: Arg(0, "string"), 44 text: Arg(1, "string"), 45 transition: Arg(2, "boolean"), 46 cause: Arg(3, "nullable:string"), 47 }, 48 response: {}, 49 }, 50 }, 51 }); 52 53 exports.styleSheetsSpec = styleSheetsSpec;