2.3.4 • Published 6 months ago

@types/tldjs v2.3.4

Weekly downloads
6,360
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/tldjs

Summary

This package contains type definitions for tldjs (https://github.com/oncletom/tld.js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tldjs.

index.d.ts

// Type definitions for tldjs v2.3.1
// Project: https://github.com/oncletom/tld.js
// Definitions by: Joshua DeVinney <https://github.com/geoffreak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

export declare function tldExists(host: string): boolean;

export declare function getDomain(host: string): string | null;

export declare function getSubdomain(host: string): string | null;

export declare function getPublicSuffix(host: string): string | null;

/**
 * @deprecated "isValid" is deprecated, please use "isValidHostname" instead.
 */
export declare function isValid(host: string): boolean;

export declare function isValidHostname(host: string): boolean;

export declare function extractHostname(host: string): string | null;

export declare function parse(host: string): {
    hostname: ReturnType<typeof extractHostname>,
    isValid: ReturnType<typeof isValid>,
    isIp: boolean,
    tldExists: ReturnType<typeof tldExists>,
    publicSuffix: ReturnType<typeof getPublicSuffix>,
    domain: ReturnType<typeof getDomain>,
    subdomain: ReturnType<typeof getSubdomain>,
};

export declare function fromUserSettings(options: {
    rules?: any,
    validHosts?: string[] | undefined,
    extractHostname?: ReturnType<typeof extractHostname> | undefined,
}): {
    extractHostname: typeof extractHostname,
    isValidHostname: typeof isValidHostname,
    isValid: typeof isValid,
    parse: typeof parse,
    tldExists: typeof tldExists,
    getPublicSuffix: typeof getPublicSuffix,
    getDomain: typeof getDomain,
    getSubdomain: typeof getSubdomain,
    fromUserSettings: typeof fromUserSettings,
};

Additional Details

  • Last updated: Fri, 02 Jul 2021 19:37:09 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Joshua DeVinney.