mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Updated JSDoc types
This commit is contained in:
parent
8ba1270a7d
commit
0da286b0a2
4 changed files with 19 additions and 10 deletions
|
@ -38,7 +38,7 @@ class Archive {
|
||||||
/**
|
/**
|
||||||
* Open an archive
|
* Open an archive
|
||||||
* @param {binary} input
|
* @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
|
* @return {Promise} zipfile
|
||||||
*/
|
*/
|
||||||
open(input, isBase64){
|
open(input, isBase64){
|
||||||
|
@ -48,7 +48,7 @@ class Archive {
|
||||||
/**
|
/**
|
||||||
* Load and Open an archive
|
* Load and Open an archive
|
||||||
* @param {string} zipUrl
|
* @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
|
* @return {Promise} zipfile
|
||||||
*/
|
*/
|
||||||
openUrl(zipUrl, isBase64){
|
openUrl(zipUrl, isBase64){
|
||||||
|
@ -62,7 +62,7 @@ class Archive {
|
||||||
* Request a url from the archive
|
* Request a url from the archive
|
||||||
* @param {string} url a url to request from the archive
|
* @param {string} url a url to request from the archive
|
||||||
* @param {string} [type] specify the type of the returned result
|
* @param {string} [type] specify the type of the returned result
|
||||||
* @return {Promise}
|
* @return {Promise<Blob | string | JSON | Document | XMLDocument>}
|
||||||
*/
|
*/
|
||||||
request(url, type){
|
request(url, type){
|
||||||
var deferred = new defer();
|
var deferred = new defer();
|
||||||
|
|
|
@ -8,7 +8,7 @@ import EventEmitter from "event-emitter";
|
||||||
* @param {object} settings
|
* @param {object} settings
|
||||||
* @param {string} [settings.layout='reflowable']
|
* @param {string} [settings.layout='reflowable']
|
||||||
* @param {string} [settings.spread]
|
* @param {string} [settings.spread]
|
||||||
* @param {int} [settings.minSpreadWidth=800]
|
* @param {number} [settings.minSpreadWidth=800]
|
||||||
* @param {boolean} [settings.evenSpreads=false]
|
* @param {boolean} [settings.evenSpreads=false]
|
||||||
*/
|
*/
|
||||||
class Layout {
|
class Layout {
|
||||||
|
@ -55,6 +55,7 @@ class Layout {
|
||||||
/**
|
/**
|
||||||
* Switch the flow between paginated and scrolled
|
* Switch the flow between paginated and scrolled
|
||||||
* @param {string} flow paginated | scrolled
|
* @param {string} flow paginated | scrolled
|
||||||
|
* @return {string} simplified flow
|
||||||
*/
|
*/
|
||||||
flow(flow) {
|
flow(flow) {
|
||||||
if (typeof(flow) != "undefined") {
|
if (typeof(flow) != "undefined") {
|
||||||
|
@ -74,8 +75,9 @@ class Layout {
|
||||||
/**
|
/**
|
||||||
* Switch between using spreads or not, and set the
|
* Switch between using spreads or not, and set the
|
||||||
* width at which they switch to single.
|
* width at which they switch to single.
|
||||||
* @param {string} spread true | false
|
* @param {string} spread "none" | "always" | "auto"
|
||||||
* @param {boolean} min integer in pixels
|
* @param {number} min integer in pixels
|
||||||
|
* @return {boolean} spread true | false
|
||||||
*/
|
*/
|
||||||
spread(spread, min) {
|
spread(spread, min) {
|
||||||
|
|
||||||
|
@ -94,9 +96,9 @@ class Layout {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the dimensions of the pagination
|
* Calculate the dimensions of the pagination
|
||||||
* @param {number} _width [description]
|
* @param {number} _width width of the rendering
|
||||||
* @param {number} _height [description]
|
* @param {number} _height height of the rendering
|
||||||
* @param {number} _gap [description]
|
* @param {number} _gap width of the gap between columns
|
||||||
*/
|
*/
|
||||||
calculate(_width, _height, _gap){
|
calculate(_width, _height, _gap){
|
||||||
|
|
||||||
|
@ -231,6 +233,11 @@ class Layout {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update props that have changed
|
||||||
|
* @private
|
||||||
|
* @param {object} props
|
||||||
|
*/
|
||||||
update(props) {
|
update(props) {
|
||||||
// Remove props that haven't changed
|
// Remove props that haven't changed
|
||||||
Object.keys(props).forEach((propName) => {
|
Object.keys(props).forEach((propName) => {
|
||||||
|
|
|
@ -181,7 +181,7 @@ class Queue {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of tasks in the queue
|
* Get the number of tasks in the queue
|
||||||
* @return {int} tasks
|
* @return {number} tasks
|
||||||
*/
|
*/
|
||||||
length(){
|
length(){
|
||||||
return this._q.length;
|
return this._q.length;
|
||||||
|
|
|
@ -73,6 +73,7 @@ class Url {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves a relative path to a absolute url
|
* Resolves a relative path to a absolute url
|
||||||
|
* @param {string} what
|
||||||
* @returns {string} url
|
* @returns {string} url
|
||||||
*/
|
*/
|
||||||
resolve (what) {
|
resolve (what) {
|
||||||
|
@ -89,6 +90,7 @@ class Url {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolve a path relative to the url
|
* Resolve a path relative to the url
|
||||||
|
* @param {string} what
|
||||||
* @returns {string} path
|
* @returns {string} path
|
||||||
*/
|
*/
|
||||||
relative (what) {
|
relative (what) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue