/** * This file is part of the NocoBase (R) project. * Copyright (c) 2020-2024 NocoBase Co., Ltd. * Authors: NocoBase Team. * * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. * For more information, please refer to: https://www.nocobase.com/agreement. */ import type { SourceBinding, SourceRange, StringLiteralBinding } from '../internal-types'; export declare function collectSourceBindings(masked: string, functionRanges: SourceRange[], blockRanges: SourceRange[], staticBlockRanges: SourceRange[]): SourceBinding[]; export declare function collectStringLiteralBindings(source: string, masked: string, bindings: SourceBinding[]): StringLiteralBinding[]; export declare function isNamedFunctionOrClassExpression(masked: string, keywordIndex: number, kind: string): boolean; export declare function isExpressionPrefixToken(token: string): boolean; export declare function findNamedFunctionOrClassExpressionRange(masked: string, keywordIndex: number, kind: string): { start: number; end: number; }; export declare function addSourceBinding(bindings: SourceBinding[], functionRanges: SourceRange[], blockRanges: SourceRange[], staticBlockRanges: SourceRange[], masked: string, name: string, start: number, sourceEnd: number, kind: string): void; export declare function resolveBindingScope(masked: string, sourceEnd: number, start: number, kind: string, functionRanges: SourceRange[], blockRanges: SourceRange[], staticBlockRanges: SourceRange[]): SourceRange; export declare function findForScopeForDeclaration(masked: string, start: number, blockRanges: SourceRange[]): { start: number; end: number; }; export declare function findForHeaderRangeContaining(masked: string, start: number): { start: number; end: number; }; export declare function findFollowingBraceRange(masked: string, afterIndex: number, blockRanges: SourceRange[]): SourceRange; export declare function findFollowingStatementRange(masked: string, afterIndex: number, blockRanges: SourceRange[]): SourceRange; export declare function findSingleStatementEnd(masked: string, start: number): number; export declare function collectDestructuredVariableBindingNames(masked: string, functionRanges: SourceRange[], blockRanges: SourceRange[], staticBlockRanges: SourceRange[], bindings: SourceBinding[]): void; export declare function collectParameterBindingNames(masked: string, bindings: SourceBinding[]): void; export declare function collectArrowParameterBindingNames(masked: string, bindings: SourceBinding[]): void; export declare function collectMethodParameterBindingNames(masked: string, bindings: SourceBinding[]): void; export declare function findBraceBodyAfter(masked: string, afterIndex: number): SourceRange | undefined; export declare function findArrowBodyRange(masked: string, afterArrowIndex: number): SourceRange | undefined; export declare function addParameterBindings(bindings: SourceBinding[], params: string, range: SourceRange): void; export declare function extractBindingPatternNames(pattern: string): string[]; export declare function collectBindingPatternNames(pattern: string, names: Set): void; export declare function collectObjectBindingPatternNames(pattern: string, names: Set): void; export declare function collectArrayBindingPatternNames(pattern: string, names: Set): void; export declare function findInnermostRange(index: number, ranges: SourceRange[]): SourceRange; export declare function isNameBoundAtIndex(bindings: SourceBinding[], name: string, index: number): boolean; export declare function findSourceBindingByDeclaration(bindings: SourceBinding[], name: string, declarationStart: number): SourceBinding; export declare function isSameAstRange(left: SourceRange, right: SourceRange): boolean; export declare function isSourceAliasShadowedAtIndex(alias: SourceRange & { declarationStart?: number; name: string; }, bindings: SourceBinding[], index: number): boolean; export declare function isAstDefinitelyNonEmptyForInSource(node: any): any; export declare function isAstDefinitelyNonEmptyForOfSource(node: any): any; export declare function isAstDefinitelyNonEmptyArrayElement(element: any): boolean; export declare function isAstDefinitelyEnumerableObjectProperty(property: any): boolean; export declare function isAstDefinitelyEnumerableComputedObjectKey(key: any): boolean; export declare function findAstAncestor(ancestors: any[], type: string): any; export declare function getAstExecutionScopeRange(ancestors: any[], sourceLength: number): SourceRange; export declare function isAstAlwaysExecutedInCurrentExecutionScope(ancestors: any[]): boolean; export declare function getAstBindingScopeRange(ancestors: any[], sourceLength: number, functionScoped?: boolean): SourceRange; export declare function isAstFunctionLike(node: any): boolean; export declare function dedupeIndexedEntries(entries: T[]): T[]; export declare function unwrapAstChainExpression(node: any): any;