@watsonserve/stock-base 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watsonserve/stock-base",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -12,7 +12,7 @@
12
12
  "influx": "^5.12.0"
13
13
  },
14
14
  "main": "index.js",
15
- "types": "types",
15
+ "types": "types/index.d.ts",
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  }
package/stock.js CHANGED
@@ -38,32 +38,3 @@ export class Stock {
38
38
  this.v = vol;
39
39
  }
40
40
  }
41
- export class HandleStock extends Stock {
42
- count = 0;
43
- cost = 0;
44
- category = '';
45
- usd_cost = 0;
46
- proportion = 0;
47
- _usdValue = 0;
48
- constructor(nc, count = 0, cost = 0.0, currency = EnCurrency.USD, category = '') {
49
- super(nc, '', currency);
50
- this.count = count;
51
- this.cost = cost;
52
- this.category = category;
53
- this.usd_cost = cost;
54
- }
55
- setFx(fx) {
56
- this._usdValue = this.c * this.count / fx;
57
- this.usd_cost = this.cost / fx;
58
- }
59
- set asset(asset) {
60
- this.proportion = this.usdValue / asset * 100.0;
61
- this.proportion;
62
- }
63
- get usdValue() {
64
- return this._usdValue || (this.c * this.count);
65
- }
66
- toJSON() {
67
- return `{"category": "${this.category}", "title": "${this.name}", "amount": ${this.usdValue.toFixed(2)}, "proportion": "${this.proportion.toFixed(2)}%"}`;
68
- }
69
- }
package/types/stock.d.ts CHANGED
@@ -49,16 +49,3 @@ export declare class Stock {
49
49
  constructor(code: string, name?: string, currency?: EnCurrency);
50
50
  setInfo(name: string, close: number, open?: number, height?: number, low?: number, vol?: number): void;
51
51
  }
52
- export declare class HandleStock extends Stock {
53
- count: number;
54
- cost: number;
55
- category: string;
56
- usd_cost: number;
57
- proportion: number;
58
- private _usdValue;
59
- constructor(nc: string, count?: number, cost?: number, currency?: EnCurrency, category?: string);
60
- setFx(fx: number): void;
61
- set asset(asset: number);
62
- get usdValue(): number;
63
- toJSON(): string;
64
- }