Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

typescript class import csv file

// # csv file
import csvData from './latlong.csv';
//# text import
import textData from '../common/text/info.txt';
//# json import
import jsonData from '../common/json/jsondata.json';


export const TextResource = textData; // not-work
export const JsonResource = <IJsondata> jsonData; // work
export const CsvResource = <ILatLong[]> csvData; // not-work

export interface IJsondata {
    email: string;
    password: string;
}

export interface ILatLong {
    name: string;
    lat: any;
    long: any;
}

declare module "*.txt" {
    const content: string;
    export default content;
}

declare module '*.csv' {
    const value: any;
    export default value;
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: feature counts bioconda 
Typescript :: ts loop through days in dates 
Typescript :: Will Tenet come in plate format 
Typescript :: how to call an action from another action slice in redux 
Typescript :: how to find out the amount of ints in c++ 
Typescript :: Carbohydrates and fats both 
Typescript :: typescript -g doesnst read tsconfog 
Typescript :: Convert the array of objects to object iterable 
Typescript :: he .native modifier for v-on is only valid on components but it was used on <a. 
Typescript :: template matching several bounding boxes outputted need only one 
Typescript :: create a 4x2 integer array and print its attributes 
Typescript :: Which Protect Presentation option protects a presentation from accidental changes: 
Typescript :: find unique elements in pandas and their connection with other column 
Typescript :: can we use function overloading and default arguments at same time in c++ 
Typescript :: Do feral cats have rabies? 
Typescript :: Correct this attempt to modify "product" or use "let" in its declaration. [+1 location] 
Typescript :: two widgets in a row in flutter on both ends not working 
Typescript :: is there somone controlling the puppets in peppermint park 
Typescript :: stats splunk many fields 
Typescript :: import path cannot end with ts 
Typescript :: how to check weather a file exists using os module 
Typescript :: How can I manage several subcontracting locations? 
Typescript :: python arbitrary arguments *args mcqs 
Typescript :: typescript get a number param 
Typescript :: Scroll,Position 
Typescript :: sts shortcut to resolve error 
Typescript :: React/Typescript Storybook not allowing objects to be imported 
Typescript :: that asks for a two digit number and then prints the english word for the number 
Typescript :: How to check that tuple contains unique elements 
Typescript :: convert java to typescript 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =