If you are unsure about the response type and don't mind about the typing, you can use:
const result = client.get<any>('URL');
If you know the response is an object but you are not familiar with its properties, you can do:
const result = client.get<{ [key: string]: unknown }>('URL');
// Alternatively, create an alias.
type Data = { [key: string]: unknown };
const result = client.get<Data>('URL');
// Or if you anticipate an array.
const result = client.get<Data[]>('URL');
If you require TypeScript to validate the type, you must ascertain the data type and define a corresponding typing. For instance:
type User = {
name: string;
email: string;
}
If you assume the response to be a User object => { name, email }
const result = client.get<User>('URL');
If you foresee the response to be an array of User objects => [ { name, email } ]
const result = client.get<User[]>('URL');
If you anticipate the response to be an array of specific string variables:
type KnownVariables = Array<'doctor' | 'programmer' | 'designer'>;
const result = client.get<KnownVariables>('URL');