import { ExpandResult, ScanExportsResult, ScanPackagesResult } from './types'; export * from './types'; /** Options accepted by `scanPackages`, mirroring the CLI's `scan-packages` flags. */ export interface ScanPackagesOptions { /** Conditional compilation flags to treat as set, e.g. `['DEBUG']`. */ defines?: string[]; /** Overrides the scanner binary path. Defaults to the one shipped with this package. */ binaryPath?: string; /** Milliseconds after which the scanner is killed and the scan fails. No limit by default. */ timeout?: number; } /** * Options accepted by `scanExports`. The deep scan evaluates `#if` per platform with no flags set, so * it takes no define option. */ export interface ScanExportsOptions { /** Overrides the scanner binary path. Defaults to the one shipped with this package. */ binaryPath?: string; /** Milliseconds after which the scanner is killed and the scan fails. No limit by default. */ timeout?: number; } /** Options accepted by `expandMacros`, mirroring the CLI's `expand` flags. */ export interface ExpandMacrosOptions { /** * Limits the result to these symbols: a type (`'MyModule'`, `'MyModule.Options'`) or a member * (`'MyModule.greet'`). A member expands its type with only the declarations of that name. Each * symbol must be declared in one of the files, or the call fails with a `ScannerError`. */ symbols?: string[]; /** Returns only the diagnostics, with no expansions. */ diagnosticsOnly?: boolean; /** Overrides the scanner binary path. Defaults to the one shipped with this package. */ binaryPath?: string; /** Milliseconds after which the scanner is killed and the call fails. No limit by default. */ timeout?: number; } /** * Thrown when the scanner exits non-zero. Exit code 2 is a usage error (bad subcommand or flags) and * 1 means the report couldn't be encoded; both put a message on stderr, carried here as `stderr`. */ export declare class ScannerError extends Error { readonly exitCode: number | null; readonly stderr: string; constructor(message: string, exitCode: number | null, stderr: string); } /** Thrown when the binary's output schema doesn't match what these types were written against. */ export declare class ScannerSchemaVersionError extends Error { readonly command: string; readonly found: number; readonly expected: number; constructor(command: string, found: number, expected: number); } /** * Absolute path to the scanner binary for the current platform. It doubles as the macro plugin * executable. * * - macOS: the universal binary shipped in this package, next to the Swift package rather than in a * `bin` directory. * - Windows and Linux: `ExpoModulesMacros.exe` or `ExpoModulesMacros` from the package for the * current platform and architecture (see `platformBinaryPackageName`). When that package isn't * installed, for example in this repository, it falls back to the executable that `pnpm run build` * writes to `platforms/-`. * * The path isn't checked here; running a missing binary fails with a `ScannerError` that says how to * get it. */ export declare function getScannerBinaryPath(): string; /** * Fast scan for top-level `@ExpoModule`, `@SharedObject` and `@ExpoView` classes, for autolinking. Each path is a `.swift` file or a * directory, scanned recursively. * * Conditions the scan can't answer statically come back in `warnings` rather than throwing, so the * caller can surface them alongside its own diagnostics. */ export declare function scanPackages(paths: string[], options?: ScanPackagesOptions): Promise; /** @deprecated Renamed to `scanPackages`. */ export declare const scanModules: typeof scanPackages; /** @deprecated Renamed to `ScanPackagesOptions`. */ export type ScanModulesOptions = ScanPackagesOptions; /** * Deep scan of the full JS-exported surface, for TypeScript type generation. Each path is a `.swift` * file or a directory, scanned recursively. * * Each declaration and member reports the Apple OSes whose `#if` conditions and `@available` * attributes include it. `#if` is read only where the runtime sees what it holds: around types, * `@Event` members, and enum cases. No define option is taken: a condition on a custom flag never holds, so * what it guards is not reported. */ export declare function scanExports(paths: string[], options?: ScanExportsOptions): Promise; /** * Expands the Expo macros in process, without a build, and returns the generated * code with the syntax errors and the macro diagnostics. The macros only read the syntax tree, so * the code is what the compiler gets, except for the names that a macro makes unique. Errors that * need type checking, for example a type that doesn't conform to a protocol, still need a build. * * Each path is a `.swift` file, which is always expanded and keeps its path in the result, or a * directory. A directory is walked like the scans walk it, and only its files that use one of the * macros are expanded, with their absolute paths. * * Error diagnostics don't make the call fail: check `severity` in `diagnostics`. Only an input that * can't be expanded (a missing path, a file that isn't Swift, a symbol that no file declares) throws * a `ScannerError`. */ export declare function expandMacros(paths: string[], options?: ExpandMacrosOptions): Promise;