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

Updated JSDoc types

This commit is contained in:
Fred Chasen 2018-08-20 19:01:31 -07:00
parent 8ba1270a7d
commit 0da286b0a2
4 changed files with 19 additions and 10 deletions

View file

@ -38,7 +38,7 @@ class Archive {
/**
* Open an archive
* @param {binary} input
* @param {boolean} isBase64 tells JSZip if the input data is base64 encoded
* @param {boolean} [isBase64] tells JSZip if the input data is base64 encoded
* @return {Promise} zipfile
*/
open(input, isBase64){
@ -48,7 +48,7 @@ class Archive {
/**
* Load and Open an archive
* @param {string} zipUrl
* @param {boolean} isBase64 tells JSZip if the input data is base64 encoded
* @param {boolean} [isBase64] tells JSZip if the input data is base64 encoded
* @return {Promise} zipfile
*/
openUrl(zipUrl, isBase64){
@ -62,7 +62,7 @@ class Archive {
* Request a url from the archive
* @param {string} url a url to request from the archive
* @param {string} [type] specify the type of the returned result
* @return {Promise}
* @return {Promise<Blob | string | JSON | Document | XMLDocument>}
*/
request(url, type){
var deferred = new defer();

View file

@ -8,7 +8,7 @@ import EventEmitter from "event-emitter";
* @param {object} settings
* @param {string} [settings.layout='reflowable']
* @param {string} [settings.spread]
* @param {int} [settings.minSpreadWidth=800]
* @param {number} [settings.minSpreadWidth=800]
* @param {boolean} [settings.evenSpreads=false]
*/
class Layout {
@ -55,6 +55,7 @@ class Layout {
/**
* Switch the flow between paginated and scrolled
* @param {string} flow paginated | scrolled
* @return {string} simplified flow
*/
flow(flow) {
if (typeof(flow) != "undefined") {
@ -74,8 +75,9 @@ class Layout {
/**
* Switch between using spreads or not, and set the
* width at which they switch to single.
* @param {string} spread true | false
* @param {boolean} min integer in pixels
* @param {string} spread "none" | "always" | "auto"
* @param {number} min integer in pixels
* @return {boolean} spread true | false
*/
spread(spread, min) {
@ -94,9 +96,9 @@ class Layout {
/**
* Calculate the dimensions of the pagination
* @param {number} _width [description]
* @param {number} _height [description]
* @param {number} _gap [description]
* @param {number} _width width of the rendering
* @param {number} _height height of the rendering
* @param {number} _gap width of the gap between columns
*/
calculate(_width, _height, _gap){
@ -231,6 +233,11 @@ class Layout {
}
/**
* Update props that have changed
* @private
* @param {object} props
*/
update(props) {
// Remove props that haven't changed
Object.keys(props).forEach((propName) => {

View file

@ -181,7 +181,7 @@ class Queue {
/**
* Get the number of tasks in the queue
* @return {int} tasks
* @return {number} tasks
*/
length(){
return this._q.length;

View file

@ -73,6 +73,7 @@ class Url {
/**
* Resolves a relative path to a absolute url
* @param {string} what
* @returns {string} url
*/
resolve (what) {
@ -89,6 +90,7 @@ class Url {
/**
* Resolve a path relative to the url
* @param {string} what
* @returns {string} path
*/
relative (what) {