/** * @module CircularProgressBar * @type {Object} * @author Ozcan Ovunc * @copyright Smartface 2020 */ import WebView from "@smartface/native/ui/webview"; interface CircularProgressBarOptions { /** * Should be an instance of @smartface/native/ui/webview * @see https://developer.smartface.io/docs/webview */ webView: WebView; /** * @default 4 * Width of the stroke */ strokeWidth?: number; /** * @default "#555" * shorthand hexadecimal color declaration - #000 */ color?: string; /** * @default 2 * Duration for animation in seconds */ duration?: number; /** * @default "#eee" * Shorthand hexadecimal - #000 * Color for lighter trail stroke underneath the actual progress path */ trailColor?: string; /** * @default 4 * Width of the trail stroke in pixels */ trailWidth?: number; /** * @default 100 * Size of the progress bar (both width & height) */ width?: number; } /** * @class * @author Ozcan Ovunc * @copyright Smartface 2020 * @example * ``` * import CircularProgressBar from '@smartface/extension-utils/lib/art/CircularProgressBar'; * * const circularProgressBar = new CircularProgressBar({ * width: 130, * trailColor: "rgb(247,201,71)", * color: "rgb(55,85,147)", * webView: this.wvCircularAnimation * }); * * // Triggers the render method whenever the value is set * circularProgressBar.value = 70; * ``` */ export default class CircularProgressBar { /** * Gets/sets current shown progress from 0 to 100 * Re-renders the progress bar when the value is set */ private __value; private __strokeWidth; private __color; private __duration; private __trailColor; private __trailWidth; private __width; private __webView; constructor(options: CircularProgressBarOptions); private static __calculateCurrentDashoffset; /** * Current shown progress from 0 to 100. This can be get and set. * @property {number} value */ get value(): number; /** * Current shown progress from 0 to 100. This can be get and set. * @property {number} value */ set value(value: number); /** * Creates proper HTML and triggers loadHTML method of UI.WebView */ private render; } export {};