slider.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /// <reference types="miniprogram-api-typings" />
  2. import { SuperComponent } from '../common/src/index';
  3. import type { SliderValue } from './type';
  4. declare type dataType = {
  5. sliderStyles: string;
  6. classPrefix: string;
  7. initialLeft: number | null;
  8. initialRight: number | null;
  9. activeLeft: number;
  10. activeRight: number;
  11. maxRange: number;
  12. lineLeft: number;
  13. lineRight: number;
  14. dotTopValue: number[];
  15. blockSize: number;
  16. isScale: boolean;
  17. scaleArray: any[];
  18. scaleTextArray: any[];
  19. _value: SliderValue;
  20. prefix: string;
  21. };
  22. interface boundingClientRect {
  23. left: number;
  24. right: number;
  25. }
  26. export default class Slider extends SuperComponent {
  27. externalClasses: string[];
  28. properties: import("./type").TdSliderProps;
  29. controlledProps: {
  30. key: string;
  31. event: string;
  32. }[];
  33. data: dataType;
  34. observers: {
  35. value(newValue: SliderValue): void;
  36. _value(newValue: SliderValue): void;
  37. marks(val: any): void;
  38. };
  39. attached(): void;
  40. triggerValue(value?: SliderValue): void;
  41. handlePropsChange(newValue: SliderValue): void;
  42. handleMask(marks: any): void;
  43. getSingleBarWidth(value: number): void;
  44. getSelectorQuery(id: string): Promise<boundingClientRect>;
  45. getInitialStyle(): Promise<void>;
  46. setDotStyle(left: number, right: number): void;
  47. stepValue(value: number): number;
  48. onSingleLineTap(e: WechatMiniprogram.TouchEvent): void;
  49. getSingleChangeValue(e: WechatMiniprogram.TouchEvent): number;
  50. convertPosToValue(posValue: number, dir: 0 | 1): number;
  51. onLineTap(e: WechatMiniprogram.TouchEvent): void;
  52. onTouchMoveLeft(e: WechatMiniprogram.TouchEvent): void;
  53. onTouchMoveRight(e: WechatMiniprogram.TouchEvent): void;
  54. setLineStyle(): void;
  55. }
  56. export {};