@jellyfin/sdk
Version:
A TypeScript SDK for Jellyfin.
39 lines (38 loc) • 1.36 kB
TypeScript
/**
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** Common URL constant values. */
export * from './constants';
/**
* Copies a URL instance.
* @param original The original URL.
* @returns A copy of the original URL.
*/
export declare function copyUrl(original: URL): URL;
/**
* Returns the default port number for a given protocol.
* @param protocol The protocol string.
* @returns The default port number of the protocol.
*/
export declare function getDefaultPort(protocol: string): number;
/**
* Checks if the URL string specifies the protocol and port.
* @param urlString The URL string to test.
* @param url The parsed URL object.
* @returns True if the the URL string includes the protocol and port.
*/
export declare function hasProtocolAndPort(urlString: string, url: URL): boolean;
/**
* Checks if the URL is using the protocol's default port.
* @param url The URL object to check.
* @returns True if the URL port is the protocol default.
*/
export declare function isDefaultPort(url: URL): boolean;
/**
* Parses a string to a URL object.
* @param input A string representing a URL.
* @returns The URL object.
*/
export declare function parseUrl(input: string): URL;