electron/browser/api/lib/protocol.coffee

21 lines
574 B
CoffeeScript
Raw Normal View History

protocol = process.atomBinding 'protocol'
2013-08-29 12:38:04 +00:00
EventEmitter = require('events').EventEmitter
protocol[key] = value for key, value of EventEmitter.prototype
2013-08-29 12:38:04 +00:00
protocol.RequestStringJob =
class RequestStringJob
constructor: ({mimeType, charset, data}) ->
if typeof data isnt 'string' and not data instanceof Buffer
throw new TypeError('Data should be string or Buffer')
@mimeType = mimeType ? 'text/plain'
@charset = charset ? 'UTF-8'
@data = String data
2013-08-29 12:38:04 +00:00
protocol.RequestFileJob =
class RequestFileJob
constructor: (@path) ->
2013-08-29 12:38:04 +00:00
module.exports = protocol