 (() ->
   # class for exposing plugin API
   class PluginApi
-    constructor: (@view, @plugin_metadata) ->
+    constructor: (@view, @plugin_metadata, @pluginManager) ->
       @name = @plugin_metadata.name
       @data = @view.data
       @cursor = @view.cursor

          data[prop] = prop_info['default']

  class PluginsManager
    constructor: () ->
      @plugins = {}
      @pluginDependencies = new DependencyGraph


# TODO: Handle dependencies automatically for the notion of "enabled" plugins.
#       pluginEnabled  - Return true if it's a dependency of something enabled
#       enablePlugin   - Enable required dependencies first
#       disablePlugin  - Unload any dependency which isn't explicitly enabled or required by another enabled plugin.

if module?
  global._ = require('lodash')
  global.tv4 = require('tv4')
