Errors after importing algolia in Ionic 5

I imported algolia in ionic5 using the command

npm install algoliasearch

I imported using this command in home.ts

import algoliasearch from 'algoliasearch';

home.page.ts in my constructor code is -

const client = algoliasearch('UVE3ADH8HY','2390abe3fff3dd8cb0354ddef86c87c3');

Now when i complie, it says

[ng] ERROR in node_modules/algoliasearch/dist/algoliasearch.d.ts:203:51 - error TS2304: Cannot find name 'Omit'.
[ng] 203 export declare type WithoutCredentials<TClient> = Omit<TClient, 'appId' | 'apiKey'>;

This thing works in 1 out of 5 times, what is wrong with algolia ??

Please help.

Hi there,

Omit is a TypeScript utility type, which we use in the algoliasearch client. If your IDE or your TypeScript compiler (tsc) doesn’t find it, it may be because of your TypeScript version.

Can you check what version you’re using? Omit is only available starting from TypeScript 3.5.

Let me know how it goes.