mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
13 lines
443 B
TypeScript
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');
|