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;
|
|
|
|
selectedValue?: number; // on peut utiliser une Pagination sans proposer d'options à l'utilisateur.
|
|
|
|
pages: PaginationsPages;
|
|
|
|
rend2HTML(): void;
|
|
|
|
creaPageSelector(nbTotal:number) : void;
|
|
|
|
}
|
|
|
|
export interface PaginationsOptions
|
|
|
|
{
|
|
|
|
displayElement: DOMElement;
|
|
|
|
name?: string;
|
|
|
|
values: number[];
|
|
|
|
};
|
|
|
|
export interface PaginationsPages
|
|
|
|
{
|
|
|
|
displayElement: DOMElement;
|
|
|
|
name: string;
|
|
|
|
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;
|
|
|
|
row: number;
|
|
|
|
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-01 13:12:45 +02:00
|
|
|
datasRemoteSource: RemoteSource;
|
2021-10-06 16:54:20 +02:00
|
|
|
datas2Parse: string;
|
|
|
|
parseResults: ParseResults|undefined;
|
|
|
|
parse(): Promise<void>;
|
2021-09-29 17:56:10 +02:00
|
|
|
}
|
|
|
|
export interface RemoteSource
|
|
|
|
{
|
|
|
|
url: string;
|
2021-10-06 16:54:20 +02:00
|
|
|
headers?: { key:string, value:string }[] ;
|
2021-09-29 17:56:10 +02:00
|
|
|
withCredentials?:boolean;
|
|
|
|
}
|
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-09-02 18:15:15 +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
|
|
|
}
|