/**
 * 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 { AstCapabilityAlias, AstIdentifierBinding, AstIdentifierWrite, CtxMethodAlias, CtxRootAlias, RunJsAstInspection, SourceBinding, SourceRange, StaticFilterValueBinding, StaticStringBinding } from '../internal-types';
export declare function resolveCtxMethodCall(node: any, aliases: CtxMethodAlias[], identifierBindings: AstIdentifierBinding[]): CtxMethodAlias | {
    capability: string;
    method: string;
};
export declare function getCtxMethodName(node: any, identifierBindings: AstIdentifierBinding[]): string;
export declare function getAstStaticPropertyName(node: any): string;
export declare function getAstStaticMemberKey(node: any): string;
export declare function isCtxIdentifier(node: any): boolean;
export declare function isUnshadowedCtxIdentifier(node: any, identifierBindings: AstIdentifierBinding[]): boolean;
export declare function isCtxRootFromAst(node: any, aliases: CtxRootAlias[], identifierBindings: AstIdentifierBinding[]): any;
export declare function hasAstActiveBinding(name: string, index: number, identifierBindings: AstIdentifierBinding[]): boolean;
export declare function isAstCtxApiAliasAssignmentOperator(operator: string): boolean;
export declare function isAstDefiniteAssignmentOperator(operator: string): boolean;
export declare function getAstAssignmentTargetScope(target: any, ancestors: any[], sourceLength: number, identifierBindings: AstIdentifierBinding[]): SourceRange;
export declare function getAstMemberAssignmentTargetScope(target: any, ancestors: any[], sourceLength: number, identifierBindings: AstIdentifierBinding[]): SourceRange;
export declare function findUnboundCtxMatches(masked: string, pattern: RegExp, bindings: SourceBinding[]): {
    index: number;
    match: string;
}[];
export declare function dedupeAstResourceEntries(entries: RunJsAstInspection['invalidResourceTypeCalls']): {
    capability: string;
    expression?: string;
    index: number;
    resourceType?: string;
    ruleId: string;
}[];
export declare function resolveAstResourceTypeExpression(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): {
    status: 'resolved';
    value: string;
} | {
    status: 'unresolved';
    expression: string;
};
export declare function resolveAstStaticStringValue(node: any, source: string): string | undefined;
export declare function resolveAstStaticTemplateLiteralValue(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): string | undefined;
export declare function resolveAstAliasBinding<T extends SourceRange & {
    name: string;
}>(name: string, index: number, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
export declare function resolveAstMemberAliasBinding<T extends SourceRange & {
    name: string;
}>(node: any, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
export declare function getAstMemberAliasLookup(node: any): {
    aliasName: string;
    index: number;
    rootName: string;
} | undefined;
export declare function getAstMemberWriteLookup(node: any): {
    aliasName: string;
    index: number;
    rootName: string;
} | undefined;
export declare function getAstMemberRootIdentifier(node: any): {
    index: number;
    name: string;
} | undefined;
export declare function getAstAliasRootName(name: string): string;
export declare function resolveAstNamedAliasBinding<T extends SourceRange & {
    name: string;
}>(name: string, index: number, rootName: string | undefined, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
export declare function resolveAstDynamicAliasBinding<T extends SourceRange & {
    name: string;
}>(name: string, index: number, rootName: string | undefined, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
export declare function compareAstAliasPrecedence(left: SourceRange & {
    precedenceStart?: number;
}, right: SourceRange & {
    precedenceStart?: number;
}): number;
export declare function getAstAliasPrecedenceStart(alias: SourceRange & {
    precedenceStart?: number;
}): number;
export declare function isAstDynamicMemberAliasMatch(patternName: string, name: string): boolean;
export declare function resolveAstActiveIdentifierBinding(name: string, index: number, identifierBindings: AstIdentifierBinding[]): AstIdentifierBinding | undefined;
export declare function hasAstShadowBinding(name: string, index: number, alias: SourceRange, identifierBindings: AstIdentifierBinding[]): boolean;
export declare function addAstFunctionParamBindings(bindings: AstIdentifierBinding[], node: any, sourceLength: number): void;
export declare function collectAstPatternBindingIdentifiers(node: any, addBinding: (name: string, node: any) => void): void;
export declare function collectAstObjectPatternAliases(pattern: any, addAlias: (alias: string, member: string, node?: any) => void): void;
export declare function collectAstObjectPatternPathAliases(pattern: any, addAlias: (alias: string, members: string[], node?: any) => void, parentMembers?: string[]): void;
export declare function collectAstPatternDefaultValueAliases(pattern: any, addAlias: (alias: string, valueNode: any, aliasNode: any, defaultPattern: any) => void): void;
export declare function collectAstPatternDefaultValueAliasesWithSource(pattern: any, sourceTarget: any, addAlias: (alias: string, valueNode: any, aliasNode: any, defaultPattern: any, sourceTarget: any) => void): void;
export declare function collectAstPatternSourceTargets(pattern: any, sourceNode: any, visit: (target: any, sourceTarget: any) => void): void;
export declare function collectAstPatternCarrierSourceTargets<T extends AstCapabilityAlias>(pattern: any, sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstPatternCarrierSourceTargetsFromSourceTarget<T extends AstCapabilityAlias>(pattern: any, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstPatternSourceTargetsRec(pattern: any, sourceTarget: any, visit: (target: any, sourceTarget: any) => void): void;
export declare function collectAstPatternRestCarrierSourceTargets<T extends AstCapabilityAlias>(pattern: any, sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstPatternRestCarrierSourceTargetsRec<T extends AstCapabilityAlias>(pattern: any, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstObjectRestCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, sourceTarget: any, excludedMembers: Set<string>, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, targetAliasName: string, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstArrayRestCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, sourceTarget: any, restStartIndex: number, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
    sourceAlias?: T;
    sourceTarget?: any;
    target: any;
    targetAliasName: string;
}) => void): void;
export declare function collectAstRestCarrierAliasCopies<T extends AstCapabilityAlias>(sourceTarget: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias: T) => void): void;
export declare function collectAstLiteralSpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void): void;
export declare function collectAstCarrierCandidateMembers<T extends AstCapabilityAlias>(sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[]): Set<string>;
export declare function collectAstObjectSpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void, excludedMembers?: Set<string>): void;
export declare function collectAstDynamicCarrierSourceTargets(sourceNode: any, visit: (suffix: string, sourceTarget: any) => void): void;
export declare function collectAstArraySpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void): void;
export declare function collectAstStaticCarrierMemberSourceTargets(node: any, visit: (member: string, sourceTarget: any) => void): void;
export declare function getAstStaticArrayElementCount(node: any): number | undefined;
export declare function collectAstObjectPatternStaticMembers(pattern: any): Set<string>;
export declare function getAstPatternTargetAliasLookup(target: any): {
    aliasName: string;
    index: number;
    rootName: string;
} | undefined;
export declare function collectAstPatternMemberExpressions(pattern: any, visit: (memberNode: any) => void): void;
export declare function createAstPatternSourceTarget(node: any): {
    node: any;
    aliasName: string;
    rootName: string;
    index: any;
};
export declare function createMaybeAstPatternSourceTarget(node: any): {
    node: any;
    aliasName: string;
    rootName: string;
    index: any;
};
export declare function getAstPatternMemberSourceTarget(sourceTarget: any, member: string): any;
export declare function getAstStaticCarrierMemberSourceTarget(node: any, member: string): any;
export declare function getAstObjectCarrierMemberSourceTarget(node: any, member: string): any;
export declare function getAstArrayCarrierMemberSourceTarget(node: any, member: string): any;
export declare function createAstAmbiguousSourceTarget(sourceTarget: any): any;
export declare function getAstSpreadMemberSourceTarget(spreadArgument: any, member: string): any;
export declare function createAstFallbackSourceTarget(fallbackSourceTargets: any[], index: number): {
    fallbackSourceTargets: any[];
    index: number;
};
export declare function getAstPatternSourceRoot(node: any): {
    aliasName: string;
    index: number;
    rootName: string;
} | undefined;
export declare function getAstStaticCarrierMemberValue(node: any, member: string): any;
export declare function collectAstKnownCarrierMembers(node: any, visit: (member: string, valueNode: any, aliasNode?: any) => void): void;
export declare function collectAstStaticCarrierMembers(node: any, visit: (member: string, valueNode: any, aliasNode?: any) => void): void;
export declare function getAstBindingIdentifierNode(node: any): any;
export declare function getAstBindingIdentifierName(node: any): string;
export declare function getAstObjectPatternFromValue(node: any): any | undefined;
export declare function trimAstAliasesAfterWrites<T extends SourceRange & {
    declarationStart?: number;
    executionScope: SourceRange;
    name: string;
}>(aliases: T[], writes: AstIdentifierWrite[], identifierBindings: AstIdentifierBinding[]): T[];
export declare function resolveRunJsStaticString(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): string;
export declare function resolveRunJsStaticObjectExpression(node: any, identifierBindings: AstIdentifierBinding[], staticFilterValueBindings: StaticFilterValueBinding[]): any;
export declare function resolveRunJsStaticObjectExpressionRec(node: any, identifierBindings: AstIdentifierBinding[], staticFilterValueBindings: StaticFilterValueBinding[], seen?: Set<StaticFilterValueBinding>): any | undefined;
export declare function getRunJsObjectProperty(node: any, names: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): any;
export declare function getRunJsObjectPropertyByPath(node: any, members: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): any;
export declare function getRunJsObjectPropertyLookup(node: any, names: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): {
    property: any;
    status: 'found';
} | {
    status: 'missing' | 'unknown';
};
