UNPKG

2.33 kBTypeScriptView Raw
1import * as React from "react";
2import { Intent, Props } from "../../common";
3export declare const HandleType: {
4 /** A full handle appears as a small square. */
5 FULL: "full";
6 /** A start handle appears as the left or top half of a square. */
7 START: "start";
8 /** An end handle appears as the right or bottom half of a square. */
9 END: "end";
10};
11export declare type HandleType = typeof HandleType[keyof typeof HandleType];
12export declare const HandleInteractionKind: {
13 /** Locked handles prevent other handles from being dragged past then. */
14 LOCK: "lock";
15 /** Push handles move overlapping handles with them as they are dragged. */
16 PUSH: "push";
17 /**
18 * Handles marked "none" are not interactive and do not appear in the UI.
19 * They serve only to break the track into subsections that can be colored separately.
20 */
21 NONE: "none";
22};
23export declare type HandleInteractionKind = typeof HandleInteractionKind[keyof typeof HandleInteractionKind];
24export declare type HandleProps = IHandleProps;
25/** @deprecated use HandleProps */
26export interface IHandleProps extends Props {
27 /** Numeric value of this handle. */
28 value: number;
29 /** Intent for the track segment immediately after this handle, taking priority over `intentBefore`. */
30 intentAfter?: Intent;
31 /** Intent for the track segment immediately before this handle. */
32 intentBefore?: Intent;
33 /** Style to use for the track segment immediately after this handle, taking priority over `trackStyleBefore`. */
34 trackStyleAfter?: React.CSSProperties;
35 /** Style to use for the track segment immediately before this handle */
36 trackStyleBefore?: React.CSSProperties;
37 /**
38 * How this handle interacts with other handles.
39 *
40 * @default "lock"
41 */
42 interactionKind?: HandleInteractionKind;
43 /**
44 * Callback invoked when this handle's value is changed due to a drag
45 * interaction. Note that "push" interactions can cause multiple handles to
46 * update at the same time.
47 */
48 onChange?: (newValue: number) => void;
49 /** Callback invoked when this handle is released (the end of a drag interaction). */
50 onRelease?: (newValue: number) => void;
51 /**
52 * Handle appearance type.
53 *
54 * @default "full"
55 */
56 type?: HandleType;
57}