semantic-typescript 0.5.3 → 0.6.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.
Files changed (42) hide show
  1. package/dist/asynchronous/collector.d.ts +231 -0
  2. package/dist/asynchronous/collector.js +800 -0
  3. package/dist/asynchronous/semantic.d.ts +257 -0
  4. package/dist/asynchronous/semantic.js +1853 -0
  5. package/dist/factory.d.ts +71 -37
  6. package/dist/factory.js +443 -262
  7. package/dist/guard.d.ts +24 -14
  8. package/dist/guard.js +73 -19
  9. package/dist/hook.d.ts +6 -6
  10. package/dist/hook.js +2 -2
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.js +2 -2
  13. package/dist/optional.d.ts +2 -2
  14. package/dist/symbol.d.ts +19 -10
  15. package/dist/symbol.js +19 -10
  16. package/dist/synchronous/collector.d.ts +232 -0
  17. package/dist/{collector.js → synchronous/collector.js} +160 -151
  18. package/dist/{semantic.d.ts → synchronous/semantic.d.ts} +111 -120
  19. package/dist/{semantic.js → synchronous/semantic.js} +299 -337
  20. package/dist/utility.d.ts +7 -1
  21. package/dist/utility.js +1 -0
  22. package/package.json +1 -1
  23. package/readme.cn.md +158 -697
  24. package/readme.de.md +163 -432
  25. package/readme.es.md +163 -433
  26. package/readme.fr.md +162 -444
  27. package/readme.jp.md +162 -442
  28. package/readme.kr.md +161 -430
  29. package/readme.md +157 -1009
  30. package/readme.ru.md +161 -426
  31. package/readme.tw.md +161 -436
  32. package/dist/collector.d.ts +0 -236
  33. package/dist/main.d.ts +0 -1
  34. package/dist/main.js +0 -4
  35. package/dist/map.d.ts +0 -76
  36. package/dist/map.js +0 -245
  37. package/dist/node.d.ts +0 -182
  38. package/dist/node.js +0 -918
  39. package/dist/set.d.ts +0 -19
  40. package/dist/set.js +0 -65
  41. package/dist/tree.d.ts +0 -82
  42. 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 {};