@watsonserve/stock-base 0.0.22 → 0.0.23

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/close-time.js CHANGED
@@ -2,6 +2,7 @@ import { EnMarket } from './stock.js';
2
2
  export const A_MIN_MS = 60000;
3
3
  export const A_HOUR_MS = 3600000;
4
4
  export const A_DAY_MS = 86400000;
5
+ export const A_DAY_S = 86400;
5
6
  // 夏令时:3月最后一个周日凌晨1AM开始夏令时,10月最后一个周日凌晨2AM结束夏令时
6
7
  function isDST_ByUK(timestamp) {
7
8
  const date = new Date(timestamp);
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
+ import { A_DAY_S } from './close-time.js';
1
2
  import { DividendLoader } from './dividend-loader.js';
2
3
  export * from './stock.js';
3
4
  export * from './log.js';
4
- export { ttm, sleep, splitFullNc } from './helper.js';
5
- const A_DAY_S = 86400;
5
+ export * from './helper.js';
6
6
  function parseUTCDate(str) {
7
7
  return ~~(Date.UTC(+str.slice(0, 4), +str.slice(4, 6) - 1, +str.slice(6, 8)) / 1000);
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@watsonserve/stock-base",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -2,6 +2,7 @@ import { EnMarket } from './stock.js';
2
2
  export declare const A_MIN_MS = 60000;
3
3
  export declare const A_HOUR_MS = 3600000;
4
4
  export declare const A_DAY_MS = 86400000;
5
+ export declare const A_DAY_S = 86400;
5
6
  /**
6
7
  * 获取市场收盘时间戳,单位秒
7
8
  * @param market 市场
@@ -1,5 +1,5 @@
1
1
  import PriceLoader from './price-loader.js';
2
- import { type IDiv } from './helper.js';
2
+ import { type IDiv } from './stock.js';
3
3
  export declare class DividendLoader extends PriceLoader {
4
4
  private __laodIbmCode;
5
5
  private __loadHKDividend;
package/types/helper.d.ts CHANGED
@@ -1,12 +1,4 @@
1
1
  import { EnMarket } from './stock.js';
2
- export interface IDiv {
3
- nc: string;
4
- annc: number;
5
- ex: number;
6
- paid: number;
7
- currency: string;
8
- amount: number;
9
- }
10
2
  export declare function sleep(t?: number): Promise<unknown>;
11
3
  export declare function splitFullNc(fullNc: string): {
12
4
  nc: string;
package/types/index.d.ts CHANGED
@@ -1,13 +1,8 @@
1
1
  import { DividendLoader } from './dividend-loader.js';
2
+ import { IHoliday } from './stock.js';
2
3
  export * from './stock.js';
3
4
  export * from './log.js';
4
- export { type IDiv, ttm, sleep, splitFullNc } from './helper.js';
5
- export interface IHoliday {
6
- market: string;
7
- title: string;
8
- start: number;
9
- end: number;
10
- }
5
+ export * from './helper.js';
11
6
  export declare class StockLoader extends DividendLoader {
12
7
  loadHolidaysSG(year: number): Promise<IHoliday[]>;
13
8
  loadHolidaysHK(): Promise<IHoliday[]>;
package/types/stock.d.ts CHANGED
@@ -38,7 +38,7 @@ export interface StockPoint {
38
38
  st: IStock;
39
39
  }
40
40
  export interface IDividend {
41
- curr: string;
41
+ currency: string;
42
42
  amount?: number;
43
43
  ratio?: number;
44
44
  annc: Date;
@@ -46,6 +46,20 @@ export interface IDividend {
46
46
  paid: Date;
47
47
  announcement_URL?: string;
48
48
  }
49
+ export interface IDiv {
50
+ nc: string;
51
+ annc: number;
52
+ ex: number;
53
+ paid: number;
54
+ currency: string;
55
+ amount: number;
56
+ }
57
+ export interface IHoliday {
58
+ market: string;
59
+ title: string;
60
+ start: number;
61
+ end: number;
62
+ }
49
63
  export declare class Stock {
50
64
  nc: string;
51
65
  name: string;