Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Marsaud Smb2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Marsaud Smb2
Commits
8fdb5e64
Commit
8fdb5e64
authored
Jan 19, 2020
by
Peter Keuter
Committed by
Julien Fontanet
Jan 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: TypeScript definitions (#55)
parent
60bc347f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
0 deletions
+152
-0
index.d.ts
index.d.ts
+151
-0
package.json
package.json
+1
-0
No files found.
index.d.ts
0 → 100644
View file @
8fdb5e64
import
{
Readable
,
Writable
}
from
'
stream
'
;
interface
ISMB2Options
{
share
:
string
;
username
:
string
;
domain
:
string
;
password
:
string
;
port
?:
number
;
packetConcurrrency
?:
number
;
autoCloseTimeout
?:
number
;
}
interface
ICreateReadStreamOptions
{
autoClose
?:
boolean
;
end
?:
number
;
fd
?:
number
;
flags
?:
string
;
start
?:
number
;
}
interface
ICreateWriteStreamOptions
{
autoClose
?:
boolean
;
fd
?:
number
;
flags
?:
string
;
start
?:
number
;
}
interface
SMB2Readable
extends
Readable
{
fileSize
:
number
;
}
interface
SMB2Writable
extends
Writable
{}
declare
class
SMB2
{
constructor
(
options
:
ISMB2Options
);
exists
(
path
:
string
):
Promise
<
boolean
>
;
exists
(
path
:
string
,
cb
:
(
err
?:
Error
,
exists
?:
boolean
)
=>
void
):
void
;
mkdir
(
path
:
string
,
mode
?:
number
):
Promise
<
void
>
;
mkdir
(
path
:
string
,
mode
:
number
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
mkdir
(
path
:
string
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
readdir
(
path
:
string
):
Promise
<
string
[]
>
;
readdir
(
path
:
string
,
cb
:
(
err
?:
Error
,
files
?:
string
[])
=>
void
):
void
;
readFile
(
path
:
string
,
options
?:
{
encoding
:
string
|
null
}
):
Promise
<
Buffer
|
string
>
;
readFile
(
path
:
string
,
cb
:
(
err
?:
Error
,
content
?:
Buffer
|
string
)
=>
void
):
void
;
readFile
(
path
:
string
,
options
:
{
encoding
:
string
|
null
},
cb
:
(
err
?:
Error
,
content
?:
Buffer
|
string
)
=>
void
):
void
;
rename
(
oldPath
:
string
,
newPath
:
string
,
options
?:
{
replace
:
boolean
}
):
Promise
<
void
>
;
rename
(
oldPath
:
string
,
newPath
:
string
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
rename
(
oldPath
:
string
,
newPath
:
string
,
options
:
{
replace
:
boolean
},
cb
:
(
err
?:
Error
)
=>
void
):
void
;
rmdir
(
path
:
string
):
Promise
<
void
>
;
rmdir
(
path
:
string
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
unlink
(
path
:
string
):
Promise
<
void
>
;
unlink
(
path
:
string
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
writeFile
(
path
:
string
,
data
:
string
|
Buffer
,
options
?:
{
encoding
:
string
|
null
}
):
Promise
<
void
>
;
writeFile
(
path
:
string
,
data
:
string
|
Buffer
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
writeFile
(
path
:
string
,
data
:
string
|
Buffer
,
options
:
{
encoding
:
string
|
null
},
cb
:
(
err
?:
Error
)
=>
void
):
void
;
truncate
(
path
:
string
,
length
?:
number
):
Promise
<
void
>
;
truncate
(
path
:
string
,
length
:
number
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
createReadStream
(
path
:
string
,
options
?:
ICreateReadStreamOptions
):
Promise
<
SMB2Readable
>
;
createReadStream
(
path
:
string
,
options
:
ICreateReadStreamOptions
,
cb
:
(
err
?:
Error
,
readable
?:
SMB2Readable
)
=>
void
):
void
;
createReadStream
(
path
:
string
,
cb
:
(
err
?:
Error
,
readable
?:
SMB2Readable
)
=>
void
):
void
;
createWriteStream
(
path
:
string
,
options
?:
ICreateWriteStreamOptions
):
Promise
<
SMB2Writable
>
;
createWriteStream
(
path
:
string
,
options
:
ICreateWriteStreamOptions
,
cb
:
(
err
?:
Error
,
writable
?:
SMB2Writable
)
=>
void
):
void
;
createWriteStream
(
path
:
string
,
cb
:
(
err
?:
Error
,
writable
?:
SMB2Writable
)
=>
void
):
void
;
open
(
path
:
string
,
flags
:
string
,
cb
:
(
err
?:
Error
,
fd
?:
number
)
=>
void
):
void
;
read
(
fd
:
number
,
buffer
:
Buffer
,
bufferOffset
:
number
,
toRead
:
number
,
fileOffset
:
number
,
cb
:
(
err
?:
Error
,
read
?:
number
,
buffer
?:
Buffer
)
=>
void
):
void
;
write
(
fd
:
number
,
buffer
:
Buffer
,
bufferOffset
:
number
,
toWrite
:
number
,
fileOffset
:
number
,
cb
:
(
err
?:
Error
,
written
?:
number
,
buffer
?:
Buffer
)
=>
void
):
void
;
close
(
fd
:
number
,
cb
:
(
err
?:
Error
)
=>
void
):
void
;
}
export
default
SMB2
;
package.json
View file @
8fdb5e64
...
...
@@ -14,6 +14,7 @@
"contributors"
:
[
"Fabrice Marsaud <fabrice.marsaud@vates.fr> (https://github.com/marsaud)"
],
"types"
:
"index.d.ts"
,
"main"
:
"lib/smb2.js"
,
"repository"
:
{
"type"
:
"git"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment