progress-events
Advanced tools
| { | ||
| "version": 3, | ||
| "sources": ["../src/index.ts"], | ||
| "sourcesContent": ["/**\n * Progress events are emitted during long running operations\n */\nexport interface ProgressEvent<T extends string = any, D = unknown> {\n /**\n * The event type\n */\n type: T\n\n /**\n * Context-specific event information\n */\n detail: D\n}\n\n/**\n * An implementation of the ProgressEvent interface, this is essentially\n * a typed `CustomEvent` with a `type` property that lets us disambiguate\n * events passed to `progress` callbacks.\n */\nexport class CustomProgressEvent<D = unknown, T extends string = any> extends Event implements ProgressEvent<T, D> {\n public type: T\n public detail: D\n\n constructor (type: T, detail?: D) {\n super(type)\n\n this.type = type\n // @ts-expect-error detail may be undefined\n this.detail = detail\n }\n}\n\n/**\n * Define an `onProgress` callback that can be invoked with `ProgressEvent`s\n *\n * @example\n *\n * ```typescript\n * type MyOperationProgressEvents =\n * ProgressEvent<'operation:start'> |\n * ProgressEvent<'operation:success', Result> |\n * ProgressEvent<'operation:error', Error>\n *\n * export interface MyOperationOptions extends ProgressOptions<MyOperationProgressEvents> {\n * // define options here\n * }\n * ```\n */\nexport interface ProgressOptions<Event extends ProgressEvent = any> {\n onProgress?(evt: Event): void\n}\n"], | ||
| "mappings": ";kcAeA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAKM,IAAOA,EAAP,cAAwE,KAAK,CAC1E,KACA,OAEP,YAAaC,EAASC,EAAU,CAC9B,MAAMD,CAAI,EAEV,KAAK,KAAOA,EAEZ,KAAK,OAASC,CAChB", | ||
| "names": ["index_exports", "__export", "CustomProgressEvent", "type", "detail"] | ||
| } |
| (function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.ProgressEvents = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
| "use strict";var ProgressEvents=(()=>{var a=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var n=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},r=(e,t,i,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of p(t))!h.call(e,s)&&s!==i&&a(e,s,{get:()=>t[s],enumerable:!(d=l(t,s))||d.enumerable});return e};var x=e=>r(a({},"__esModule",{value:!0}),e);var o={};n(o,{CustomProgressEvent:()=>c});var c=class extends Event{type;detail;constructor(t,i){super(t),this.type=t,this.detail=i}};return x(o);})(); | ||
| return ProgressEvents})); | ||
| //# sourceMappingURL=index.min.js.map |
@@ -41,4 +41,4 @@ /** | ||
| export interface ProgressOptions<Event extends ProgressEvent = any> { | ||
| onProgress?: (evt: Event) => void; | ||
| onProgress?(evt: Event): void; | ||
| } | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO;IAChE;;OAEG;IACH,IAAI,EAAE,CAAC,CAAA;IAEP;;OAEG;IACH,MAAM,EAAE,CAAC,CAAA;CACV;AAED;;;;GAIG;AACH,qBAAa,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,KAAM,YAAW,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;IACzG,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,CAAC,CAAA;gBAEH,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;CAOjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,aAAa,GAAG,GAAG;IAChE,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;CAClC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO;IAChE;;OAEG;IACH,IAAI,EAAE,CAAC,CAAA;IAEP;;OAEG;IACH,MAAM,EAAE,CAAC,CAAA;CACV;AAED;;;;GAIG;AACH,qBAAa,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,MAAM,GAAG,GAAG,CAAE,SAAQ,KAAM,YAAW,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;IACzG,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,CAAC,CAAA;gBAEH,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC;CAOjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,aAAa,GAAG,GAAG;IAChE,UAAU,CAAC,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;CAC9B"} |
+16
-9
| { | ||
| "name": "progress-events", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Progress events and types", | ||
@@ -15,2 +15,6 @@ "author": "", | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "provenance": true | ||
| }, | ||
| "type": "module", | ||
@@ -30,8 +34,2 @@ "types": "./dist/src/index.d.ts", | ||
| }, | ||
| "eslintConfig": { | ||
| "extends": "ipfs", | ||
| "parserOptions": { | ||
| "sourceType": "module" | ||
| } | ||
| }, | ||
| "release": { | ||
@@ -119,3 +117,11 @@ "branches": [ | ||
| "@semantic-release/github", | ||
| "@semantic-release/git" | ||
| [ | ||
| "@semantic-release/git", | ||
| { | ||
| "assets": [ | ||
| "CHANGELOG.md", | ||
| "package.json" | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
@@ -135,2 +141,3 @@ }, | ||
| "dep-check": "aegir dep-check", | ||
| "spell-check": "aegir spell-check", | ||
| "release": "aegir release", | ||
@@ -140,4 +147,4 @@ "docs": "aegir docs" | ||
| "devDependencies": { | ||
| "aegir": "^40.0.0" | ||
| "aegir": "^47.0.26" | ||
| } | ||
| } |
+17
-17
@@ -1,2 +0,2 @@ | ||
| # progress-events <!-- omit in toc --> | ||
| # progress-events | ||
@@ -8,12 +8,4 @@ [](https://codecov.io/gh/achingbrain/progress-events) | ||
| ## Table of contents <!-- omit in toc --> | ||
| # Install | ||
| - [Install](#install) | ||
| - [Browser `<script>` tag](#browser-script-tag) | ||
| - [API Docs](#api-docs) | ||
| - [License](#license) | ||
| - [Contribution](#contribution) | ||
| ## Install | ||
| ```console | ||
@@ -23,5 +15,5 @@ $ npm i progress-events | ||
| ### Browser `<script>` tag | ||
| ## Browser `<script>` tag | ||
| Loading this module through a script tag will make it's exports available as `ProgressEvents` in the global namespace. | ||
| Loading this module through a script tag will make its exports available as `ProgressEvents` in the global namespace. | ||
@@ -32,15 +24,23 @@ ```html | ||
| ## API Docs | ||
| ## Table of contents <!-- omit in toc --> | ||
| - [Install](#install) | ||
| - [Browser `<script>` tag](#browser-script-tag) | ||
| - [API Docs](#api-docs) | ||
| - [License](#license) | ||
| - [Contribution](#contribution) | ||
| # API Docs | ||
| - <https://achingbrain.github.io/progress-events> | ||
| ## License | ||
| # License | ||
| Licensed under either of | ||
| - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) | ||
| - MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) | ||
| - Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/progress-events/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) | ||
| - MIT ([LICENSE-MIT](https://github.com/achingbrain/progress-events/LICENSE-MIT) / <http://opensource.org/licenses/MIT>) | ||
| ## Contribution | ||
| # Contribution | ||
| Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
+1
-1
@@ -51,3 +51,3 @@ /** | ||
| export interface ProgressOptions<Event extends ProgressEvent = any> { | ||
| onProgress?: (evt: Event) => void | ||
| onProgress?(evt: Event): void | ||
| } |
-4
| This project is dual licensed under MIT and Apache-2.0. | ||
| MIT: https://www.opensource.org/licenses/mit | ||
| Apache-2.0: https://www.apache.org/licenses/license-2.0 |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Mixed license
LicensePackage contains multiple licenses.
12142
16.77%0
-100%117
0.86%