Création d'un script séparé pour déclarer les interfaces correspondant aux options de Papa Parse
This commit is contained in:
parent
d90e38d5dc
commit
d980412b0f
@ -3,29 +3,7 @@ const errors= require("./errors.js");
|
|||||||
import { RemoteSource } from "./freeDatas2HTMLRemoteSource";
|
import { RemoteSource } from "./freeDatas2HTMLRemoteSource";
|
||||||
|
|
||||||
import { ParseResults, Parsers, RemoteSources, RemoteSourceSettings } from "./interfaces";
|
import { ParseResults, Parsers, RemoteSources, RemoteSourceSettings } from "./interfaces";
|
||||||
|
import { PublicPapaParseOptions, PrivatePapaParseOptions } from "./interfacesPapaParse";
|
||||||
// Options de Papa Parse
|
|
||||||
// cf. https://www.papaparse.com/docs#config
|
|
||||||
interface PublicPapaParseOptions
|
|
||||||
{
|
|
||||||
delimiter: string;
|
|
||||||
newline: string;
|
|
||||||
quoteChar: string;
|
|
||||||
escapeChar: string;
|
|
||||||
transformHeader?(field: string, index: number): string;
|
|
||||||
preview: number;
|
|
||||||
comments: false|string;
|
|
||||||
fastMode: boolean|undefined;
|
|
||||||
transform?(value: string): string;
|
|
||||||
}
|
|
||||||
interface PrivatePapaParseOptions
|
|
||||||
{
|
|
||||||
header: boolean;
|
|
||||||
download: boolean;
|
|
||||||
downloadRequestHeaders: undefined| { [index: string]:string };
|
|
||||||
skipEmptyLines: string;
|
|
||||||
withCredentials: boolean|undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ParserForCSV implements Parsers
|
export class ParserForCSV implements Parsers
|
||||||
{
|
{
|
||||||
|
22
src/interfacesPapaParse.ts
Normal file
22
src/interfacesPapaParse.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Options de Papa Parse
|
||||||
|
// cf. https://www.papaparse.com/docs#config
|
||||||
|
interface PublicPapaParseOptions
|
||||||
|
{
|
||||||
|
delimiter: string;
|
||||||
|
newline: string;
|
||||||
|
quoteChar: string;
|
||||||
|
escapeChar: string;
|
||||||
|
transformHeader?(field: string, index: number): string;
|
||||||
|
preview: number;
|
||||||
|
comments: false|string;
|
||||||
|
fastMode: boolean|undefined;
|
||||||
|
transform?(value: string): string;
|
||||||
|
}
|
||||||
|
interface PrivatePapaParseOptions
|
||||||
|
{
|
||||||
|
header: boolean;
|
||||||
|
download: boolean;
|
||||||
|
downloadRequestHeaders: undefined| { [index: string]:string };
|
||||||
|
skipEmptyLines: string;
|
||||||
|
withCredentials: boolean|undefined;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user