pretty
This commit is contained in:
parent
984cba226f
commit
76d2524b8b
30
packages/taler-util/src/http-impl.node.d.ts
vendored
30
packages/taler-util/src/http-impl.node.d.ts
vendored
@ -1,17 +1,25 @@
|
||||
import { HttpLibArgs } from "./http-common.js";
|
||||
import { HttpRequestLibrary, HttpRequestOptions, HttpResponse } from "./http.js";
|
||||
import {
|
||||
HttpRequestLibrary,
|
||||
HttpRequestOptions,
|
||||
HttpResponse,
|
||||
} from "./http.js";
|
||||
/**
|
||||
* Implementation of the HTTP request library interface for node.
|
||||
*/
|
||||
export declare class HttpLibImpl implements HttpRequestLibrary {
|
||||
private throttle;
|
||||
private throttlingEnabled;
|
||||
constructor(args?: HttpLibArgs);
|
||||
/**
|
||||
* Set whether requests should be throttled.
|
||||
*/
|
||||
setThrottling(enabled: boolean): void;
|
||||
fetch(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||
get(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||
postJson(url: string, body: any, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||
private throttle;
|
||||
private throttlingEnabled;
|
||||
constructor(args?: HttpLibArgs);
|
||||
/**
|
||||
* Set whether requests should be throttled.
|
||||
*/
|
||||
setThrottling(enabled: boolean): void;
|
||||
fetch(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||
get(url: string, opt?: HttpRequestOptions): Promise<HttpResponse>;
|
||||
postJson(
|
||||
url: string,
|
||||
body: any,
|
||||
opt?: HttpRequestOptions,
|
||||
): Promise<HttpResponse>;
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ import * as common from "./http-common.js";
|
||||
|
||||
export * from "./http-common.js";
|
||||
|
||||
|
||||
export function createPlatformHttpLib(args?: common.HttpLibArgs): common.HttpRequestLibrary {
|
||||
export function createPlatformHttpLib(
|
||||
args?: common.HttpLibArgs,
|
||||
): common.HttpRequestLibrary {
|
||||
return new impl.HttpLibImpl(args);
|
||||
}
|
||||
|
@ -23,8 +23,6 @@ test("iban validation", (t) => {
|
||||
t.assert(validateIban("NL71RABO9996666779").type === "invalid");
|
||||
});
|
||||
|
||||
|
||||
|
||||
test("iban generation", (t) => {
|
||||
let iban1 = generateIban("DE", 10);
|
||||
console.log("generated IBAN", iban1);
|
||||
|
@ -276,7 +276,7 @@ export function generateIban(countryCode: string, length: number): string {
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
const cc = ccZero + (Math.floor(Math.random() * 100) % 10);
|
||||
appendDigit(digits, cc)
|
||||
appendDigit(digits, cc);
|
||||
ibanSuffix += String.fromCharCode(cc);
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,6 @@ export interface WaitingForRetryNotification {
|
||||
numDue: number;
|
||||
}
|
||||
|
||||
|
||||
export interface ExchangeAddedNotification {
|
||||
type: NotificationType.ExchangeAdded;
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
|
||||
// @ts-ignore
|
||||
import * as _qjsOsImp from "os";
|
||||
// @ts-ignore
|
||||
import * as _qjsStdImp from "std";
|
||||
|
||||
|
||||
export interface QjsHttpResp {
|
||||
status: number;
|
||||
data: ArrayBuffer;
|
||||
@ -17,7 +15,6 @@ export interface QjsHttpOptions {
|
||||
headers?: string[];
|
||||
}
|
||||
|
||||
|
||||
export interface QjsOsLib {
|
||||
fetchHttp(url: string, options?: QjsHttpOptions): Promise<QjsHttpResp>;
|
||||
postMessageToHost(s: string): void;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user