1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Added type declarations

This commit is contained in:
Fred Chasen 2018-08-20 22:21:26 -07:00
parent 0da286b0a2
commit 6bfcd1e4eb
50 changed files with 1837 additions and 54 deletions

View file

@ -9,10 +9,10 @@ import path from "path-webpack";
* Handle Package Resources
* @class
* @param {Manifest} manifest
* @param {[object]} options
* @param {[string="base64"]} options.replacements
* @param {[Archive]} options.archive
* @param {[method]} options.resolver
* @param {object} [options]
* @param {string} [options.replacements="base64"]
* @param {Archive} [options.archive]
* @param {method} [options.resolver]
*/
class Resources {
constructor(manifest, options) {
@ -93,6 +93,11 @@ class Resources {
}
/**
* Create a url to a resource
* @param {string} url
* @return {Promise<string>} Promise resolves with url string
*/
createUrl (url) {
var parsedUrl = new Url(url);
var mimeType = mime.lookup(parsedUrl.filename);
@ -239,7 +244,7 @@ class Resources {
/**
* Resolve all resources URLs relative to an absolute URL
* @param {string} absolute to be resolved to
* @param {[resolver]} resolver
* @param {resolver} [resolver]
* @return {string[]} array with relative Urls
*/
relativeTo(absolute, resolver){