UNPKG

faktory-worker

Version:
22 lines (21 loc) 1.14 kB
import { Job, JobPayload, PartialJobPayload } from "./job"; export declare function encode(object: Record<string, unknown> | Array<Record<string, unknown>>): string; export declare function encodeArray(object: Array<Record<string, unknown>>): string; export declare function sleep(ms: number, value?: unknown): Promise<unknown>; /** * wraps things that are not errors in an error object * @param {*} object likely a string that was thrown instead of an error * @return {Error} an error with a warning about throwing non-errors * @private */ export declare function wrapNonErrors(object: string | Error | undefined): Error; /** * hashes the password with server-provided salt * @param {String} password the password to the faktory server * @param {String} salt the server-provided salt to use in hashing * @param {Number} iterations the number of time to apply the salt * @return {String} the password hash * @private */ export declare function hash(password: string, salt: string, iterations: number): string; export declare function toJobPayloadWithDefaults(job: Job | PartialJobPayload): JobPayload;