extra-parser 0.2.0 → 0.2.1
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/README.md +8 -8
- package/lib/types.d.ts +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,23 +8,23 @@ yarn add extra-parser
|
|
|
8
8
|
|
|
9
9
|
## API
|
|
10
10
|
```ts
|
|
11
|
-
interface IToken<
|
|
12
|
-
type:
|
|
11
|
+
interface IToken<Type extends string> {
|
|
12
|
+
type: Type
|
|
13
13
|
value: string
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
interface INode<
|
|
17
|
-
type:
|
|
16
|
+
interface INode<Type extends string> {
|
|
17
|
+
type: Type
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
interface ITokenPatternMatch<
|
|
20
|
+
interface ITokenPatternMatch<Token extends IToken<string>> {
|
|
21
21
|
consumed: number
|
|
22
|
-
token:
|
|
22
|
+
token: Token
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
interface INodePatternMatch<
|
|
25
|
+
interface INodePatternMatch<Node extends INode<string>> {
|
|
26
26
|
consumed: number
|
|
27
|
-
node:
|
|
27
|
+
node: Node
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
type TokenPattern<Token extends IToken<string>> =
|
package/lib/types.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Falsy } from '@blackglory/prelude';
|
|
2
|
-
export interface IToken<
|
|
3
|
-
type:
|
|
2
|
+
export interface IToken<Type extends string> {
|
|
3
|
+
type: Type;
|
|
4
4
|
value: string;
|
|
5
5
|
}
|
|
6
|
-
export interface INode<
|
|
7
|
-
type:
|
|
6
|
+
export interface INode<Type extends string> {
|
|
7
|
+
type: Type;
|
|
8
8
|
}
|
|
9
|
-
export interface ITokenPatternMatch<
|
|
9
|
+
export interface ITokenPatternMatch<Token extends IToken<string>> {
|
|
10
10
|
consumed: number;
|
|
11
|
-
token:
|
|
11
|
+
token: Token;
|
|
12
12
|
}
|
|
13
|
-
export interface INodePatternMatch<
|
|
13
|
+
export interface INodePatternMatch<Node extends INode<string>> {
|
|
14
14
|
consumed: number;
|
|
15
|
-
node:
|
|
15
|
+
node: Node;
|
|
16
16
|
}
|
|
17
17
|
export interface ITokenPattern<Token extends IToken<string>> {
|
|
18
18
|
(text: string): ITokenPatternMatch<Token> | Falsy;
|