From 614d5972863beb0b11ea95397612508909470592 Mon Sep 17 00:00:00 2001 From: David Mesquita-Morris Date: Tue, 7 Dec 2021 21:05:39 +0000 Subject: [PATCH] Retrict default type of Pair.key --- lib/node/index.d.ts | 4 ++-- lib/node/index.js | 14 ++++++++++++++ lib/node/pair.d.ts | 2 +- package.json | 3 ++- src/index.ts | 6 ++++-- src/pair.ts | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/node/index.d.ts b/lib/node/index.d.ts index 2867712..1cf7d51 100644 --- a/lib/node/index.d.ts +++ b/lib/node/index.d.ts @@ -1,2 +1,2 @@ -export { Constructor, Consumer, Function, Operator, Predicate, Supplier } from './functions'; -export { Pair } from './pair'; +export * from './functions'; +export * from './pair'; diff --git a/lib/node/index.js b/lib/node/index.js index c8ad2e5..3f48a36 100644 --- a/lib/node/index.js +++ b/lib/node/index.js @@ -1,2 +1,16 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", { value: true }); +// function prototypes +__exportStar(require("./functions"), exports); +// data structures +__exportStar(require("./pair"), exports); diff --git a/lib/node/pair.d.ts b/lib/node/pair.d.ts index b4586a6..c1265b2 100644 --- a/lib/node/pair.d.ts +++ b/lib/node/pair.d.ts @@ -1,5 +1,5 @@ /** A key/value pair. */ -export interface Pair { +export interface Pair> { /** The key. */ key: TKey; /** The value. */ diff --git a/package.json b/package.json index e9968ec..da580fe 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "@steelbreeze/types", - "version": "1.0.0-rc.1", + "version": "1.0.0-rc.2", "description": "Common TypeScript types used in development of other projects.", "main": "./lib/node/index.js", + "types": "./lib/node/index.d.ts", "directories": { "lib": "lib" }, diff --git a/src/index.ts b/src/index.ts index f77d7a8..4345dd6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ -export { Constructor, Consumer, Function, Operator, Predicate, Supplier } from './functions'; +// function prototypes +export * from './functions'; -export { Pair } from './pair'; +// data structures +export * from './pair'; diff --git a/src/pair.ts b/src/pair.ts index 5176d2b..d2a3936 100644 --- a/src/pair.ts +++ b/src/pair.ts @@ -1,5 +1,5 @@ /** A key/value pair. */ -export interface Pair { +export interface Pair> { /** The key. */ key: TKey;