Overview
This page documents all exported types and interfaces from the React Native SSH SFTP library. These types provide strong type safety for TypeScript users and define the data structures used throughout the library.Enums
PtyType
Represents the types of PTY (pseudo-terminal) for SSH connections.| Value | Description |
|---|---|
VANILLA | Basic vanilla terminal type |
VT100 | VT100 terminal emulation |
VT102 | VT102 terminal emulation |
VT220 | VT220 terminal emulation |
ANSI | ANSI terminal emulation |
XTERM | XTerm terminal emulation |
Interfaces
KeyPair
Represents a key pair used for SSH authentication.| Property | Type | Required | Description |
|---|---|---|---|
privateKey | string | Yes | The private key in PEM format |
publicKey | string | No | The public key (optional) |
passphrase | string | No | The passphrase for the encrypted private key (optional) |
LsResult
Represents the result of a directory listing operation.| Property | Type | Description |
|---|---|---|
filename | string | The name of the file or directory |
isDirectory | boolean | Whether the item is a directory |
modificationDate | string | The last modification date |
lastAccess | string | The last access date |
fileSize | number | The size of the file in bytes |
ownerUserID | number | The user ID of the owner |
ownerGroupID | number | The group ID of the owner |
flags | number | File permission flags |
genKeyPair
Represents the result of a key pair generation operation.| Property | Type | Required | Description |
|---|---|---|---|
privateKey | string | Yes | The generated private key in PEM format |
publicKey | string | No | The generated public key (optional) |
keyDetail
Represents the details of an SSH key.| Property | Type | Required | Description |
|---|---|---|---|
keyType | string | Yes | The type of the key (e.g., ‘RSA’, ‘DSA’, ‘ECDSA’) |
keySize | number | No | The size of the key in bits (optional) |
Type Aliases
PasswordOrKey
Represents a password or key for authentication. Can be either a string (password) or a KeyPair object.CallbackFunction
Represents a callback function with an optional response.| Parameter | Description |
|---|---|
T | The type of the response object |
| Parameter | Type | Description |
|---|---|---|
error | any | The error object, if any error occurred |
response | T | The response object, if the operation was successful (optional) |
EventHandler
Represents an event handler function for SSH events.| Parameter | Type | Description |
|---|---|---|
value | any | The value passed to the event handler |