faastjs
Version:
Serverless batch computing made simple.
84 lines (83 loc) • 4.34 kB
TypeScript
/// <reference types="node" />
export declare function test(): string;
export declare function empty(): void;
export declare function identityString(name: string): string;
export declare function identityNum(n: number): number;
export declare function identityBool(b: boolean): boolean;
export declare function identityUndefined(u: undefined): undefined;
export declare function identityNull(n: null): null;
export declare function identityObject(o: object): object;
export declare function identityArrayNum(n: number[]): number[];
export declare function identityArrayString(s: string[]): string[];
export declare function identityInt8(a: Int8Array): Int8Array;
export declare function identityUint8(a: Uint8Array): Uint8Array;
export declare function identityUint8Clamped(a: Uint8ClampedArray): Uint8ClampedArray;
export declare function identityInt16(a: Int16Array): Int16Array;
export declare function identityUint16(a: Uint16Array): Uint16Array;
export declare function identityInt32(a: Int32Array): Int32Array;
export declare function identityUint32(a: Uint32Array): Uint32Array;
export declare function identityFloat32(a: Float32Array): Float32Array;
export declare function identityFloat64(a: Float64Array): Float64Array;
export declare function identityBigInt64(a: BigInt64Array): BigInt64Array;
export declare function identityBigUint64(a: BigUint64Array): BigUint64Array;
export declare function identityMap(m: Map<number, number>): Map<number, number>;
export declare function identitySet(s: Set<number>): Set<number>;
export declare const arrow: (str: string) => string;
export declare const asyncArrow: (str: string) => Promise<string>;
export declare function hello(name: string): string;
export declare function fact(n: number): number;
export declare function concat(a: string, b: string): string;
export declare function error(a: string): void;
export declare function noargs(): string;
export declare function sleep(ms: number): Promise<void>;
export declare function delayReject(ms: number): Promise<unknown>;
export declare function async(): Promise<string>;
export declare function path(): Promise<string>;
export declare function emptyReject(): Promise<never>;
export declare function rejected(): Promise<void>;
export interface Timing {
start: number;
end: number;
}
export declare function timer(delayMs: number): Promise<Timing>;
export declare function spin(ms: number): Timing;
export declare function infiniteLoop(): void;
export declare function optionalArg(arg?: string): string;
export declare function consoleLog(str: string): void;
export declare function consoleWarn(str: string): void;
export declare function consoleError(str: string): void;
export declare function consoleInfo(str: string): void;
export declare function processExit(code?: number): void;
export declare function customError(): void;
export declare function returnsError(): Error;
export declare function allocate(bytes: number): Promise<{
bytes: number;
elems: number;
}>;
export declare function returnSize(size: number): string;
export declare function getEnv(key: string): string | undefined;
export interface MonteCarloReturn {
inside: number;
samples: number;
}
export declare function monteCarloPI(samples: number): MonteCarloReturn;
export declare function generator(args: string[]): Generator<string, void, undefined>;
export declare function asyncGenerator(args: string[]): AsyncGenerator<string, void, undefined>;
export declare function generateThenInfiniteLoop(arg: string): AsyncGenerator<string, void, unknown>;
export declare function asyncGeneratorDelay(args: string[], delay: number): AsyncGenerator<string, void, unknown>;
export declare function asyncGeneratorError(msg: string): AsyncGenerator<number, void, unknown>;
/**
* Not supported.
* @remarks
* Examples of functions arguments or return values that are not supported.
*/
export declare function promiseArg(promise: Promise<any>): Promise<any>;
export declare function identityFunction(fn: () => void): () => void;
export declare function functionReturn(): () => void;
export declare function identityBuffer(buf: Buffer): Buffer;
export declare function identityDate(arg: Date): Date;
export declare class Cls {
constructor();
}
export declare function identityClass(arg: Cls): Cls;
export declare function classReturn(): Cls;