From dc038fe4d5ef1b8a9e310f95ba949c18a22a45d5 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Thu, 15 Nov 2018 19:25:54 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Add=20type=20definitions=20to=20?= =?UTF-8?q?endpoints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index fac3d4a..ccccb60 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,21 @@ +import { Product } from 'ssn'; import getManifest from './exports/getManifest'; import productList from './exports/productList'; import init from './init'; +import IDatabaseSettings from './interfaces/IDatabaseSettings'; +import IProductData from './interfaces/IProductData'; -//Exports various functions as endpoints -export default Object.freeze({ +interface IEndpoints { + getManifest: (product: Product) => {}; + init: (dbSettings: IDatabaseSettings) => Promise<{ [key in Product]?: IProductData }>; + productList: ReadonlyArray; +} + +const out: Readonly = Object.freeze({ getManifest, init, productList, }); + +//Exports various functions as endpoints +export default out;