@obliczeniowo/elementary
Version:
Library made in Angular version 20
95 lines (82 loc) • 3.82 kB
TypeScript
import * as i0 from '@angular/core';
import { PipeTransform } from '@angular/core';
import { TranslationPipe } from '@obliczeniowo/elementary/text-pipes';
import { Operations, MinMax } from '@obliczeniowo/elementary/math';
interface UnitsPipeOptions {
precision?: number;
type?: 'basic' | 'fullInteger' | 'decimal' | 'fullDecimal';
translations?: {
[en: string]: string;
} | 'phonetic';
}
/**
* Transform number from '12345' to '12.35 k'
* Can use basic units: [k, M, G, ...]
* Or in fullInteger type: [da, h, k, M, ...]
* Ot in decimal type: [..., m, , k, ...]
* Ot in fullDecimal type: [..., m, c, d, , da, h, k, ...]
*/
declare class UnitsPipe implements PipeTransform {
translate: TranslationPipe;
transform(value: number, options?: UnitsPipeOptions): string;
static ɵfac: i0.ɵɵFactoryDeclaration<UnitsPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<UnitsPipe, "oblUnits", true>;
}
interface LimitsPipeOptions {
min?: number;
max?: number;
transformTo?: 'int-ceil' | 'int-floor' | 'int-round';
}
declare class LimitsPipe implements PipeTransform {
transform(value: number[], options?: LimitsPipeOptions): number[];
roundTo(value: number, type: 'floor' | 'ceil' | 'bottom' | string): number;
static ɵfac: i0.ɵɵFactoryDeclaration<LimitsPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<LimitsPipe, "oblLimits", true>;
}
declare class IntFilterPipe implements PipeTransform {
transform(value: number[]): number[];
static ɵfac: i0.ɵɵFactoryDeclaration<IntFilterPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<IntFilterPipe, "oblIntFilter", true>;
}
declare class RangeFilterPipe implements PipeTransform {
transform(value: number[], min?: number, max?: number): number[];
static ɵfac: i0.ɵɵFactoryDeclaration<RangeFilterPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<RangeFilterPipe, "oblRangeFilter", true>;
}
declare class AbsPipe implements PipeTransform {
transform(value: number[]): number[];
static ɵfac: i0.ɵɵFactoryDeclaration<AbsPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<AbsPipe, "oblAbs", true>;
}
declare class UIntFilterPipe implements PipeTransform {
transform(value: number[], max?: number): unknown;
static ɵfac: i0.ɵɵFactoryDeclaration<UIntFilterPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<UIntFilterPipe, "oblUIntFilter", true>;
}
declare class MathPipe implements PipeTransform {
transform(value: number, operations: Operations): number;
static ɵfac: i0.ɵɵFactoryDeclaration<MathPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<MathPipe, "oblMath", true>;
}
declare class IsNumericPipe implements PipeTransform {
transform(value: string | number, fully?: boolean): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<IsNumericPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<IsNumericPipe, "oblIsNumeric", true>;
}
declare class MinMaxPipe implements PipeTransform {
transform(numbers: number[]): MinMax;
static ɵfac: i0.ɵɵFactoryDeclaration<MinMaxPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<MinMaxPipe, "oblMinMax", true>;
}
declare class MinPipe implements PipeTransform {
transform(value: number[]): number;
static ɵfac: i0.ɵɵFactoryDeclaration<MinPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<MinPipe, "oblMin", true>;
}
declare class MaxPipe implements PipeTransform {
transform(value: number[]): number;
static ɵfac: i0.ɵɵFactoryDeclaration<MaxPipe, never>;
static ɵpipe: i0.ɵɵPipeDeclaration<MaxPipe, "oblMax", true>;
}
export { AbsPipe, IntFilterPipe, IsNumericPipe, LimitsPipe, MathPipe, MaxPipe, MinMaxPipe, MinPipe, RangeFilterPipe, UIntFilterPipe, UnitsPipe };
export type { LimitsPipeOptions, UnitsPipeOptions };