版博士V2.0程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

25 righe
1.2 KiB

  1. import * as ts from 'typescript';
  2. export declare function endsControlFlow(statement: ts.Statement | ts.BlockLike, checker?: ts.TypeChecker): boolean;
  3. export declare type ControlFlowStatement = ts.BreakStatement | ts.ContinueStatement | ts.ReturnStatement | ts.ThrowStatement | ts.ExpressionStatement & {
  4. expression: ts.CallExpression;
  5. };
  6. export interface ControlFlowEnd {
  7. /**
  8. * Statements that may end control flow at this statement.
  9. * Does not contain control flow statements that jump only inside the statement, for example a `continue` inside a nested for loop.
  10. */
  11. readonly statements: ReadonlyArray<ControlFlowStatement>;
  12. /** `true` if control flow definitely ends. */
  13. readonly end: boolean;
  14. }
  15. export declare function getControlFlowEnd(statement: ts.Statement | ts.BlockLike, checker?: ts.TypeChecker): ControlFlowEnd;
  16. export declare enum SignatureEffect {
  17. Never = 1,
  18. Asserts = 2
  19. }
  20. /**
  21. * Dermines whether a top level CallExpression has a control flow effect according to TypeScript's rules.
  22. * This handles functions returning `never` and `asserts`.
  23. */
  24. export declare function callExpressionAffectsControlFlow(node: ts.CallExpression, checker: ts.TypeChecker): SignatureEffect | undefined;