Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

babel-parser.d.ts 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. // Type definitions for @babel/parser
  2. // Project: https://github.com/babel/babel/tree/main/packages/babel-parser
  3. // Definitions by: Troy Gerwien <https://github.com/yortus>
  4. // Marvin Hagemeister <https://github.com/marvinhagemeister>
  5. // Avi Vahl <https://github.com/AviVahl>
  6. // TypeScript Version: 2.9
  7. /**
  8. * Parse the provided code as an entire ECMAScript program.
  9. */
  10. export function parse(
  11. input: string,
  12. options?: ParserOptions
  13. ): import("@babel/types").File;
  14. /**
  15. * Parse the provided code as a single expression.
  16. */
  17. export function parseExpression(
  18. input: string,
  19. options?: ParserOptions
  20. ): import("@babel/types").Expression;
  21. export interface ParserOptions {
  22. /**
  23. * By default, import and export declarations can only appear at a program's top level.
  24. * Setting this option to true allows them anywhere where a statement is allowed.
  25. */
  26. allowImportExportEverywhere?: boolean;
  27. /**
  28. * By default, await use is not allowed outside of an async function.
  29. * Set this to true to accept such code.
  30. */
  31. allowAwaitOutsideFunction?: boolean;
  32. /**
  33. * By default, a return statement at the top level raises an error.
  34. * Set this to true to accept such code.
  35. */
  36. allowReturnOutsideFunction?: boolean;
  37. allowSuperOutsideMethod?: boolean;
  38. /**
  39. * By default, exported identifiers must refer to a declared variable.
  40. * Set this to true to allow export statements to reference undeclared variables.
  41. */
  42. allowUndeclaredExports?: boolean;
  43. /**
  44. * By default, Babel always throws an error when it finds some invalid code.
  45. * When this option is set to true, it will store the parsing error and
  46. * try to continue parsing the invalid input file.
  47. */
  48. errorRecovery?: boolean;
  49. /**
  50. * Indicate the mode the code should be parsed in.
  51. * Can be one of "script", "module", or "unambiguous". Defaults to "script".
  52. * "unambiguous" will make @babel/parser attempt to guess, based on the presence
  53. * of ES6 import or export statements.
  54. * Files with ES6 imports and exports are considered "module" and are otherwise "script".
  55. */
  56. sourceType?: "script" | "module" | "unambiguous";
  57. /**
  58. * Correlate output AST nodes with their source filename.
  59. * Useful when generating code and source maps from the ASTs of multiple input files.
  60. */
  61. sourceFilename?: string;
  62. /**
  63. * By default, the first line of code parsed is treated as line 1.
  64. * You can provide a line number to alternatively start with.
  65. * Useful for integration with other source tools.
  66. */
  67. startLine?: number;
  68. /**
  69. * Array containing the plugins that you want to enable.
  70. */
  71. plugins?: ParserPlugin[];
  72. /**
  73. * Should the parser work in strict mode.
  74. * Defaults to true if sourceType === 'module'. Otherwise, false.
  75. */
  76. strictMode?: boolean;
  77. /**
  78. * Adds a ranges property to each node: [node.start, node.end]
  79. */
  80. ranges?: boolean;
  81. /**
  82. * Adds all parsed tokens to a tokens property on the File node.
  83. */
  84. tokens?: boolean;
  85. /**
  86. * By default, the parser adds information about parentheses by setting
  87. * `extra.parenthesized` to `true` as needed.
  88. * When this option is `true` the parser creates `ParenthesizedExpression`
  89. * AST nodes instead of using the `extra` property.
  90. */
  91. createParenthesizedExpressions?: boolean;
  92. }
  93. export type ParserPlugin =
  94. | "asyncDoExpressions"
  95. | "asyncGenerators"
  96. | "bigInt"
  97. | "classPrivateMethods"
  98. | "classPrivateProperties"
  99. | "classProperties"
  100. | "classStaticBlock"
  101. | "decimal"
  102. | "decorators"
  103. | "decorators-legacy"
  104. | "doExpressions"
  105. | "dynamicImport"
  106. | "estree"
  107. | "exportDefaultFrom"
  108. | "exportNamespaceFrom" // deprecated
  109. | "flow"
  110. | "flowComments"
  111. | "functionBind"
  112. | "functionSent"
  113. | "importMeta"
  114. | "jsx"
  115. | "logicalAssignment"
  116. | "importAssertions"
  117. | "moduleStringNames"
  118. | "nullishCoalescingOperator"
  119. | "numericSeparator"
  120. | "objectRestSpread"
  121. | "optionalCatchBinding"
  122. | "optionalChaining"
  123. | "partialApplication"
  124. | "pipelineOperator"
  125. | "placeholders"
  126. | "privateIn"
  127. | "throwExpressions"
  128. | "topLevelAwait"
  129. | "typescript"
  130. | "v8intrinsic"
  131. | ParserPluginWithOptions;
  132. export type ParserPluginWithOptions =
  133. | ["decorators", DecoratorsPluginOptions]
  134. | ["pipelineOperator", PipelineOperatorPluginOptions]
  135. | ["recordAndTuple", RecordAndTuplePluginOptions]
  136. | ["flow", FlowPluginOptions];
  137. export interface DecoratorsPluginOptions {
  138. decoratorsBeforeExport?: boolean;
  139. }
  140. export interface PipelineOperatorPluginOptions {
  141. proposal: "fsharp" | "minimal" | "smart";
  142. }
  143. export interface RecordAndTuplePluginOptions {
  144. syntaxType: "bar" | "hash";
  145. }
  146. export interface FlowPluginOptions {
  147. all?: boolean;
  148. }
  149. export const tokTypes: {
  150. // todo(flow->ts) real token type
  151. [name: string]: any;
  152. };