🎨 Add type definitions to endpoints

This commit is contained in:
C-3PO 2018-11-15 19:25:54 +01:00
parent 7995285034
commit dc038fe4d5
Signed by: c3po
GPG key ID: 62993C4BB4D86F24

View file

@ -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<Product>;
}
const out: Readonly<IEndpoints> = Object.freeze({
getManifest,
init,
productList,
});
//Exports various functions as endpoints
export default out;