Is it possible to define a class which has interface variables without implementation in TypeScript?
For example:
interface ITask {
id: number;
title: string;
}
class Task implements ITask {
// without implementation
}
The above code will cause an error like this:
Type 'Task' is missing the following properties from type 'Task', ...
I also tried the following code, but it also caused an error:
class Task extends ITask {
// without implementation
}
TypeError: Class extends value undefined is not a constructor or null
I am asking this question because I want to generate classes from interfaces automatically, without changing any variable. I don't want to copy and paste all the variables.