Skip to content

Commit b2be8db

Browse files
committed
[*]Change d.ts bug
1 parent 4f9b6d2 commit b2be8db

2 files changed

Lines changed: 39 additions & 3 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "func-formula-parser",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "a AST parser for formula & formula function",
55
"main": "dist/index.js",
66
"types": "src/index.d.ts",
@@ -10,7 +10,8 @@
1010
"cover-test": "node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha",
1111
"build": "npm run lint && tsc",
1212
"lint": "tslint -c tslint.json -p tsconfig.json && eslint test/",
13-
"benchmark": "node test/benchmark/"
13+
"benchmark": "node test/benchmark/",
14+
"declaration": "tsc --declaration src/index.ts && git clean -f src/*.js && git clean -f src/*/*.d.ts"
1415
},
1516
"pre-commit": [
1617
"commit"

src/index.d.ts

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1-
export * from './';
1+
import { IFormulaOption } from './interfaces/common';
2+
import { INodeItem } from './interfaces/node';
3+
import { ITokenItem } from './interfaces/token';
4+
/**
5+
* 公式函数解析器
6+
* formula function parser
7+
*/
8+
declare class FuncFormulaParser {
9+
private option;
10+
private sourceFormula;
11+
private tokenArr;
12+
private nodeTree;
13+
constructor(customOpt?: IFormulaOption);
14+
/**
15+
* 创建令牌词法分析结果
16+
* @param {string} formula 公式字符串
17+
* @return {ITokenItem[]} 令牌流
18+
*/
19+
public setFormula(formula: string): ITokenItem[];
20+
/**
21+
* 编译当前令牌的语法节点
22+
* @return {INodeItem} 语法节点树
23+
*/
24+
public parseNode(): INodeItem;
25+
/**
26+
* 获取令牌词法分析结果
27+
* @return {ITokenItem[]} 令牌流
28+
*/
29+
public getTokens(): ITokenItem[];
30+
/**
31+
* 获取已经编译后的语法节点
32+
* @return {INodeItem} 语法节点树
33+
*/
34+
public getNodeTree(): INodeItem;
35+
}
36+
export default FuncFormulaParser;

0 commit comments

Comments
 (0)