rantjs 2.0.0 → 2.1.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/cli.js +830 -124
- package/dist/index.cjs +825 -112
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +825 -112
- package/dist/rant.js +836 -115
- package/dist/rant.min.js +6 -4
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface Entry {
|
|
2
2
|
forms: string[];
|
|
3
3
|
classes: string[];
|
|
4
|
+
pron?: string[];
|
|
4
5
|
}
|
|
5
6
|
interface Table {
|
|
6
7
|
name: string;
|
|
@@ -20,10 +21,12 @@ interface RantOptions {
|
|
|
20
21
|
}
|
|
21
22
|
interface RantInstance {
|
|
22
23
|
run(pattern: string, options?: RantOptions): string;
|
|
24
|
+
channels: Record<string, string>;
|
|
23
25
|
}
|
|
24
26
|
declare function createRant(options?: RantOptions): RantInstance;
|
|
25
27
|
declare function rant(pattern: string, second?: RantOptions | Dictionary | unknown): string;
|
|
26
28
|
|
|
29
|
+
type CarrierKind = "match" | "unique" | "rhyme";
|
|
27
30
|
type Node = TextNode | QueryNode | TagNode | BlockNode | EscapeNode;
|
|
28
31
|
interface TextNode {
|
|
29
32
|
type: "text";
|
|
@@ -33,17 +36,24 @@ interface QueryNode {
|
|
|
33
36
|
type: "query";
|
|
34
37
|
table: string;
|
|
35
38
|
args: string[];
|
|
39
|
+
exclude: string[];
|
|
36
40
|
carrier?: string;
|
|
41
|
+
carrierKind?: CarrierKind;
|
|
37
42
|
raw: string;
|
|
38
43
|
}
|
|
39
44
|
interface TagNode {
|
|
40
45
|
type: "tag";
|
|
41
46
|
name: string;
|
|
42
47
|
arg: string;
|
|
48
|
+
args: Node[][];
|
|
49
|
+
}
|
|
50
|
+
interface BlockAlt {
|
|
51
|
+
weight: Node[] | null;
|
|
52
|
+
nodes: Node[];
|
|
43
53
|
}
|
|
44
54
|
interface BlockNode {
|
|
45
55
|
type: "block";
|
|
46
|
-
alternatives:
|
|
56
|
+
alternatives: BlockAlt[];
|
|
47
57
|
}
|
|
48
58
|
interface EscapeNode {
|
|
49
59
|
type: "escape";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
interface Entry {
|
|
2
2
|
forms: string[];
|
|
3
3
|
classes: string[];
|
|
4
|
+
pron?: string[];
|
|
4
5
|
}
|
|
5
6
|
interface Table {
|
|
6
7
|
name: string;
|
|
@@ -20,10 +21,12 @@ interface RantOptions {
|
|
|
20
21
|
}
|
|
21
22
|
interface RantInstance {
|
|
22
23
|
run(pattern: string, options?: RantOptions): string;
|
|
24
|
+
channels: Record<string, string>;
|
|
23
25
|
}
|
|
24
26
|
declare function createRant(options?: RantOptions): RantInstance;
|
|
25
27
|
declare function rant(pattern: string, second?: RantOptions | Dictionary | unknown): string;
|
|
26
28
|
|
|
29
|
+
type CarrierKind = "match" | "unique" | "rhyme";
|
|
27
30
|
type Node = TextNode | QueryNode | TagNode | BlockNode | EscapeNode;
|
|
28
31
|
interface TextNode {
|
|
29
32
|
type: "text";
|
|
@@ -33,17 +36,24 @@ interface QueryNode {
|
|
|
33
36
|
type: "query";
|
|
34
37
|
table: string;
|
|
35
38
|
args: string[];
|
|
39
|
+
exclude: string[];
|
|
36
40
|
carrier?: string;
|
|
41
|
+
carrierKind?: CarrierKind;
|
|
37
42
|
raw: string;
|
|
38
43
|
}
|
|
39
44
|
interface TagNode {
|
|
40
45
|
type: "tag";
|
|
41
46
|
name: string;
|
|
42
47
|
arg: string;
|
|
48
|
+
args: Node[][];
|
|
49
|
+
}
|
|
50
|
+
interface BlockAlt {
|
|
51
|
+
weight: Node[] | null;
|
|
52
|
+
nodes: Node[];
|
|
43
53
|
}
|
|
44
54
|
interface BlockNode {
|
|
45
55
|
type: "block";
|
|
46
|
-
alternatives:
|
|
56
|
+
alternatives: BlockAlt[];
|
|
47
57
|
}
|
|
48
58
|
interface EscapeNode {
|
|
49
59
|
type: "escape";
|