Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. // Generated by dts-bundle v0.7.3
  2. declare module 'regexpp' {
  3. import * as AST from "regexpp/ast";
  4. import { RegExpParser } from "regexpp/parser";
  5. import { RegExpValidator } from "regexpp/validator";
  6. import { RegExpVisitor } from "regexpp/visitor";
  7. export { AST, RegExpParser, RegExpValidator };
  8. export function parseRegExpLiteral(source: string | RegExp, options?: RegExpParser.Options): AST.RegExpLiteral;
  9. export function validateRegExpLiteral(source: string, options?: RegExpValidator.Options): void;
  10. export function visitRegExpAST(node: AST.Node, handlers: RegExpVisitor.Handlers): void;
  11. }
  12. declare module 'regexpp/ast' {
  13. export type Node = BranchNode | LeafNode;
  14. export type BranchNode = RegExpLiteral | Pattern | Alternative | Group | CapturingGroup | Quantifier | CharacterClass | LookaroundAssertion | CharacterClassRange;
  15. export type LeafNode = BoundaryAssertion | CharacterSet | Character | Backreference | Flags;
  16. export type Element = Assertion | Quantifier | QuantifiableElement;
  17. export type QuantifiableElement = Group | CapturingGroup | CharacterClass | CharacterSet | Character | Backreference | LookaheadAssertion;
  18. export type CharacterClassElement = EscapeCharacterSet | UnicodePropertyCharacterSet | Character | CharacterClassRange;
  19. export interface NodeBase {
  20. type: Node["type"];
  21. parent: Node["parent"];
  22. start: number;
  23. end: number;
  24. raw: string;
  25. }
  26. export interface RegExpLiteral extends NodeBase {
  27. type: "RegExpLiteral";
  28. parent: null;
  29. pattern: Pattern;
  30. flags: Flags;
  31. }
  32. export interface Pattern extends NodeBase {
  33. type: "Pattern";
  34. parent: RegExpLiteral | null;
  35. alternatives: Alternative[];
  36. }
  37. export interface Alternative extends NodeBase {
  38. type: "Alternative";
  39. parent: Pattern | Group | CapturingGroup | LookaroundAssertion;
  40. elements: Element[];
  41. }
  42. export interface Group extends NodeBase {
  43. type: "Group";
  44. parent: Alternative | Quantifier;
  45. alternatives: Alternative[];
  46. }
  47. export interface CapturingGroup extends NodeBase {
  48. type: "CapturingGroup";
  49. parent: Alternative | Quantifier;
  50. name: string | null;
  51. alternatives: Alternative[];
  52. references: Backreference[];
  53. }
  54. export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion;
  55. export interface LookaheadAssertion extends NodeBase {
  56. type: "Assertion";
  57. parent: Alternative | Quantifier;
  58. kind: "lookahead";
  59. negate: boolean;
  60. alternatives: Alternative[];
  61. }
  62. export interface LookbehindAssertion extends NodeBase {
  63. type: "Assertion";
  64. parent: Alternative;
  65. kind: "lookbehind";
  66. negate: boolean;
  67. alternatives: Alternative[];
  68. }
  69. export interface Quantifier extends NodeBase {
  70. type: "Quantifier";
  71. parent: Alternative;
  72. min: number;
  73. max: number;
  74. greedy: boolean;
  75. element: QuantifiableElement;
  76. }
  77. export interface CharacterClass extends NodeBase {
  78. type: "CharacterClass";
  79. parent: Alternative | Quantifier;
  80. negate: boolean;
  81. elements: CharacterClassElement[];
  82. }
  83. export interface CharacterClassRange extends NodeBase {
  84. type: "CharacterClassRange";
  85. parent: CharacterClass;
  86. min: Character;
  87. max: Character;
  88. }
  89. export type Assertion = BoundaryAssertion | LookaroundAssertion;
  90. export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion;
  91. export interface EdgeAssertion extends NodeBase {
  92. type: "Assertion";
  93. parent: Alternative | Quantifier;
  94. kind: "start" | "end";
  95. }
  96. export interface WordBoundaryAssertion extends NodeBase {
  97. type: "Assertion";
  98. parent: Alternative | Quantifier;
  99. kind: "word";
  100. negate: boolean;
  101. }
  102. export type CharacterSet = AnyCharacterSet | EscapeCharacterSet | UnicodePropertyCharacterSet;
  103. export interface AnyCharacterSet extends NodeBase {
  104. type: "CharacterSet";
  105. parent: Alternative | Quantifier;
  106. kind: "any";
  107. }
  108. export interface EscapeCharacterSet extends NodeBase {
  109. type: "CharacterSet";
  110. parent: Alternative | Quantifier | CharacterClass;
  111. kind: "digit" | "space" | "word";
  112. negate: boolean;
  113. }
  114. export interface UnicodePropertyCharacterSet extends NodeBase {
  115. type: "CharacterSet";
  116. parent: Alternative | Quantifier | CharacterClass;
  117. kind: "property";
  118. key: string;
  119. value: string | null;
  120. negate: boolean;
  121. }
  122. export interface Character extends NodeBase {
  123. type: "Character";
  124. parent: Alternative | Quantifier | CharacterClass | CharacterClassRange;
  125. value: number;
  126. }
  127. export interface Backreference extends NodeBase {
  128. type: "Backreference";
  129. parent: Alternative | Quantifier;
  130. ref: number | string;
  131. resolved: CapturingGroup;
  132. }
  133. export interface Flags extends NodeBase {
  134. type: "Flags";
  135. parent: RegExpLiteral | null;
  136. dotAll: boolean;
  137. global: boolean;
  138. ignoreCase: boolean;
  139. multiline: boolean;
  140. sticky: boolean;
  141. unicode: boolean;
  142. }
  143. }
  144. declare module 'regexpp/parser' {
  145. import { Flags, RegExpLiteral, Pattern } from "regexpp/ast";
  146. export namespace RegExpParser {
  147. interface Options {
  148. strict?: boolean;
  149. ecmaVersion?: 5 | 2015 | 2016 | 2017 | 2018;
  150. }
  151. }
  152. export class RegExpParser {
  153. constructor(options?: RegExpParser.Options);
  154. parseLiteral(source: string, start?: number, end?: number): RegExpLiteral;
  155. parseFlags(source: string, start?: number, end?: number): Flags;
  156. parsePattern(source: string, start?: number, end?: number, uFlag?: boolean): Pattern;
  157. }
  158. }
  159. declare module 'regexpp/validator' {
  160. export namespace RegExpValidator {
  161. interface Options {
  162. strict?: boolean;
  163. ecmaVersion?: 5 | 2015 | 2016 | 2017 | 2018;
  164. onLiteralEnter?(start: number): void;
  165. onLiteralLeave?(start: number, end: number): void;
  166. onFlags?(start: number, end: number, global: boolean, ignoreCase: boolean, multiline: boolean, unicode: boolean, sticky: boolean, dotAll: boolean): void;
  167. onPatternEnter?(start: number): void;
  168. onPatternLeave?(start: number, end: number): void;
  169. onDisjunctionEnter?(start: number): void;
  170. onDisjunctionLeave?(start: number, end: number): void;
  171. onAlternativeEnter?(start: number, index: number): void;
  172. onAlternativeLeave?(start: number, end: number, index: number): void;
  173. onGroupEnter?(start: number): void;
  174. onGroupLeave?(start: number, end: number): void;
  175. onCapturingGroupEnter?(start: number, name: string | null): void;
  176. onCapturingGroupLeave?(start: number, end: number, name: string | null): void;
  177. onQuantifier?(start: number, end: number, min: number, max: number, greedy: boolean): void;
  178. onLookaroundAssertionEnter?(start: number, kind: "lookahead" | "lookbehind", negate: boolean): void;
  179. onLookaroundAssertionLeave?(start: number, end: number, kind: "lookahead" | "lookbehind", negate: boolean): void;
  180. onEdgeAssertion?(start: number, end: number, kind: "start" | "end"): void;
  181. onWordBoundaryAssertion?(start: number, end: number, kind: "word", negate: boolean): void;
  182. onAnyCharacterSet?(start: number, end: number, kind: "any"): void;
  183. onEscapeCharacterSet?(start: number, end: number, kind: "digit" | "space" | "word", negate: boolean): void;
  184. onUnicodePropertyCharacterSet?(start: number, end: number, kind: "property", key: string, value: string | null, negate: boolean): void;
  185. onCharacter?(start: number, end: number, value: number): void;
  186. onBackreference?(start: number, end: number, ref: number | string): void;
  187. onCharacterClassEnter?(start: number, negate: boolean): void;
  188. onCharacterClassLeave?(start: number, end: number, negate: boolean): void;
  189. onCharacterClassRange?(start: number, end: number, min: number, max: number): void;
  190. }
  191. }
  192. export class RegExpValidator {
  193. constructor(options?: RegExpValidator.Options);
  194. validateLiteral(source: string, start?: number, end?: number): void;
  195. validateFlags(source: string, start?: number, end?: number): void;
  196. validatePattern(source: string, start?: number, end?: number, uFlag?: boolean): void;
  197. }
  198. }
  199. declare module 'regexpp/visitor' {
  200. import { Alternative, Assertion, Backreference, CapturingGroup, Character, CharacterClass, CharacterClassRange, CharacterSet, Flags, Group, Node, Pattern, Quantifier, RegExpLiteral } from "regexpp/ast";
  201. export class RegExpVisitor {
  202. constructor(handlers: RegExpVisitor.Handlers);
  203. visit(node: Node): void;
  204. }
  205. export namespace RegExpVisitor {
  206. interface Handlers {
  207. onAlternativeEnter?(node: Alternative): void;
  208. onAlternativeLeave?(node: Alternative): void;
  209. onAssertionEnter?(node: Assertion): void;
  210. onAssertionLeave?(node: Assertion): void;
  211. onBackreferenceEnter?(node: Backreference): void;
  212. onBackreferenceLeave?(node: Backreference): void;
  213. onCapturingGroupEnter?(node: CapturingGroup): void;
  214. onCapturingGroupLeave?(node: CapturingGroup): void;
  215. onCharacterEnter?(node: Character): void;
  216. onCharacterLeave?(node: Character): void;
  217. onCharacterClassEnter?(node: CharacterClass): void;
  218. onCharacterClassLeave?(node: CharacterClass): void;
  219. onCharacterClassRangeEnter?(node: CharacterClassRange): void;
  220. onCharacterClassRangeLeave?(node: CharacterClassRange): void;
  221. onCharacterSetEnter?(node: CharacterSet): void;
  222. onCharacterSetLeave?(node: CharacterSet): void;
  223. onFlagsEnter?(node: Flags): void;
  224. onFlagsLeave?(node: Flags): void;
  225. onGroupEnter?(node: Group): void;
  226. onGroupLeave?(node: Group): void;
  227. onPatternEnter?(node: Pattern): void;
  228. onPatternLeave?(node: Pattern): void;
  229. onQuantifierEnter?(node: Quantifier): void;
  230. onQuantifierLeave?(node: Quantifier): void;
  231. onRegExpLiteralEnter?(node: RegExpLiteral): void;
  232. onRegExpLiteralLeave?(node: RegExpLiteral): void;
  233. }
  234. }
  235. }