diff --git a/_packages/native-preview/src/api/async/api.ts b/_packages/native-preview/src/api/async/api.ts index d0f258c2eb9..e768e7e71ff 100644 --- a/_packages/native-preview/src/api/async/api.ts +++ b/_packages/native-preview/src/api/async/api.ts @@ -13,8 +13,10 @@ import { TypeFlags } from "#enums/typeFlags"; import { TypePredicateKind } from "#enums/typePredicateKind"; import { type __String, + type Declaration, type Expression, type Identifier, + type IndexSignatureDeclaration, ModifierFlags, type Node, type Path, @@ -696,7 +698,7 @@ class ProjectObjectRegistry { keyType: this.getOrCreateType(info.keyType), valueType: this.getOrCreateType(info.valueType), isReadonly: info.isReadonly ?? false, - declaration: info.declaration ? new NodeHandle(info.declaration, this.project) : undefined, + declaration: info.declaration ? new NodeHandle(info.declaration, this.project) : undefined, })); } @@ -1876,7 +1878,7 @@ export class Emitter { } } -export class NodeHandle { +export class NodeHandle { /** * The project this handle was produced in, used as the default for {@link resolve}. * Node handles are only meaningful within a project's program, so the producing project @@ -1900,12 +1902,12 @@ export class NodeHandle { * and looking up the node by index. If no project is passed, the project that produced * the handle is used. */ - async resolve(project: Project = this.canonicalProject): Promise { + async resolve(project: Project = this.canonicalProject): Promise { const sourceFile = await project.program.getSourceFile(this.path); if (!sourceFile) { return undefined; } - return (sourceFile as unknown as RemoteSourceFile).getOrCreateNodeAtIndex(this.index); + return (sourceFile as unknown as RemoteSourceFile).getOrCreateNodeAtIndex(this.index) as T | undefined; } } @@ -1943,8 +1945,8 @@ export class Symbol { readonly name: string; readonly flags: SymbolFlags; readonly checkFlags: CheckFlags; - readonly declarations: readonly NodeHandle[]; - readonly valueDeclaration: NodeHandle | undefined; + readonly declarations: readonly NodeHandle[]; + readonly valueDeclaration: NodeHandle | undefined; private readonly parent!: number; private readonly exportSymbol!: number; private membersCache: Promise> | undefined; @@ -1963,8 +1965,8 @@ export class Symbol { throw new Error(`Symbol ${data.id} references unknown canonical project '${data.project}'`); } this.canonicalProject = canonicalProject; - this.declarations = (data.declarations ?? []).map(d => new NodeHandle(d, canonicalProject)); - this.valueDeclaration = data.valueDeclaration ? new NodeHandle(data.valueDeclaration, canonicalProject) : undefined; + this.declarations = (data.declarations ?? []).map(d => new NodeHandle(d, canonicalProject)); + this.valueDeclaration = data.valueDeclaration ? new NodeHandle(data.valueDeclaration, canonicalProject) : undefined; if (data.parent !== undefined) this.parent = data.parent; if (data.exportSymbol !== undefined) this.exportSymbol = data.exportSymbol; @@ -2469,7 +2471,7 @@ export class Signature { private objectRegistry: ProjectObjectRegistry; readonly id: number; - readonly declaration?: NodeHandle | undefined; + readonly declaration?: NodeHandle | undefined; readonly typeParameters?: readonly number[] | undefined; readonly parameters: readonly number[]; readonly thisParameter?: number | undefined; @@ -2480,7 +2482,7 @@ export class Signature { this.id = data.id; this.flags = data.flags; this.objectRegistry = objectRegistry; - this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined; + this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined; this.typeParameters = data.typeParameters ?? []; this.parameters = data.parameters ?? []; this.thisParameter = data.thisParameter; diff --git a/_packages/native-preview/src/api/async/types.ts b/_packages/native-preview/src/api/async/types.ts index 69a8f760e7a..8204e09f86b 100644 --- a/_packages/native-preview/src/api/async/types.ts +++ b/_packages/native-preview/src/api/async/types.ts @@ -3,6 +3,7 @@ import type { ElementFlags } from "#enums/elementFlags"; import type { ObjectFlags } from "#enums/objectFlags"; import type { TypeFlags } from "#enums/typeFlags"; import type { TypePredicateKind } from "#enums/typePredicateKind"; +import type { IndexSignatureDeclaration } from "../../ast/ast.ts"; import type { Diagnostic } from "../proto.ts"; import type { NodeHandle, @@ -319,7 +320,7 @@ export interface IndexInfo { /** Whether the index signature is readonly */ readonly isReadonly: boolean; /** The index signature declaration, if any */ - readonly declaration?: NodeHandle | undefined; + readonly declaration?: NodeHandle | undefined; } /** diff --git a/_packages/native-preview/src/api/sync/api.ts b/_packages/native-preview/src/api/sync/api.ts index 6a4bd88af4a..fc0783018ae 100644 --- a/_packages/native-preview/src/api/sync/api.ts +++ b/_packages/native-preview/src/api/sync/api.ts @@ -21,8 +21,10 @@ import { TypeFlags } from "#enums/typeFlags"; import { TypePredicateKind } from "#enums/typePredicateKind"; import { type __String, + type Declaration, type Expression, type Identifier, + type IndexSignatureDeclaration, ModifierFlags, type Node, type Path, @@ -704,7 +706,7 @@ class ProjectObjectRegistry { keyType: this.getOrCreateType(info.keyType), valueType: this.getOrCreateType(info.valueType), isReadonly: info.isReadonly ?? false, - declaration: info.declaration ? new NodeHandle(info.declaration, this.project) : undefined, + declaration: info.declaration ? new NodeHandle(info.declaration, this.project) : undefined, })); } @@ -1884,7 +1886,7 @@ export class Emitter { } } -export class NodeHandle { +export class NodeHandle { /** * The project this handle was produced in, used as the default for {@link resolve}. * Node handles are only meaningful within a project's program, so the producing project @@ -1908,12 +1910,12 @@ export class NodeHandle { * and looking up the node by index. If no project is passed, the project that produced * the handle is used. */ - resolve(project: Project = this.canonicalProject): Node | undefined { + resolve(project: Project = this.canonicalProject): T | undefined { const sourceFile = project.program.getSourceFile(this.path); if (!sourceFile) { return undefined; } - return (sourceFile as unknown as RemoteSourceFile).getOrCreateNodeAtIndex(this.index); + return (sourceFile as unknown as RemoteSourceFile).getOrCreateNodeAtIndex(this.index) as T | undefined; } } @@ -1951,8 +1953,8 @@ export class Symbol { readonly name: string; readonly flags: SymbolFlags; readonly checkFlags: CheckFlags; - readonly declarations: readonly NodeHandle[]; - readonly valueDeclaration: NodeHandle | undefined; + readonly declarations: readonly NodeHandle[]; + readonly valueDeclaration: NodeHandle | undefined; private readonly parent!: number; private readonly exportSymbol!: number; private membersCache: ReadonlyMap<__String, Symbol> | undefined; @@ -1971,8 +1973,8 @@ export class Symbol { throw new Error(`Symbol ${data.id} references unknown canonical project '${data.project}'`); } this.canonicalProject = canonicalProject; - this.declarations = (data.declarations ?? []).map(d => new NodeHandle(d, canonicalProject)); - this.valueDeclaration = data.valueDeclaration ? new NodeHandle(data.valueDeclaration, canonicalProject) : undefined; + this.declarations = (data.declarations ?? []).map(d => new NodeHandle(d, canonicalProject)); + this.valueDeclaration = data.valueDeclaration ? new NodeHandle(data.valueDeclaration, canonicalProject) : undefined; if (data.parent !== undefined) this.parent = data.parent; if (data.exportSymbol !== undefined) this.exportSymbol = data.exportSymbol; @@ -2477,7 +2479,7 @@ export class Signature { private objectRegistry: ProjectObjectRegistry; readonly id: number; - readonly declaration?: NodeHandle | undefined; + readonly declaration?: NodeHandle | undefined; readonly typeParameters?: readonly number[] | undefined; readonly parameters: readonly number[]; readonly thisParameter?: number | undefined; @@ -2488,7 +2490,7 @@ export class Signature { this.id = data.id; this.flags = data.flags; this.objectRegistry = objectRegistry; - this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined; + this.declaration = data.declaration ? new NodeHandle(data.declaration, project) : undefined; this.typeParameters = data.typeParameters ?? []; this.parameters = data.parameters ?? []; this.thisParameter = data.thisParameter; diff --git a/_packages/native-preview/src/api/sync/types.ts b/_packages/native-preview/src/api/sync/types.ts index d9d9e500819..622930fe9d1 100644 --- a/_packages/native-preview/src/api/sync/types.ts +++ b/_packages/native-preview/src/api/sync/types.ts @@ -11,6 +11,7 @@ import type { ElementFlags } from "#enums/elementFlags"; import type { ObjectFlags } from "#enums/objectFlags"; import type { TypeFlags } from "#enums/typeFlags"; import type { TypePredicateKind } from "#enums/typePredicateKind"; +import type { IndexSignatureDeclaration } from "../../ast/ast.ts"; import type { Diagnostic } from "../proto.ts"; import type { NodeHandle, @@ -327,7 +328,7 @@ export interface IndexInfo { /** Whether the index signature is readonly */ readonly isReadonly: boolean; /** The index signature declaration, if any */ - readonly declaration?: NodeHandle | undefined; + readonly declaration?: NodeHandle | undefined; } /** diff --git a/_packages/native-preview/src/ast/is.generated.ts b/_packages/native-preview/src/ast/is.generated.ts index 44370944c56..5cd47656956 100644 --- a/_packages/native-preview/src/ast/is.generated.ts +++ b/_packages/native-preview/src/ast/is.generated.ts @@ -1,6 +1,8 @@ // Code generated by _scripts/generate-ts-ast.ts. DO NOT EDIT. import { SyntaxKind } from "#enums/syntaxKind"; +import type { NodeHandle as AsyncNodeHandle } from "../api/async/api.ts"; +import type { NodeHandle as SyncNodeHandle } from "../api/sync/api.ts"; import type { AbstractKeyword, AccessExpression, @@ -326,147 +328,324 @@ import type { WithStatement, YieldExpression, } from "./ast.ts"; +type NodeHandleLike = { kind: SyntaxKind; resolve(...args: any): any; }; +type SpecializeNodeHandle, U extends Node> = T extends AsyncNodeHandle ? AsyncNodeHandle & T : SyncNodeHandle & T; export function isToken(node: Node): node is Token { return isTokenKind(node.kind); } +export declare namespace isToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isToken.Handle = isToken as any; + export function isIdentifier(node: Node): node is Identifier { return node.kind === SyntaxKind.Identifier; } +export declare namespace isIdentifier { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isIdentifier.Handle = isIdentifier as any; + export function isPrivateIdentifier(node: Node): node is PrivateIdentifier { return node.kind === SyntaxKind.PrivateIdentifier; } +export declare namespace isPrivateIdentifier { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPrivateIdentifier.Handle = isPrivateIdentifier as any; + export function isQualifiedName(node: Node): node is QualifiedName { return node.kind === SyntaxKind.QualifiedName; } +export declare namespace isQualifiedName { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isQualifiedName.Handle = isQualifiedName as any; + export function isComputedPropertyName(node: Node): node is ComputedPropertyName { return node.kind === SyntaxKind.ComputedPropertyName; } +export declare namespace isComputedPropertyName { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isComputedPropertyName.Handle = isComputedPropertyName as any; + export function isDecorator(node: Node): node is Decorator { return node.kind === SyntaxKind.Decorator; } +export declare namespace isDecorator { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isDecorator.Handle = isDecorator as any; + export function isEmptyStatement(node: Node): node is EmptyStatement { return node.kind === SyntaxKind.EmptyStatement; } +export declare namespace isEmptyStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isEmptyStatement.Handle = isEmptyStatement as any; + export function isIfStatement(node: Node): node is IfStatement { return node.kind === SyntaxKind.IfStatement; } +export declare namespace isIfStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isIfStatement.Handle = isIfStatement as any; + export function isDoStatement(node: Node): node is DoStatement { return node.kind === SyntaxKind.DoStatement; } +export declare namespace isDoStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isDoStatement.Handle = isDoStatement as any; + export function isWhileStatement(node: Node): node is WhileStatement { return node.kind === SyntaxKind.WhileStatement; } +export declare namespace isWhileStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isWhileStatement.Handle = isWhileStatement as any; + export function isForStatement(node: Node): node is ForStatement { return node.kind === SyntaxKind.ForStatement; } +export declare namespace isForStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isForStatement.Handle = isForStatement as any; + export function isBreakStatement(node: Node): node is BreakStatement { return node.kind === SyntaxKind.BreakStatement; } +export declare namespace isBreakStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isBreakStatement.Handle = isBreakStatement as any; + export function isContinueStatement(node: Node): node is ContinueStatement { return node.kind === SyntaxKind.ContinueStatement; } +export declare namespace isContinueStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isContinueStatement.Handle = isContinueStatement as any; + export function isReturnStatement(node: Node): node is ReturnStatement { return node.kind === SyntaxKind.ReturnStatement; } +export declare namespace isReturnStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isReturnStatement.Handle = isReturnStatement as any; + export function isWithStatement(node: Node): node is WithStatement { return node.kind === SyntaxKind.WithStatement; } +export declare namespace isWithStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isWithStatement.Handle = isWithStatement as any; + export function isSwitchStatement(node: Node): node is SwitchStatement { return node.kind === SyntaxKind.SwitchStatement; } +export declare namespace isSwitchStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSwitchStatement.Handle = isSwitchStatement as any; + export function isCaseBlock(node: Node): node is CaseBlock { return node.kind === SyntaxKind.CaseBlock; } +export declare namespace isCaseBlock { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isCaseBlock.Handle = isCaseBlock as any; + export function isThrowStatement(node: Node): node is ThrowStatement { return node.kind === SyntaxKind.ThrowStatement; } +export declare namespace isThrowStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isThrowStatement.Handle = isThrowStatement as any; + export function isTryStatement(node: Node): node is TryStatement { return node.kind === SyntaxKind.TryStatement; } +export declare namespace isTryStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTryStatement.Handle = isTryStatement as any; + export function isCatchClause(node: Node): node is CatchClause { return node.kind === SyntaxKind.CatchClause; } +export declare namespace isCatchClause { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isCatchClause.Handle = isCatchClause as any; + export function isDebuggerStatement(node: Node): node is DebuggerStatement { return node.kind === SyntaxKind.DebuggerStatement; } +export declare namespace isDebuggerStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isDebuggerStatement.Handle = isDebuggerStatement as any; + export function isLabeledStatement(node: Node): node is LabeledStatement { return node.kind === SyntaxKind.LabeledStatement; } +export declare namespace isLabeledStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isLabeledStatement.Handle = isLabeledStatement as any; + export function isExpressionStatement(node: Node): node is ExpressionStatement { return node.kind === SyntaxKind.ExpressionStatement; } +export declare namespace isExpressionStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExpressionStatement.Handle = isExpressionStatement as any; + export function isBlock(node: Node): node is Block { return node.kind === SyntaxKind.Block; } +export declare namespace isBlock { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isBlock.Handle = isBlock as any; + export function isVariableStatement(node: Node): node is VariableStatement { return node.kind === SyntaxKind.VariableStatement; } +export declare namespace isVariableStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isVariableStatement.Handle = isVariableStatement as any; + export function isVariableDeclaration(node: Node): node is VariableDeclaration { return node.kind === SyntaxKind.VariableDeclaration; } +export declare namespace isVariableDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isVariableDeclaration.Handle = isVariableDeclaration as any; + export function isVariableDeclarationList(node: Node): node is VariableDeclarationList { return node.kind === SyntaxKind.VariableDeclarationList; } +export declare namespace isVariableDeclarationList { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isVariableDeclarationList.Handle = isVariableDeclarationList as any; + export function isParameterDeclaration(node: Node): node is ParameterDeclaration { return node.kind === SyntaxKind.Parameter; } +export declare namespace isParameterDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isParameterDeclaration.Handle = isParameterDeclaration as any; + export function isBindingElement(node: Node): node is BindingElement { return node.kind === SyntaxKind.BindingElement; } +export declare namespace isBindingElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isBindingElement.Handle = isBindingElement as any; + export function isMissingDeclaration(node: Node): node is MissingDeclaration { return node.kind === SyntaxKind.MissingDeclaration; } +export declare namespace isMissingDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isMissingDeclaration.Handle = isMissingDeclaration as any; + export function isFunctionDeclaration(node: Node): node is FunctionDeclaration { return node.kind === SyntaxKind.FunctionDeclaration; } +export declare namespace isFunctionDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isFunctionDeclaration.Handle = isFunctionDeclaration as any; + export function isClassDeclaration(node: Node): node is ClassDeclaration { return node.kind === SyntaxKind.ClassDeclaration; } +export declare namespace isClassDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isClassDeclaration.Handle = isClassDeclaration as any; + export function isClassExpression(node: Node): node is ClassExpression { return node.kind === SyntaxKind.ClassExpression; } +export declare namespace isClassExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isClassExpression.Handle = isClassExpression as any; + export function isHeritageClause(node: Node): node is HeritageClause { return node.kind === SyntaxKind.HeritageClause; } +export declare namespace isHeritageClause { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isHeritageClause.Handle = isHeritageClause as any; + export function isInterfaceDeclaration(node: Node): node is InterfaceDeclaration { return node.kind === SyntaxKind.InterfaceDeclaration; } +export declare namespace isInterfaceDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isInterfaceDeclaration.Handle = isInterfaceDeclaration as any; + export function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration { switch (node.kind) { case SyntaxKind.TypeAliasDeclaration: @@ -477,26 +656,56 @@ export function isTypeAliasDeclaration(node: Node): node is TypeAliasDeclaration } } +export declare namespace isTypeAliasDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeAliasDeclaration.Handle = isTypeAliasDeclaration as any; + export function isEnumMember(node: Node): node is EnumMember { return node.kind === SyntaxKind.EnumMember; } +export declare namespace isEnumMember { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isEnumMember.Handle = isEnumMember as any; + export function isEnumDeclaration(node: Node): node is EnumDeclaration { return node.kind === SyntaxKind.EnumDeclaration; } +export declare namespace isEnumDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isEnumDeclaration.Handle = isEnumDeclaration as any; + export function isModuleBlock(node: Node): node is ModuleBlock { return node.kind === SyntaxKind.ModuleBlock; } +export declare namespace isModuleBlock { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isModuleBlock.Handle = isModuleBlock as any; + export function isNotEmittedStatement(node: Node): node is NotEmittedStatement { return node.kind === SyntaxKind.NotEmittedStatement; } +export declare namespace isNotEmittedStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNotEmittedStatement.Handle = isNotEmittedStatement as any; + export function isNotEmittedTypeElement(node: Node): node is NotEmittedTypeElement { return node.kind === SyntaxKind.NotEmittedTypeElement; } +export declare namespace isNotEmittedTypeElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNotEmittedTypeElement.Handle = isNotEmittedTypeElement as any; + export function isImportDeclaration(node: Node): node is ImportDeclaration { switch (node.kind) { case SyntaxKind.ImportDeclaration: @@ -507,872 +716,1995 @@ export function isImportDeclaration(node: Node): node is ImportDeclaration { } } +export declare namespace isImportDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportDeclaration.Handle = isImportDeclaration as any; + export function isExternalModuleReference(node: Node): node is ExternalModuleReference { return node.kind === SyntaxKind.ExternalModuleReference; } +export declare namespace isExternalModuleReference { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExternalModuleReference.Handle = isExternalModuleReference as any; + export function isNamespaceImport(node: Node): node is NamespaceImport { return node.kind === SyntaxKind.NamespaceImport; } +export declare namespace isNamespaceImport { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamespaceImport.Handle = isNamespaceImport as any; + export function isNamedImports(node: Node): node is NamedImports { return node.kind === SyntaxKind.NamedImports; } +export declare namespace isNamedImports { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamedImports.Handle = isNamedImports as any; + export function isExportAssignment(node: Node): node is ExportAssignment { return node.kind === SyntaxKind.ExportAssignment; } +export declare namespace isExportAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExportAssignment.Handle = isExportAssignment as any; + export function isNamespaceExportDeclaration(node: Node): node is NamespaceExportDeclaration { return node.kind === SyntaxKind.NamespaceExportDeclaration; } +export declare namespace isNamespaceExportDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamespaceExportDeclaration.Handle = isNamespaceExportDeclaration as any; + export function isNamespaceExport(node: Node): node is NamespaceExport { return node.kind === SyntaxKind.NamespaceExport; } +export declare namespace isNamespaceExport { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamespaceExport.Handle = isNamespaceExport as any; + export function isNamedExports(node: Node): node is NamedExports { return node.kind === SyntaxKind.NamedExports; } +export declare namespace isNamedExports { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamedExports.Handle = isNamedExports as any; + export function isExportSpecifier(node: Node): node is ExportSpecifier { return node.kind === SyntaxKind.ExportSpecifier; } +export declare namespace isExportSpecifier { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExportSpecifier.Handle = isExportSpecifier as any; + export function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration { return node.kind === SyntaxKind.CallSignature; } +export declare namespace isCallSignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isCallSignatureDeclaration.Handle = isCallSignatureDeclaration as any; + export function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration { return node.kind === SyntaxKind.ConstructSignature; } +export declare namespace isConstructSignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isConstructSignatureDeclaration.Handle = isConstructSignatureDeclaration as any; + export function isConstructorDeclaration(node: Node): node is ConstructorDeclaration { return node.kind === SyntaxKind.Constructor; } +export declare namespace isConstructorDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isConstructorDeclaration.Handle = isConstructorDeclaration as any; + export function isGetAccessorDeclaration(node: Node): node is GetAccessorDeclaration { return node.kind === SyntaxKind.GetAccessor; } +export declare namespace isGetAccessorDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isGetAccessorDeclaration.Handle = isGetAccessorDeclaration as any; + export function isSetAccessorDeclaration(node: Node): node is SetAccessorDeclaration { return node.kind === SyntaxKind.SetAccessor; } +export declare namespace isSetAccessorDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSetAccessorDeclaration.Handle = isSetAccessorDeclaration as any; + export function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration { return node.kind === SyntaxKind.IndexSignature; } +export declare namespace isIndexSignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isIndexSignatureDeclaration.Handle = isIndexSignatureDeclaration as any; + export function isMethodSignatureDeclaration(node: Node): node is MethodSignatureDeclaration { return node.kind === SyntaxKind.MethodSignature; } +export declare namespace isMethodSignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isMethodSignatureDeclaration.Handle = isMethodSignatureDeclaration as any; + export function isMethodDeclaration(node: Node): node is MethodDeclaration { return node.kind === SyntaxKind.MethodDeclaration; } +export declare namespace isMethodDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isMethodDeclaration.Handle = isMethodDeclaration as any; + export function isPropertySignatureDeclaration(node: Node): node is PropertySignatureDeclaration { return node.kind === SyntaxKind.PropertySignature; } +export declare namespace isPropertySignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPropertySignatureDeclaration.Handle = isPropertySignatureDeclaration as any; + export function isPropertyDeclaration(node: Node): node is PropertyDeclaration { return node.kind === SyntaxKind.PropertyDeclaration; } +export declare namespace isPropertyDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPropertyDeclaration.Handle = isPropertyDeclaration as any; + export function isSemicolonClassElement(node: Node): node is SemicolonClassElement { return node.kind === SyntaxKind.SemicolonClassElement; } +export declare namespace isSemicolonClassElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSemicolonClassElement.Handle = isSemicolonClassElement as any; + export function isClassStaticBlockDeclaration(node: Node): node is ClassStaticBlockDeclaration { return node.kind === SyntaxKind.ClassStaticBlockDeclaration; } +export declare namespace isClassStaticBlockDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isClassStaticBlockDeclaration.Handle = isClassStaticBlockDeclaration as any; + export function isOmittedExpression(node: Node): node is OmittedExpression { return node.kind === SyntaxKind.OmittedExpression; } +export declare namespace isOmittedExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isOmittedExpression.Handle = isOmittedExpression as any; + export function isKeywordExpression(node: Node): node is KeywordExpression { return isKeywordExpressionKind(node.kind); } +export declare namespace isKeywordExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isKeywordExpression.Handle = isKeywordExpression as any; + export function isStringLiteral(node: Node): node is StringLiteral { return node.kind === SyntaxKind.StringLiteral; } +export declare namespace isStringLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isStringLiteral.Handle = isStringLiteral as any; + export function isNumericLiteral(node: Node): node is NumericLiteral { return node.kind === SyntaxKind.NumericLiteral; } +export declare namespace isNumericLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNumericLiteral.Handle = isNumericLiteral as any; + export function isBigIntLiteral(node: Node): node is BigIntLiteral { return node.kind === SyntaxKind.BigIntLiteral; } +export declare namespace isBigIntLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isBigIntLiteral.Handle = isBigIntLiteral as any; + export function isRegularExpressionLiteral(node: Node): node is RegularExpressionLiteral { return node.kind === SyntaxKind.RegularExpressionLiteral; } +export declare namespace isRegularExpressionLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isRegularExpressionLiteral.Handle = isRegularExpressionLiteral as any; + export function isNoSubstitutionTemplateLiteral(node: Node): node is NoSubstitutionTemplateLiteral { return node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; } +export declare namespace isNoSubstitutionTemplateLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNoSubstitutionTemplateLiteral.Handle = isNoSubstitutionTemplateLiteral as any; + export function isBinaryExpression(node: Node): node is BinaryExpression { return node.kind === SyntaxKind.BinaryExpression; } +export declare namespace isBinaryExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isBinaryExpression.Handle = isBinaryExpression as any; + export function isPrefixUnaryExpression(node: Node): node is PrefixUnaryExpression { return node.kind === SyntaxKind.PrefixUnaryExpression; } +export declare namespace isPrefixUnaryExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPrefixUnaryExpression.Handle = isPrefixUnaryExpression as any; + export function isPostfixUnaryExpression(node: Node): node is PostfixUnaryExpression { return node.kind === SyntaxKind.PostfixUnaryExpression; } +export declare namespace isPostfixUnaryExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPostfixUnaryExpression.Handle = isPostfixUnaryExpression as any; + export function isYieldExpression(node: Node): node is YieldExpression { return node.kind === SyntaxKind.YieldExpression; } +export declare namespace isYieldExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isYieldExpression.Handle = isYieldExpression as any; + export function isArrowFunction(node: Node): node is ArrowFunction { return node.kind === SyntaxKind.ArrowFunction; } +export declare namespace isArrowFunction { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isArrowFunction.Handle = isArrowFunction as any; + export function isFunctionExpression(node: Node): node is FunctionExpression { return node.kind === SyntaxKind.FunctionExpression; } +export declare namespace isFunctionExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isFunctionExpression.Handle = isFunctionExpression as any; + export function isAsExpression(node: Node): node is AsExpression { return node.kind === SyntaxKind.AsExpression; } +export declare namespace isAsExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isAsExpression.Handle = isAsExpression as any; + export function isSatisfiesExpression(node: Node): node is SatisfiesExpression { return node.kind === SyntaxKind.SatisfiesExpression; } +export declare namespace isSatisfiesExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSatisfiesExpression.Handle = isSatisfiesExpression as any; + export function isConditionalExpression(node: Node): node is ConditionalExpression { return node.kind === SyntaxKind.ConditionalExpression; } +export declare namespace isConditionalExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isConditionalExpression.Handle = isConditionalExpression as any; + export function isPropertyAccessExpression(node: Node): node is PropertyAccessExpression { return node.kind === SyntaxKind.PropertyAccessExpression; } +export declare namespace isPropertyAccessExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPropertyAccessExpression.Handle = isPropertyAccessExpression as any; + export function isElementAccessExpression(node: Node): node is ElementAccessExpression { return node.kind === SyntaxKind.ElementAccessExpression; } +export declare namespace isElementAccessExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isElementAccessExpression.Handle = isElementAccessExpression as any; + export function isCallExpression(node: Node): node is CallExpression { return node.kind === SyntaxKind.CallExpression; } +export declare namespace isCallExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isCallExpression.Handle = isCallExpression as any; + export function isNewExpression(node: Node): node is NewExpression { return node.kind === SyntaxKind.NewExpression; } +export declare namespace isNewExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNewExpression.Handle = isNewExpression as any; + export function isMetaProperty(node: Node): node is MetaProperty { return node.kind === SyntaxKind.MetaProperty; } +export declare namespace isMetaProperty { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isMetaProperty.Handle = isMetaProperty as any; + export function isNonNullExpression(node: Node): node is NonNullExpression { return node.kind === SyntaxKind.NonNullExpression; } +export declare namespace isNonNullExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNonNullExpression.Handle = isNonNullExpression as any; + export function isSpreadElement(node: Node): node is SpreadElement { return node.kind === SyntaxKind.SpreadElement; } +export declare namespace isSpreadElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSpreadElement.Handle = isSpreadElement as any; + export function isTemplateExpression(node: Node): node is TemplateExpression { return node.kind === SyntaxKind.TemplateExpression; } +export declare namespace isTemplateExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateExpression.Handle = isTemplateExpression as any; + export function isTemplateSpan(node: Node): node is TemplateSpan { return node.kind === SyntaxKind.TemplateSpan; } +export declare namespace isTemplateSpan { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateSpan.Handle = isTemplateSpan as any; + export function isTaggedTemplateExpression(node: Node): node is TaggedTemplateExpression { return node.kind === SyntaxKind.TaggedTemplateExpression; } +export declare namespace isTaggedTemplateExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTaggedTemplateExpression.Handle = isTaggedTemplateExpression as any; + export function isParenthesizedExpression(node: Node): node is ParenthesizedExpression { return node.kind === SyntaxKind.ParenthesizedExpression; } +export declare namespace isParenthesizedExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isParenthesizedExpression.Handle = isParenthesizedExpression as any; + export function isArrayLiteralExpression(node: Node): node is ArrayLiteralExpression { return node.kind === SyntaxKind.ArrayLiteralExpression; } +export declare namespace isArrayLiteralExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isArrayLiteralExpression.Handle = isArrayLiteralExpression as any; + export function isObjectLiteralExpression(node: Node): node is ObjectLiteralExpression { return node.kind === SyntaxKind.ObjectLiteralExpression; } +export declare namespace isObjectLiteralExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isObjectLiteralExpression.Handle = isObjectLiteralExpression as any; + export function isSpreadAssignment(node: Node): node is SpreadAssignment { return node.kind === SyntaxKind.SpreadAssignment; } +export declare namespace isSpreadAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSpreadAssignment.Handle = isSpreadAssignment as any; + export function isPropertyAssignment(node: Node): node is PropertyAssignment { return node.kind === SyntaxKind.PropertyAssignment; } +export declare namespace isPropertyAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPropertyAssignment.Handle = isPropertyAssignment as any; + export function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment { return node.kind === SyntaxKind.ShorthandPropertyAssignment; } +export declare namespace isShorthandPropertyAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isShorthandPropertyAssignment.Handle = isShorthandPropertyAssignment as any; + export function isDeleteExpression(node: Node): node is DeleteExpression { return node.kind === SyntaxKind.DeleteExpression; } +export declare namespace isDeleteExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isDeleteExpression.Handle = isDeleteExpression as any; + export function isTypeOfExpression(node: Node): node is TypeOfExpression { return node.kind === SyntaxKind.TypeOfExpression; } +export declare namespace isTypeOfExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeOfExpression.Handle = isTypeOfExpression as any; + export function isVoidExpression(node: Node): node is VoidExpression { return node.kind === SyntaxKind.VoidExpression; } +export declare namespace isVoidExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isVoidExpression.Handle = isVoidExpression as any; + export function isAwaitExpression(node: Node): node is AwaitExpression { return node.kind === SyntaxKind.AwaitExpression; } +export declare namespace isAwaitExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isAwaitExpression.Handle = isAwaitExpression as any; + export function isTypeAssertion(node: Node): node is TypeAssertion { return node.kind === SyntaxKind.TypeAssertionExpression; } +export declare namespace isTypeAssertion { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeAssertion.Handle = isTypeAssertion as any; + export function isKeywordTypeNode(node: Node): node is KeywordTypeNode { return isKeywordTypeKind(node.kind); } +export declare namespace isKeywordTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isKeywordTypeNode.Handle = isKeywordTypeNode as any; + export function isUnionTypeNode(node: Node): node is UnionTypeNode { return node.kind === SyntaxKind.UnionType; } +export declare namespace isUnionTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isUnionTypeNode.Handle = isUnionTypeNode as any; + export function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode { return node.kind === SyntaxKind.IntersectionType; } +export declare namespace isIntersectionTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isIntersectionTypeNode.Handle = isIntersectionTypeNode as any; + export function isConditionalTypeNode(node: Node): node is ConditionalTypeNode { return node.kind === SyntaxKind.ConditionalType; } +export declare namespace isConditionalTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isConditionalTypeNode.Handle = isConditionalTypeNode as any; + export function isTypeOperatorNode(node: Node): node is TypeOperatorNode { return node.kind === SyntaxKind.TypeOperator; } +export declare namespace isTypeOperatorNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeOperatorNode.Handle = isTypeOperatorNode as any; + export function isInferTypeNode(node: Node): node is InferTypeNode { return node.kind === SyntaxKind.InferType; } +export declare namespace isInferTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isInferTypeNode.Handle = isInferTypeNode as any; + export function isArrayTypeNode(node: Node): node is ArrayTypeNode { return node.kind === SyntaxKind.ArrayType; } +export declare namespace isArrayTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isArrayTypeNode.Handle = isArrayTypeNode as any; + export function isIndexedAccessTypeNode(node: Node): node is IndexedAccessTypeNode { return node.kind === SyntaxKind.IndexedAccessType; } +export declare namespace isIndexedAccessTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isIndexedAccessTypeNode.Handle = isIndexedAccessTypeNode as any; + export function isTypeReferenceNode(node: Node): node is TypeReferenceNode { return node.kind === SyntaxKind.TypeReference; } +export declare namespace isTypeReferenceNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeReferenceNode.Handle = isTypeReferenceNode as any; + export function isExpressionWithTypeArguments(node: Node): node is ExpressionWithTypeArguments { return node.kind === SyntaxKind.ExpressionWithTypeArguments; } +export declare namespace isExpressionWithTypeArguments { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExpressionWithTypeArguments.Handle = isExpressionWithTypeArguments as any; + export function isLiteralTypeNode(node: Node): node is LiteralTypeNode { return node.kind === SyntaxKind.LiteralType; } +export declare namespace isLiteralTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isLiteralTypeNode.Handle = isLiteralTypeNode as any; + export function isThisTypeNode(node: Node): node is ThisTypeNode { return node.kind === SyntaxKind.ThisType; } +export declare namespace isThisTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isThisTypeNode.Handle = isThisTypeNode as any; + export function isTypePredicateNode(node: Node): node is TypePredicateNode { return node.kind === SyntaxKind.TypePredicate; } +export declare namespace isTypePredicateNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypePredicateNode.Handle = isTypePredicateNode as any; + export function isImportAttribute(node: Node): node is ImportAttribute { return node.kind === SyntaxKind.ImportAttribute; } +export declare namespace isImportAttribute { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportAttribute.Handle = isImportAttribute as any; + export function isImportAttributes(node: Node): node is ImportAttributes { return node.kind === SyntaxKind.ImportAttributes; } +export declare namespace isImportAttributes { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportAttributes.Handle = isImportAttributes as any; + export function isTypeQueryNode(node: Node): node is TypeQueryNode { return node.kind === SyntaxKind.TypeQuery; } +export declare namespace isTypeQueryNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeQueryNode.Handle = isTypeQueryNode as any; + export function isMappedTypeNode(node: Node): node is MappedTypeNode { return node.kind === SyntaxKind.MappedType; } +export declare namespace isMappedTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isMappedTypeNode.Handle = isMappedTypeNode as any; + export function isTypeLiteralNode(node: Node): node is TypeLiteralNode { return node.kind === SyntaxKind.TypeLiteral; } +export declare namespace isTypeLiteralNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeLiteralNode.Handle = isTypeLiteralNode as any; + export function isTupleTypeNode(node: Node): node is TupleTypeNode { return node.kind === SyntaxKind.TupleType; } +export declare namespace isTupleTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTupleTypeNode.Handle = isTupleTypeNode as any; + export function isNamedTupleMember(node: Node): node is NamedTupleMember { return node.kind === SyntaxKind.NamedTupleMember; } +export declare namespace isNamedTupleMember { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isNamedTupleMember.Handle = isNamedTupleMember as any; + export function isOptionalTypeNode(node: Node): node is OptionalTypeNode { return node.kind === SyntaxKind.OptionalType; } +export declare namespace isOptionalTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isOptionalTypeNode.Handle = isOptionalTypeNode as any; + export function isRestTypeNode(node: Node): node is RestTypeNode { return node.kind === SyntaxKind.RestType; } +export declare namespace isRestTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isRestTypeNode.Handle = isRestTypeNode as any; + export function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode { return node.kind === SyntaxKind.ParenthesizedType; } +export declare namespace isParenthesizedTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isParenthesizedTypeNode.Handle = isParenthesizedTypeNode as any; + export function isFunctionTypeNode(node: Node): node is FunctionTypeNode { return node.kind === SyntaxKind.FunctionType; } +export declare namespace isFunctionTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isFunctionTypeNode.Handle = isFunctionTypeNode as any; + export function isConstructorTypeNode(node: Node): node is ConstructorTypeNode { return node.kind === SyntaxKind.ConstructorType; } +export declare namespace isConstructorTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isConstructorTypeNode.Handle = isConstructorTypeNode as any; + export function isTemplateHead(node: Node): node is TemplateHead { return node.kind === SyntaxKind.TemplateHead; } +export declare namespace isTemplateHead { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateHead.Handle = isTemplateHead as any; + export function isTemplateMiddle(node: Node): node is TemplateMiddle { return node.kind === SyntaxKind.TemplateMiddle; } +export declare namespace isTemplateMiddle { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateMiddle.Handle = isTemplateMiddle as any; + export function isTemplateTail(node: Node): node is TemplateTail { return node.kind === SyntaxKind.TemplateTail; } +export declare namespace isTemplateTail { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateTail.Handle = isTemplateTail as any; + export function isTemplateLiteralTypeNode(node: Node): node is TemplateLiteralTypeNode { return node.kind === SyntaxKind.TemplateLiteralType; } +export declare namespace isTemplateLiteralTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateLiteralTypeNode.Handle = isTemplateLiteralTypeNode as any; + export function isTemplateLiteralTypeSpan(node: Node): node is TemplateLiteralTypeSpan { return node.kind === SyntaxKind.TemplateLiteralTypeSpan; } +export declare namespace isTemplateLiteralTypeSpan { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTemplateLiteralTypeSpan.Handle = isTemplateLiteralTypeSpan as any; + export function isSyntheticExpression(node: Node): node is SyntheticExpression { return node.kind === SyntaxKind.SyntheticExpression; } +export declare namespace isSyntheticExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSyntheticExpression.Handle = isSyntheticExpression as any; + export function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression { return node.kind === SyntaxKind.PartiallyEmittedExpression; } +export declare namespace isPartiallyEmittedExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isPartiallyEmittedExpression.Handle = isPartiallyEmittedExpression as any; + export function isJsxElement(node: Node): node is JsxElement { return node.kind === SyntaxKind.JsxElement; } +export declare namespace isJsxElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxElement.Handle = isJsxElement as any; + export function isJsxAttributes(node: Node): node is JsxAttributes { return node.kind === SyntaxKind.JsxAttributes; } +export declare namespace isJsxAttributes { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxAttributes.Handle = isJsxAttributes as any; + export function isJsxNamespacedName(node: Node): node is JsxNamespacedName { return node.kind === SyntaxKind.JsxNamespacedName; } +export declare namespace isJsxNamespacedName { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxNamespacedName.Handle = isJsxNamespacedName as any; + export function isJsxOpeningElement(node: Node): node is JsxOpeningElement { return node.kind === SyntaxKind.JsxOpeningElement; } +export declare namespace isJsxOpeningElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxOpeningElement.Handle = isJsxOpeningElement as any; + export function isJsxSelfClosingElement(node: Node): node is JsxSelfClosingElement { return node.kind === SyntaxKind.JsxSelfClosingElement; } +export declare namespace isJsxSelfClosingElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxSelfClosingElement.Handle = isJsxSelfClosingElement as any; + export function isJsxFragment(node: Node): node is JsxFragment { return node.kind === SyntaxKind.JsxFragment; } +export declare namespace isJsxFragment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxFragment.Handle = isJsxFragment as any; + export function isJsxOpeningFragment(node: Node): node is JsxOpeningFragment { return node.kind === SyntaxKind.JsxOpeningFragment; } +export declare namespace isJsxOpeningFragment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxOpeningFragment.Handle = isJsxOpeningFragment as any; + export function isJsxClosingFragment(node: Node): node is JsxClosingFragment { return node.kind === SyntaxKind.JsxClosingFragment; } +export declare namespace isJsxClosingFragment { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxClosingFragment.Handle = isJsxClosingFragment as any; + export function isJsxAttribute(node: Node): node is JsxAttribute { return node.kind === SyntaxKind.JsxAttribute; } +export declare namespace isJsxAttribute { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxAttribute.Handle = isJsxAttribute as any; + export function isJsxSpreadAttribute(node: Node): node is JsxSpreadAttribute { return node.kind === SyntaxKind.JsxSpreadAttribute; } +export declare namespace isJsxSpreadAttribute { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxSpreadAttribute.Handle = isJsxSpreadAttribute as any; + export function isJsxClosingElement(node: Node): node is JsxClosingElement { return node.kind === SyntaxKind.JsxClosingElement; } +export declare namespace isJsxClosingElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxClosingElement.Handle = isJsxClosingElement as any; + export function isJsxExpression(node: Node): node is JsxExpression { return node.kind === SyntaxKind.JsxExpression; } +export declare namespace isJsxExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxExpression.Handle = isJsxExpression as any; + export function isJsxText(node: Node): node is JsxText { return node.kind === SyntaxKind.JsxText; } +export declare namespace isJsxText { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJsxText.Handle = isJsxText as any; + export function isSyntaxList(node: Node): node is SyntaxList { return node.kind === SyntaxKind.SyntaxList; } +export declare namespace isSyntaxList { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSyntaxList.Handle = isSyntaxList as any; + export function isJSDoc(node: Node): node is JSDoc { return node.kind === SyntaxKind.JSDoc; } +export declare namespace isJSDoc { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDoc.Handle = isJSDoc as any; + export function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression { return node.kind === SyntaxKind.JSDocTypeExpression; } +export declare namespace isJSDocTypeExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocTypeExpression.Handle = isJSDocTypeExpression as any; + export function isJSDocNonNullableType(node: Node): node is JSDocNonNullableType { return node.kind === SyntaxKind.JSDocNonNullableType; } +export declare namespace isJSDocNonNullableType { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocNonNullableType.Handle = isJSDocNonNullableType as any; + export function isJSDocNullableType(node: Node): node is JSDocNullableType { return node.kind === SyntaxKind.JSDocNullableType; } +export declare namespace isJSDocNullableType { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocNullableType.Handle = isJSDocNullableType as any; + export function isJSDocAllType(node: Node): node is JSDocAllType { return node.kind === SyntaxKind.JSDocAllType; } +export declare namespace isJSDocAllType { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocAllType.Handle = isJSDocAllType as any; + export function isJSDocVariadicType(node: Node): node is JSDocVariadicType { return node.kind === SyntaxKind.JSDocVariadicType; } +export declare namespace isJSDocVariadicType { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocVariadicType.Handle = isJSDocVariadicType as any; + export function isJSDocOptionalType(node: Node): node is JSDocOptionalType { return node.kind === SyntaxKind.JSDocOptionalType; } +export declare namespace isJSDocOptionalType { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocOptionalType.Handle = isJSDocOptionalType as any; + export function isJSDocTypeTag(node: Node): node is JSDocTypeTag { return node.kind === SyntaxKind.JSDocTypeTag; } +export declare namespace isJSDocTypeTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocTypeTag.Handle = isJSDocTypeTag as any; + export function isJSDocUnknownTag(node: Node): node is JSDocUnknownTag { return node.kind === SyntaxKind.JSDocUnknownTag; } +export declare namespace isJSDocUnknownTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocUnknownTag.Handle = isJSDocUnknownTag as any; + export function isJSDocTemplateTag(node: Node): node is JSDocTemplateTag { return node.kind === SyntaxKind.JSDocTemplateTag; } +export declare namespace isJSDocTemplateTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocTemplateTag.Handle = isJSDocTemplateTag as any; + export function isJSDocReturnTag(node: Node): node is JSDocReturnTag { return node.kind === SyntaxKind.JSDocReturnTag; } +export declare namespace isJSDocReturnTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocReturnTag.Handle = isJSDocReturnTag as any; + export function isJSDocPublicTag(node: Node): node is JSDocPublicTag { return node.kind === SyntaxKind.JSDocPublicTag; } +export declare namespace isJSDocPublicTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocPublicTag.Handle = isJSDocPublicTag as any; + export function isJSDocPrivateTag(node: Node): node is JSDocPrivateTag { return node.kind === SyntaxKind.JSDocPrivateTag; } +export declare namespace isJSDocPrivateTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocPrivateTag.Handle = isJSDocPrivateTag as any; + export function isJSDocProtectedTag(node: Node): node is JSDocProtectedTag { return node.kind === SyntaxKind.JSDocProtectedTag; } +export declare namespace isJSDocProtectedTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocProtectedTag.Handle = isJSDocProtectedTag as any; + export function isJSDocReadonlyTag(node: Node): node is JSDocReadonlyTag { return node.kind === SyntaxKind.JSDocReadonlyTag; } +export declare namespace isJSDocReadonlyTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocReadonlyTag.Handle = isJSDocReadonlyTag as any; + export function isJSDocOverrideTag(node: Node): node is JSDocOverrideTag { return node.kind === SyntaxKind.JSDocOverrideTag; } +export declare namespace isJSDocOverrideTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocOverrideTag.Handle = isJSDocOverrideTag as any; + export function isJSDocDeprecatedTag(node: Node): node is JSDocDeprecatedTag { return node.kind === SyntaxKind.JSDocDeprecatedTag; } +export declare namespace isJSDocDeprecatedTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocDeprecatedTag.Handle = isJSDocDeprecatedTag as any; + export function isJSDocSeeTag(node: Node): node is JSDocSeeTag { return node.kind === SyntaxKind.JSDocSeeTag; } +export declare namespace isJSDocSeeTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocSeeTag.Handle = isJSDocSeeTag as any; + export function isJSDocImplementsTag(node: Node): node is JSDocImplementsTag { return node.kind === SyntaxKind.JSDocImplementsTag; } +export declare namespace isJSDocImplementsTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocImplementsTag.Handle = isJSDocImplementsTag as any; + export function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag { return node.kind === SyntaxKind.JSDocAugmentsTag; } +export declare namespace isJSDocAugmentsTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocAugmentsTag.Handle = isJSDocAugmentsTag as any; + export function isJSDocSatisfiesTag(node: Node): node is JSDocSatisfiesTag { return node.kind === SyntaxKind.JSDocSatisfiesTag; } +export declare namespace isJSDocSatisfiesTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocSatisfiesTag.Handle = isJSDocSatisfiesTag as any; + export function isJSDocThrowsTag(node: Node): node is JSDocThrowsTag { return node.kind === SyntaxKind.JSDocThrowsTag; } +export declare namespace isJSDocThrowsTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocThrowsTag.Handle = isJSDocThrowsTag as any; + export function isJSDocThisTag(node: Node): node is JSDocThisTag { return node.kind === SyntaxKind.JSDocThisTag; } +export declare namespace isJSDocThisTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocThisTag.Handle = isJSDocThisTag as any; + export function isJSDocImportTag(node: Node): node is JSDocImportTag { return node.kind === SyntaxKind.JSDocImportTag; } +export declare namespace isJSDocImportTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocImportTag.Handle = isJSDocImportTag as any; + export function isJSDocCallbackTag(node: Node): node is JSDocCallbackTag { return node.kind === SyntaxKind.JSDocCallbackTag; } +export declare namespace isJSDocCallbackTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocCallbackTag.Handle = isJSDocCallbackTag as any; + export function isJSDocOverloadTag(node: Node): node is JSDocOverloadTag { return node.kind === SyntaxKind.JSDocOverloadTag; } +export declare namespace isJSDocOverloadTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocOverloadTag.Handle = isJSDocOverloadTag as any; + export function isJSDocTypedefTag(node: Node): node is JSDocTypedefTag { return node.kind === SyntaxKind.JSDocTypedefTag; } +export declare namespace isJSDocTypedefTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocTypedefTag.Handle = isJSDocTypedefTag as any; + export function isJSDocSignature(node: Node): node is JSDocSignature { return node.kind === SyntaxKind.JSDocSignature; } +export declare namespace isJSDocSignature { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocSignature.Handle = isJSDocSignature as any; + export function isJSDocNameReference(node: Node): node is JSDocNameReference { return node.kind === SyntaxKind.JSDocNameReference; } +export declare namespace isJSDocNameReference { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocNameReference.Handle = isJSDocNameReference as any; + export function isSourceFile(node: Node): node is SourceFile { return node.kind === SyntaxKind.SourceFile; } +export declare namespace isSourceFile { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSourceFile.Handle = isSourceFile as any; + export function isModuleDeclaration(node: Node): node is ModuleDeclaration { return node.kind === SyntaxKind.ModuleDeclaration; } +export declare namespace isModuleDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isModuleDeclaration.Handle = isModuleDeclaration as any; + export function isImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration { return node.kind === SyntaxKind.ImportEqualsDeclaration; } +export declare namespace isImportEqualsDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportEqualsDeclaration.Handle = isImportEqualsDeclaration as any; + export function isExportDeclaration(node: Node): node is ExportDeclaration { return node.kind === SyntaxKind.ExportDeclaration; } +export declare namespace isExportDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isExportDeclaration.Handle = isExportDeclaration as any; + export function isImportTypeNode(node: Node): node is ImportTypeNode { return node.kind === SyntaxKind.ImportType; } +export declare namespace isImportTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportTypeNode.Handle = isImportTypeNode as any; + export function isImportClause(node: Node): node is ImportClause { return node.kind === SyntaxKind.ImportClause; } +export declare namespace isImportClause { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportClause.Handle = isImportClause as any; + export function isImportSpecifier(node: Node): node is ImportSpecifier { return node.kind === SyntaxKind.ImportSpecifier; } +export declare namespace isImportSpecifier { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isImportSpecifier.Handle = isImportSpecifier as any; + export function isJSDocText(node: Node): node is JSDocText { return node.kind === SyntaxKind.JSDocText; } +export declare namespace isJSDocText { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocText.Handle = isJSDocText as any; + export function isJSDocLink(node: Node): node is JSDocLink { return node.kind === SyntaxKind.JSDocLink; } +export declare namespace isJSDocLink { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocLink.Handle = isJSDocLink as any; + export function isJSDocLinkPlain(node: Node): node is JSDocLinkPlain { return node.kind === SyntaxKind.JSDocLinkPlain; } +export declare namespace isJSDocLinkPlain { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocLinkPlain.Handle = isJSDocLinkPlain as any; + export function isJSDocLinkCode(node: Node): node is JSDocLinkCode { return node.kind === SyntaxKind.JSDocLinkCode; } +export declare namespace isJSDocLinkCode { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocLinkCode.Handle = isJSDocLinkCode as any; + export function isTypeParameterDeclaration(node: Node): node is TypeParameterDeclaration { return node.kind === SyntaxKind.TypeParameter; } +export declare namespace isTypeParameterDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isTypeParameterDeclaration.Handle = isTypeParameterDeclaration as any; + export function isSyntheticReferenceExpression(node: Node): node is SyntheticReferenceExpression { return node.kind === SyntaxKind.SyntheticReferenceExpression; } +export declare namespace isSyntheticReferenceExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isSyntheticReferenceExpression.Handle = isSyntheticReferenceExpression as any; + export function isJSDocTypeLiteral(node: Node): node is JSDocTypeLiteral { return node.kind === SyntaxKind.JSDocTypeLiteral; } +export declare namespace isJSDocTypeLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocTypeLiteral.Handle = isJSDocTypeLiteral as any; + export function isForInStatement(node: Node): node is ForInStatement { return node.kind === SyntaxKind.ForInStatement; } +export declare namespace isForInStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isForInStatement.Handle = isForInStatement as any; + export function isForOfStatement(node: Node): node is ForOfStatement { return node.kind === SyntaxKind.ForOfStatement; } +export declare namespace isForOfStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isForOfStatement.Handle = isForOfStatement as any; + export function isCaseClause(node: Node): node is CaseClause { return node.kind === SyntaxKind.CaseClause; } +export declare namespace isCaseClause { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isCaseClause.Handle = isCaseClause as any; + export function isDefaultClause(node: Node): node is DefaultClause { return node.kind === SyntaxKind.DefaultClause; } +export declare namespace isDefaultClause { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isDefaultClause.Handle = isDefaultClause as any; + export function isObjectBindingPattern(node: Node): node is ObjectBindingPattern { return node.kind === SyntaxKind.ObjectBindingPattern; } +export declare namespace isObjectBindingPattern { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isObjectBindingPattern.Handle = isObjectBindingPattern as any; + export function isArrayBindingPattern(node: Node): node is ArrayBindingPattern { return node.kind === SyntaxKind.ArrayBindingPattern; } +export declare namespace isArrayBindingPattern { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isArrayBindingPattern.Handle = isArrayBindingPattern as any; + export function isJSDocParameterTag(node: Node): node is JSDocParameterTag { return node.kind === SyntaxKind.JSDocParameterTag; } +export declare namespace isJSDocParameterTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocParameterTag.Handle = isJSDocParameterTag as any; + export function isJSDocPropertyTag(node: Node): node is JSDocPropertyTag { return node.kind === SyntaxKind.JSDocPropertyTag; } +export declare namespace isJSDocPropertyTag { + function Handle>(node: T): node is SpecializeNodeHandle; +} +isJSDocPropertyTag.Handle = isJSDocPropertyTag as any; + export function isHeritageClauseElement(node: Node): node is HeritageClauseElement { return node.kind === SyntaxKind.ExpressionWithTypeArguments || node.kind === SyntaxKind.TypeReference; } +export declare namespace isHeritageClauseElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isHeritageClauseElement.Handle = isHeritageClauseElement as any; + export function isAccessExpression(node: Node): node is AccessExpression { return node.kind === SyntaxKind.PropertyAccessExpression || node.kind === SyntaxKind.ElementAccessExpression; } +export declare namespace isAccessExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAccessExpression.Handle = isAccessExpression as any; + export function isDeclarationName(node: Node): node is DeclarationName { const kind = node.kind; return kind === SyntaxKind.Identifier || kind === SyntaxKind.PrivateIdentifier || kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.BigIntLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral || kind === SyntaxKind.ComputedPropertyName || kind === SyntaxKind.ObjectBindingPattern || kind === SyntaxKind.ArrayBindingPattern || kind === SyntaxKind.ElementAccessExpression; } +export declare namespace isDeclarationName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDeclarationName.Handle = isDeclarationName as any; + export function isModuleName(node: Node): node is ModuleName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral; } +export declare namespace isModuleName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModuleName.Handle = isModuleName as any; + export function isModuleExportName(node: Node): node is ModuleExportName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral; } +export declare namespace isModuleExportName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModuleExportName.Handle = isModuleExportName as any; + export function isPropertyName(node: Node): node is PropertyName { const kind = node.kind; return kind === SyntaxKind.Identifier || kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.ComputedPropertyName || kind === SyntaxKind.PrivateIdentifier || kind === SyntaxKind.BigIntLiteral; } +export declare namespace isPropertyName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPropertyName.Handle = isPropertyName as any; + export function isModuleBody(node: Node): node is ModuleBody { return node.kind === SyntaxKind.ModuleBlock || node.kind === SyntaxKind.ModuleDeclaration; } +export declare namespace isModuleBody { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModuleBody.Handle = isModuleBody as any; + export function isJSDocFullName(node: Node): node is JSDocFullName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ModuleDeclaration; } +export declare namespace isJSDocFullName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJSDocFullName.Handle = isJSDocFullName as any; + export function isModuleReference(node: Node): node is ModuleReference { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.ExternalModuleReference; } +export declare namespace isModuleReference { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModuleReference.Handle = isModuleReference as any; + export function isNamedImportBindings(node: Node): node is NamedImportBindings { return node.kind === SyntaxKind.NamespaceImport || node.kind === SyntaxKind.NamedImports; } +export declare namespace isNamedImportBindings { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isNamedImportBindings.Handle = isNamedImportBindings as any; + export function isNamedExportBindings(node: Node): node is NamedExportBindings { return node.kind === SyntaxKind.NamespaceExport || node.kind === SyntaxKind.NamedExports; } +export declare namespace isNamedExportBindings { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isNamedExportBindings.Handle = isNamedExportBindings as any; + export function isMemberName(node: Node): node is MemberName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.PrivateIdentifier; } +export declare namespace isMemberName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isMemberName.Handle = isMemberName as any; + export function isEntityName(node: Node): node is EntityName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName; } +export declare namespace isEntityName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isEntityName.Handle = isEntityName as any; + export function isBindingName(node: Node): node is BindingName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ObjectBindingPattern || node.kind === SyntaxKind.ArrayBindingPattern; } +export declare namespace isBindingName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isBindingName.Handle = isBindingName as any; + export function isModifierLike(node: Node): node is ModifierLike { const kind = node.kind; return kind === SyntaxKind.AbstractKeyword || kind === SyntaxKind.AccessorKeyword || kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.ConstKeyword || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.DefaultKeyword || kind === SyntaxKind.ExportKeyword || kind === SyntaxKind.InKeyword || kind === SyntaxKind.PrivateKeyword || kind === SyntaxKind.ProtectedKeyword || kind === SyntaxKind.PublicKeyword || kind === SyntaxKind.ReadonlyKeyword || kind === SyntaxKind.OutKeyword || kind === SyntaxKind.OverrideKeyword || kind === SyntaxKind.StaticKeyword || kind === SyntaxKind.Decorator; } +export declare namespace isModifierLike { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModifierLike.Handle = isModifierLike as any; + export function isJsxChild(node: Node): node is JsxChild { const kind = node.kind; return kind === SyntaxKind.JsxText || kind === SyntaxKind.JsxExpression || kind === SyntaxKind.JsxElement || kind === SyntaxKind.JsxSelfClosingElement || kind === SyntaxKind.JsxFragment; } +export declare namespace isJsxChild { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJsxChild.Handle = isJsxChild as any; + export function isJsxAttributeLike(node: Node): node is JsxAttributeLike { return node.kind === SyntaxKind.JsxAttribute || node.kind === SyntaxKind.JsxSpreadAttribute; } +export declare namespace isJsxAttributeLike { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJsxAttributeLike.Handle = isJsxAttributeLike as any; + export function isJsxAttributeName(node: Node): node is JsxAttributeName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.JsxNamespacedName; } +export declare namespace isJsxAttributeName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJsxAttributeName.Handle = isJsxAttributeName as any; + export function isJsxAttributeValue(node: Node): node is JsxAttributeValue { const kind = node.kind; return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.JsxExpression || kind === SyntaxKind.JsxElement || kind === SyntaxKind.JsxSelfClosingElement || kind === SyntaxKind.JsxFragment; } +export declare namespace isJsxAttributeValue { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJsxAttributeValue.Handle = isJsxAttributeValue as any; + export function isClassLikeDeclaration(node: Node): node is ClassLikeDeclaration { return node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression; } +export declare namespace isClassLikeDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isClassLikeDeclaration.Handle = isClassLikeDeclaration as any; + export function isAccessorDeclaration(node: Node): node is AccessorDeclaration { return node.kind === SyntaxKind.GetAccessor || node.kind === SyntaxKind.SetAccessor; } +export declare namespace isAccessorDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAccessorDeclaration.Handle = isAccessorDeclaration as any; + export function isLiteralLikeNode(node: Node): node is LiteralLikeNode { const kind = node.kind; return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.BigIntLiteral || kind === SyntaxKind.RegularExpressionLiteral || kind === SyntaxKind.TemplateHead || kind === SyntaxKind.TemplateMiddle || kind === SyntaxKind.TemplateTail || kind === SyntaxKind.JsxText; } +export declare namespace isLiteralLikeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isLiteralLikeNode.Handle = isLiteralLikeNode as any; + export function isLiteralExpression(node: Node): node is LiteralExpression { const kind = node.kind; return kind === SyntaxKind.StringLiteral || kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.BigIntLiteral || kind === SyntaxKind.RegularExpressionLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral; } +export declare namespace isLiteralExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isLiteralExpression.Handle = isLiteralExpression as any; + export function isUnionOrIntersectionTypeNode(node: Node): node is UnionOrIntersectionTypeNode { return node.kind === SyntaxKind.UnionType || node.kind === SyntaxKind.IntersectionType; } +export declare namespace isUnionOrIntersectionTypeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isUnionOrIntersectionTypeNode.Handle = isUnionOrIntersectionTypeNode as any; + export function isTemplateLiteralLikeNode(node: Node): node is TemplateLiteralLikeNode { const kind = node.kind; return isPseudoLiteralKind(kind); } +export declare namespace isTemplateLiteralLikeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTemplateLiteralLikeNode.Handle = isTemplateLiteralLikeNode as any; + export function isTemplateMiddleOrTail(node: Node): node is TemplateMiddleOrTail { return node.kind === SyntaxKind.TemplateMiddle || node.kind === SyntaxKind.TemplateTail; } +export declare namespace isTemplateMiddleOrTail { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTemplateMiddleOrTail.Handle = isTemplateMiddleOrTail as any; + export function isTemplateLiteral(node: Node): node is TemplateLiteral { return node.kind === SyntaxKind.TemplateExpression || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; } +export declare namespace isTemplateLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTemplateLiteral.Handle = isTemplateLiteral as any; + export function isTypePredicateParameterName(node: Node): node is TypePredicateParameterName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisType; } +export declare namespace isTypePredicateParameterName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTypePredicateParameterName.Handle = isTypePredicateParameterName as any; + export function isImportAttributeName(node: Node): node is ImportAttributeName { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral; } +export declare namespace isImportAttributeName { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isImportAttributeName.Handle = isImportAttributeName as any; + export function isJSDocComment(node: Node): node is JSDocComment { const kind = node.kind; return kind === SyntaxKind.JSDocText || kind === SyntaxKind.JSDocLink || kind === SyntaxKind.JSDocLinkCode || kind === SyntaxKind.JSDocLinkPlain; } +export declare namespace isJSDocComment { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJSDocComment.Handle = isJSDocComment as any; + export function isSignatureDeclaration(node: Node): node is SignatureDeclaration { const kind = node.kind; return kind === SyntaxKind.CallSignature || kind === SyntaxKind.ConstructSignature || kind === SyntaxKind.MethodSignature || kind === SyntaxKind.IndexSignature || kind === SyntaxKind.FunctionType || kind === SyntaxKind.ConstructorType || kind === SyntaxKind.FunctionDeclaration || kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.Constructor || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction; } +export declare namespace isSignatureDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isSignatureDeclaration.Handle = isSignatureDeclaration as any; + export function isStringLiteralLikeNode(node: Node): node is StringLiteralLikeNode { return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral; } +export declare namespace isStringLiteralLikeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isStringLiteralLikeNode.Handle = isStringLiteralLikeNode as any; + export function isNumericOrStringLikeLiteral(node: Node): node is NumericOrStringLikeLiteral { return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral || node.kind === SyntaxKind.NumericLiteral; } +export declare namespace isNumericOrStringLikeLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isNumericOrStringLikeLiteral.Handle = isNumericOrStringLikeLiteral as any; + export function isObjectLiteralLikeNode(node: Node): node is ObjectLiteralLikeNode { return node.kind === SyntaxKind.ObjectLiteralExpression || node.kind === SyntaxKind.ObjectBindingPattern; } +export declare namespace isObjectLiteralLikeNode { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isObjectLiteralLikeNode.Handle = isObjectLiteralLikeNode as any; + export function isObjectTypeDeclaration(node: Node): node is ObjectTypeDeclaration { const kind = node.kind; return kind === SyntaxKind.ClassDeclaration || kind === SyntaxKind.ClassExpression || kind === SyntaxKind.InterfaceDeclaration || kind === SyntaxKind.TypeLiteral; } +export declare namespace isObjectTypeDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isObjectTypeDeclaration.Handle = isObjectTypeDeclaration as any; + export function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement { return node.kind === SyntaxKind.JsxOpeningElement || node.kind === SyntaxKind.JsxSelfClosingElement; } +export declare namespace isJsxOpeningLikeElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isJsxOpeningLikeElement.Handle = isJsxOpeningLikeElement as any; + export function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports { return node.kind === SyntaxKind.NamedImports || node.kind === SyntaxKind.NamedExports; } +export declare namespace isNamedImportsOrExports { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isNamedImportsOrExports.Handle = isNamedImportsOrExports as any; + export function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement { return node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement; } +export declare namespace isBreakOrContinueStatement { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isBreakOrContinueStatement.Handle = isBreakOrContinueStatement as any; + export function isCallLikeExpression(node: Node): node is CallLikeExpression { const kind = node.kind; return kind === SyntaxKind.CallExpression || kind === SyntaxKind.NewExpression || kind === SyntaxKind.TaggedTemplateExpression || kind === SyntaxKind.Decorator || kind === SyntaxKind.JsxOpeningElement || kind === SyntaxKind.JsxSelfClosingElement || kind === SyntaxKind.BinaryExpression; } +export declare namespace isCallLikeExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isCallLikeExpression.Handle = isCallLikeExpression as any; + export function isFunctionLikeDeclaration(node: Node): node is FunctionLikeDeclaration { const kind = node.kind; return kind === SyntaxKind.FunctionDeclaration || kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor || kind === SyntaxKind.Constructor || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction; } +export declare namespace isFunctionLikeDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isFunctionLikeDeclaration.Handle = isFunctionLikeDeclaration as any; + export function isVariableOrParameterDeclaration(node: Node): node is VariableOrParameterDeclaration { return node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.Parameter; } +export declare namespace isVariableOrParameterDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isVariableOrParameterDeclaration.Handle = isVariableOrParameterDeclaration as any; + export function isVariableOrPropertyDeclaration(node: Node): node is VariableOrPropertyDeclaration { return node.kind === SyntaxKind.VariableDeclaration || node.kind === SyntaxKind.PropertyDeclaration; } +export declare namespace isVariableOrPropertyDeclaration { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isVariableOrPropertyDeclaration.Handle = isVariableOrPropertyDeclaration as any; + export function isCallOrNewExpression(node: Node): node is CallOrNewExpression { return node.kind === SyntaxKind.CallExpression || node.kind === SyntaxKind.NewExpression; } +export declare namespace isCallOrNewExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isCallOrNewExpression.Handle = isCallOrNewExpression as any; + export function isImportClauseOrBindingPattern(node: Node): node is ImportClauseOrBindingPattern { return node.kind === SyntaxKind.ImportClause || node.kind === SyntaxKind.ObjectBindingPattern || node.kind === SyntaxKind.ArrayBindingPattern; } +export declare namespace isImportClauseOrBindingPattern { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isImportClauseOrBindingPattern.Handle = isImportClauseOrBindingPattern as any; + export function isAnyImportSyntax(node: Node): node is AnyImportSyntax { return node.kind === SyntaxKind.ImportDeclaration || node.kind === SyntaxKind.JSImportDeclaration || node.kind === SyntaxKind.ImportEqualsDeclaration; } +export declare namespace isAnyImportSyntax { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAnyImportSyntax.Handle = isAnyImportSyntax as any; + export function isArrayBindingElement(node: Node): node is ArrayBindingElement { return node.kind === SyntaxKind.BindingElement || node.kind === SyntaxKind.OmittedExpression; } +export declare namespace isArrayBindingElement { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isArrayBindingElement.Handle = isArrayBindingElement as any; + export function isAssertionExpression(node: Node): node is AssertionExpression { return node.kind === SyntaxKind.TypeAssertionExpression || node.kind === SyntaxKind.AsExpression; } +export declare namespace isAssertionExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAssertionExpression.Handle = isAssertionExpression as any; + export function isBooleanLiteral(node: Node): node is BooleanLiteral { return node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword; } +export declare namespace isBooleanLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isBooleanLiteral.Handle = isBooleanLiteral as any; + export function isDestructuringAssignment(node: Node): node is DestructuringAssignment { return node.kind === SyntaxKind.BinaryExpression; } +export declare namespace isDestructuringAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDestructuringAssignment.Handle = isDestructuringAssignment as any; + export function isLiteralToken(node: Node): node is LiteralToken { const kind = node.kind; return kind === SyntaxKind.NumericLiteral || kind === SyntaxKind.BigIntLiteral || kind === SyntaxKind.StringLiteral || kind === SyntaxKind.JsxText || kind === SyntaxKind.RegularExpressionLiteral || kind === SyntaxKind.NoSubstitutionTemplateLiteral; } +export declare namespace isLiteralToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isLiteralToken.Handle = isLiteralToken as any; + export function isModifier(node: Node): node is Modifier { const kind = node.kind; return isModifierKind(kind); } +export declare namespace isModifier { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isModifier.Handle = isModifier as any; + export function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike { const kind = node.kind; return kind === SyntaxKind.PropertyAssignment || kind === SyntaxKind.ShorthandPropertyAssignment || kind === SyntaxKind.SpreadAssignment || kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor; } +export declare namespace isObjectLiteralElementLike { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isObjectLiteralElementLike.Handle = isObjectLiteralElementLike as any; + export function isPropertyNameLiteral(node: Node): node is PropertyNameLiteral { return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral; } +export declare namespace isPropertyNameLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPropertyNameLiteral.Handle = isPropertyNameLiteral as any; + export function isPseudoLiteralToken(node: Node): node is PseudoLiteralToken { const kind = node.kind; return isPseudoLiteralKind(kind); } +export declare namespace isPseudoLiteralToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPseudoLiteralToken.Handle = isPseudoLiteralToken as any; + export function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken { const kind = node.kind; return kind === SyntaxKind.NoSubstitutionTemplateLiteral || kind === SyntaxKind.TemplateHead || kind === SyntaxKind.TemplateMiddle || kind === SyntaxKind.TemplateTail; } +export declare namespace isTemplateLiteralToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTemplateLiteralToken.Handle = isTemplateLiteralToken as any; + export function isArrayDestructuringAssignment(node: Node): node is ArrayDestructuringAssignment { return node.kind === SyntaxKind.BinaryExpression; } +export declare namespace isArrayDestructuringAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isArrayDestructuringAssignment.Handle = isArrayDestructuringAssignment as any; + export function isObjectDestructuringAssignment(node: Node): node is ObjectDestructuringAssignment { return node.kind === SyntaxKind.BinaryExpression; } +export declare namespace isObjectDestructuringAssignment { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isObjectDestructuringAssignment.Handle = isObjectDestructuringAssignment as any; + export function isFunctionBody(node: Node): node is FunctionBody { return node.kind === SyntaxKind.Block; } +export declare namespace isFunctionBody { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isFunctionBody.Handle = isFunctionBody as any; + export function isTriviaKind(kind: SyntaxKind): kind is TriviaSyntaxKind { return kind === SyntaxKind.SingleLineCommentTrivia || kind === SyntaxKind.MultiLineCommentTrivia @@ -1605,154 +2937,388 @@ export function isEndOfFile(node: Node): node is EndOfFile { return node.kind === SyntaxKind.EndOfFile; } +export declare namespace isEndOfFile { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isEndOfFile.Handle = isEndOfFile as any; + export function isDotToken(node: Node): node is DotToken { return node.kind === SyntaxKind.DotToken; } +export declare namespace isDotToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDotToken.Handle = isDotToken as any; + export function isDotDotDotToken(node: Node): node is DotDotDotToken { return node.kind === SyntaxKind.DotDotDotToken; } +export declare namespace isDotDotDotToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDotDotDotToken.Handle = isDotDotDotToken as any; + export function isQuestionToken(node: Node): node is QuestionToken { return node.kind === SyntaxKind.QuestionToken; } +export declare namespace isQuestionToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isQuestionToken.Handle = isQuestionToken as any; + export function isExclamationToken(node: Node): node is ExclamationToken { return node.kind === SyntaxKind.ExclamationToken; } +export declare namespace isExclamationToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isExclamationToken.Handle = isExclamationToken as any; + export function isColonToken(node: Node): node is ColonToken { return node.kind === SyntaxKind.ColonToken; } +export declare namespace isColonToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isColonToken.Handle = isColonToken as any; + export function isEqualsToken(node: Node): node is EqualsToken { return node.kind === SyntaxKind.EqualsToken; } +export declare namespace isEqualsToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isEqualsToken.Handle = isEqualsToken as any; + export function isAsteriskToken(node: Node): node is AsteriskToken { return node.kind === SyntaxKind.AsteriskToken; } +export declare namespace isAsteriskToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAsteriskToken.Handle = isAsteriskToken as any; + export function isEqualsGreaterThanToken(node: Node): node is EqualsGreaterThanToken { return node.kind === SyntaxKind.EqualsGreaterThanToken; } +export declare namespace isEqualsGreaterThanToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isEqualsGreaterThanToken.Handle = isEqualsGreaterThanToken as any; + export function isPlusToken(node: Node): node is PlusToken { return node.kind === SyntaxKind.PlusToken; } +export declare namespace isPlusToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPlusToken.Handle = isPlusToken as any; + export function isMinusToken(node: Node): node is MinusToken { return node.kind === SyntaxKind.MinusToken; } +export declare namespace isMinusToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isMinusToken.Handle = isMinusToken as any; + export function isQuestionDotToken(node: Node): node is QuestionDotToken { return node.kind === SyntaxKind.QuestionDotToken; } +export declare namespace isQuestionDotToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isQuestionDotToken.Handle = isQuestionDotToken as any; + export function isAssertsKeyword(node: Node): node is AssertsKeyword { return node.kind === SyntaxKind.AssertsKeyword; } +export declare namespace isAssertsKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAssertsKeyword.Handle = isAssertsKeyword as any; + export function isAssertKeyword(node: Node): node is AssertKeyword { return node.kind === SyntaxKind.AssertKeyword; } +export declare namespace isAssertKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAssertKeyword.Handle = isAssertKeyword as any; + export function isAwaitKeyword(node: Node): node is AwaitKeyword { return node.kind === SyntaxKind.AwaitKeyword; } +export declare namespace isAwaitKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAwaitKeyword.Handle = isAwaitKeyword as any; + export function isCaseKeyword(node: Node): node is CaseKeyword { return node.kind === SyntaxKind.CaseKeyword; } +export declare namespace isCaseKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isCaseKeyword.Handle = isCaseKeyword as any; + export function isAbstractKeyword(node: Node): node is AbstractKeyword { return node.kind === SyntaxKind.AbstractKeyword; } +export declare namespace isAbstractKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAbstractKeyword.Handle = isAbstractKeyword as any; + export function isAccessorKeyword(node: Node): node is AccessorKeyword { return node.kind === SyntaxKind.AccessorKeyword; } +export declare namespace isAccessorKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAccessorKeyword.Handle = isAccessorKeyword as any; + export function isAsyncKeyword(node: Node): node is AsyncKeyword { return node.kind === SyntaxKind.AsyncKeyword; } +export declare namespace isAsyncKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAsyncKeyword.Handle = isAsyncKeyword as any; + export function isConstKeyword(node: Node): node is ConstKeyword { return node.kind === SyntaxKind.ConstKeyword; } +export declare namespace isConstKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isConstKeyword.Handle = isConstKeyword as any; + export function isDeclareKeyword(node: Node): node is DeclareKeyword { return node.kind === SyntaxKind.DeclareKeyword; } +export declare namespace isDeclareKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDeclareKeyword.Handle = isDeclareKeyword as any; + export function isDefaultKeyword(node: Node): node is DefaultKeyword { return node.kind === SyntaxKind.DefaultKeyword; } +export declare namespace isDefaultKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isDefaultKeyword.Handle = isDefaultKeyword as any; + export function isExportKeyword(node: Node): node is ExportKeyword { return node.kind === SyntaxKind.ExportKeyword; } +export declare namespace isExportKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isExportKeyword.Handle = isExportKeyword as any; + export function isInKeyword(node: Node): node is InKeyword { return node.kind === SyntaxKind.InKeyword; } +export declare namespace isInKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isInKeyword.Handle = isInKeyword as any; + export function isPrivateKeyword(node: Node): node is PrivateKeyword { return node.kind === SyntaxKind.PrivateKeyword; } +export declare namespace isPrivateKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPrivateKeyword.Handle = isPrivateKeyword as any; + export function isProtectedKeyword(node: Node): node is ProtectedKeyword { return node.kind === SyntaxKind.ProtectedKeyword; } +export declare namespace isProtectedKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isProtectedKeyword.Handle = isProtectedKeyword as any; + export function isPublicKeyword(node: Node): node is PublicKeyword { return node.kind === SyntaxKind.PublicKeyword; } +export declare namespace isPublicKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isPublicKeyword.Handle = isPublicKeyword as any; + export function isReadonlyKeyword(node: Node): node is ReadonlyKeyword { return node.kind === SyntaxKind.ReadonlyKeyword; } +export declare namespace isReadonlyKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isReadonlyKeyword.Handle = isReadonlyKeyword as any; + export function isOutKeyword(node: Node): node is OutKeyword { return node.kind === SyntaxKind.OutKeyword; } +export declare namespace isOutKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isOutKeyword.Handle = isOutKeyword as any; + export function isOverrideKeyword(node: Node): node is OverrideKeyword { return node.kind === SyntaxKind.OverrideKeyword; } +export declare namespace isOverrideKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isOverrideKeyword.Handle = isOverrideKeyword as any; + export function isStaticKeyword(node: Node): node is StaticKeyword { return node.kind === SyntaxKind.StaticKeyword; } +export declare namespace isStaticKeyword { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isStaticKeyword.Handle = isStaticKeyword as any; + export function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken { return isBinaryOperator(node.kind); } +export declare namespace isBinaryOperatorToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isBinaryOperatorToken.Handle = isBinaryOperatorToken as any; + export function isAssignmentOperatorToken(node: Node): node is AssignmentOperatorToken { return isAssignmentOperator(node.kind); } +export declare namespace isAssignmentOperatorToken { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isAssignmentOperatorToken.Handle = isAssignmentOperatorToken as any; + export function isNullLiteral(node: Node): node is NullLiteral { return node.kind === SyntaxKind.NullKeyword; } +export declare namespace isNullLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isNullLiteral.Handle = isNullLiteral as any; + export function isTrueLiteral(node: Node): node is TrueLiteral { return node.kind === SyntaxKind.TrueKeyword; } +export declare namespace isTrueLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isTrueLiteral.Handle = isTrueLiteral as any; + export function isFalseLiteral(node: Node): node is FalseLiteral { return node.kind === SyntaxKind.FalseKeyword; } +export declare namespace isFalseLiteral { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isFalseLiteral.Handle = isFalseLiteral as any; + export function isThisExpression(node: Node): node is ThisExpression { return node.kind === SyntaxKind.ThisKeyword; } +export declare namespace isThisExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isThisExpression.Handle = isThisExpression as any; + export function isSuperExpression(node: Node): node is SuperExpression { return node.kind === SyntaxKind.SuperKeyword; } +export declare namespace isSuperExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isSuperExpression.Handle = isSuperExpression as any; + export function isImportExpression(node: Node): node is ImportExpression { return node.kind === SyntaxKind.ImportKeyword; } + +export declare namespace isImportExpression { + function Handle>(node: T): node is SpecializeNodeHandle; +} + +isImportExpression.Handle = isImportExpression as any; diff --git a/_packages/native-preview/test/async/api.test.ts b/_packages/native-preview/test/async/api.test.ts index f8e347cf67b..c313431f8c5 100644 --- a/_packages/native-preview/test/async/api.test.ts +++ b/_packages/native-preview/test/async/api.test.ts @@ -80,6 +80,7 @@ import { test, } from "node:test"; import { fileURLToPath } from "node:url"; +import { isSignatureDeclaration } from "../../src/ast/is.ts"; import { runBenchmarks } from "./api.bench.ts"; const defaultFiles = { @@ -1864,11 +1865,16 @@ export class Cache { assert.ok(callSigs.length > 0); const sig = callSigs[0]; assert.ok(sig.declaration); + assert.ok(isSignatureDeclaration.Handle(sig.declaration)); const node = await sig.declaration.resolve(project); assert.ok(node); + assert.ok(node.parameters); + assert.ok(isSignatureDeclaration(node)); // The handle remembers its canonical project, so resolve() works without an argument. const nodeFromCanonical = await sig.declaration.resolve(); assert.ok(nodeFromCanonical); + assert.ok(nodeFromCanonical.parameters); + assert.ok(isSignatureDeclaration(nodeFromCanonical)); assert.strictEqual(nodeFromCanonical.kind, node.kind); const methodPos = src.indexOf("getValue"); diff --git a/_packages/native-preview/test/sync/api.test.ts b/_packages/native-preview/test/sync/api.test.ts index 25adf528093..3535446d88e 100644 --- a/_packages/native-preview/test/sync/api.test.ts +++ b/_packages/native-preview/test/sync/api.test.ts @@ -88,6 +88,7 @@ import { test, } from "node:test"; import { fileURLToPath } from "node:url"; +import { isSignatureDeclaration } from "../../src/ast/is.ts"; import { runBenchmarks } from "./api.bench.ts"; const defaultFiles = { @@ -1872,11 +1873,16 @@ export class Cache { assert.ok(callSigs.length > 0); const sig = callSigs[0]; assert.ok(sig.declaration); + assert.ok(isSignatureDeclaration.Handle(sig.declaration)); const node = sig.declaration.resolve(project); assert.ok(node); + assert.ok(node.parameters); + assert.ok(isSignatureDeclaration(node)); // The handle remembers its canonical project, so resolve() works without an argument. const nodeFromCanonical = sig.declaration.resolve(); assert.ok(nodeFromCanonical); + assert.ok(nodeFromCanonical.parameters); + assert.ok(isSignatureDeclaration(nodeFromCanonical)); assert.strictEqual(nodeFromCanonical.kind, node.kind); const methodPos = src.indexOf("getValue"); diff --git a/_scripts/generate-ts-ast.ts b/_scripts/generate-ts-ast.ts index 17ff07631b4..eed6f9b862f 100644 --- a/_scripts/generate-ts-ast.ts +++ b/_scripts/generate-ts-ast.ts @@ -1422,6 +1422,11 @@ function generateIsGenerated(): string { out.push(` ${t},`); } out.push(`} from "./ast.ts";`); + out.push(`import type { NodeHandle as AsyncNodeHandle } from "../api/async/api.ts";`); + out.push(`import type { NodeHandle as SyncNodeHandle } from "../api/sync/api.ts";`); + out.push(`type NodeHandleLike = { kind: SyntaxKind; resolve(...args: any): any; };`); + // Note that we must `& T` to satisfy the requirements of a type guard, and it must be _second_ so the narrowed `resolve` overload from the specialization is selected (order matters) + out.push(`type SpecializeNodeHandle, U extends Node> = T extends AsyncNodeHandle ? AsyncNodeHandle & T : SyncNodeHandle & T;`); out.push(``); // ── Simple guards ── @@ -1446,6 +1451,11 @@ function generateIsGenerated(): string { } out.push(`}`); out.push(``); + out.push(`export declare namespace ${g.funcName} {`); + out.push(` function Handle>(node: T): node is SpecializeNodeHandle;`); + out.push(`}`); + out.push(`${g.funcName}.Handle = ${g.funcName} as any;`); + out.push(``); } // ── Composite guards ── @@ -1454,6 +1464,12 @@ function generateIsGenerated(): string { out.push(` ${g.body}`); out.push(`}`); out.push(``); + out.push(`export declare namespace ${g.funcName} {`); + out.push(` function Handle>(node: T): node is SpecializeNodeHandle;`); + out.push(`}`); + out.push(``); + out.push(`${g.funcName}.Handle = ${g.funcName} as any;`); + out.push(``); } // ── Kind alias guards ── @@ -1480,10 +1496,17 @@ function generateIsGenerated(): string { // ── Token alias guards ── for (const g of tokenAliasGuards) { const returnType = g.isRangeBased ? `boolean` : `node is ${g.typeName}`; + const handleReturnType = g.isRangeBased ? `boolean` : `node is SpecializeNodeHandle`; out.push(`export function ${g.funcName}(node: Node): ${returnType} {`); out.push(` ${g.body}`); out.push(`}`); out.push(``); + out.push(`export declare namespace ${g.funcName} {`); + out.push(` function Handle>(node: T): ${handleReturnType};`); + out.push(`}`); + out.push(``); + out.push(`${g.funcName}.Handle = ${g.funcName} as any;`); + out.push(``); } while (out.length > 0 && out[out.length - 1] === "") out.pop();