Expose methods

pull/3094/head
ioedeveloper 5 years ago
parent fd556d1e4d
commit f995d09098
  1. 1
      .gitignore
  2. 2
      package.json
  3. 7
      src/services/remixdClient.ts
  4. 10
      types/index.ts

1
.gitignore vendored

@ -2,3 +2,4 @@ node_modules
npm-debug.log
python_modules
lib
shared

@ -8,7 +8,7 @@
},
"scripts": {
"test": "echo \"Error: no test specified\"",
"start": "./lib/bin/remixd.js",
"start": "./lib/bin/remixd.js -s ./shared --remix-ide http://127.0.0.1:8080",
"npip": "npip",
"lint": "eslint ./src",
"build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js",

@ -7,7 +7,7 @@ const isbinaryfile = require('isbinaryfile')
const fs = require('fs-extra')
export default class RemixdClient extends PluginClient {
methods: []
methods: ['folderIsReadOnly', 'resolveDirectory']
trackDownStreamUpdate: TrackDownStreamUpdate
websocket: WebSocket | null
currentSharedFolder: string
@ -31,6 +31,7 @@ export default class RemixdClient extends PluginClient {
}
resolveDirectory (args: SharedFolderArgs, cb: Function) {
console.log('called resolveDirectory!')
try {
const path = utils.absolutePath(args.path, this.currentSharedFolder)
@ -40,8 +41,8 @@ export default class RemixdClient extends PluginClient {
}
}
folderIsReadOnly (args: SharedFolderArgs, cb: Function) {
return cb(null, this.readOnly)
folderIsReadOnly () {
return this.readOnly
}
get (args: SharedFolderArgs, cb: Function) {

@ -17,4 +17,14 @@ export type ResolveDirectory = {
}
}
export type WebsocketProfile = {
name: string
methods?: string[]
permission?: boolean
hash?: string
redirect?: {
[key: string]: string
}
}
export type TrackDownStreamUpdate = KeyPairString
Loading…
Cancel
Save