I have following declaration in the end of Types.ts
:
export let selectItemList = {
selectedInvoiceProvider: new SelectItemData<InvoiceProvider>(
{
"-": new SelectItemDataOption<InvoiceProvider>(InvoiceProvider.No),
Billingo: new SelectItemDataOption<InvoiceProvider>(
InvoiceProvider.Billingo
),
"szamlazz.hu": new SelectItemDataOption<InvoiceProvider>(
InvoiceProvider.Szamlazzhu
),
},
InvoiceProvider.No
),
But when I save and run I got this error:
Failed to compile.
./src/Types.ts Line 0: Parsing error: Cannot read property 'map' of
undefined
If I remove export
ALL WORKS, STRANGE
[EDIT]
I tried as Julian Kleine suggested, without any success:
const selectItemList = {
selectedInvoiceProvider: new SelectItemData<InvoiceProvider>(
{
"-": new SelectItemDataOption<InvoiceProvider>(InvoiceProvider.No),
Billingo: new SelectItemDataOption<InvoiceProvider>(
InvoiceProvider.Billingo
),
"szamlazz.hu": new SelectItemDataOption<InvoiceProvider>(
InvoiceProvider.Szamlazzhu
),
},
InvoiceProvider.No
),
// ...
export { selectItemList };
question from:
https://stackoverflow.com/questions/65847968/how-to-export-object-in-typescript-from-types-ts-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…