ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
26 lines (25 loc) • 868 B
TypeScript
import * as ts from "typescript";
import { Constructor } from "./../../Constructor";
import { Node } from "./../common";
import { ModifierableNode } from "./ModifierableNode";
export declare type AsyncableNodeExtensionType = Node & ModifierableNode;
export interface AsyncableNode {
/**
* If it's async.
*/
isAsync(): boolean;
/**
* Gets the async keyword or undefined if none exists.
*/
getAsyncKeyword(): Node<ts.Modifier> | undefined;
/**
* Gets the async keyword or throws if none exists.
*/
getAsyncKeywordOrThrow(): Node<ts.Modifier>;
/**
* Sets if the node is async.
* @param value - If it should be async or not.
*/
setIsAsync(value: boolean): this;
}
export declare function AsyncableNode<T extends Constructor<AsyncableNodeExtensionType>>(Base: T): Constructor<AsyncableNode> & T;