material-motion
Version:
Makes it easy to add rich, interactive motion to your application.
56 lines (55 loc) • 2.13 kB
TypeScript
import { Dimensions, Observable, Observer, Point2D, Timestamped } from './types';
/**
* Checks if an object is a Boolean.
*/
export declare function isBoolean(value: any): value is boolean;
/**
* Checks if an object is not undefined.
*/
export declare function isDefined(value: any): boolean;
/**
* Checks if an object has numeric values for both `width` and `height`.
*/
export declare function isDimensions(value: any): value is Dimensions;
/**
* Checks if an object is a Number.
*/
export declare function isNumber(value: any): value is number;
/**
* Checks if an object is an observable by checking if it returns itself from
* [Symbol.observable]()
*/
export declare function isObservable(value: any): value is Observable<any>;
/**
* Checks if an object is a `Map` using `instanceof`.
*/
export declare function isMap(value: any): value is Map<any, any>;
/**
* Checks if an object has numeric values for both `x` and `y`.
*/
export declare function isPoint2D(value: any): value is Point2D;
/**
* Checks if a value is an `Observer` by checking if the value has a `next`
* method.
*/
export declare function isObserver<T = any>(value: any): value is Observer<T>;
/**
* Checks if a value is a `PointerEvent` by checking if the value is an `Event`
* whose `type` starts with `pointer`.
*
* This is useful for ensuring that `downEvent.target.setPointerCapture()` can
* be called: To avoid using the PointerEvent polyfill, a developer could
* create an object that had the subset of `PointerEvent` that we care about
* (`PartialPointerEvent`) and populate its values from `event.targetTouches`.
* However, we only need to call `setPointerCapture()` on a true `PointerEvent`,
* so `isPointerEvent(value)` needs to be able to distinguish between them.
*/
export declare function isPointerEvent(value: any): value is PointerEvent;
/**
* Checks if value is iterable; that is, usable in a `for of` loop.
*/
export declare function isIterable(value: any): value is Iterable<any>;
/**
* Checks if value has a timestamp property.
*/
export declare function isTimestamped(value: any): value is Timestamped<any>;