2021-09-23 11:28:27 +02:00
|
|
|
export interface Counter
|
|
|
|
{
|
|
|
|
displayElement?: DOMElement; // peut être undefined si on ne souhaite pas d'affichage automatique dans la page
|
|
|
|
value?: number; // undefined jusqu'à recevoir sa première valeur
|
|
|
|
}
|
2021-09-27 12:10:22 +02:00
|
|
|
export interface DatasRenders // interface à respecter par toute alternative à la classe Render par défaut
|
2021-09-23 17:19:31 +02:00
|
|
|
{
|
|
|
|
rend2HTML(datas: any[]): string;
|
|
|
|
}
|
2021-09-27 12:10:22 +02:00
|
|
|
export interface DatasRendersSettings // interface spécifique à la classe Render par défaut.
|
2021-09-23 17:19:31 +02:00
|
|
|
{
|
|
|
|
allBegining: string;
|
|
|
|
allEnding: string;
|
|
|
|
fieldsBegining?: string;
|
|
|
|
fieldsEnding?: string;
|
|
|
|
fieldDisplaying?: string;
|
|
|
|
linesBegining: string;
|
|
|
|
linesEnding: string;
|
|
|
|
lineBegining: string;
|
|
|
|
lineEnding: string;
|
|
|
|
dataDisplaying: string;
|
|
|
|
}
|
2021-09-17 18:02:45 +02:00
|
|
|
export interface DOMElement
|
2021-08-30 17:42:09 +02:00
|
|
|
{
|
|
|
|
id: string;
|
|
|
|
eltDOM?: HTMLElement;
|
|
|
|
}
|
2021-09-21 17:46:04 +02:00
|
|
|
export interface Paginations
|
|
|
|
{
|
|
|
|
options?: PaginationsOptions;
|
2021-10-20 12:36:09 +02:00
|
|
|
selectedValue: number|undefined;
|
2021-09-21 17:46:04 +02:00
|
|
|
pages: PaginationsPages;
|
2021-10-20 12:36:09 +02:00
|
|
|
options2HTML(): void;
|
|
|
|
pages2HTML(nbTotal:number) : void;
|
2021-09-21 17:46:04 +02:00
|
|
|
}
|
|
|
|
export interface PaginationsOptions
|
|
|
|
{
|
|
|
|
displayElement: DOMElement;
|
|
|
|
name?: string;
|
|
|
|
values: number[];
|
|
|
|
};
|
|
|
|
export interface PaginationsPages
|
|
|
|
{
|
|
|
|
displayElement: DOMElement;
|
2021-10-20 12:36:09 +02:00
|
|
|
name?: string;
|
2021-09-21 17:46:04 +02:00
|
|
|
values?: number[];
|
|
|
|
selectedValue?: number;
|
|
|
|
}
|
2021-09-29 17:56:10 +02:00
|
|
|
export interface Datas
|
|
|
|
{
|
|
|
|
[key: string]: string;
|
|
|
|
}
|
2021-10-06 16:54:20 +02:00
|
|
|
export interface ParseErrors
|
2021-09-29 17:56:10 +02:00
|
|
|
{
|
|
|
|
code?: string;
|
|
|
|
message: string;
|
2021-10-18 11:27:53 +02:00
|
|
|
row: number; // -1 quand bug avant de traiter les lignes
|
2021-09-29 17:56:10 +02:00
|
|
|
type?: string;
|
|
|
|
}
|
|
|
|
export interface ParseResults
|
|
|
|
{
|
2021-10-06 16:54:20 +02:00
|
|
|
datas: {[index: string]:string}[];
|
2021-09-29 17:56:10 +02:00
|
|
|
errors: ParseErrors[];
|
|
|
|
fields: string[];
|
|
|
|
}
|
|
|
|
export interface Parsers
|
|
|
|
{
|
2021-10-13 17:22:02 +02:00
|
|
|
datasRemoteSource: RemoteSources;
|
2021-10-11 16:44:20 +02:00
|
|
|
setRemoteSource(settings : RemoteSourceSettings): void;
|
2021-10-13 12:41:34 +02:00
|
|
|
datas2Parse?: string;
|
|
|
|
document2Parse?: HTMLDocument;
|
2021-10-06 16:54:20 +02:00
|
|
|
parseResults: ParseResults|undefined;
|
|
|
|
parse(): Promise<void>;
|
2021-09-29 17:56:10 +02:00
|
|
|
}
|
2021-10-11 16:44:20 +02:00
|
|
|
export interface RemoteSourceSettings
|
2021-09-29 17:56:10 +02:00
|
|
|
{
|
|
|
|
url: string;
|
2021-10-11 16:44:20 +02:00
|
|
|
headers?: { key:string, value:string }[];
|
|
|
|
withCredentials?: boolean;
|
|
|
|
}
|
2021-10-13 17:22:02 +02:00
|
|
|
export interface RemoteSources extends RemoteSourceSettings
|
2021-10-11 16:44:20 +02:00
|
|
|
{
|
|
|
|
getFetchSettings() : {};
|
2021-09-29 17:56:10 +02:00
|
|
|
}
|
2021-09-17 18:02:45 +02:00
|
|
|
export interface Selectors
|
2021-08-30 17:42:09 +02:00
|
|
|
{
|
2021-09-17 18:02:45 +02:00
|
|
|
datasViewElt: DOMElement;
|
2021-09-22 17:12:00 +02:00
|
|
|
datasFieldNb: number;
|
2021-09-17 18:02:45 +02:00
|
|
|
separator?: string|undefined;
|
2021-08-30 17:42:09 +02:00
|
|
|
name?: string;
|
2021-09-09 12:57:23 +02:00
|
|
|
values?: string[];
|
2021-09-17 18:02:45 +02:00
|
|
|
selector2HTML() : void;
|
|
|
|
dataIsOk(data: any) : boolean;
|
2021-09-02 18:15:15 +02:00
|
|
|
}
|
2021-09-20 18:01:09 +02:00
|
|
|
export interface SortingFields
|
2021-09-02 18:15:15 +02:00
|
|
|
{
|
2021-09-22 17:36:11 +02:00
|
|
|
datasFieldNb: number;
|
2021-10-19 15:49:10 +02:00
|
|
|
order: "asc"|"desc"|undefined;
|
2021-09-20 18:01:09 +02:00
|
|
|
field2HTML() : void;
|
2021-09-06 17:25:30 +02:00
|
|
|
}
|
2021-09-17 18:02:45 +02:00
|
|
|
export interface SortingFunctions
|
2021-09-06 17:25:30 +02:00
|
|
|
{
|
|
|
|
datasFieldNb: number;
|
|
|
|
sort(a: any,b: any, order?: "asc"|"desc"): number; // cf. https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
|
2021-08-30 17:42:09 +02:00
|
|
|
}
|