@yozora/tokenizer-table 2.0.5 → 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/lib/types/index.d.ts +4 -4
- package/package.json +5 -5
- package/src/match.ts +2 -2
- package/src/types.ts +4 -4
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IPartialBlockToken, ITokenizer, IBaseBlockTokenizerProps, IPhrasingContentLine, IMatchBlockHookCreator, IParseBlockHookCreator, BaseBlockTokenizer, IBlockTokenizer } from '@yozora/core-tokenizer';
|
|
2
2
|
import { TableType, TableColumn, TableRowType, TableCellType, Position, Table } from '@yozora/ast';
|
|
3
3
|
|
|
4
4
|
type T = TableType;
|
|
5
5
|
type INode = Table;
|
|
6
6
|
declare const uniqueName = "@yozora/tokenizer-table";
|
|
7
|
-
interface IToken extends
|
|
7
|
+
interface IToken extends IPartialBlockToken<TableType> {
|
|
8
8
|
/**
|
|
9
9
|
* Table column configuration items
|
|
10
10
|
*/
|
|
@@ -16,10 +16,10 @@ interface IToken extends IPartialYastBlockToken<TableType> {
|
|
|
16
16
|
}
|
|
17
17
|
type IThis = ITokenizer;
|
|
18
18
|
type ITokenizerProps = Partial<IBaseBlockTokenizerProps>;
|
|
19
|
-
interface ITableRowToken extends
|
|
19
|
+
interface ITableRowToken extends IPartialBlockToken<TableRowType> {
|
|
20
20
|
cells: ITableCellToken[];
|
|
21
21
|
}
|
|
22
|
-
interface ITableCellToken extends
|
|
22
|
+
interface ITableCellToken extends IPartialBlockToken<TableCellType> {
|
|
23
23
|
position: Position;
|
|
24
24
|
lines: IPhrasingContentLine[];
|
|
25
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-table",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"test": "cross-env TS_NODE_FILES=true NODE_OPTIONS=--experimental-vm-modules jest --config ../../jest.config.mjs --rootDir ."
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@yozora/ast": "^2.0
|
|
43
|
-
"@yozora/character": "^2.0
|
|
44
|
-
"@yozora/core-tokenizer": "^2.0
|
|
42
|
+
"@yozora/ast": "^2.1.0",
|
|
43
|
+
"@yozora/character": "^2.1.0",
|
|
44
|
+
"@yozora/core-tokenizer": "^2.1.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "387a68e8f9154944e2a6a7009a808d076d0659c6"
|
|
47
47
|
}
|
package/src/match.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { AlignType, Point, TableColumn } from '@yozora/ast'
|
|
|
2
2
|
import { TableCellType, TableRowType, TableType } from '@yozora/ast'
|
|
3
3
|
import { AsciiCodePoint, isWhitespaceCharacter } from '@yozora/character'
|
|
4
4
|
import type {
|
|
5
|
+
IBlockToken,
|
|
5
6
|
IMatchBlockHookCreator,
|
|
6
7
|
IPhrasingContentLine,
|
|
7
8
|
IResultOfEatAndInterruptPreviousSibling,
|
|
8
9
|
IResultOfEatLazyContinuationText,
|
|
9
10
|
IResultOfEatOpener,
|
|
10
|
-
IYastBlockToken,
|
|
11
11
|
} from '@yozora/core-tokenizer'
|
|
12
12
|
import { calcEndPoint, calcStartPoint } from '@yozora/core-tokenizer'
|
|
13
13
|
import type { ITableCellToken, ITableRowToken, IThis, IToken, T } from './types'
|
|
@@ -41,7 +41,7 @@ export const match: IMatchBlockHookCreator<T, IToken, IThis> = function (api) {
|
|
|
41
41
|
|
|
42
42
|
function eatAndInterruptPreviousSibling(
|
|
43
43
|
line: Readonly<IPhrasingContentLine>,
|
|
44
|
-
prevSiblingToken: Readonly<
|
|
44
|
+
prevSiblingToken: Readonly<IBlockToken>,
|
|
45
45
|
): IResultOfEatAndInterruptPreviousSibling<T, IToken> {
|
|
46
46
|
/**
|
|
47
47
|
* Four spaces is too much
|
package/src/types.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type {
|
|
|
8
8
|
} from '@yozora/ast'
|
|
9
9
|
import type {
|
|
10
10
|
IBaseBlockTokenizerProps,
|
|
11
|
-
|
|
11
|
+
IPartialBlockToken,
|
|
12
12
|
IPhrasingContentLine,
|
|
13
13
|
ITokenizer,
|
|
14
14
|
} from '@yozora/core-tokenizer'
|
|
@@ -17,7 +17,7 @@ export type T = TableType
|
|
|
17
17
|
export type INode = Table
|
|
18
18
|
export const uniqueName = '@yozora/tokenizer-table'
|
|
19
19
|
|
|
20
|
-
export interface IToken extends
|
|
20
|
+
export interface IToken extends IPartialBlockToken<TableType> {
|
|
21
21
|
/**
|
|
22
22
|
* Table column configuration items
|
|
23
23
|
*/
|
|
@@ -32,11 +32,11 @@ export type IThis = ITokenizer
|
|
|
32
32
|
|
|
33
33
|
export type ITokenizerProps = Partial<IBaseBlockTokenizerProps>
|
|
34
34
|
|
|
35
|
-
export interface ITableRowToken extends
|
|
35
|
+
export interface ITableRowToken extends IPartialBlockToken<TableRowType> {
|
|
36
36
|
cells: ITableCellToken[]
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export interface ITableCellToken extends
|
|
39
|
+
export interface ITableCellToken extends IPartialBlockToken<TableCellType> {
|
|
40
40
|
position: Position
|
|
41
41
|
lines: IPhrasingContentLine[]
|
|
42
42
|
}
|