Add documentation to models.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/** Account data interface */
|
||||
interface AccountDetails {
|
||||
date_registered: number;
|
||||
gender: string;
|
||||
@@ -51,6 +52,7 @@ interface AccountDetails {
|
||||
};
|
||||
}
|
||||
|
||||
/** Meta signature interface */
|
||||
interface Signature {
|
||||
algo: string;
|
||||
data: string;
|
||||
@@ -58,17 +60,20 @@ interface Signature {
|
||||
engine: string;
|
||||
}
|
||||
|
||||
/** Meta object interface */
|
||||
interface Meta {
|
||||
data: AccountDetails;
|
||||
id: string;
|
||||
signature: Signature;
|
||||
}
|
||||
|
||||
/** Meta response interface */
|
||||
interface MetaResponse {
|
||||
id: string;
|
||||
m: Meta;
|
||||
}
|
||||
|
||||
/** Default account data object */
|
||||
const defaultAccount: AccountDetails = {
|
||||
date_registered: Date.now(),
|
||||
gender: 'other',
|
||||
@@ -116,4 +121,5 @@ const defaultAccount: AccountDetails = {
|
||||
},
|
||||
};
|
||||
|
||||
export { AccountDetails, Signature, Meta, MetaResponse, defaultAccount };
|
||||
/** @exports */
|
||||
export { AccountDetails, Meta, MetaResponse, Signature, defaultAccount };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export * from '@app/_models/transaction';
|
||||
export * from '@app/_models/settings';
|
||||
export * from '@app/_models/account';
|
||||
export * from '@app/_models/mappings';
|
||||
export * from '@app/_models/settings';
|
||||
export * from '@app/_models/staff';
|
||||
export * from '@app/_models/token';
|
||||
export * from '@app/_models/mappings';
|
||||
export * from '@app/_models/transaction';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/** Action object interface */
|
||||
interface Action {
|
||||
id: number;
|
||||
user: string;
|
||||
@@ -6,19 +7,23 @@ interface Action {
|
||||
approval: boolean;
|
||||
}
|
||||
|
||||
interface Category {
|
||||
name: string;
|
||||
products: Array<string>;
|
||||
}
|
||||
|
||||
/** Area name object interface */
|
||||
interface AreaName {
|
||||
name: string;
|
||||
locations: Array<string>;
|
||||
}
|
||||
|
||||
/** Area type object interface */
|
||||
interface AreaType {
|
||||
name: string;
|
||||
area: Array<string>;
|
||||
}
|
||||
|
||||
export { Action, Category, AreaName, AreaType };
|
||||
/** Category object interface */
|
||||
interface Category {
|
||||
name: string;
|
||||
products: Array<string>;
|
||||
}
|
||||
|
||||
/** @exports */
|
||||
export { Action, AreaName, AreaType, Category };
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/** Settings class */
|
||||
class Settings {
|
||||
w3: W3 = {
|
||||
engine: undefined,
|
||||
@@ -12,9 +13,11 @@ class Settings {
|
||||
}
|
||||
}
|
||||
|
||||
class W3 {
|
||||
/** Web3 object interface */
|
||||
interface W3 {
|
||||
engine: any;
|
||||
provider: any;
|
||||
}
|
||||
|
||||
/** @exports */
|
||||
export { Settings, W3 };
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/** Staff object interface */
|
||||
interface Staff {
|
||||
comment: string;
|
||||
email: string;
|
||||
@@ -6,4 +7,5 @@ interface Staff {
|
||||
userid: string;
|
||||
}
|
||||
|
||||
/** @exports */
|
||||
export { Staff };
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/** Token object interface */
|
||||
interface Token {
|
||||
name: string;
|
||||
symbol: string;
|
||||
@@ -14,4 +15,5 @@ interface Token {
|
||||
owner?: string;
|
||||
}
|
||||
|
||||
/** @exports */
|
||||
export { Token };
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Application imports
|
||||
import { AccountDetails } from '@app/_models/account';
|
||||
|
||||
class BlocksBloom {
|
||||
/** BlocksBloom object interface */
|
||||
interface BlocksBloom {
|
||||
low: number;
|
||||
blockFilter: string;
|
||||
blocktxFilter: string;
|
||||
@@ -8,21 +10,19 @@ class BlocksBloom {
|
||||
filterRounds: number;
|
||||
}
|
||||
|
||||
class TxToken {
|
||||
address: string;
|
||||
name: string;
|
||||
symbol: string;
|
||||
/** Conversion object interface */
|
||||
interface Conversion {
|
||||
destinationToken: TxToken;
|
||||
fromValue: number;
|
||||
sourceToken: TxToken;
|
||||
toValue: number;
|
||||
trader: string;
|
||||
user: AccountDetails;
|
||||
tx: Tx;
|
||||
}
|
||||
|
||||
class Tx {
|
||||
block: number;
|
||||
success: boolean;
|
||||
timestamp: number;
|
||||
txHash: string;
|
||||
txIndex: number;
|
||||
}
|
||||
|
||||
class Transaction {
|
||||
/** Transaction object interface */
|
||||
interface Transaction {
|
||||
from: string;
|
||||
sender: AccountDetails;
|
||||
to: string;
|
||||
@@ -33,14 +33,21 @@ class Transaction {
|
||||
type?: string;
|
||||
}
|
||||
|
||||
class Conversion {
|
||||
destinationToken: TxToken;
|
||||
fromValue: number;
|
||||
sourceToken: TxToken;
|
||||
toValue: number;
|
||||
trader: string;
|
||||
user: AccountDetails;
|
||||
tx: Tx;
|
||||
/** Transaction data interface */
|
||||
interface Tx {
|
||||
block: number;
|
||||
success: boolean;
|
||||
timestamp: number;
|
||||
txHash: string;
|
||||
txIndex: number;
|
||||
}
|
||||
|
||||
export { BlocksBloom, TxToken, Tx, Transaction, Conversion };
|
||||
/** Transaction token object interface */
|
||||
interface TxToken {
|
||||
address: string;
|
||||
name: string;
|
||||
symbol: string;
|
||||
}
|
||||
|
||||
/** @exports */
|
||||
export { BlocksBloom, Conversion, Transaction, Tx, TxToken };
|
||||
|
||||
Reference in New Issue
Block a user