From dbc0042a03ebbe555aaf09ca34dc8f5edc989549 Mon Sep 17 00:00:00 2001 From: a-morales Date: Tue, 22 Mar 2016 15:59:26 -0700 Subject: [PATCH] add naturalSort typings --- naturalSort/naturalSort-tests.ts | 6 ++++++ naturalSort/naturalSort.d.ts | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 naturalSort/naturalSort-tests.ts create mode 100644 naturalSort/naturalSort.d.ts diff --git a/naturalSort/naturalSort-tests.ts b/naturalSort/naturalSort-tests.ts new file mode 100644 index 000000000..02b6c633d --- /dev/null +++ b/naturalSort/naturalSort-tests.ts @@ -0,0 +1,6 @@ +/// + +import naturalSort = require("naturalSort"); + +[5, 3, 2, 4, 1].sort(naturalSort); +["a", "c", "b", "z", "w", "l"].sort(naturalSort); diff --git a/naturalSort/naturalSort.d.ts b/naturalSort/naturalSort.d.ts new file mode 100644 index 000000000..a37a64ce9 --- /dev/null +++ b/naturalSort/naturalSort.d.ts @@ -0,0 +1,9 @@ +// Type definitions for NaturalSort +// Project: https://github.com/studio-b12/natural-sort +// Definitions by: Antonio Morales +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "naturalSort" { + function naturalSort(a: T, b: T): number; + export = naturalSort; +}