mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
37 lines
784 B
TypeScript
37 lines
784 B
TypeScript
import * as favicons from "favicons";
|
|
|
|
let config: Partial<favicons.Configuration> = {
|
|
path: "/foo/bar"
|
|
};
|
|
|
|
config = {
|
|
icons: {
|
|
android: true
|
|
}
|
|
};
|
|
|
|
let html = "";
|
|
favicons("path/to/file.png", config, (err, res) => {
|
|
html = res.html.join("");
|
|
|
|
for (const { name, contents } of [...res.files, ...res.images]) {
|
|
html = name + contents.toString();
|
|
}
|
|
});
|
|
|
|
favicons("file.png", (err: any, res: any) => {
|
|
html = res.html.join("");
|
|
|
|
for (const { name, contents } of [...res.files, ...res.images]) {
|
|
html = name + contents.toString();
|
|
}
|
|
});
|
|
|
|
favicons("file.png").then((res) => {
|
|
html = res.html.join("");
|
|
|
|
for (const { name, contents } of [...res.files, ...res.images]) {
|
|
html = name + contents.toString();
|
|
}
|
|
});
|