/** * @license * Copyright 厦门乾元盛世科技有限公司 All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file. */ import { ElementRef, Renderer } from '@angular/core'; import { OnChanges, SimpleChanges } from '@angular/core'; export interface Digit { n: number; position: number; } /** * 徽标数 */ export declare class ScrollNumber implements OnChanges { private _renderer; private _elementRef; /** 样式前缀 */ prefixCls: string; /** 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏。 Number to show in badge */ count: number; /** 与count同级,如果非空时则只显示text,不显示count */ text: string; /** 用户CSS样式 */ class: string; private lastCount; /** 当前count拆分后的数字 */ digits: Digit[]; /** 上次count拆分后的数字 */ lastDigits: Digit[]; private defaultNumItems; private resetPosition; constructor(_renderer: Renderer, _elementRef: ElementRef); readonly classes: string; ngOnChanges(changes: SimpleChanges): void; setPosition(fromDigits: Digit[], toDigits: Digit[]): void; /** * 获取拆分后的数字在`30`个NumItems中的位置,用于生成translateY(x%)的值 * * @param i num在拆分后的数字数组中的索引 */ getPosition(num: number, i: number): number; /** * 将数值拆分为数字组合,例如: 123 => [1,2,3],倒序是为了从“个位数”开始匹配 * * @param value 原始数字 * @return 数列 */ getDigits(value: number, getPos: boolean): Digit[]; /** * 生成数字序列,从0开始,例如:getNumItems(5) => [0,1,2,3,4] * * @param size 总数,如30,则数组内包含0-29的数字 * @return 数列 */ getNumItems(): number[]; /** * 获取拆分后的数字所在span的样式 * * @param i num在拆分后的数字数组中的索引 */ getNumElementStyle(i: number): any; }