UNPKG

@itwin/presentation-shared

Version:

The package contains types and utilities used across different iTwin.js Presentation packages.

27 lines 918 B
import { Event } from "./Event.js"; /** * An utility `Omit` type which works with union types. * @public */ export type OmitOverUnion<T, K extends PropertyKey> = T extends T ? Omit<T, K> : never; /** * An utility generic type to get array element's type. * @public */ export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never; /** * Returns type of the first `TFunc` parameter. * @public */ export type Props<TFunc extends (...args: any[]) => any> = Parameters<TFunc>[0]; /** * Returns type of the given `Event` listener. * @public */ export type EventListener<TEvent extends Event> = TEvent extends Event<infer TListener> ? TListener : never; /** * Returns type of the given `Event` arguments. * @public */ export type EventArgs<TEvent extends Event> = Props<EventListener<TEvent>>; //# sourceMappingURL=MappedTypes.d.ts.map