@barchart/common-js
Version:
Library of common JavaScript utilities
54 lines (53 loc) • 1.16 kB
TypeScript
/**
* Defines the protocol for a web request.
*
* @public
* @extends {Enum}
*/
export default class ProtocolType extends Enum {
/**
* Returns the {@link ProtocolType} associated with a specific code.
*
* @public
* @static
* @param {string} code
* @returns {ProtocolType|null}
*/
public static parse(code: string): ProtocolType | null;
/**
* HTTP.
*
* @static
* @returns {ProtocolType}
*/
static get HTTP(): ProtocolType;
/**
* HTTPS.
*
* @static
* @returns {ProtocolType}
*/
static get HTTPS(): ProtocolType;
/**
* @param {string} code
* @param {number} defaultPort
* @param {string} prefix
*/
constructor(code: string, defaultPort: number, prefix: string);
/**
* Returns the default TCP port used by the protocol.
*
* @public
* @returns {number}
*/
public get defaultPort(): number;
/**
* Returns the prefix used to compose a URL.
*
* @public
* @returns {string}
*/
public get prefix(): string;
#private;
}
import Enum from './../../../lang/Enum.js';