Skip to content

Commit

Permalink
feat(bindings/nodejs): generate types and add typed create_operator m…
Browse files Browse the repository at this point in the history
…ethod
  • Loading branch information
trim21 committed Dec 27, 2024
1 parent 6ccef00 commit d8efa68
Show file tree
Hide file tree
Showing 9 changed files with 706 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ default = [
"services-webhdfs",
]


# NOTE: this is the feature we used to build pypi wheels.
# When enable or disable some features,
# also need to update dev/src/generate/binding_python.rs `enabled_service` to match it.
services-all = [
"default",
"services-aliyun-drive",
Expand Down
1 change: 1 addition & 0 deletions bindings/nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ declare module './generated' {
}

export * from './generated'
export { create_operator } from './types.generated'
4 changes: 4 additions & 0 deletions bindings/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ Writer.prototype.createWriteStream = function (options) {
return new WriteStream(this, options)
}

module.exports.create_operator = function (scheme, options) {
return Operator(scheme, options)
}

module.exports.Operator = Operator
module.exports.layers = {
RetryLayer,
Expand Down
1 change: 1 addition & 0 deletions bindings/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"webhdfs"
],
"files": [
"types.generated.d.ts",
"index.d.ts",
"index.js",
"generated.d.ts",
Expand Down
Loading

0 comments on commit d8efa68

Please sign in to comment.