resource-loader
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -157,3 +157,3 @@ 'use strict'; | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Loader.OnProgressSignal>} | ||
*/ | ||
@@ -167,3 +167,3 @@ this.onProgress = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Loader.OnErrorSignal>} | ||
*/ | ||
@@ -177,3 +177,3 @@ this.onError = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Loader.OnLoadSignal>} | ||
*/ | ||
@@ -187,3 +187,3 @@ this.onLoad = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Loader.OnStartSignal>} | ||
*/ | ||
@@ -197,3 +197,3 @@ this.onStart = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Loader.OnCompleteSignal>} | ||
*/ | ||
@@ -274,7 +274,8 @@ this.onComplete = new _miniSignals2.default(); | ||
* should the data being loaded be interpreted when using XHR? | ||
* @property {Loader.OnCompleteSignal} [onComplete] - Callback to add an an onComplete signal istener. | ||
* @property {Loader.OnCompleteSignal} [callback] - Alias for `onComplete`. | ||
* @property {Resource.OnCompleteSignal} [onComplete] - Callback to add an an onComplete signal istener. | ||
* @property {Resource.OnCompleteSignal} [callback] - Alias for `onComplete`. | ||
* @property {Resource.IMetadata} [metadata] - Extra configuration for middleware and the Resource object. | ||
*/ | ||
/* eslint-disable require-jsdoc,valid-jsdoc */ | ||
/** | ||
@@ -324,8 +325,43 @@ * Adds a resource (or multiple resources) to the loader queue. | ||
* | ||
* @param {string|IAddOptions} [name] - The name of the resource to load, if not passed the url is used. | ||
* @param {string} [url] - The url for this resource, relative to the baseUrl of this loader. | ||
* @param {IAddOptions} [options] - The options for the load. | ||
* @param {Loader.OnCompleteSignal} [cb] - Function to call when this specific resource completes loading. | ||
* @function | ||
* @variation 1 | ||
* @param {string} name - The name of the resource to load. | ||
* @param {string} url - The url for this resource, relative to the baseUrl of this loader. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ | ||
*/ /** | ||
* @function | ||
* @variation 2 | ||
* @param {string} name - The name of the resource to load. | ||
* @param {string} url - The url for this resource, relative to the baseUrl of this loader. | ||
* @param {IAddOptions} [options] - The options for the load. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ /** | ||
* @function | ||
* @variation 3 | ||
* @param {string} url - The url for this resource, relative to the baseUrl of this loader. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ /** | ||
* @function | ||
* @variation 4 | ||
* @param {string} url - The url for this resource, relative to the baseUrl of this loader. | ||
* @param {IAddOptions} [options] - The options for the load. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ /** | ||
* @function | ||
* @variation 5 | ||
* @param {IAddOptions} options - The options for the load. This object must contain a `url` property. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ /** | ||
* @function | ||
* @variation 6 | ||
* @param {Array<IAddOptions|string>} resources - An array of resources to load, where each is | ||
* either an object with the options or a string url. If you pass an object, it must contain a `url` property. | ||
* @param {Resource.OnCompleteSignal} [callback] - Function to call when this specific resource completes loading. | ||
* @return {this} Returns itself. | ||
*/ | ||
@@ -418,2 +454,3 @@ | ||
}; | ||
/* eslint-enable require-jsdoc,valid-jsdoc */ | ||
@@ -420,0 +457,0 @@ /** |
@@ -283,3 +283,3 @@ 'use strict'; | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Resource.OnStartSignal>} | ||
*/ | ||
@@ -297,3 +297,3 @@ this.onStart = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Resource.OnProgressSignal>} | ||
*/ | ||
@@ -308,3 +308,3 @@ this.onProgress = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Resource.OnCompleteSignal>} | ||
*/ | ||
@@ -318,3 +318,3 @@ this.onComplete = new _miniSignals2.default(); | ||
* | ||
* @member {Signal} | ||
* @member {Signal<Resource.OnCompleteSignal>} | ||
*/ | ||
@@ -321,0 +321,0 @@ this.onAfterMiddleware = new _miniSignals2.default(); |
{ | ||
"name": "resource-loader", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./typings/resource-loader.d.ts", |
@@ -0,1 +1,3 @@ | ||
import Signal from 'mini-signals'; | ||
declare namespace async { | ||
@@ -21,8 +23,13 @@ function eachSeries(array: any[], iterator: (...params: any[]) => any, callback: (...params: any[]) => any, deferNext?: boolean): void; | ||
}; | ||
onProgress: Signal; | ||
onError: Signal; | ||
onLoad: Signal; | ||
onStart: Signal; | ||
onComplete: Signal; | ||
add(name?: string | IAddOptions, url?: string, options?: IAddOptions, cb?: Loader.OnCompleteSignal): this; | ||
onProgress: Signal<Loader.OnProgressSignal>; | ||
onError: Signal<Loader.OnErrorSignal>; | ||
onLoad: Signal<Loader.OnLoadSignal>; | ||
onStart: Signal<Loader.OnStartSignal>; | ||
onComplete: Signal<Loader.OnCompleteSignal>; | ||
add(name: string, url: string, callback?: Resource.OnCompleteSignal): this; | ||
add(name: string, url: string, options?: IAddOptions, callback?: Resource.OnCompleteSignal): this; | ||
add(url: string, callback?: Resource.OnCompleteSignal): this; | ||
add(url: string, options?: IAddOptions, callback?: Resource.OnCompleteSignal): this; | ||
add(options: IAddOptions, callback?: Resource.OnCompleteSignal): this; | ||
add(resources: (IAddOptions | string)[], callback?: Resource.OnCompleteSignal): this; | ||
pre(fn: (...params: any[]) => any): this; | ||
@@ -53,4 +60,4 @@ use(fn: (...params: any[]) => any): this; | ||
xhrType?: Resource.XHR_RESPONSE_TYPE; | ||
onComplete?: Loader.OnCompleteSignal; | ||
callback?: Loader.OnCompleteSignal; | ||
onComplete?: Resource.OnCompleteSignal; | ||
callback?: Resource.OnCompleteSignal; | ||
metadata?: Resource.IMetadata; | ||
@@ -83,6 +90,6 @@ }; | ||
readonly progressChunk: number; | ||
onStart: Signal; | ||
onProgress: Signal; | ||
onComplete: Signal; | ||
onAfterMiddleware: Signal; | ||
onStart: Signal<Resource.OnStartSignal>; | ||
onProgress: Signal<Resource.OnProgressSignal>; | ||
onComplete: Signal<Resource.OnCompleteSignal>; | ||
onAfterMiddleware: Signal<Resource.OnCompleteSignal>; | ||
readonly isDataUrl: boolean; | ||
@@ -89,0 +96,0 @@ readonly isComplete: boolean; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
436424
22
4785