jc-structure 0.1.10 → 0.1.11

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/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
+ /// <reference path='./global.d.ts' />
2
+ /// <reference path='./types/stack.d.ts' />
3
+ /// <reference path='./types/queue.d.ts' />
4
+ /// <reference path='./types/heap.d.ts' />
5
+
1
6
  declare module "jc-structure" {
2
- import type { IStack } from "./types/stack";
3
- import type { IQueue } from "./types/queue";
4
- import type { IHeap } from "./types/heap";
5
7
  /**
6
8
  * 栈类,采用object实现
7
9
  */
@@ -22,15 +24,15 @@ declare module "jc-structure" {
22
24
  }
23
25
  declare const Queue: QueueConstructor;
24
26
 
25
- type CompareResult = -1 | 0 | 1;
27
+ // type CompareResult = -1 | 0 | 1;
26
28
 
27
- interface CompareFn<T> {
28
- (a: T, b: T): CompareResult;
29
- }
29
+ // interface CompareFn<T> {
30
+ // (a: T, b: T): CompareResult;
31
+ // }
30
32
 
31
- interface Obj<V = any> {
32
- [key: string]: V;
33
- }
33
+ // interface Obj<V = any> {
34
+ // [key: string]: V;
35
+ // }
34
36
  /**
35
37
  * 最小堆
36
38
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jc-structure",
3
3
  "private": false,
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
package/types/global.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare interface Structure {
1
+ interface Structure {
2
2
  /**
3
3
  * 判断数据结构是否为空
4
4
  */
@@ -19,10 +19,16 @@ export declare interface Structure {
19
19
 
20
20
  type CompareResult = -1 | 0 | 1;
21
21
 
22
+ /**
23
+ * #### 比较函数接口
24
+ */
22
25
  interface CompareFn<T> {
23
26
  (a: T, b: T): CompareResult;
24
27
  }
25
28
 
29
+ /**
30
+ * #### 对象接口,用于存储数据结构元素,值类型默认为 any
31
+ */
26
32
  interface Obj<V = any> {
27
33
  [key: string]: V;
28
34
  }
package/types/heap.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- // import type { Structure } from "./global";
2
-
3
- export declare interface IHeap<T> extends Structure {
1
+ /**
2
+ * #### 堆
3
+ */
4
+ interface IHeap<T> extends Structure {
4
5
  /**
5
6
  * #### 插入一个值,返回一个布尔值
6
7
  * @param value 要插入的值
package/types/queue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * #### 队列接口
3
3
  */
4
- export declare interface IQueue<T> extends Structure {
4
+ interface IQueue<T> extends Structure {
5
5
  /**
6
6
  * #### 移除队列头部元素并返回该元素
7
7
  */
package/types/stack.d.ts CHANGED
@@ -1,13 +1,11 @@
1
- import type { Structure } from "./global";
2
-
3
- export interface StructureObj<T> {
1
+ interface StructureObj<T> {
4
2
  [key: number]: T;
5
3
  }
6
4
 
7
5
  /**
8
6
  * #### 栈接口
9
7
  */
10
- export declare interface IStack<T> extends Structure {
8
+ interface IStack<T> extends Structure {
11
9
  /**
12
10
  * #### 移除栈顶元素并返回该元素
13
11
  */