My object instantiation using a constructor declared for the interface:
let obj = new Output(cur.req, cur.type, cur.batchId, cur.rowId, dat2);
Model data structure
import { Data } from './data';
export interface Output {
req: string;
type: string;
batchId: number;
rowId: number;
data: Array<Data>
}
export interface OutputConstructor {
new (req: number, type: string, batchId: number, rowId: number, data:Array<Data>): Output;
Clone(): Output;
}
export var Output: OutputConstructor;
Output
is an interface, not a class. You can't directly instantiate an interface.
Like another user said before, Output is an interface. So what you have to do to set the type is this:
let obj = {} as Output;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With