import { React } from '../../common';
import * as url from 'url';
const CoreLink = require('next/link').default;

export type UrlLike = url.UrlObject | url.Url;

export interface ILinkProps {
  prefetch?: boolean;
  shallow?: boolean;
  scroll?: boolean;
  replace?: boolean;
  onError?(error: any): void;
  href?: string | UrlLike;
  as?: string | UrlLike;
  children?: React.ReactNode;
}

export const Link = (props: ILinkProps) => <CoreLink {...props} />;
