axis-core
Version:
A Node.js library written in TypeScript containing shared behavior for the other packages, e.g. code handling communication and authentication with Axis Communication cameras.
52 lines • 1.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Connection = void 0;
const Protocol_1 = require("./Protocol");
/**
* Class describing a connection to a device.
*/
class Connection {
/**
* Initializes a new instance of the class.
* @param protocol The protocol to use when creating the connection.
* @param address The address or hostname of the device.
* @param port The port of the device.
* @param username The username.
* @param password The password.
*/
constructor(
/**
* Gets the protocol to use when creating the connection.
*/
protocol,
/**
* Gets the address or hostname of the device.
*/
address,
/**
* Gets the port of the device.
*/
port,
/**
* Gets the username.
*/
username,
/**
* Gets the password.
*/
password) {
this.protocol = protocol;
this.address = address;
this.port = port;
this.username = username;
this.password = password;
}
/**
* Gets the url.
*/
get url() {
return `${this.protocol === Protocol_1.Protocol.Http ? 'http' : 'https'}://${this.address}:${this.port}`;
}
}
exports.Connection = Connection;
//# sourceMappingURL=Connection.js.map