From 1fa034cbd89d184dd038b293b779e50ce936c16b Mon Sep 17 00:00:00 2001 From: Eric Crosson Date: Fri, 15 Nov 2019 17:39:36 -0600 Subject: [PATCH] Add types for compute-argmax (#40313) * Add types for compute-argmax * Update types/compute-argmax/index.d.ts Co-Authored-By: Dmitry Demensky <10235949+demensky@users.noreply.github.com> --- types/compute-argmax/compute-argmax-tests.ts | 4 ++++ types/compute-argmax/index.d.ts | 8 +++++++ types/compute-argmax/tsconfig.json | 23 ++++++++++++++++++++ types/compute-argmax/tslint.json | 1 + 4 files changed, 36 insertions(+) create mode 100644 types/compute-argmax/compute-argmax-tests.ts create mode 100644 types/compute-argmax/index.d.ts create mode 100644 types/compute-argmax/tsconfig.json create mode 100644 types/compute-argmax/tslint.json diff --git a/types/compute-argmax/compute-argmax-tests.ts b/types/compute-argmax/compute-argmax-tests.ts new file mode 100644 index 0000000000..a2d6047a53 --- /dev/null +++ b/types/compute-argmax/compute-argmax-tests.ts @@ -0,0 +1,4 @@ +import compute = require('compute-argmax'); + +const data = [3, 2, 5, 2, 5]; +const idx: number[] = compute(data); diff --git a/types/compute-argmax/index.d.ts b/types/compute-argmax/index.d.ts new file mode 100644 index 0000000000..feb7e57d71 --- /dev/null +++ b/types/compute-argmax/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for compute-argmax 1.0 +// Project: https://github.com/compute-io/argmax +// Definitions by: Eric Crosson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function argmax(values: ArrayLike): number[]; + +export = argmax; diff --git a/types/compute-argmax/tsconfig.json b/types/compute-argmax/tsconfig.json new file mode 100644 index 0000000000..69140bb89a --- /dev/null +++ b/types/compute-argmax/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "compute-argmax-tests.ts" + ] +} diff --git a/types/compute-argmax/tslint.json b/types/compute-argmax/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/compute-argmax/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }