UNPKG

locutus

Version:

Locutus other languages' standard libraries to JavaScript for fun and educational purposes

12 lines (11 loc) 815 B
import type { PhpCallableDescriptor, PhpList, PhpRuntimeValue } from '../_helpers/_phpTypes.ts'; type ArrayMapValue = PhpRuntimeValue; type ArrayMapInputs = [firstArray: PhpList<ArrayMapValue>, ...restArrays: Array<PhpList<ArrayMapValue>>]; type ArrayMapTupleArgs<TInputs extends readonly PhpList<ArrayMapValue>[]> = [ ...{ [K in keyof TInputs]: TInputs[K] extends PhpList<infer TValue> ? TValue | undefined : ArrayMapValue | undefined; } ]; export declare function array_map<TInputs extends ArrayMapInputs, TResult>(callback: PhpCallableDescriptor<ArrayMapTupleArgs<TInputs>, TResult>, ...inputArrays: TInputs): PhpList<TResult>; export declare function array_map<TInputs extends ArrayMapInputs>(callback: null | undefined, ...inputArrays: TInputs): PhpList<ArrayMapTupleArgs<TInputs>>; export {};