🎨 Add type definitions to endpoints
This commit is contained in:
parent
7995285034
commit
dc038fe4d5
1 changed files with 13 additions and 2 deletions
15
src/index.ts
15
src/index.ts
|
@ -1,10 +1,21 @@
|
||||||
|
import { Product } from 'ssn';
|
||||||
import getManifest from './exports/getManifest';
|
import getManifest from './exports/getManifest';
|
||||||
import productList from './exports/productList';
|
import productList from './exports/productList';
|
||||||
import init from './init';
|
import init from './init';
|
||||||
|
import IDatabaseSettings from './interfaces/IDatabaseSettings';
|
||||||
|
import IProductData from './interfaces/IProductData';
|
||||||
|
|
||||||
//Exports various functions as endpoints
|
interface IEndpoints {
|
||||||
export default Object.freeze({
|
getManifest: (product: Product) => {};
|
||||||
|
init: (dbSettings: IDatabaseSettings) => Promise<{ [key in Product]?: IProductData }>;
|
||||||
|
productList: ReadonlyArray<Product>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const out: Readonly<IEndpoints> = Object.freeze({
|
||||||
getManifest,
|
getManifest,
|
||||||
init,
|
init,
|
||||||
productList,
|
productList,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//Exports various functions as endpoints
|
||||||
|
export default out;
|
||||||
|
|
Loading…
Reference in a new issue