| 1 |
/// <reference types="backbone" /> |
| 2 |
import { CoreDescriptionModel } from './widget_core'; |
| 3 |
import { DescriptionStyleModel, DescriptionView } from './widget_description'; |
| 4 |
import { DOMWidgetView, WidgetView } from '@jupyter-widgets/base'; |
| 5 |
export declare class IntModel extends CoreDescriptionModel { |
| 6 |
defaults(): Backbone.ObjectHash; |
| 7 |
} |
| 8 |
export declare class BoundedIntModel extends IntModel { |
| 9 |
defaults(): Backbone.ObjectHash; |
| 10 |
} |
| 11 |
export declare class SliderStyleModel extends DescriptionStyleModel { |
| 12 |
defaults(): Backbone.ObjectHash; |
| 13 |
static styleProperties: { |
| 14 |
handle_color: { |
| 15 |
selector: string; |
| 16 |
attribute: string; |
| 17 |
default: any; |
| 18 |
}; |
| 19 |
description_width: { |
| 20 |
selector: string; |
| 21 |
attribute: string; |
| 22 |
default: any; |
| 23 |
}; |
| 24 |
}; |
| 25 |
} |
| 26 |
export declare class IntSliderModel extends BoundedIntModel { |
| 27 |
defaults(): Backbone.ObjectHash; |
| 28 |
initialize(attributes: Backbone.ObjectHash, options: { |
| 29 |
model_id: string; |
| 30 |
comm: any; |
| 31 |
widget_manager: any; |
| 32 |
}): void; |
| 33 |
update_readout_format(): void; |
| 34 |
readout_formatter: any; |
| 35 |
} |
| 36 |
export declare class IntRangeSliderModel extends IntSliderModel { |
| 37 |
} |
| 38 |
export declare abstract class BaseIntSliderView extends DescriptionView { |
| 39 |
render(): void; |
| 40 |
/** |
| 41 |
* Update the contents of this view |
| 42 |
* |
| 43 |
* Called when the model is changed. The model may have been |
| 44 |
* changed by another view or by a state update from the back-end. |
| 45 |
*/ |
| 46 |
update(options?: any): void; |
| 47 |
/** |
| 48 |
* Returns true if the readout box content overflows. |
| 49 |
*/ |
| 50 |
readout_overflow(): boolean; |
| 51 |
/** |
| 52 |
* Write value to a string |
| 53 |
*/ |
| 54 |
abstract valueToString(value: number | number[]): string; |
| 55 |
/** |
| 56 |
* Parse value from a string |
| 57 |
*/ |
| 58 |
abstract stringToValue(text: string): number | number[] | null; |
| 59 |
events(): { |
| 60 |
[e: string]: string; |
| 61 |
}; |
| 62 |
handleKeyDown(e: KeyboardEvent): void; |
| 63 |
/** |
| 64 |
* Create a new noUiSlider object |
| 65 |
*/ |
| 66 |
createSlider(): void; |
| 67 |
/** |
| 68 |
* Recreate/Regenerate a slider object |
| 69 |
* noUiSlider does not support in-place mutation of the orientation |
| 70 |
* state. We therefore need to destroy the current instance |
| 71 |
* and create a new one with the new properties. This is |
| 72 |
* handled in a separate function and has a dedicated event |
| 73 |
* handler. |
| 74 |
*/ |
| 75 |
regenSlider(e: any): void; |
| 76 |
/** |
| 77 |
* Update noUiSlider object in-place with new options |
| 78 |
*/ |
| 79 |
abstract updateSliderOptions(e: any): void; |
| 80 |
/** |
| 81 |
* Update noUiSlider's state so that it is |
| 82 |
* synced with the Backbone.jas model |
| 83 |
*/ |
| 84 |
abstract updateSliderValue(model: any, value: any, options: any): void; |
| 85 |
/** |
| 86 |
* this handles the entry of text into the contentEditable label first, the |
| 87 |
* value is checked if it contains a parseable value then it is clamped |
| 88 |
* within the min-max range of the slider finally, the model is updated if |
| 89 |
* the value is to be changed |
| 90 |
* |
| 91 |
* if any of these conditions are not met, the text is reset |
| 92 |
*/ |
| 93 |
abstract handleTextChange(): void; |
| 94 |
/** |
| 95 |
* Called when the slider handle is released after dragging, |
| 96 |
* or by tapping or moving by the arrow keys. |
| 97 |
*/ |
| 98 |
abstract handleSliderChangeEvent(value: any, handle: any): void; |
| 99 |
/** |
| 100 |
* Called whilst the slider is dragged, tapped or moved by the arrow keys. |
| 101 |
*/ |
| 102 |
abstract handleSliderUpdateEvent(value: any, handle: any): void; |
| 103 |
/** |
| 104 |
* Called when the slider value has changed. |
| 105 |
* |
| 106 |
* Calling model.set will trigger all of the other views of the |
| 107 |
* model to update. |
| 108 |
*/ |
| 109 |
abstract handleSliderChanged(values: number[], handle: number): void; |
| 110 |
/** |
| 111 |
* Validate the value of the slider before sending it to the back-end |
| 112 |
* and applying it to the other views on the page. |
| 113 |
*/ |
| 114 |
_validate_slide_value(x: number): number; |
| 115 |
$slider: any; |
| 116 |
slider_container: HTMLElement; |
| 117 |
readout: HTMLDivElement; |
| 118 |
model: IntSliderModel; |
| 119 |
_parse_value: typeof parseInt; |
| 120 |
} |
| 121 |
export declare class IntRangeSliderView extends BaseIntSliderView { |
| 122 |
update(options?: any): void; |
| 123 |
/** |
| 124 |
* Write value to a string |
| 125 |
*/ |
| 126 |
valueToString(value: number[]): string; |
| 127 |
/** |
| 128 |
* Parse value from a string |
| 129 |
*/ |
| 130 |
stringToValue(text: string | null): number[] | null; |
| 131 |
handleTextChange(): void; |
| 132 |
/** |
| 133 |
* Called when the slider handle is released after dragging, |
| 134 |
* or by tapping or moving by the arrow keys. |
| 135 |
*/ |
| 136 |
handleSliderChangeEvent(values: any, handle: any): void; |
| 137 |
/** |
| 138 |
* Called whilst the slider is dragged, tapped or moved by the arrow keys. |
| 139 |
*/ |
| 140 |
handleSliderUpdateEvent(values: any, handle: any): void; |
| 141 |
handleSliderChanged(values: number[], handle: number): void; |
| 142 |
updateSliderOptions(e: any): void; |
| 143 |
updateSliderValue(model: any, _: any, options: any): void; |
| 144 |
_range_regex: RegExp; |
| 145 |
} |
| 146 |
export declare class IntSliderView extends BaseIntSliderView { |
| 147 |
update(options?: any): void; |
| 148 |
valueToString(value: number | number[]): string; |
| 149 |
stringToValue(text: string): number | number[]; |
| 150 |
handleTextChange(): void; |
| 151 |
handleSliderChangeEvent(values: any, handle: any): void; |
| 152 |
handleSliderUpdateEvent(values: any, handle: any): void; |
| 153 |
handleSliderChanged(values: any, handle: any): void; |
| 154 |
updateSliderOptions(e: any): void; |
| 155 |
updateSliderValue(model: any, _: any, options: any): void; |
| 156 |
} |
| 157 |
export declare class IntTextModel extends IntModel { |
| 158 |
defaults(): Backbone.ObjectHash; |
| 159 |
} |
| 160 |
export declare class BoundedIntTextModel extends BoundedIntModel { |
| 161 |
defaults(): Backbone.ObjectHash; |
| 162 |
} |
| 163 |
export declare class IntTextView extends DescriptionView { |
| 164 |
render(): void; |
| 165 |
/** |
| 166 |
* Update the contents of this view |
| 167 |
* |
| 168 |
* Called when the model is changed. The model may have been |
| 169 |
* changed by another view or by a state update from the back-end. |
| 170 |
*/ |
| 171 |
update(options?: any): void; |
| 172 |
events(): { |
| 173 |
[e: string]: string; |
| 174 |
}; |
| 175 |
/** |
| 176 |
* Handle key down |
| 177 |
* |
| 178 |
* Stop propagation so the event isn't sent to the application. |
| 179 |
*/ |
| 180 |
handleKeyDown(e: KeyboardEvent): void; |
| 181 |
/** |
| 182 |
* Handles key press |
| 183 |
*/ |
| 184 |
handleKeypress(e: KeyboardEvent): void; |
| 185 |
/** |
| 186 |
* Handle key up |
| 187 |
*/ |
| 188 |
handleKeyUp(e: KeyboardEvent): void; |
| 189 |
/** |
| 190 |
* Call the submit handler if continuous update is true and we are not |
| 191 |
* obviously incomplete. |
| 192 |
*/ |
| 193 |
handleChanging(e: Event): void; |
| 194 |
/** |
| 195 |
* Applies validated input. |
| 196 |
*/ |
| 197 |
handleChanged(e: Event): void; |
| 198 |
_parse_value: typeof parseInt; |
| 199 |
_default_step: string; |
| 200 |
textbox: HTMLInputElement; |
| 201 |
} |
| 202 |
export declare class ProgressStyleModel extends DescriptionStyleModel { |
| 203 |
defaults(): Backbone.ObjectHash; |
| 204 |
static styleProperties: { |
| 205 |
bar_color: { |
| 206 |
selector: string; |
| 207 |
attribute: string; |
| 208 |
default: any; |
| 209 |
}; |
| 210 |
description_width: { |
| 211 |
selector: string; |
| 212 |
attribute: string; |
| 213 |
default: any; |
| 214 |
}; |
| 215 |
}; |
| 216 |
} |
| 217 |
export declare class IntProgressModel extends BoundedIntModel { |
| 218 |
defaults(): Backbone.ObjectHash; |
| 219 |
} |
| 220 |
export declare class ProgressView extends DescriptionView { |
| 221 |
initialize(parameters: WidgetView.IInitializeParameters): void; |
| 222 |
render(): void; |
| 223 |
/** |
| 224 |
* Update the contents of this view |
| 225 |
* |
| 226 |
* Called when the model is changed. The model may have been |
| 227 |
* changed by another view or by a state update from the back-end. |
| 228 |
*/ |
| 229 |
update(): void; |
| 230 |
update_bar_style(): void; |
| 231 |
set_bar_style(): void; |
| 232 |
progress: HTMLDivElement; |
| 233 |
bar: HTMLDivElement; |
| 234 |
static class_map: { |
| 235 |
success: string[]; |
| 236 |
info: string[]; |
| 237 |
warning: string[]; |
| 238 |
danger: string[]; |
| 239 |
}; |
| 240 |
} |
| 241 |
export declare class PlayModel extends BoundedIntModel { |
| 242 |
defaults(): Backbone.ObjectHash; |
| 243 |
initialize(attributes: any, options: { |
| 244 |
model_id: string; |
| 245 |
comm: any; |
| 246 |
widget_manager: any; |
| 247 |
}): void; |
| 248 |
loop(): void; |
| 249 |
schedule_next(): void; |
| 250 |
stop(): void; |
| 251 |
pause(): void; |
| 252 |
animate(): void; |
| 253 |
play(): void; |
| 254 |
repeat(): void; |
| 255 |
private _timerId; |
| 256 |
} |
| 257 |
export declare class PlayView extends DOMWidgetView { |
| 258 |
render(): void; |
| 259 |
update(): void; |
| 260 |
onPlayingChanged(): void; |
| 261 |
updatePlaying(): void; |
| 262 |
updateRepeat(): void; |
| 263 |
playPauseButton: HTMLButtonElement; |
| 264 |
stopButton: HTMLButtonElement; |
| 265 |
repeatButton: HTMLButtonElement; |
| 266 |
model: PlayModel; |
| 267 |
} |
| 268 |
//# sourceMappingURL=widget_int.d.ts.map |