#Create Type

3 messages · Page 1 of 1 (latest)

opal igloo
#

how could you construct a type forts outputs: { Key: string; Value: string }[] , it would be like passing something just like this ```ts
outputs: TypeOutputs

cedar badge
#

You mean like this?

type TypeOutputs = {Key: string, Value: string}[]
const f = (): TypeOutputs => ([{Key: 'foo', Value: 'bar'}]);
opal igloo
#

It would be a type to simplify and not need to pass it in the constructor ```ts
export class TechOutputs {
private techOutputsKeys = new Map<string, string>();

constructor(outputs: { Key: string; Value: string }[]) {
this.assignNeurotechOutputsKeys(outputs);
}