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 npm-debug.log
python_modules python_modules
lib lib
shared

@ -8,7 +8,7 @@
}, },
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\"", "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", "npip": "npip",
"lint": "eslint ./src", "lint": "eslint ./src",
"build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js", "build": "tsc -p ./ && chmod +x ./lib/bin/remixd.js",

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