From d61c304a8e48a382067c35798919d2191615c071 Mon Sep 17 00:00:00 2001 From: kabeep Date: Wed, 11 Dec 2024 20:46:42 +0800 Subject: [PATCH] docs: update version 1.0.1 --- docs/classes/index.ForexClient.html | 14 +++++++------- docs/classes/index._internal_.HttpClient.html | 4 ++-- docs/classes/index._internal_.HttpRequest.html | 4 ++-- docs/documents/____.html | 9 +++++++-- docs/index.html | 9 +++++++-- docs/interfaces/index.AvailableCurrency.html | 4 ++-- docs/interfaces/index.ExchangeRate.html | 4 ++-- docs/interfaces/index.ForexClientOptions.html | 4 ++-- docs/interfaces/index.HttpRequestOptions.html | 4 ++-- docs/interfaces/index.HttpResponse.html | 4 ++-- docs/modules/index.html | 2 +- docs/types/index.OriginalExchangeRates.html | 2 +- docs/variables/index.BASE_URL.html | 2 +- docs/variables/index.BASE_URL_VERSION.html | 2 +- docs/variables/index.LOCALE_CURRENCY.html | 2 +- docs/variables/index.NON_STANDARD_CODES.html | 2 +- 16 files changed, 41 insertions(+), 31 deletions(-) diff --git a/docs/classes/index.ForexClient.html b/docs/classes/index.ForexClient.html index 6ee1cd7..fd961de 100644 --- a/docs/classes/index.ForexClient.html +++ b/docs/classes/index.ForexClient.html @@ -157,7 +157,7 @@ --md-sys-color-surface-container-highest: #e6e1e6 }

A client to interact with the Forex API for fetching currency rates and conversion data

-

Hierarchy (view full)

Constructors

Hierarchy (view full)

Constructors

Properties

Methods

getCurrencies @@ -169,14 +169,14 @@ _fetch

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

Returns ForexClient

Properties

timeout: number
headers: HeadersInit

Methods

  • Fetches the list of available currencies

    Parameters

    • Optionaldate: Date | "latest" = 'latest'

      The date for fetching currencies, or "latest" for the most recent

    • Optionaloptions: RequestInit = {}

      Additional request options

    Returns Promise<HttpResponse<AvailableCurrency[]>>

    A list of available currencies

    // => {
    // code: 200,
    // message: 'OK',
    // data: [
    // { code: 'eur', name: 'Euro' },
    // { code: 'usd', name: 'US Dollar' },
    // { code: 'cny', name: 'Chinese Yuan Renminbi' },
    // ... More items
    // ]
    // }
    new ForexClient().getCurrencies('latest');
    -
  • Fetches the exchange rates for a specific currency

    Parameters

    • Optionalcode: string = ...

      The currency code or locale code to get rates for

    • Optionaldate: Date | "latest" = 'latest'

      The date for the rates, or 'latest' for the most recent

    • Optionaloptions: RequestInit = {}

      Additional request options

      @@ -184,7 +184,7 @@
      // => {
      // code: 200,
      // message: 'OK',
      // data: [
      // { code: 'eur', rate: 100_000 },
      // { code: 'usd', rate: 100_000 },
      // { code: 'cny', rate: 100_000 },
      // ... More items
      // ]
      // }
      new ForexClient().getRates('BTC');
      -
  • Fetches the exchange rate between two currencies

    +
  • Converts an amount from one currency to another

    Parameters

    • OptionalbaseCode: string = ...

      The base currency code or locale code

    • OptionaldestCode: string

      The destination currency code or locale code

    • Optionalamount: string | number = 0

      The amount to convert

      @@ -218,7 +218,7 @@
      // => {
      // code: 200,
      // message: 'OK',
      // data: 7.27
      // }
      new ForexClient().convert('US', 'HK', 1);
      -

Hierarchy (view full)

Constructors

constructor +

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

Hierarchy (view full)

Constructors

constructor +

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

timeout: number
headers: HeadersInit

Methods

Interface AvailableCurrency

interface AvailableCurrency {
    code: string;
    name: string;
}

Properties

code +

Interface AvailableCurrency

interface AvailableCurrency {
    code: string;
    name: string;
}

Properties

Properties

code: string
name: string

Interface ExchangeRate

interface ExchangeRate {
    code: string;
    rate: number;
}

Properties

code +

Interface ExchangeRate

interface ExchangeRate {
    code: string;
    rate: number;
}

Properties

Properties

code: string
rate: number

Interface ForexClientOptions

interface ForexClientOptions {
    baseCurrency?: string;
    minified?: boolean;
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

baseCurrency? +

Interface ForexClientOptions

interface ForexClientOptions {
    baseCurrency?: string;
    minified?: boolean;
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

baseCurrency?: string
minified?: boolean
timeout?: number
headers?: HeadersInit

Interface HttpRequestOptions

interface HttpRequestOptions {
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

timeout? +

Interface HttpRequestOptions

interface HttpRequestOptions {
    timeout?: number;
    headers?: HeadersInit;
}

Hierarchy (view full)

Properties

Properties

timeout?: number
headers?: HeadersInit

Interface HttpResponse<T>

interface HttpResponse<T> {
    code: number;
    message: string;
    data?: T;
}

Type Parameters

  • T

Properties

code +

Interface HttpResponse<T>

interface HttpResponse<T> {
    code: number;
    message: string;
    data?: T;
}

Type Parameters

  • T

Properties

Properties

code: number
message: string
data?: T

Module index

Index

Modules

<internal> +

Module index

Index

Modules

Classes

Interfaces

ForexClientOptions AvailableCurrency diff --git a/docs/types/index.OriginalExchangeRates.html b/docs/types/index.OriginalExchangeRates.html index 70080b8..563b57e 100644 --- a/docs/types/index.OriginalExchangeRates.html +++ b/docs/types/index.OriginalExchangeRates.html @@ -156,7 +156,7 @@ --md-sys-color-surface-container-high: #ece7eb; --md-sys-color-surface-container-highest: #e6e1e6 } -

Type Alias OriginalExchangeRates

OriginalExchangeRates: {
    [key: string]: Record<string, number>;
} & {
    date: string;
}

Type Alias OriginalExchangeRates

OriginalExchangeRates: {
    [key: string]: Record<string, number>;
} & {
    date: string;
}