export type SymbolKind = "class" | "struct" | "enum" | "alias" | "function"; export interface EngineSymbol { name: string; kind: SymbolKind; /** Path under Engine/Source, forward slashes. Where it is declared. */ header: string; /** The owning module, taken from the path (Runtime//...). */ module: string; /** What to put in an #include, which is the path below Public/ or Classes/. */ include: string; line: number; /** The declaration line, trimmed. */ signature: string; /** Carries a MODULE_API export macro, so it is usable outside its module. */ exported: boolean; /** Marked UE_DEPRECATED, with the version and message when they were given. */ deprecated?: { version?: string; message?: string; }; /** Base class, for a class or struct that named one. */ parent?: string; } export interface EngineIndex { engineRoot: string; engineVersion: string; builtAt: string; trees: string[]; headerCount: number; symbolCount: number; /** Symbol name to every declaration of it. A name is rarely unique. */ symbols: Record; } /** * What gets indexed. * * The first three are the engine's own trees under `Engine/Source`. `Plugins` * is `Engine/Plugins`, and it is not optional: Gameplay Abilities, Niagara, * PCG, Enhanced Input, StateTree and Chooser are all plugins, so an index * without them cannot answer the questions most often asked of it. * * It is filtered rather than taken whole. All 51,178 plugin headers include a * great deal of vendored third-party code and a great deal of `Private`. * Restricting to `Public` and `Classes` leaves 14,154 and loses nothing * usable, because a `Private` header cannot be included from another module in * the first place: it could only ever answer "does this exist" with a symbol * the caller is unable to reach. */ export declare const DEFAULT_TREES: readonly ["Runtime", "Editor", "Developer", "Plugins"]; /** * The include path for a header: the part below `Public/`, `Classes/` or * `Internal/`. * * `Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h` is included as * `GameFramework/Actor.h`, not by its path on disk. A header under `Private/` * has no include path that works from another module, and is reported by its * full path so the caller can see why. */ export declare function includePathFor(relHeader: string): string; /** * The module a header belongs to. * * Two layouts, because the engine and its plugins are laid out differently * and both have to end up as one table: * * Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h -> Engine * Engine/Plugins/Runtime/GameplayAbilities/Source/ * GameplayAbilities/Public/AbilitySystemComponent.h -> GameplayAbilities * * A plugin's module is the segment after its `Source/`, which is also the name * that goes in a Build.cs dependency list. For the engine trees it is the * segment after the tree. */ export declare function moduleFor(relHeader: string): string; /** Whether a header can be included from another module at all. */ export declare function isPrivateHeader(relHeader: string): boolean; /** * Does what follows a `class Foo` read as a definition rather than a use? * * Accepts an empty tail, `final`, an alignas, and a base-class list. Rejects * anything holding a `*`, `&`, `(` or `=`, which is what a return type, a * variable declaration or an alias looks like. */ export declare function isDefinitionTail(tail: string): boolean; /** * The engine's type-prefix convention, stripped, so `AActor` can be matched * against `Actor.h`. Only stripped when what follows still looks like a type * name, so `FVector` gives `Vector` but `Frustum` is left alone. */ export declare function unprefixed(name: string): string; /** * Pull every recognisable declaration out of one header. * * Exported rather than private so the unit tests can hold the recognition * rules against small, readable inputs instead of against the engine. */ export declare function scanHeader(source: string, relHeader: string): EngineSymbol[]; /** The engine's own version string, used to invalidate the cache. */ export declare function engineVersionOf(engineRoot: string): string; export interface BuildProgress { (done: number, total: number): void; } /** Scan the engine tree and build the index. Slow on a cold cache; see the * module comment. Callers should go through `loadEngineIndex`. */ export declare function buildEngineIndex(engineRoot: string, trees?: readonly string[], onProgress?: BuildProgress): EngineIndex; /** Where indexes live: beside the user state, so every project on one engine * shares one index rather than each paying the cold-scan cost. */ export declare function indexCacheDir(): string; /** A stable filename for one engine root, so two installs never collide. */ export declare function indexCacheFile(engineRoot: string, trees?: readonly string[]): string; /** Read a cached index, or null when there is none, it is unreadable, or the * engine has been upgraded since it was written. */ export declare function readCachedIndex(engineRoot: string, trees?: readonly string[]): EngineIndex | null; /** Persist an index. Best-effort: a cache that cannot be written is a slow * next call, not a failed one. */ export declare function writeCachedIndex(index: EngineIndex): string | null; export interface LoadOptions { trees?: readonly string[]; /** Rebuild even when a valid cache exists. */ refresh?: boolean; onProgress?: BuildProgress; } export interface LoadedIndex { index: EngineIndex; /** Where it came from, which the actions report so a slow first call is * explained rather than mysterious. */ source: "cache" | "built"; cacheFile: string | null; buildMs?: number; } /** The index for one engine, from memory or cache when possible. */ export declare function loadEngineIndex(engineRoot: string, options?: LoadOptions): LoadedIndex; /** * Every declaration of a name, best first. * * "Best" is the one a caller wants to include: an exported declaration in a * public header beats a private or unexported one, and Runtime beats Editor, * because a symbol declared in both is nearly always wanted from Runtime. */ export declare function lookupSymbol(index: EngineIndex, name: string): EngineSymbol[]; /** * Resolve `Class::Method` by finding the class, then looking for the method * inside that class's header. * * The index holds types, not members, because indexing every member of every * engine header is a much larger table for a question that is nearly always * asked about a type. A member query is answered by reading the one file the * type resolved to, which costs a single read. */ export declare function lookupMember(index: EngineIndex, className: string, memberName: string): { owner: EngineSymbol; line: number; signature: string; } | null; /** Split `UGameplayStatics::GetPlayerPawn` into its parts. */ export declare function splitQualified(name: string): { className?: string; member: string; };