Global Types
Answered
Havana posted this in #help-forum
HavanaOP
I'm creating a global type named
But, it's not working in this project, while it does in other projects. I'm not sure why, and it seems strange.
ContactResponse
in the file src/types/global.d.ts
like this:declare global {
type ContactResponse = {
status: boolean;
message: {
title: string;
description: string;
};
};
}
But, it's not working in this project, while it does in other projects. I'm not sure why, and it seems strange.
Answered by Havana
it looks like the
But it's also weird it's working on other projects.
.d.ts
putting thing in the global scope by default so I removed the global declare and it works!type ContactResponse = {
status: boolean;
message: {
title: string;
description: string;
};
};
But it's also weird it's working on other projects.
1 Reply
HavanaOP
it looks like the
But it's also weird it's working on other projects.
.d.ts
putting thing in the global scope by default so I removed the global declare and it works!type ContactResponse = {
status: boolean;
message: {
title: string;
description: string;
};
};
But it's also weird it's working on other projects.
Answer