aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:58:36 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:58:36 +0800
commit196194c04aa5dca0b11e86158e510ec49cf72030 (patch)
treeb936f02e1ca279535f4986cc6dfff58008808357 /src
parentc5dca95f893cbc66d7e6d2de234f1411f28e1d19 (diff)
downloaddexon-0x-contracts-196194c04aa5dca0b11e86158e510ec49cf72030.tar.gz
dexon-0x-contracts-196194c04aa5dca0b11e86158e510ec49cf72030.tar.zst
dexon-0x-contracts-196194c04aa5dca0b11e86158e510ec49cf72030.zip
Add StringEnum type
Diffstat (limited to 'src')
-rw-r--r--src/types.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/types.ts b/src/types.ts
index 6eb769630..66881e170 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -3,7 +3,10 @@ import * as Web3 from 'web3';
// Utility function to create a K:V from a list of strings
// Adapted from: https://basarat.gitbooks.io/typescript/content/docs/types/literal-types.html
-function strEnum(values: string[]): {[key: string]: string} {
+export interface StringEnum {
+ [key: string]: string;
+}
+function strEnum(values: string[]): StringEnum {
return _.reduce(values, (result, key) => {
result[key] = key;
return result;