Files
DefinitelyTyped/types/downloadjs/downloadjs-tests.ts
Jeffrey Young 1a688277d3 downloadjs types added (#16032)
* downloadjs types added

* downloadjs inline types, remove unnecessary toString
2017-04-20 14:51:11 -07:00

13 lines
443 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');
download(document.documentElement.outerHTML, 'dlHTML.html', 'text/html');
download(new Blob(['hello world'.bold()]), 'dlHtmlBlob.html', 'text/html');
download('/diff6.png');