I have a few declarations in src/types/*.d.ts and in my src/types/role.d.ts, I have:
declare interface Role {
id: string;
title: string;
openings: string;
jobDescriptionUrl?: string;
minCompRange: number | string;
maxCompRange: number | string;
location: string;
postCovidLocation: string;
urgency: ROLE_URGENCY;
equity: ROLE_EQUITY;
company?: Company;
color: string;
status: ROLE_STATUS;
deletedAt?: Date;
hiredAt?: Date;
createdAt: Date;
pausedAt?: Date;
managerEmail?: string;
managerName?: string;
isExcRole?: boolean;
recruiter?: Recruiter;
offer?: File;
}
Somehow, it finds the Recruiter and File, but Company, which is declared in src/types/company.d.ts:
declare interface Company {
companyName: string;
companyUrl: string;
}
doesn't get found. I get an error:
src/types/role.d.ts:14:12 - error TS2304: Cannot find name 'Company'.
14 company?: Company;
~~~~~~~
In my tsconfig.json, I have:
"include": [
"src/**/*.ts",
]
What am I doing wrong?
typeRootsin favor ofinclude'ing it allrole.d.ts?/// <reference types="...">) lets you specify a dependency between different type files. I was thinking you might have missed the reference forcompany.d.tsbut you say you don't have any references at all yetRecruiterandFilework.