@yozora/tokenizer-table 2.0.2 → 2.0.3
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/LICENSE +1 -1
- package/package.json +6 -6
- package/lib/types/match.d.ts +0 -26
- package/lib/types/parse.d.ts +0 -3
- package/lib/types/tokenizer.d.ts +0 -14
- package/lib/types/types.d.ts +0 -24
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2020-
|
|
3
|
+
Copyright (c) 2020-2022 guanghechen (me.guanghechen@gmail.com)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yozora/tokenizer-table",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "guanghechen",
|
|
6
6
|
"url": "https://github.com/guanghechen/"
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "cross-env NODE_ENV=production rollup -c ../../rollup.config.js",
|
|
33
|
-
"prebuild": "rimraf lib/
|
|
33
|
+
"prebuild": "rimraf lib/",
|
|
34
34
|
"prepublishOnly": "cross-env ROLLUP_SHOULD_SOURCEMAP=false yarn build",
|
|
35
35
|
"test": "cross-env TS_NODE_FILES=true jest --config ../../jest.config.js --rootDir ."
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yozora/ast": "^2.0.
|
|
39
|
-
"@yozora/character": "^2.0.
|
|
40
|
-
"@yozora/core-tokenizer": "^2.0.
|
|
38
|
+
"@yozora/ast": "^2.0.3",
|
|
39
|
+
"@yozora/character": "^2.0.3",
|
|
40
|
+
"@yozora/core-tokenizer": "^2.0.3"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "8cc8f95cfebc8d752bc3272cdd24965f540c130b"
|
|
43
43
|
}
|
package/lib/types/match.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { IMatchBlockHookCreator } from '@yozora/core-tokenizer';
|
|
2
|
-
import type { IThis, IToken, T } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* A table is an arrangement of data with rows and columns, consisting of
|
|
5
|
-
* a single header row, a delimiter row separating the header from the data,
|
|
6
|
-
* and zero or more data rows.
|
|
7
|
-
*
|
|
8
|
-
* Each row consists of cells containing arbitrary text, in which inlines
|
|
9
|
-
* are parsed, separated by pipes (|). A leading and trailing pipe is also
|
|
10
|
-
* recommended for clarity of reading, and if there’s otherwise parsing
|
|
11
|
-
* ambiguity. Spaces between pipes and cell content are trimmed. Block-level
|
|
12
|
-
* elements cannot be inserted in a table.
|
|
13
|
-
*
|
|
14
|
-
* @see https://github.github.com/gfm/#table
|
|
15
|
-
* @see https://github.com/syntax-tree/mdast#tablerow
|
|
16
|
-
* @see https://github.com/syntax-tree/mdast#tablecell
|
|
17
|
-
*/
|
|
18
|
-
export declare const match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
19
|
-
/**
|
|
20
|
-
* Find delimiter row
|
|
21
|
-
*
|
|
22
|
-
* The delimiter row consists of cells whose only content are
|
|
23
|
-
* hyphens (-), and optionally, a leading or trailing colon (:),
|
|
24
|
-
* or both, to indicate left, right, or center alignment respectively.
|
|
25
|
-
* @see https://github.github.com/gfm/#delimiter-row
|
|
26
|
-
*/
|
package/lib/types/parse.d.ts
DELETED
package/lib/types/tokenizer.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IBlockTokenizer, IMatchBlockHookCreator, IParseBlockHookCreator } from '@yozora/core-tokenizer';
|
|
2
|
-
import { BaseBlockTokenizer } from '@yozora/core-tokenizer';
|
|
3
|
-
import type { INode, IThis, IToken, ITokenizerProps, T } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Lexical Analyzer for Table, table-row and table-cell.
|
|
6
|
-
* @see https://github.github.com/gfm/#table
|
|
7
|
-
* @see https://github.com/syntax-tree/mdast#tablerow
|
|
8
|
-
* @see https://github.com/syntax-tree/mdast#tablecell
|
|
9
|
-
*/
|
|
10
|
-
export declare class TableTokenizer extends BaseBlockTokenizer<T, IToken, INode, IThis> implements IBlockTokenizer<T, IToken, INode, IThis> {
|
|
11
|
-
constructor(props?: ITokenizerProps);
|
|
12
|
-
readonly match: IMatchBlockHookCreator<T, IToken, IThis>;
|
|
13
|
-
readonly parse: IParseBlockHookCreator<T, IToken, INode, IThis>;
|
|
14
|
-
}
|
package/lib/types/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Position, Table, TableCellType, TableColumn, TableRowType, TableType } from '@yozora/ast';
|
|
2
|
-
import type { IBaseBlockTokenizerProps, IPartialYastBlockToken, IPhrasingContentLine, ITokenizer } from '@yozora/core-tokenizer';
|
|
3
|
-
export declare type T = TableType;
|
|
4
|
-
export declare type INode = Table;
|
|
5
|
-
export declare const uniqueName = "@yozora/tokenizer-table";
|
|
6
|
-
export interface IToken extends IPartialYastBlockToken<TableType> {
|
|
7
|
-
/**
|
|
8
|
-
* Table column configuration items
|
|
9
|
-
*/
|
|
10
|
-
columns: TableColumn[];
|
|
11
|
-
/**
|
|
12
|
-
* Table rows
|
|
13
|
-
*/
|
|
14
|
-
rows: ITableRowToken[];
|
|
15
|
-
}
|
|
16
|
-
export declare type IThis = ITokenizer;
|
|
17
|
-
export declare type ITokenizerProps = Partial<IBaseBlockTokenizerProps>;
|
|
18
|
-
export interface ITableRowToken extends IPartialYastBlockToken<TableRowType> {
|
|
19
|
-
cells: ITableCellToken[];
|
|
20
|
-
}
|
|
21
|
-
export interface ITableCellToken extends IPartialYastBlockToken<TableCellType> {
|
|
22
|
-
position: Position;
|
|
23
|
-
lines: IPhrasingContentLine[];
|
|
24
|
-
}
|