UNPKG

tamda

Version:

Practical functional programming library for TypeScript

28 lines (27 loc) 1.19 kB
/** * Returns a substring of a string `text`, from `start` to `end`. * @param text String to slice. * @param start Index to start slicing the string. Default: `0` * @param end Index to end slicing the string. Default: `text.length` */ export declare function slice(text: string, start?: number, end?: number): string; /** * Returns a subsection of an `array`, from `start` to `end`. * @param array Array to slice. * @param start The index to start slicing the list. Default: `0` * @param end The index to end slicing the list. Default: `list.length` */ export declare function slice<T>(array: T[], start?: number, end?: number): T[]; /** * Returns a function that * returns a subsection of a `list`, from `start` to `end`. * @param start The index to start slicing the list. Default: `0` * @param end The index to end slicing the list. Default: `list.length` */ export declare function slice<T>(start?: number, end?: number): typeof deferred; /** * Returns a subsection of a `list`, according to previously specified `start` and `end`. * @param list List to slice. */ declare function deferred<T, L extends string | T[]>(list: L): L; export {};