typescript class import csv file

Solutions on MaxInterview for typescript class import csv file by the best coders in the world

showing results for - "typescript class import csv file"
Frieda
07 Jun 2018
1// # csv file
2import csvData from './latlong.csv';
3//# text import
4import textData from '../common/text/info.txt';
5//# json import
6import jsonData from '../common/json/jsondata.json';
7
8
9export const TextResource = textData; // not-work
10export const JsonResource = <IJsondata> jsonData; // work
11export const CsvResource = <ILatLong[]> csvData; // not-work
12
13export interface IJsondata {
14    email: string;
15    password: string;
16}
17
18export interface ILatLong {
19    name: string;
20    lat: any;
21    long: any;
22}
23
24declare module "*.txt" {
25    const content: string;
26    export default content;
27}
28
29declare module '*.csv' {
30    const value: any;
31    export default value;
32}
33