UNPKG

@ctrl/ngx-csv

Version:

Easily generate a CSV download in the browser with Angular

28 lines (27 loc) 1.16 kB
import { OnChanges } from '@angular/core'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; import { HeaderObj } from './util'; import * as i0 from "@angular/core"; export declare class CsvDirective implements OnChanges { private sanitizer; /** the body of the csv */ data: string | string[][] | { [key: string]: string; }[] | any[]; /** Set the first line of the csv */ headers?: string[] | HeaderObj[]; /** Set the seperator between values */ delimiter: string; /** Set the filename of the csv. Default is `data.csv` */ set filename(a: string); /** adds a Byte order mark to setup the csv as UTF-8 */ uFEFF: boolean; href?: SafeResourceUrl; /** filename */ download: string; target: string; constructor(sanitizer: DomSanitizer); ngOnChanges(): void; static ɵfac: i0.ɵɵFactoryDeclaration<CsvDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<CsvDirective, "[csvLink]", never, { "data": "data"; "headers": "headers"; "delimiter": "delimiter"; "filename": "filename"; "uFEFF": "uFEFF"; "target": "target"; }, {}, never, never, false>; }