title: HashId for Angular
body: <p>I'm trying to use <a href="http://hashids.org" rel="nofollow noreferrer">http://hashids.org</a> in an Angular Last version project.</p>
  
  <p>I found this definition file:</p>
  
  <pre><code>// Type definitions for Hashids.js 1.x
  // Project: https://github.com/ivanakimov/hashids.node.js
  // Definitions by: Paulo Cesar &lt;https://github.com/pocesar&gt;
  // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  
  /// &lt;reference types="node" /&gt;
  
  export default class Hashids {
      private version: string;
      private minAlphabetLength: number;
      private sepDiv: number;
      private guardDiv: number;
      private errorAlphabetLength: string;
      private errorAlphabetSpace: string;
      private alphabet: string[];
      private seps: string;
      private minHashLength: number;
      private salt: string;
      constructor(salt: string, minHashLength?: number, alphabet?: string);
      public decode(hash: string): number[];
      public encode(arg: number): string;
      public encode(arg: number[]): string;
      public encode(...args: number[]): string;
      public encodeHex(str: string): string;
      public decodeHex(hash: string): string;
      public hash(input: number, alphabet: string): string;
      public unhash(input: string[], alphabet: string): number;
  } 
  </code></pre>
  
  <p>but When I try to use in my Angular project using this code:</p>
  
  <pre><code>import * as Hashids from 'hashids';
  export abstract class BaseService {
       protected getId(id: any) {
              const x = new Hashids('somesecretec');
              return x.encode(id);
       }
  }
  </code></pre>
  
  <p>I got this error:</p>
  
  <blockquote>
    <p>error TS2351: Cannot use 'new' with an expression whose type lacks a
    call or construct signature.</p>
  </blockquote>
  
  <p>In my local it works, without a problem. But I tried to compile a production setting and it doesn't work.</p>