mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
14 lines
502 B
TypeScript
14 lines
502 B
TypeScript
import * as download from 'downloadjs';
|
|
|
|
download('hello world', 'dlText.txt', 'text/plain');
|
|
download('data:text/plain,hello%20world', 'dlDataUrlText.txt', 'text/plain');
|
|
|
|
download(new Blob(['hello world']), 'dlTextBlob.txt', 'text/plain');
|
|
|
|
download('/robots.txt');
|
|
|
|
// tslint:disable-next-line no-unnecessary-type-assertion
|
|
download(document.documentElement!.outerHTML, 'dlHTML.html', 'text/html');
|
|
download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html');
|
|
download('/diff6.png');
|