From 7f75bb9dd8dcae461b4c6a91318317b1ba75781c Mon Sep 17 00:00:00 2001 From: Vladimir Trunin Date: Thu, 30 Nov 2017 19:50:13 +0300 Subject: [PATCH] added typings --- src/ISpeg.ts | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/ISpeg.ts diff --git a/src/ISpeg.ts b/src/ISpeg.ts new file mode 100644 index 0000000..f8431b9 --- /dev/null +++ b/src/ISpeg.ts @@ -0,0 +1,54 @@ +export interface ISpeg { + parser: { + parser: Function, + state: { + lastExpectations: [{ + position: number; + rule: string; + type: string; + }]; + position: number; + text: string; + }; + }; + speg_parser: { + action: string; + children: [{ + name: string; + parser: Function; + }] + end_position: number; + match: string; + start_position: number; + type: string; + }; + state: { + position: number; + text: string; + succesfullRules?: [{ + end_position: number; + match: string, + rule: string; + start_position: number; + text: string; + }]; + failedRules: [{ + rule: string + start_position: number + }]; + failedTags: string[]; + lastExpectations: [{ + position: number; + rule: string; + type: string; + }]; + rules: [{ + name: string; + parser: Function + }]; + }; + visitor: { + actions: {}; + }; +} +