shimi
Version:
A JS framework for building complex MIDI applications
51 lines (50 loc) • 2.1 kB
TypeScript
import PropertyTracker from './PropertyTracker';
import ShimiEvent, { ShimiEventData } from './ShimiEvent';
/**
* The SliderEventData class extends ShimiEventData. It contains a reference to the source SliderInput that created the event.
*
* @category User Inputs
*/
export declare class SliderEventData extends ShimiEventData<SliderInput> {
constructor(source: SliderInput);
}
/**
* The SliderEvent class extends ShimiEvent, providing an object which can be subscribed to.
*
* When the event is fired, it calls all subscribed event handlers, passing in a SliderEventData object containing information about the slider that triggered the event.
*
* @category User Inputs
*/
export declare class SliderEvent extends ShimiEvent<SliderEventData, SliderInput> {
}
/**
* The SliderInput class models a slider that can move through a range of numerical values.
*
* @category User Inputs
*/
export default class SliderInput {
/** Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable. */
get typeName(): string;
/** Tracks changes to the sliders value. */
valueTracker: PropertyTracker<number>;
/** Returns the value of the slider. */
get value(): number;
/** The name property allows for an easy way to identify a button when it may be one of many sliders available. */
get name(): string;
private _name;
/** Returns how many consecutive milliseconds the slider has had a non-zero value. */
get activeMs(): number;
private _activeMs;
/** This event is fired every time the slider value changes. */
changed: SliderEvent;
/**
* @param name The name property allows for an easy way to identify a button when it may be one of many sliders available.
*/
constructor(name: string);
/**
* This method is intended to be called by a clock to provide regular updates. It should not be called by consumers of the library.
* @param deltaMs How many milliseconds have passed since the last update cycle.
* @returns
*/
update(deltaMs: number): void;
}