@deephaven/utils
Advanced tools
Comparing version 0.9.1-beta.2 to 0.9.1-beta.5
@@ -1,8 +0,12 @@ | ||
import type { Event } from 'event-target-shim'; | ||
import type { Event, EventTarget } from 'event-target-shim'; | ||
/** | ||
* A CustomEvent extension which combines the browser CustomEvent and event-target-shim's Event types for type safety | ||
* CustomEvent does not | ||
* CustomEvent does not have a generic type and augmenting the dom types seemed like not the best idea | ||
*/ | ||
export declare class EventShimCustomEvent<T extends string, D = unknown> extends CustomEvent<D> { | ||
export declare class EventShimCustomEvent<T extends string, D = unknown> extends CustomEvent<D> implements Event<T> { | ||
type: T; | ||
target: EventTarget | null; | ||
srcElement: EventTarget | null; | ||
currentTarget: EventTarget | null; | ||
composedPath: () => EventTarget[]; | ||
constructor(typeArg: T, eventInitDict?: CustomEventInit<D>); | ||
@@ -15,5 +19,5 @@ } | ||
*/ | ||
export declare type CustomEventMap<M extends Record<string, Event>> = { | ||
export declare type CustomEventMap<M extends Record<string, Event | CustomEvent>> = { | ||
[T in keyof M]: T extends string ? M[T] extends CustomEvent<infer D> ? EventShimCustomEvent<T, D> : M[T] extends Event ? Event<T> : never : never; | ||
}; | ||
//# sourceMappingURL=EventTargetShimUtils.d.ts.map |
@@ -1,13 +0,14 @@ | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
/** | ||
* A CustomEvent extension which combines the browser CustomEvent and event-target-shim's Event types for type safety | ||
* CustomEvent does not | ||
* CustomEvent does not have a generic type and augmenting the dom types seemed like not the best idea | ||
*/ | ||
export class EventShimCustomEvent extends CustomEvent { | ||
// The fields declared are so TS plays nicely w/ event-target-shim and the browser CustomEvent | ||
// They don't actually do anything other than tell TS to not complain that they aren't set in the constructor | ||
// If declare is removed, then the properties are initialized to undefined which breaks this class | ||
// This will be the default for tsc and babel at some point | ||
// https://github.com/babel/babel/issues/12128#issuecomment-702119272 | ||
// eslint-disable-next-line @typescript-eslint/no-useless-constructor | ||
constructor(typeArg, eventInitDict) { | ||
super(typeArg, eventInitDict); | ||
_defineProperty(this, "type", void 0); | ||
} | ||
@@ -14,0 +15,0 @@ |
@@ -12,5 +12,5 @@ export interface CancelablePromise<T> extends Promise<T> { | ||
static makeCancelable<T>(promise: Promise<T> | T, cleanup?: (val: T) => void | null): CancelablePromise<T>; | ||
static isCanceled(error: Error): boolean; | ||
static isTimedOut(error: Error): boolean; | ||
static isCanceled(error: unknown): boolean; | ||
static isTimedOut(error: unknown): boolean; | ||
} | ||
//# sourceMappingURL=PromiseUtils.d.ts.map |
{ | ||
"name": "@deephaven/utils", | ||
"version": "0.9.1-beta.2+b7c0512", | ||
"version": "0.9.1-beta.5+675913b", | ||
"description": "Deephaven Utils", | ||
@@ -35,7 +35,6 @@ "author": "Deephaven Data Labs LLC", | ||
"@babel/cli": "^7.16.0", | ||
"@deephaven/tsconfig": "^0.9.1-beta.2+b7c0512", | ||
"@deephaven/tsconfig": "^0.9.1-beta.5+675913b", | ||
"cross-env": "^7.0.2", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2", | ||
"typescript": "~4.3.2" | ||
"rimraf": "^3.0.2" | ||
}, | ||
@@ -48,3 +47,3 @@ "files": [ | ||
}, | ||
"gitHead": "b7c05127d0caa20989ff59bd061b5780e408e38e" | ||
"gitHead": "675913bbbdbadb2eae76b3732f457b8ec7be4a90" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
96731
5
815