webssh2-server
Version:
A Websocket to SSH2 gateway using xterm.js, socket.io, ssh2
106 lines (105 loc) • 3.27 kB
TypeScript
import type { SessionId, UserId, SshHost, SshPort, Username, Password, PrivateKey, TerminalType, EnvVarName, EnvVarValue, EventName, FilePath, UrlString, CssColor, SafeHtml, RegexPattern } from '../types/branded.js';
/**
* Create a SessionId from string
*/
export declare function createSessionId(id: string): SessionId;
/**
* Create a UserId from string
*/
export declare function createUserId(id: string): UserId;
/**
* Create an SshHost from string
*/
export declare function createSshHost(host: string): SshHost;
/**
* Try to create an SshHost, returning null on invalid input
*/
export declare function trySshHost(host: string | undefined): SshHost | null;
/**
* Create an SshPort from number
*/
export declare function createSshPort(port: number): SshPort;
/**
* Try to create an SshPort, returning null on invalid input
*/
export declare function trySshPort(port: number | undefined): SshPort | null;
/**
* Create a Username from string
*/
export declare function createUsername(username: string): Username;
/**
* Try to create a Username, returning null on invalid input
*/
export declare function tryUsername(username: string | undefined): Username | null;
/**
* Create a Password from string
*/
export declare function createPassword(password: string): Password;
/**
* Create a PrivateKey from string
*/
export declare function createPrivateKey(key: string): PrivateKey;
/**
* Create a TerminalType from string
*/
export declare function createTerminalType(term: string): TerminalType;
/**
* Try to create a TerminalType, returning null on invalid input
*/
export declare function tryTerminalType(term: string | undefined | null): TerminalType | null;
/**
* Create an EnvVarName from string
*/
export declare function createEnvVarName(name: string): EnvVarName;
/**
* Create an EnvVarValue from string
*/
export declare function createEnvVarValue(value: string): EnvVarValue;
/**
* Create an EventName from string
*/
export declare function createEventName(name: string): EventName;
/**
* Create a FilePath from string
*/
export declare function createFilePath(path: string): FilePath;
/**
* Create a UrlString from string
*/
export declare function createUrlString(url: string): UrlString;
/**
* Create a CssColor from string
*/
export declare function createCssColor(color: string): CssColor;
/**
* Create SafeHtml from string (assumes it's been sanitized)
*/
export declare function createSafeHtml(html: string): SafeHtml;
/**
* Create a RegexPattern from string
*/
export declare function createRegexPattern(pattern: string): RegexPattern;
/**
* Check if value is a SessionId
*/
export declare function isSessionId(value: unknown): value is SessionId;
/**
* Check if value is an SshHost
*/
export declare function isSshHost(value: unknown): value is SshHost;
/**
* Check if value is an SshPort
*/
export declare function isSshPort(value: unknown): value is SshPort;
/**
* Check if value is a Username
*/
export declare function isUsername(value: unknown): value is Username;
/**
* Check if value is a Password
*/
export declare function isPassword(value: unknown): value is Password;
/**
* Check if value is a TerminalType
*/
export declare function isTerminalType(value: unknown): value is TerminalType;