jc-structure 0.2.9 → 0.2.10
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 +2 -13
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -33,14 +33,14 @@ declare module "jc-structure" {
|
|
|
33
33
|
export class JcNode<T> {
|
|
34
34
|
value: T;
|
|
35
35
|
next: JcNode<T> | null;
|
|
36
|
-
constructor(value: T, next
|
|
36
|
+
constructor(value: T, next?: JcNode<T> | null);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* 双向链表类
|
|
41
41
|
*/
|
|
42
42
|
export class LinkedList<T> implements ILinkedList<T> {
|
|
43
|
-
constructor(elements?: T[])
|
|
43
|
+
constructor(elements?: T[]);
|
|
44
44
|
indexOf(element: T): number;
|
|
45
45
|
getElementAt(index: number): JcNode<T> | null;
|
|
46
46
|
getValueAt(index: number): T | undefined;
|
|
@@ -114,17 +114,6 @@ declare module "jc-structure" {
|
|
|
114
114
|
distanceTo(p: Point): number;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
interface PointConstructor {
|
|
118
|
-
new (x: number, y: number): Point;
|
|
119
|
-
/**
|
|
120
|
-
* #### 计算两点之间的距离
|
|
121
|
-
* @param p1 点1
|
|
122
|
-
* @param p2 点2
|
|
123
|
-
*/
|
|
124
|
-
distance(p1: Point, p2: Point): number;
|
|
125
|
-
}
|
|
126
|
-
var Point: PointConstructor;
|
|
127
|
-
|
|
128
117
|
interface Line {
|
|
129
118
|
/**
|
|
130
119
|
* #### 线段长度
|