mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Add timsort (#30493)
* Add timsort * Reduce the number of overloads for timsort
This commit is contained in:
committed by
Pranav Senthilnathan
parent
936d8f558c
commit
f849e87482
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for timsort 0.3
|
||||
// Project: https://github.com/mziccard/node-timsort
|
||||
// Definitions by: Vunovati <https://github.com/Vunovati>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array - The array to sort.
|
||||
* @param lo - First element in the range (inclusive). Default is 0
|
||||
* @param hi - Last element in the range. Default is last element
|
||||
*/
|
||||
export function sort(array: any[], lo: number, hi?: number): void;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array - The array to sort.
|
||||
* @param compare - Item comparison function. Default is alphabetical
|
||||
* @param lo - First element in the range (inclusive).
|
||||
* @param hi - Last element in the range.
|
||||
*/
|
||||
export function sort<T>(
|
||||
array: T[],
|
||||
compare?: (a: T, b: T) => number,
|
||||
lo?: number,
|
||||
hi?: number
|
||||
): void;
|
||||
@@ -0,0 +1,3 @@
|
||||
import * as TimSort from 'timsort';
|
||||
|
||||
TimSort.sort([]); // $ExpectType void
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"timsort-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user