import type { AppContext } from "../api" ; export interface SliderOpts { event : PropertyKey ; view : PropertyKey ; label : string ; min ? : number ; max ? : number ; step ? : number ; } param ctx param opts export const slider = ( ctx , opts ) => { opts = Object . assign ( { oninput : ( e ) => ctx . bus . dispatch ( [ opts . event , parseFloat ( ( < HTMLInputElement > e . target ) . value ) , ] ) , min : 0 , max : 100 , step : 1 , } , opts ) ; const ui = ctx . ui . slider ; return ( ) => [ "section" , ui . root , [ "input" , { ... ui . range , ... opts , type : "range" , value : ( < any > ctx . views ) [ opts . view ] . deref ( ) , } , ] , [ "div" , ui . label , opts . label , [ "input" , { ... ui . number , ... opts , type : "number" , value : ( < any > ctx . views ) [ opts . view ] . deref ( ) , } , ] , ] , ] ; } ;