🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@types/js-quantities

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/js-quantities

TypeScript definitions for js-quantities

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
1.6.6
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/js-quantities

Summary

This package contains type definitions for js-quantities (http://gentooboontoo.github.io/js-quantities/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/js-quantities.

index.d.ts

declare const Qty: Qty.Type;

interface Qty {
    readonly numerator: string[];
    readonly denominator: string[];
    readonly scalar: number;
    readonly baseScalar: number;
    readonly initValue: string;
    units(): string;
    isCompatible(value: Qty.UnitSource): boolean;
    kind(): string;
    isUnitless(): boolean;
    isBase(): boolean;
    toBase(): Qty;
    toFloat(): number;
    to(value: Qty.UnitSource): Qty;
    inverse(): Qty;
    eq(value: Qty.UnitSource): boolean;
    same(value: Qty.UnitSource): boolean;
    lt(value: Qty.UnitSource): boolean;
    lte(value: Qty.UnitSource): boolean;
    gt(value: Qty.UnitSource): boolean;
    gte(value: Qty.UnitSource): boolean;
    compareTo(value: Qty): Qty.ComparisonResult;
    add(value: Qty.Source): Qty;
    sub(value: Qty.Source): Qty;
    mul(value: Qty.Source): Qty;
    div(value: Qty.Source): Qty;
    toPrec(value: Qty.Source): Qty;
    toString(valueOrPrecision?: Qty.Source): string;
    toString(value: string, precision: number): string;
    format(formatter?: Qty.Formatter): string;
    format(value: string, formatter?: Qty.Formatter): string;
}

declare namespace Qty {
    interface Type {
        (value: Source): Qty;
        (value: number, unit: string): Qty;
        new(value: Source): Qty;
        new(value: number, unit: string): Qty;
        parse(value: string): Qty;
        getKinds(): string[];
        getUnits(kind?: string): string[];
        getAliases(unit: string): string[];
        swiftConverter(sourceUnit: string, targetUnit: string): Converter;
        formatter: Formatter;
        readonly Error: any;
        mulSafe(n1: number, n2: number): number;
        divSafe(n1: number, n2: number): number;
    }

    interface Converter {
        (sourceValue: number): number;
        (sourceValues: number[]): number[];
    }

    type Formatter = (scalar: number, unit: string) => string;

    type ComparisonResult = -1 | 0 | 1;

    type Source = UnitSource | number;

    type UnitSource = Qty | string;
}

export = Qty;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by .

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts