semantic-typescript 0.5.3 → 0.7.0
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/dist/asynchronous/collector.d.ts +235 -0
- package/dist/asynchronous/collector.js +811 -0
- package/dist/asynchronous/semantic.d.ts +257 -0
- package/dist/asynchronous/semantic.js +1863 -0
- package/dist/factory.d.ts +79 -37
- package/dist/factory.js +534 -277
- package/dist/guard.d.ts +24 -14
- package/dist/guard.js +73 -19
- package/dist/hook.d.ts +11 -6
- package/dist/hook.js +22 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/main.js +6 -4
- package/dist/optional.d.ts +2 -2
- package/dist/symbol.d.ts +19 -10
- package/dist/symbol.js +19 -10
- package/dist/synchronous/collector.d.ts +236 -0
- package/dist/{collector.js → synchronous/collector.js} +217 -193
- package/dist/{semantic.d.ts → synchronous/semantic.d.ts} +125 -130
- package/dist/{semantic.js → synchronous/semantic.js} +465 -574
- package/dist/utility.d.ts +7 -1
- package/dist/utility.js +1 -0
- package/package.json +3 -2
- package/readme.cn.md +213 -753
- package/readme.de.md +171 -441
- package/readme.es.md +171 -436
- package/readme.fr.md +170 -443
- package/readme.jp.md +177 -439
- package/readme.kr.md +177 -433
- package/readme.md +213 -1066
- package/readme.ru.md +174 -420
- package/readme.tw.md +175 -441
- package/dist/collector.d.ts +0 -236
- package/dist/map.d.ts +0 -76
- package/dist/map.js +0 -245
- package/dist/node.d.ts +0 -182
- package/dist/node.js +0 -918
- package/dist/set.d.ts +0 -19
- package/dist/set.js +0 -65
- package/dist/tree.d.ts +0 -82
- package/dist/tree.js +0 -257
package/dist/node.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { Optional } from "./optional";
|
|
2
|
-
import { type Comparator } from "./utility";
|
|
3
|
-
export interface Node<E, N extends Node<E, N>> extends Iterable<N> {
|
|
4
|
-
ancestors(): Iterable<N>;
|
|
5
|
-
children(): Iterable<N>;
|
|
6
|
-
descendants(): Iterable<N>;
|
|
7
|
-
siblings(): Iterable<N>;
|
|
8
|
-
parent(): Optional<N>;
|
|
9
|
-
root(): N;
|
|
10
|
-
previousSibling(): Optional<N>;
|
|
11
|
-
nextSibling(): Optional<N>;
|
|
12
|
-
preorder(): Generator<N>;
|
|
13
|
-
inorder(): Generator<N>;
|
|
14
|
-
postorder(): Generator<N>;
|
|
15
|
-
breadthfirst(): Generator<N>;
|
|
16
|
-
depth(): bigint;
|
|
17
|
-
height(): bigint;
|
|
18
|
-
width(): bigint;
|
|
19
|
-
level(): bigint;
|
|
20
|
-
isLeaf(): boolean;
|
|
21
|
-
isRoot(): boolean;
|
|
22
|
-
[Symbol.iterator](): Iterator<N>;
|
|
23
|
-
}
|
|
24
|
-
export declare abstract class AbstractNode<E, N extends Node<E, N>> implements Node<E, N> {
|
|
25
|
-
protected readonly Node: symbol;
|
|
26
|
-
constructor();
|
|
27
|
-
ancestors(): Iterable<N>;
|
|
28
|
-
abstract children(): Iterable<N>;
|
|
29
|
-
descendants(): Iterable<N>;
|
|
30
|
-
root(): N;
|
|
31
|
-
siblings(): Iterable<N>;
|
|
32
|
-
abstract parent(): Optional<N>;
|
|
33
|
-
previousSibling(): Optional<N>;
|
|
34
|
-
nextSibling(): Optional<N>;
|
|
35
|
-
preorder(): Generator<N>;
|
|
36
|
-
inorder(): Generator<N>;
|
|
37
|
-
postorder(): Generator<N>;
|
|
38
|
-
breadthfirst(): Generator<N>;
|
|
39
|
-
[Symbol.iterator](): Iterator<N>;
|
|
40
|
-
depth(): bigint;
|
|
41
|
-
height(): bigint;
|
|
42
|
-
width(): bigint;
|
|
43
|
-
level(): bigint;
|
|
44
|
-
isLeaf(): boolean;
|
|
45
|
-
isRoot(): boolean;
|
|
46
|
-
}
|
|
47
|
-
export declare class LinearNode<E> extends AbstractNode<E, LinearNode<E>> {
|
|
48
|
-
protected previous: Optional<LinearNode<E>>;
|
|
49
|
-
protected next: Optional<LinearNode<E>>;
|
|
50
|
-
protected element: Optional<E>;
|
|
51
|
-
protected readonly LinearNode: symbol;
|
|
52
|
-
constructor(element: E);
|
|
53
|
-
constructor(element: E, previous: Optional<LinearNode<E>>, next: Optional<LinearNode<E>>);
|
|
54
|
-
ancestors(): Iterable<LinearNode<E>>;
|
|
55
|
-
descendants(): Iterable<LinearNode<E>>;
|
|
56
|
-
root(): LinearNode<E>;
|
|
57
|
-
siblings(): Iterable<LinearNode<E>>;
|
|
58
|
-
children(): Iterable<LinearNode<E>>;
|
|
59
|
-
parent(): Optional<LinearNode<E>>;
|
|
60
|
-
[Symbol.iterator](): Iterator<LinearNode<E>>;
|
|
61
|
-
getElement(): Optional<E>;
|
|
62
|
-
setElement(element: E): void;
|
|
63
|
-
getPrevious(): Optional<LinearNode<E>>;
|
|
64
|
-
setPrevious(previous: LinearNode<E>): void;
|
|
65
|
-
setPrevious(previous: Optional<LinearNode<E>>): void;
|
|
66
|
-
getNext(): Optional<LinearNode<E>>;
|
|
67
|
-
setNext(next: LinearNode<E>): void;
|
|
68
|
-
setNext(next: Optional<LinearNode<E>>): void;
|
|
69
|
-
linkPrevious(previous: LinearNode<E>): void;
|
|
70
|
-
unlinkPrevious(): void;
|
|
71
|
-
linkNext(next: LinearNode<E>): void;
|
|
72
|
-
unlinkNext(): void;
|
|
73
|
-
}
|
|
74
|
-
export declare abstract class BinaryNode<E, N extends BinaryNode<E, N>> extends AbstractNode<E, N> {
|
|
75
|
-
BinaryNode: symbol;
|
|
76
|
-
protected ancestor: Optional<N>;
|
|
77
|
-
protected left: Optional<N>;
|
|
78
|
-
protected right: Optional<N>;
|
|
79
|
-
protected element: Optional<E>;
|
|
80
|
-
constructor(element: E);
|
|
81
|
-
constructor(element: E, ancestor: Optional<N>, left: Optional<N>, right: Optional<N>);
|
|
82
|
-
ancestors(): Iterable<N>;
|
|
83
|
-
compare(other: N): bigint;
|
|
84
|
-
compare(other: N, comparator: Comparator<E>): bigint;
|
|
85
|
-
descendants(): Iterable<N>;
|
|
86
|
-
abstract identity(): N;
|
|
87
|
-
root(): N;
|
|
88
|
-
siblings(): Iterable<N>;
|
|
89
|
-
children(): Iterable<N>;
|
|
90
|
-
parent(): Optional<N>;
|
|
91
|
-
[Symbol.iterator](): Iterator<N>;
|
|
92
|
-
preorder(): Generator<N>;
|
|
93
|
-
inorder(): Generator<N>;
|
|
94
|
-
postorder(): Generator<N>;
|
|
95
|
-
breadthfirst(): Generator<N>;
|
|
96
|
-
getElement(): Optional<E>;
|
|
97
|
-
setElement(element: E): void;
|
|
98
|
-
getLeft(): Optional<N>;
|
|
99
|
-
setLeft(left: N): void;
|
|
100
|
-
setLeft(left: Optional<N>): void;
|
|
101
|
-
getRight(): Optional<N>;
|
|
102
|
-
setRight(right: N): void;
|
|
103
|
-
setRight(right: Optional<N>): void;
|
|
104
|
-
getAncestor(): Optional<N>;
|
|
105
|
-
setAncestor(ancestor: N): void;
|
|
106
|
-
setAncestor(ancestor: Optional<N>): void;
|
|
107
|
-
linkLeft(left: N): void;
|
|
108
|
-
unlinkLeft(): Optional<N>;
|
|
109
|
-
linkRight(right: N): void;
|
|
110
|
-
unlinkRight(): Optional<N>;
|
|
111
|
-
isLeftChild(): boolean;
|
|
112
|
-
isRightChild(): boolean;
|
|
113
|
-
detach(): void;
|
|
114
|
-
isBanlanced(): boolean;
|
|
115
|
-
isFull(): boolean;
|
|
116
|
-
isComplete(): boolean;
|
|
117
|
-
isPerfect(): boolean;
|
|
118
|
-
invert(): void;
|
|
119
|
-
invert(deep: boolean): void;
|
|
120
|
-
}
|
|
121
|
-
type Color = "RED" | "BLACK";
|
|
122
|
-
export declare class RedBlackNode<E> extends BinaryNode<E, RedBlackNode<E>> {
|
|
123
|
-
protected readonly RedBlackNode: symbol;
|
|
124
|
-
protected color: Color;
|
|
125
|
-
constructor(element: E);
|
|
126
|
-
constructor(element: E, color: Color);
|
|
127
|
-
constructor(element: E, color: Color, ancestor: Optional<RedBlackNode<E>>, left: Optional<RedBlackNode<E>>, right: Optional<RedBlackNode<E>>);
|
|
128
|
-
identity(): RedBlackNode<E>;
|
|
129
|
-
getElement(): Optional<E>;
|
|
130
|
-
setElement(element: E): void;
|
|
131
|
-
getLeft(): Optional<RedBlackNode<E>>;
|
|
132
|
-
getRight(): Optional<RedBlackNode<E>>;
|
|
133
|
-
getColor(): Color;
|
|
134
|
-
setColor(color: Color): void;
|
|
135
|
-
isRed(): boolean;
|
|
136
|
-
isBlack(): boolean;
|
|
137
|
-
turnRed(): void;
|
|
138
|
-
turnBlack(): void;
|
|
139
|
-
toggle(): void;
|
|
140
|
-
compareAndLink(other: RedBlackNode<E>): void;
|
|
141
|
-
compareAndLink(other: RedBlackNode<E>, comparator: Comparator<E>): void;
|
|
142
|
-
rotate(): void;
|
|
143
|
-
rotateLeft(): RedBlackNode<E>;
|
|
144
|
-
rotateRight(): RedBlackNode<E>;
|
|
145
|
-
fix(): void;
|
|
146
|
-
uncle(): Optional<RedBlackNode<E>>;
|
|
147
|
-
findMinimum(): RedBlackNode<E>;
|
|
148
|
-
findMaximum(): RedBlackNode<E>;
|
|
149
|
-
}
|
|
150
|
-
export declare class AverageLevelNode<E> extends BinaryNode<E, AverageLevelNode<E>> {
|
|
151
|
-
constructor(element: E);
|
|
152
|
-
constructor(element: E, ancestor: Optional<AverageLevelNode<E>>, left: Optional<AverageLevelNode<E>>, right: Optional<AverageLevelNode<E>>);
|
|
153
|
-
[Symbol.iterator](): Iterator<AverageLevelNode<E>>;
|
|
154
|
-
identity(): AverageLevelNode<E>;
|
|
155
|
-
getElement(): Optional<E>;
|
|
156
|
-
setElement(element: E): void;
|
|
157
|
-
getLeft(): Optional<AverageLevelNode<E>>;
|
|
158
|
-
getRight(): Optional<AverageLevelNode<E>>;
|
|
159
|
-
}
|
|
160
|
-
export declare class BinarySearchNode<E> extends AbstractNode<E, BinarySearchNode<E>> {
|
|
161
|
-
protected left: Optional<BinarySearchNode<E>>;
|
|
162
|
-
protected right: Optional<BinarySearchNode<E>>;
|
|
163
|
-
protected element: Optional<E>;
|
|
164
|
-
constructor(element: E);
|
|
165
|
-
constructor(element: E, left: Optional<BinarySearchNode<E>>, right: Optional<BinarySearchNode<E>>);
|
|
166
|
-
ancestors(): Iterable<BinarySearchNode<E>>;
|
|
167
|
-
descendants(): Iterable<BinarySearchNode<E>>;
|
|
168
|
-
root(): BinarySearchNode<E>;
|
|
169
|
-
siblings(): Iterable<BinarySearchNode<E>>;
|
|
170
|
-
children(): Iterable<BinarySearchNode<E>>;
|
|
171
|
-
parent(): Optional<BinarySearchNode<E>>;
|
|
172
|
-
[Symbol.iterator](): Iterator<BinarySearchNode<E>>;
|
|
173
|
-
inorder(): Generator<BinarySearchNode<E>>;
|
|
174
|
-
preorder(): Generator<BinarySearchNode<E>>;
|
|
175
|
-
postorder(): Generator<BinarySearchNode<E>>;
|
|
176
|
-
breadthfirst(): Generator<BinarySearchNode<E>>;
|
|
177
|
-
getElement(): Optional<E>;
|
|
178
|
-
setElement(element: E): void;
|
|
179
|
-
getLeft(): Optional<BinarySearchNode<E>>;
|
|
180
|
-
getRight(): Optional<BinarySearchNode<E>>;
|
|
181
|
-
}
|
|
182
|
-
export {};
|