HEX
Server: nginx/1.18.0
System: Linux test-ipsremont 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
User: ips (1000)
PHP: 8.0.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/design.system/node_modules/psl/types/index.d.ts
// TypeScript Version: 2.4

/**
 * Result returned when a given domain name was not parsable (not exported)
 */
export type ErrorResult<T extends keyof errorCodes> = {
  input: string;
  error: {
    code: T;
    message: errorCodes[T];
  };
}

/**
 * Error codes and descriptions for domain name parsing errors
 */
export const enum errorCodes {
  DOMAIN_TOO_SHORT = 'Domain name too short',
  DOMAIN_TOO_LONG = 'Domain name too long. It should be no more than 255 chars.',
  LABEL_STARTS_WITH_DASH = 'Domain name label can not start with a dash.',
  LABEL_ENDS_WITH_DASH = 'Domain name label can not end with a dash.',
  LABEL_TOO_LONG = 'Domain name label should be at most 63 chars long.',
  LABEL_TOO_SHORT = 'Domain name label should be at least 1 character long.',
  LABEL_INVALID_CHARS = 'Domain name label can only contain alphanumeric characters or dashes.'
}

// Export the browser global variable name additionally to the CJS/AMD exports below
export as namespace psl;

export type ParsedDomain = {
  input: string;
  tld: string | null;
  sld: string | null;
  domain: string | null;
  subdomain: string | null;
  listed: boolean;
}

/**
 * Parse a domain name and return its components
 */
export function parse(input: string): ParsedDomain | ErrorResult<keyof errorCodes>;

/**
 * Get the base domain for full domain name
 */
export function get(domain: string): string | null;

/**
 * Check whether the given domain belongs to a known public suffix
 */
export function isValid(domain: string): boolean;