UNPKG

pxt-core

Version:

Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors

33 lines (32 loc) 1.26 kB
/// <reference path="../../pxtlib.d.ts" /> import * as Blockly from "blockly"; import { FieldSlider } from "../plugins/math"; import { FieldCustomOptions, FieldCustom } from "./field_utils"; export interface FieldSpeedOptions extends FieldCustomOptions { min?: string; max?: string; format?: string; label?: string; } export declare class FieldSpeed extends FieldSlider implements FieldCustom { isFieldCustom_: boolean; private params; private speedSVG; private circleBar; private reporter; /** * Class for a color wheel field. * @param {number|string} value The initial content of the field. * @param {Function=} opt_validator An optional function that is called * to validate any constraints on what the user entered. Takes the new * text as an argument and returns either the accepted text, a replacement * text, or null to abort the change. * @extends {Blockly.FieldNumber} * @constructor */ constructor(value_: any, params: FieldSpeedOptions, opt_validator?: Blockly.FieldValidator); createLabelDom_(labelText: string): [HTMLDivElement, HTMLSpanElement]; setReadout(value: string | number): void; private updateSpeed; private sign; }