2.3.3 • Published 7 months ago

@types/sales-tax v2.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Installation

npm install --save @types/sales-tax

Summary

This package contains type definitions for sales-tax (https://github.com/valeriansaliou/node-sales-tax).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sales-tax.

index.d.ts

// Type definitions for sales-tax 2.3
// Project: https://github.com/valeriansaliou/node-sales-tax
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace SalesTax {
    interface SalesTaxResult {
        type: string;
        rate: number;
        area: "worldwide" | "national" | "regional";
        exchange: "business" | "consumer";
        charge: {
            direct: boolean;
            reverse: boolean;
        };
        details: Array<{ type: string; rate: number }>;
    }

    interface SalesTaxAmountResult extends SalesTaxResult {
        price: number;
        total: number;
    }

    interface TaxExchangeStatus {
        exchange: "business" | "consumer";
        area: "worldwide" | "national" | "regional";
        exempt: boolean;
    }

    class SalesTax {
        hasSalesTax(countryCode: string): boolean;
        hasStateSalesTax(countryCode: string, stateCode: string): boolean;
        getSalesTax(countryCode: string, stateCode?: string | null, taxNumber?: string): Promise<SalesTaxResult>;
        getAmountWithSalesTax(
            countryCode: string,
            stateCode?: string | null,
            amount?: number,
            taxNumber?: string,
        ): Promise<SalesTaxAmountResult>;
        getTaxExchangeStatus(
            countryCode: string,
            stateCode?: string | null,
            taxNumber?: string,
        ): Promise<TaxExchangeStatus>;
        validateTaxNumber(countryCode: string, taxNumber: string): Promise<boolean>;

        setTaxOriginCountry(countryCode: string, useRegionalTax?: boolean): void;
        toggleEnabledTaxNumberFraudCheck(isEnabled: boolean): void;
        toggleEnabledTaxNumberValidation(isEnabled: boolean): void;
    }
}

declare const salesTax: InstanceType<typeof SalesTax.SalesTax>;

export = salesTax;
export as namespace SalesTax;

Additional Details

  • Last updated: Thu, 23 Dec 2021 23:35:47 GMT
  • Dependencies: none
  • Global values: SalesTax

Credits

These definitions were written by DefinitelyTyped.

2.3.2

7 months ago

2.3.3

7 months ago

2.3.1

2 years ago

2.3.0

3 years ago