import { BabelFileResult } from '@babel/core'; import { e3 as SourceLocation$1, I as Identifier$1, aY as FunctionDeclaration, B as BlockStatement, q as Comment, aZ as FunctionExpression$1, m as ArrowFunctionExpression, f as Program, g as Function, i as FlowType, T as TSType, H as BinaryExpression, dS as UnaryExpression, dV as UpdateExpression, N as Node, bz as LogicalExpression } from './babel-types.d-DFYaN2-m.js'; import { S as Scope, N as NodePath } from './babel-traverse.d-CSGq7n0v.js'; import { z } from 'zod'; export { CompilerDiagnostic, CompilerError, CompilerErrorDetail, CompilerSuggestionOperation, Effect, ErrorCategory, ErrorSeverity, LintRules, OPT_IN_DIRECTIVES, OPT_OUT_DIRECTIVES, ProgramContext, ValueKind, ValueReason, compile, compileProgram, default, findDirectiveDisablingMemoization, findDirectiveEnablingMemoization, parseConfigPragmaForTests, parsePluginOptions, printFunctionWithOutlined, printHIR, printReactiveFunction, printReactiveFunctionWithOutlined, validateEnvironmentConfig } from 'babel-plugin-react-compiler'; interface Result { map(fn: (val: T) => U): Result; mapErr(fn: (val: E) => F): Result; mapOr(fallback: U, fn: (val: T) => U): U; mapOrElse(fallback: () => U, fn: (val: T) => U): U; andThen(fn: (val: T) => Result): Result; and(res: Result): Result; or(res: Result): Result; orElse(fn: (val: E) => Result): Result; isOk(): this is OkImpl; isErr(): this is ErrImpl; expect(msg: string): T; expectErr(msg: string): E; unwrap(): T; unwrapOr(fallback: T): T; unwrapOrElse(fallback: (val: E) => T): T; unwrapErr(): E; } export class OkImpl implements Result { #private; constructor(val: T); map(fn: (val: T) => U): Result; mapErr(_fn: (val: never) => F): Result; mapOr(_fallback: U, fn: (val: T) => U): U; mapOrElse(_fallback: () => U, fn: (val: T) => U): U; andThen(fn: (val: T) => Result): Result; and(res: Result): Result; or(_res: Result): Result; orElse(_fn: (val: never) => Result): Result; isOk(): this is OkImpl; isErr(): this is ErrImpl; expect(_msg: string): T; expectErr(msg: string): never; unwrap(): T; unwrapOr(_fallback: T): T; unwrapOrElse(_fallback: (val: never) => T): T; unwrapErr(): never; } export class ErrImpl implements Result { #private; constructor(val: E); map(_fn: (val: never) => U): Result; mapErr(fn: (val: E) => F): Result; mapOr(fallback: U, _fn: (val: never) => U): U; mapOrElse(fallback: () => U, _fn: (val: never) => U): U; andThen(_fn: (val: never) => Result): Result; and(_res: Result): Result; or(res: Result): Result; orElse(fn: (val: E) => ErrImpl): Result; isOk(): this is OkImpl; isErr(): this is ErrImpl; expect(msg: string): never; expectErr(_msg: string): E; unwrap(): never; unwrapOr(fallback: T): T; unwrapOrElse(fallback: (val: E) => T): T; unwrapErr(): E; } type AliasingEffect = { kind: 'Freeze'; value: Place; reason: ValueReason; } | { kind: 'Mutate'; value: Place; reason?: MutationReason | null; } | { kind: 'MutateConditionally'; value: Place; } | { kind: 'MutateTransitive'; value: Place; } | { kind: 'MutateTransitiveConditionally'; value: Place; } | { kind: 'Capture'; from: Place; into: Place; } | { kind: 'Alias'; from: Place; into: Place; } | { kind: 'MaybeAlias'; from: Place; into: Place; } | { kind: 'Assign'; from: Place; into: Place; } | { kind: 'Create'; into: Place; value: ValueKind; reason: ValueReason; } | { kind: 'CreateFrom'; from: Place; into: Place; } | { kind: 'ImmutableCapture'; from: Place; into: Place; } | { kind: 'Apply'; receiver: Place; function: Place; mutatesFunction: boolean; args: Array; into: Place; signature: FunctionSignature | null; loc: SourceLocation; } | { kind: 'CreateFunction'; captures: Array; function: FunctionExpression | ObjectMethod; into: Place; } | { kind: 'MutateFrozen'; place: Place; error: CompilerDiagnostic; } | { kind: 'MutateGlobal'; place: Place; error: CompilerDiagnostic; } | { kind: 'Impure'; place: Place; error: CompilerDiagnostic; } | { kind: 'Render'; place: Place; }; type MutationReason = { kind: 'AssignCurrentProperty'; }; type AliasingSignature = { receiver: IdentifierId; params: Array; rest: IdentifierId | null; returns: IdentifierId; effects: Array; temporaries: Array; }; type BuiltInType = PrimitiveType | FunctionType | ObjectType; type Type = BuiltInType | PhiType | TypeVar | PolyType | PropType | ObjectMethod$1; type PrimitiveType = { kind: 'Primitive'; }; type FunctionType = { kind: 'Function'; shapeId: string | null; return: Type; isConstructor: boolean; }; type ObjectType = { kind: 'Object'; shapeId: string | null; }; type TypeVar = { kind: 'Type'; id: TypeId; }; type PolyType = { kind: 'Poly'; }; type PhiType = { kind: 'Phi'; operands: Array; }; type PropType = { kind: 'Property'; objectType: Type; objectName: string; propertyName: { kind: 'literal'; value: PropertyLiteral; } | { kind: 'computed'; value: Type; }; }; type ObjectMethod$1 = { kind: 'ObjectMethod'; }; declare const opaqueTypeId: unique symbol; type TypeId = number & { [opaqueTypeId]: 'IdentifierId'; }; type HookKind = 'useContext' | 'useState' | 'useActionState' | 'useReducer' | 'useRef' | 'useEffect' | 'useLayoutEffect' | 'useInsertionEffect' | 'useMemo' | 'useCallback' | 'useTransition' | 'useImperativeHandle' | 'useEffectEvent' | 'Custom'; type FunctionSignature = { positionalParams: Array; restParam: Effect | null; returnType: BuiltInType | PolyType; returnValueKind: ValueKind; returnValueReason?: ValueReason; calleeEffect: Effect; hookKind: HookKind | null; noAlias?: boolean; mutableOnlyIfOperandsAreMutable?: boolean; impure?: boolean; canonicalName?: string; aliasing?: AliasingSignature | null | undefined; }; type Global = BuiltInType | PolyType; type ResolvedType = { kind: 'Concrete'; type: ConcreteType; platform: Platform; }; type ComponentType = { kind: 'Component'; props: Map; children: null | T; }; type ConcreteType = { kind: 'Enum'; } | { kind: 'Mixed'; } | { kind: 'Number'; } | { kind: 'String'; } | { kind: 'Boolean'; } | { kind: 'Void'; } | { kind: 'Nullable'; type: T; } | { kind: 'Array'; element: T; } | { kind: 'Set'; element: T; } | { kind: 'Map'; key: T; value: T; } | { kind: 'Function'; typeParameters: null | Array>; params: Array; returnType: T; } | ComponentType | { kind: 'Generic'; id: TypeParameterId; bound: T; } | { kind: 'Object'; id: NominalId; members: Map; } | { kind: 'Tuple'; id: NominalId; members: Array; } | { kind: 'Structural'; id: LinearId; } | { kind: 'Union'; members: Array; } | { kind: 'Instance'; name: string; members: Map; }; type TypeParameter = { name: string; id: TypeParameterId; bound: T; }; declare const opaqueLinearId: unique symbol; type LinearId = number & { [opaqueLinearId]: 'LinearId'; }; declare const opaqueTypeParameterId: unique symbol; type TypeParameterId = number & { [opaqueTypeParameterId]: 'TypeParameterId'; }; declare const opaqueNominalId: unique symbol; type NominalId = number & { [opaqueNominalId]: 'NominalId'; }; type Platform = 'client' | 'server' | 'shared'; interface ITypeEnv { popGeneric(name: string): void; getGeneric(name: string): null | TypeParameter; pushGeneric(name: string, binding: { name: string; id: TypeParameterId; bound: ResolvedType; }): void; getType(id: Identifier): ResolvedType; getTypeOrNull(id: Identifier): ResolvedType | null; setType(id: Identifier, type: ResolvedType): void; nextNominalId(): NominalId; nextTypeParameterId(): TypeParameterId; moduleEnv: Map; addBinding(bindingIdentifier: Identifier$1, type: ResolvedType): void; resolveBinding(bindingIdentifier: Identifier$1): ResolvedType | null; } export class FlowTypeEnv implements ITypeEnv { #private; moduleEnv: Map; init(env: Environment, source: string): void; setType(identifier: Identifier, type: ResolvedType): void; getType(identifier: Identifier): ResolvedType; getTypeOrNull(identifier: Identifier): ResolvedType | null; getTypeByLoc(loc: SourceLocation): ResolvedType | null; nextNominalId(): NominalId; nextTypeParameterId(): TypeParameterId; addBinding(bindingIdentifier: Identifier$1, type: ResolvedType): void; resolveBinding(bindingIdentifier: Identifier$1): ResolvedType | null; pushGeneric(name: string, generic: TypeParameter): void; popGeneric(name: string): void; getGeneric(name: string): null | TypeParameter; } declare const ExternalFunctionSchema: z.ZodObject<{ source: z.ZodString; importSpecifierName: z.ZodString; }, "strip", z.ZodTypeAny, { source: string; importSpecifierName: string; }, { source: string; importSpecifierName: string; }>; type ExternalFunction = z.infer; type CompilerMode = 'all_features' | 'no_inferred_memo'; declare const HookSchema: z.ZodObject<{ effectKind: z.ZodNativeEnum; valueKind: z.ZodNativeEnum; noAlias: z.ZodDefault; transitiveMixedData: z.ZodDefault; }, "strip", z.ZodTypeAny, { noAlias: boolean; effectKind: Effect; valueKind: ValueKind; transitiveMixedData: boolean; }, { effectKind: Effect; valueKind: ValueKind; noAlias?: boolean | undefined; transitiveMixedData?: boolean | undefined; }>; type Hook = z.infer; declare const EnvironmentConfigSchema: z.ZodObject<{ customHooks: z.ZodDefault; valueKind: z.ZodNativeEnum; noAlias: z.ZodDefault; transitiveMixedData: z.ZodDefault; }, "strip", z.ZodTypeAny, { noAlias: boolean; effectKind: Effect; valueKind: ValueKind; transitiveMixedData: boolean; }, { effectKind: Effect; valueKind: ValueKind; noAlias?: boolean | undefined; transitiveMixedData?: boolean | undefined; }>>>; moduleTypeProvider: z.ZodDefault, z.ZodUnknown>>>; customMacros: z.ZodDefault; }, "strip", z.ZodTypeAny, { type: "wildcard"; }, { type: "wildcard"; }>, z.ZodObject<{ type: z.ZodLiteral<"name">; name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "name"; name: string; }, { type: "name"; name: string; }>]>, "many">], null>]>, "many">>>; enableResetCacheOnSourceFileChanges: z.ZodDefault>; enablePreserveExistingMemoizationGuarantees: z.ZodDefault; validatePreserveExistingMemoizationGuarantees: z.ZodDefault; enablePreserveExistingManualUseMemo: z.ZodDefault; enableForest: z.ZodDefault; enableUseTypeAnnotations: z.ZodDefault; flowTypeProvider: z.ZodDefault, z.ZodUnknown>>>; enableOptionalDependencies: z.ZodDefault; enableFire: z.ZodDefault; inferEffectDependencies: z.ZodDefault; autodepsIndex: z.ZodNumber; }, "strip", z.ZodTypeAny, { function: { source: string; importSpecifierName: string; }; autodepsIndex: number; }, { function: { source: string; importSpecifierName: string; }; autodepsIndex: number; }>, "many">>>; inlineJsxTransform: z.ZodDefault, z.ZodLiteral<"react.transitional.element">]>; globalDevVar: z.ZodString; }, "strip", z.ZodTypeAny, { elementSymbol: "react.element" | "react.transitional.element"; globalDevVar: string; }, { elementSymbol: "react.element" | "react.transitional.element"; globalDevVar: string; }>>>; validateHooksUsage: z.ZodDefault; validateRefAccessDuringRender: z.ZodDefault; validateNoSetStateInRender: z.ZodDefault; validateNoSetStateInEffects: z.ZodDefault; validateNoDerivedComputationsInEffects: z.ZodDefault; validateNoJSXInTryStatements: z.ZodDefault; validateStaticComponents: z.ZodDefault; validateMemoizedEffectDependencies: z.ZodDefault; validateNoCapitalizedCalls: z.ZodDefault>>; validateBlocklistedImports: z.ZodDefault>>; validateNoImpureFunctionsInRender: z.ZodDefault; validateNoFreezingKnownMutableFunctions: z.ZodDefault; enableAssumeHooksFollowRulesOfReact: z.ZodDefault; enableTransitivelyFreezeFunctionExpressions: z.ZodDefault; enableEmitFreeze: z.ZodDefault>>; enableEmitHookGuards: z.ZodDefault>>; enableInstructionReordering: z.ZodDefault; enableFunctionOutlining: z.ZodDefault; enableJsxOutlining: z.ZodDefault; enableEmitInstrumentForget: z.ZodDefault; gating: z.ZodNullable>; globalGating: z.ZodNullable; }, "strip", z.ZodTypeAny, { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; }, { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; }>, { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; }, { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; }>>>; assertValidMutableRanges: z.ZodDefault; enableChangeVariableCodegen: z.ZodDefault; enableMemoizationComments: z.ZodDefault; throwUnknownException__testonly: z.ZodDefault; enableTreatFunctionDepsAsConditional: z.ZodDefault; disableMemoizationForDebugging: z.ZodDefault; enableChangeDetectionForDebugging: z.ZodDefault>>; enableCustomTypeDefinitionForReanimated: z.ZodDefault; hookPattern: z.ZodDefault>; enableTreatRefLikeIdentifiersAsRefs: z.ZodDefault; lowerContextAccess: z.ZodDefault>>; validateNoVoidUseMemo: z.ZodDefault; validateNoDynamicallyCreatedComponentsOrHooks: z.ZodDefault; }, "strip", z.ZodTypeAny, { customHooks: Map; moduleTypeProvider: ((args_0: string, ...args_1: unknown[]) => unknown) | null; customMacros: (string | [string, ({ type: "wildcard"; } | { type: "name"; name: string; })[]])[] | null; enableResetCacheOnSourceFileChanges: boolean | null; enablePreserveExistingMemoizationGuarantees: boolean; validatePreserveExistingMemoizationGuarantees: boolean; enablePreserveExistingManualUseMemo: boolean; enableForest: boolean; enableUseTypeAnnotations: boolean; flowTypeProvider: ((args_0: string, ...args_1: unknown[]) => unknown) | null; enableOptionalDependencies: boolean; enableFire: boolean; inferEffectDependencies: { function: { source: string; importSpecifierName: string; }; autodepsIndex: number; }[] | null; inlineJsxTransform: { elementSymbol: "react.element" | "react.transitional.element"; globalDevVar: string; } | null; validateHooksUsage: boolean; validateRefAccessDuringRender: boolean; validateNoSetStateInRender: boolean; validateNoSetStateInEffects: boolean; validateNoDerivedComputationsInEffects: boolean; validateNoJSXInTryStatements: boolean; validateStaticComponents: boolean; validateMemoizedEffectDependencies: boolean; validateNoCapitalizedCalls: string[] | null; validateBlocklistedImports: string[] | null; validateNoImpureFunctionsInRender: boolean; validateNoFreezingKnownMutableFunctions: boolean; enableAssumeHooksFollowRulesOfReact: boolean; enableTransitivelyFreezeFunctionExpressions: boolean; enableEmitFreeze: { source: string; importSpecifierName: string; } | null; enableEmitHookGuards: { source: string; importSpecifierName: string; } | null; enableInstructionReordering: boolean; enableFunctionOutlining: boolean; enableJsxOutlining: boolean; enableEmitInstrumentForget: { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; } | null; assertValidMutableRanges: boolean; enableChangeVariableCodegen: boolean; enableMemoizationComments: boolean; throwUnknownException__testonly: boolean; enableTreatFunctionDepsAsConditional: boolean; disableMemoizationForDebugging: boolean; enableChangeDetectionForDebugging: { source: string; importSpecifierName: string; } | null; enableCustomTypeDefinitionForReanimated: boolean; hookPattern: string | null; enableTreatRefLikeIdentifiersAsRefs: boolean; lowerContextAccess: { source: string; importSpecifierName: string; } | null; validateNoVoidUseMemo: boolean; validateNoDynamicallyCreatedComponentsOrHooks: boolean; }, { customHooks?: Map | undefined; moduleTypeProvider?: ((args_0: string, ...args_1: unknown[]) => unknown) | null | undefined; customMacros?: (string | [string, ({ type: "wildcard"; } | { type: "name"; name: string; })[]])[] | null | undefined; enableResetCacheOnSourceFileChanges?: boolean | null | undefined; enablePreserveExistingMemoizationGuarantees?: boolean | undefined; validatePreserveExistingMemoizationGuarantees?: boolean | undefined; enablePreserveExistingManualUseMemo?: boolean | undefined; enableForest?: boolean | undefined; enableUseTypeAnnotations?: boolean | undefined; flowTypeProvider?: ((args_0: string, ...args_1: unknown[]) => unknown) | null | undefined; enableOptionalDependencies?: boolean | undefined; enableFire?: boolean | undefined; inferEffectDependencies?: { function: { source: string; importSpecifierName: string; }; autodepsIndex: number; }[] | null | undefined; inlineJsxTransform?: { elementSymbol: "react.element" | "react.transitional.element"; globalDevVar: string; } | null | undefined; validateHooksUsage?: boolean | undefined; validateRefAccessDuringRender?: boolean | undefined; validateNoSetStateInRender?: boolean | undefined; validateNoSetStateInEffects?: boolean | undefined; validateNoDerivedComputationsInEffects?: boolean | undefined; validateNoJSXInTryStatements?: boolean | undefined; validateStaticComponents?: boolean | undefined; validateMemoizedEffectDependencies?: boolean | undefined; validateNoCapitalizedCalls?: string[] | null | undefined; validateBlocklistedImports?: string[] | null | undefined; validateNoImpureFunctionsInRender?: boolean | undefined; validateNoFreezingKnownMutableFunctions?: boolean | undefined; enableAssumeHooksFollowRulesOfReact?: boolean | undefined; enableTransitivelyFreezeFunctionExpressions?: boolean | undefined; enableEmitFreeze?: { source: string; importSpecifierName: string; } | null | undefined; enableEmitHookGuards?: { source: string; importSpecifierName: string; } | null | undefined; enableInstructionReordering?: boolean | undefined; enableFunctionOutlining?: boolean | undefined; enableJsxOutlining?: boolean | undefined; enableEmitInstrumentForget?: { fn: { source: string; importSpecifierName: string; }; gating: { source: string; importSpecifierName: string; } | null; globalGating: string | null; } | null | undefined; assertValidMutableRanges?: boolean | undefined; enableChangeVariableCodegen?: boolean | undefined; enableMemoizationComments?: boolean | undefined; throwUnknownException__testonly?: boolean | undefined; enableTreatFunctionDepsAsConditional?: boolean | undefined; disableMemoizationForDebugging?: boolean | undefined; enableChangeDetectionForDebugging?: { source: string; importSpecifierName: string; } | null | undefined; enableCustomTypeDefinitionForReanimated?: boolean | undefined; hookPattern?: string | null | undefined; enableTreatRefLikeIdentifiersAsRefs?: boolean | undefined; lowerContextAccess?: { source: string; importSpecifierName: string; } | null | undefined; validateNoVoidUseMemo?: boolean | undefined; validateNoDynamicallyCreatedComponentsOrHooks?: boolean | undefined; }>; type EnvironmentConfig = z.infer; type ReactFunctionType = 'Component' | 'Hook' | 'Other'; export class Environment { #private; logger: Logger | null; filename: string | null; code: string | null; config: EnvironmentConfig; fnType: ReactFunctionType; compilerMode: CompilerMode; programContext: ProgramContext; hasFireRewrite: boolean; hasInferredEffect: boolean; inferredEffectLocations: Set; parentFunction: NodePath; constructor(scope: Scope, fnType: ReactFunctionType, compilerMode: CompilerMode, config: EnvironmentConfig, contextIdentifiers: Set, parentFunction: NodePath, logger: Logger | null, filename: string | null, code: string | null, programContext: ProgramContext); get typeContext(): FlowTypeEnv; get isInferredMemoEnabled(): boolean; get nextIdentifierId(): IdentifierId; get nextBlockId(): BlockId; get nextScopeId(): ScopeId; get scope(): Scope; logErrors(errors: Result): void; isContextIdentifier(node: Identifier$1): boolean; isHoistedIdentifier(node: Identifier$1): boolean; generateGloballyUniqueIdentifierName(name: string | null): ValidatedIdentifier; outlineFunction(fn: HIRFunction, type: ReactFunctionType | null): void; getOutlinedFunctions(): Array<{ fn: HIRFunction; type: ReactFunctionType | null; }>; getGlobalDeclaration(binding: NonLocalBinding, loc: SourceLocation): Global | null; static knownReactModules: ReadonlyArray; getFallthroughPropertyType(receiver: Type, _property: Type): BuiltInType | PolyType | null; getPropertyType(receiver: Type, property: string | number): BuiltInType | PolyType | null; getFunctionSignature(type: FunctionType): FunctionSignature | null; addHoistedIdentifier(node: Identifier$1): void; } declare const GeneratedSource: unique symbol; type SourceLocation = SourceLocation$1 | typeof GeneratedSource; type ReactiveFunction = { loc: SourceLocation; id: string | null; params: Array; generator: boolean; async: boolean; body: ReactiveBlock; env: Environment; directives: Array; }; type ReactiveScopeBlock = { kind: 'scope'; scope: ReactiveScope; instructions: ReactiveBlock; }; type PrunedReactiveScopeBlock = { kind: 'pruned-scope'; scope: ReactiveScope; instructions: ReactiveBlock; }; type ReactiveBlock = Array; type ReactiveStatement = ReactiveInstructionStatement | ReactiveTerminalStatement | ReactiveScopeBlock | PrunedReactiveScopeBlock; type ReactiveInstructionStatement = { kind: 'instruction'; instruction: ReactiveInstruction; }; type ReactiveTerminalStatement = { kind: 'terminal'; terminal: Tterminal; label: { id: BlockId; implicit: boolean; } | null; }; type ReactiveInstruction = { id: InstructionId; lvalue: Place | null; value: ReactiveValue; effects?: Array | null; loc: SourceLocation; }; type ReactiveValue = InstructionValue | ReactiveLogicalValue | ReactiveSequenceValue | ReactiveTernaryValue | ReactiveOptionalCallValue; type ReactiveLogicalValue = { kind: 'LogicalExpression'; operator: LogicalExpression['operator']; left: ReactiveValue; right: ReactiveValue; loc: SourceLocation; }; type ReactiveTernaryValue = { kind: 'ConditionalExpression'; test: ReactiveValue; consequent: ReactiveValue; alternate: ReactiveValue; loc: SourceLocation; }; type ReactiveSequenceValue = { kind: 'SequenceExpression'; instructions: Array; id: InstructionId; value: ReactiveValue; loc: SourceLocation; }; type ReactiveOptionalCallValue = { kind: 'OptionalExpression'; id: InstructionId; value: ReactiveValue; optional: boolean; loc: SourceLocation; }; type ReactiveTerminal = ReactiveBreakTerminal | ReactiveContinueTerminal | ReactiveReturnTerminal | ReactiveThrowTerminal | ReactiveSwitchTerminal | ReactiveDoWhileTerminal | ReactiveWhileTerminal | ReactiveForTerminal | ReactiveForOfTerminal | ReactiveForInTerminal | ReactiveIfTerminal | ReactiveLabelTerminal | ReactiveTryTerminal; type ReactiveTerminalTargetKind = 'implicit' | 'labeled' | 'unlabeled'; type ReactiveBreakTerminal = { kind: 'break'; target: BlockId; id: InstructionId; targetKind: ReactiveTerminalTargetKind; loc: SourceLocation; }; type ReactiveContinueTerminal = { kind: 'continue'; target: BlockId; id: InstructionId; targetKind: ReactiveTerminalTargetKind; loc: SourceLocation; }; type ReactiveReturnTerminal = { kind: 'return'; value: Place; id: InstructionId; loc: SourceLocation; }; type ReactiveThrowTerminal = { kind: 'throw'; value: Place; id: InstructionId; loc: SourceLocation; }; type ReactiveSwitchTerminal = { kind: 'switch'; test: Place; cases: Array<{ test: Place | null; block: ReactiveBlock | void; }>; id: InstructionId; loc: SourceLocation; }; type ReactiveDoWhileTerminal = { kind: 'do-while'; loop: ReactiveBlock; test: ReactiveValue; id: InstructionId; loc: SourceLocation; }; type ReactiveWhileTerminal = { kind: 'while'; test: ReactiveValue; loop: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type ReactiveForTerminal = { kind: 'for'; init: ReactiveValue; test: ReactiveValue; update: ReactiveValue | null; loop: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type ReactiveForOfTerminal = { kind: 'for-of'; init: ReactiveValue; test: ReactiveValue; loop: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type ReactiveForInTerminal = { kind: 'for-in'; init: ReactiveValue; loop: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type ReactiveIfTerminal = { kind: 'if'; test: Place; consequent: ReactiveBlock; alternate: ReactiveBlock | null; id: InstructionId; loc: SourceLocation; }; type ReactiveLabelTerminal = { kind: 'label'; block: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type ReactiveTryTerminal = { kind: 'try'; block: ReactiveBlock; handlerBinding: Place | null; handler: ReactiveBlock; id: InstructionId; loc: SourceLocation; }; type HIRFunction = { loc: SourceLocation; id: string | null; fnType: ReactFunctionType; env: Environment; params: Array; returnTypeAnnotation: FlowType | TSType | null; returns: Place; context: Array; body: HIR; generator: boolean; async: boolean; directives: Array; aliasingEffects: Array | null; }; type HIR = { entry: BlockId; blocks: Map; }; type BlockKind = 'block' | 'value' | 'loop' | 'sequence' | 'catch'; type BasicBlock = { kind: BlockKind; id: BlockId; instructions: Array; terminal: Terminal; preds: Set; phis: Set; }; type Terminal = UnsupportedTerminal | UnreachableTerminal | ThrowTerminal | ReturnTerminal | GotoTerminal | IfTerminal | BranchTerminal | SwitchTerminal | ForTerminal | ForOfTerminal | ForInTerminal | DoWhileTerminal | WhileTerminal | LogicalTerminal | TernaryTerminal | OptionalTerminal | LabelTerminal | SequenceTerminal | MaybeThrowTerminal | TryTerminal | ReactiveScopeTerminal | PrunedScopeTerminal; type UnsupportedTerminal = { kind: 'unsupported'; id: InstructionId; loc: SourceLocation; fallthrough?: never; }; type UnreachableTerminal = { kind: 'unreachable'; id: InstructionId; loc: SourceLocation; fallthrough?: never; }; type ThrowTerminal = { kind: 'throw'; value: Place; id: InstructionId; loc: SourceLocation; fallthrough?: never; }; type Case = { test: Place | null; block: BlockId; }; type ReturnVariant = 'Void' | 'Implicit' | 'Explicit'; type ReturnTerminal = { kind: 'return'; returnVariant: ReturnVariant; loc: SourceLocation; value: Place; id: InstructionId; fallthrough?: never; effects: Array | null; }; type GotoTerminal = { kind: 'goto'; block: BlockId; variant: GotoVariant; id: InstructionId; loc: SourceLocation; fallthrough?: never; }; declare enum GotoVariant { Break = "Break", Continue = "Continue", Try = "Try" } type IfTerminal = { kind: 'if'; test: Place; consequent: BlockId; alternate: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type BranchTerminal = { kind: 'branch'; test: Place; consequent: BlockId; alternate: BlockId; id: InstructionId; loc: SourceLocation; fallthrough: BlockId; }; type SwitchTerminal = { kind: 'switch'; test: Place; cases: Array; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type DoWhileTerminal = { kind: 'do-while'; loop: BlockId; test: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type WhileTerminal = { kind: 'while'; loc: SourceLocation; test: BlockId; loop: BlockId; fallthrough: BlockId; id: InstructionId; }; type ForTerminal = { kind: 'for'; loc: SourceLocation; init: BlockId; test: BlockId; update: BlockId | null; loop: BlockId; fallthrough: BlockId; id: InstructionId; }; type ForOfTerminal = { kind: 'for-of'; loc: SourceLocation; init: BlockId; test: BlockId; loop: BlockId; fallthrough: BlockId; id: InstructionId; }; type ForInTerminal = { kind: 'for-in'; loc: SourceLocation; init: BlockId; loop: BlockId; fallthrough: BlockId; id: InstructionId; }; type LogicalTerminal = { kind: 'logical'; operator: LogicalExpression['operator']; test: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type TernaryTerminal = { kind: 'ternary'; test: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type LabelTerminal = { kind: 'label'; block: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type OptionalTerminal = { kind: 'optional'; optional: boolean; test: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type SequenceTerminal = { kind: 'sequence'; block: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type TryTerminal = { kind: 'try'; block: BlockId; handlerBinding: Place | null; handler: BlockId; fallthrough: BlockId; id: InstructionId; loc: SourceLocation; }; type MaybeThrowTerminal = { kind: 'maybe-throw'; continuation: BlockId; handler: BlockId; id: InstructionId; loc: SourceLocation; fallthrough?: never; effects: Array | null; }; type ReactiveScopeTerminal = { kind: 'scope'; fallthrough: BlockId; block: BlockId; scope: ReactiveScope; id: InstructionId; loc: SourceLocation; }; type PrunedScopeTerminal = { kind: 'pruned-scope'; fallthrough: BlockId; block: BlockId; scope: ReactiveScope; id: InstructionId; loc: SourceLocation; }; type Instruction = { id: InstructionId; lvalue: Place; value: InstructionValue; loc: SourceLocation; effects: Array | null; }; type LValue = { place: Place; kind: InstructionKind; }; type LValuePattern = { pattern: Pattern; kind: InstructionKind; }; type ArrayExpression = { kind: 'ArrayExpression'; elements: Array; loc: SourceLocation; }; type Pattern = ArrayPattern | ObjectPattern; type Hole = { kind: 'Hole'; }; type SpreadPattern = { kind: 'Spread'; place: Place; }; type ArrayPattern = { kind: 'ArrayPattern'; items: Array; }; type ObjectPattern = { kind: 'ObjectPattern'; properties: Array; }; type ObjectPropertyKey = { kind: 'string'; name: string; } | { kind: 'identifier'; name: string; } | { kind: 'computed'; name: Place; } | { kind: 'number'; name: number; }; type ObjectProperty = { kind: 'ObjectProperty'; key: ObjectPropertyKey; type: 'property' | 'method'; place: Place; }; type LoweredFunction = { func: HIRFunction; }; type ObjectMethod = { kind: 'ObjectMethod'; loc: SourceLocation; loweredFunc: LoweredFunction; }; declare enum InstructionKind { Const = "Const", Let = "Let", Reassign = "Reassign", Catch = "Catch", HoistedConst = "HoistedConst", HoistedLet = "HoistedLet", HoistedFunction = "HoistedFunction", Function = "Function" } type Phi = { kind: 'Phi'; place: Place; operands: Map; }; type ManualMemoDependency = { root: { kind: 'NamedLocal'; value: Place; } | { kind: 'Global'; identifierName: string; }; path: DependencyPath; }; type StartMemoize = { kind: 'StartMemoize'; manualMemoId: number; deps: Array | null; loc: SourceLocation; }; type FinishMemoize = { kind: 'FinishMemoize'; manualMemoId: number; decl: Place; pruned?: true; loc: SourceLocation; }; type MethodCall = { kind: 'MethodCall'; receiver: Place; property: Place; args: Array; loc: SourceLocation; }; type CallExpression = { kind: 'CallExpression'; callee: Place; args: Array; loc: SourceLocation; typeArguments?: Array; }; type NewExpression = { kind: 'NewExpression'; callee: Place; args: Array; loc: SourceLocation; }; type LoadLocal = { kind: 'LoadLocal'; place: Place; loc: SourceLocation; }; type LoadContext = { kind: 'LoadContext'; place: Place; loc: SourceLocation; }; type InstructionValue = LoadLocal | LoadContext | { kind: 'DeclareLocal'; lvalue: LValue; type: FlowType | TSType | null; loc: SourceLocation; } | { kind: 'DeclareContext'; lvalue: { kind: InstructionKind.Let | InstructionKind.HoistedConst | InstructionKind.HoistedLet | InstructionKind.HoistedFunction; place: Place; }; loc: SourceLocation; } | StoreLocal | { kind: 'StoreContext'; lvalue: { kind: InstructionKind.Reassign | InstructionKind.Const | InstructionKind.Let | InstructionKind.Function; place: Place; }; value: Place; loc: SourceLocation; } | Destructure | { kind: 'Primitive'; value: number | boolean | string | null | undefined; loc: SourceLocation; } | JSXText | { kind: 'BinaryExpression'; operator: Exclude'>; left: Place; right: Place; loc: SourceLocation; } | NewExpression | CallExpression | MethodCall | { kind: 'UnaryExpression'; operator: Exclude; value: Place; loc: SourceLocation; } | ({ kind: 'TypeCastExpression'; value: Place; type: Type; loc: SourceLocation; } & ({ typeAnnotation: FlowType; typeAnnotationKind: 'cast'; } | { typeAnnotation: TSType; typeAnnotationKind: 'as' | 'satisfies'; })) | JsxExpression | { kind: 'ObjectExpression'; properties: Array; loc: SourceLocation; } | ObjectMethod | ArrayExpression | { kind: 'JsxFragment'; children: Array; loc: SourceLocation; } | { kind: 'RegExpLiteral'; pattern: string; flags: string; loc: SourceLocation; } | { kind: 'MetaProperty'; meta: string; property: string; loc: SourceLocation; } | { kind: 'PropertyStore'; object: Place; property: PropertyLiteral; value: Place; loc: SourceLocation; } | PropertyLoad | { kind: 'PropertyDelete'; object: Place; property: PropertyLiteral; loc: SourceLocation; } | { kind: 'ComputedStore'; object: Place; property: Place; value: Place; loc: SourceLocation; } | { kind: 'ComputedLoad'; object: Place; property: Place; loc: SourceLocation; } | { kind: 'ComputedDelete'; object: Place; property: Place; loc: SourceLocation; } | LoadGlobal | StoreGlobal | FunctionExpression | { kind: 'TaggedTemplateExpression'; tag: Place; value: { raw: string; cooked?: string; }; loc: SourceLocation; } | { kind: 'TemplateLiteral'; subexprs: Array; quasis: Array<{ raw: string; cooked?: string; }>; loc: SourceLocation; } | { kind: 'Await'; value: Place; loc: SourceLocation; } | { kind: 'GetIterator'; collection: Place; loc: SourceLocation; } | { kind: 'IteratorNext'; iterator: Place; collection: Place; loc: SourceLocation; } | { kind: 'NextPropertyOf'; value: Place; loc: SourceLocation; } | { kind: 'PrefixUpdate'; lvalue: Place; operation: UpdateExpression['operator']; value: Place; loc: SourceLocation; } | { kind: 'PostfixUpdate'; lvalue: Place; operation: UpdateExpression['operator']; value: Place; loc: SourceLocation; } | { kind: 'Debugger'; loc: SourceLocation; } | StartMemoize | FinishMemoize | { kind: 'UnsupportedNode'; node: Node; loc: SourceLocation; }; type JsxExpression = { kind: 'JsxExpression'; tag: Place | BuiltinTag; props: Array; children: Array | null; loc: SourceLocation; openingLoc: SourceLocation; closingLoc: SourceLocation; }; type JsxAttribute = { kind: 'JsxSpreadAttribute'; argument: Place; } | { kind: 'JsxAttribute'; name: string; place: Place; }; type FunctionExpression = { kind: 'FunctionExpression'; name: string | null; loweredFunc: LoweredFunction; type: 'ArrowFunctionExpression' | 'FunctionExpression' | 'FunctionDeclaration'; loc: SourceLocation; }; type Destructure = { kind: 'Destructure'; lvalue: LValuePattern; value: Place; loc: SourceLocation; }; type Place = { kind: 'Identifier'; identifier: Identifier; effect: Effect; reactive: boolean; loc: SourceLocation; }; type JSXText = { kind: 'JSXText'; value: string; loc: SourceLocation; }; type StoreLocal = { kind: 'StoreLocal'; lvalue: LValue; value: Place; type: FlowType | TSType | null; loc: SourceLocation; }; type PropertyLoad = { kind: 'PropertyLoad'; object: Place; property: PropertyLiteral; loc: SourceLocation; }; type LoadGlobal = { kind: 'LoadGlobal'; binding: NonLocalBinding; loc: SourceLocation; }; type StoreGlobal = { kind: 'StoreGlobal'; name: string; value: Place; loc: SourceLocation; }; type BuiltinTag = { kind: 'BuiltinTag'; name: string; loc: SourceLocation; }; type MutableRange = { start: InstructionId; end: InstructionId; }; type NonLocalImportSpecifier = { kind: 'ImportSpecifier'; name: string; module: string; imported: string; }; type NonLocalBinding = { kind: 'ImportDefault'; name: string; module: string; } | { kind: 'ImportNamespace'; name: string; module: string; } | NonLocalImportSpecifier | { kind: 'ModuleLocal'; name: string; } | { kind: 'Global'; name: string; }; type Identifier = { id: IdentifierId; declarationId: DeclarationId; name: IdentifierName | null; mutableRange: MutableRange; scope: ReactiveScope | null; type: Type; loc: SourceLocation; }; type IdentifierName = ValidatedIdentifier | PromotedIdentifier; type ValidatedIdentifier = { kind: 'named'; value: ValidIdentifierName; }; type PromotedIdentifier = { kind: 'promoted'; value: string; }; declare const opaqueValidIdentifierName: unique symbol; type ValidIdentifierName = string & { [opaqueValidIdentifierName]: 'ValidIdentifierName'; }; declare enum ValueReason { Global = "global", JsxCaptured = "jsx-captured", HookCaptured = "hook-captured", HookReturn = "hook-return", Effect = "effect", KnownReturnSignature = "known-return-signature", Context = "context", State = "state", ReducerState = "reducer-state", ReactiveFunctionArgument = "reactive-function-argument", Other = "other" } declare enum ValueKind { MaybeFrozen = "maybefrozen", Frozen = "frozen", Primitive = "primitive", Global = "global", Mutable = "mutable", Context = "context" } declare enum Effect { Unknown = "", Freeze = "freeze", Read = "read", Capture = "capture", ConditionallyMutateIterator = "mutate-iterator?", ConditionallyMutate = "mutate?", Mutate = "mutate", Store = "store" } type ReactiveScope = { id: ScopeId; range: MutableRange; dependencies: ReactiveScopeDependencies; declarations: Map; reassignments: Set; earlyReturnValue: { value: Identifier; loc: SourceLocation; label: BlockId; } | null; merged: Set; loc: SourceLocation; }; type ReactiveScopeDependencies = Set; type ReactiveScopeDeclaration = { identifier: Identifier; scope: ReactiveScope; }; declare const opaquePropertyLiteral: unique symbol; type PropertyLiteral = (string | number) & { [opaquePropertyLiteral]: 'PropertyLiteral'; }; type DependencyPathEntry = { property: PropertyLiteral; optional: boolean; }; type DependencyPath = Array; type ReactiveScopeDependency = { identifier: Identifier; reactive: boolean; path: DependencyPath; }; declare const opaqueBlockId: unique symbol; type BlockId = number & { [opaqueBlockId]: 'BlockId'; }; declare const opaqueScopeId: unique symbol; type ScopeId = number & { [opaqueScopeId]: 'ScopeId'; }; declare const opaqueIdentifierId: unique symbol; type IdentifierId = number & { [opaqueIdentifierId]: 'IdentifierId'; }; declare const opageDeclarationId: unique symbol; type DeclarationId = number & { [opageDeclarationId]: 'DeclarationId'; }; declare const opaqueInstructionId: unique symbol; type InstructionId = number & { [opaqueInstructionId]: 'IdentifierId'; }; declare enum ErrorSeverity { InvalidJS = "InvalidJS", UnsupportedJS = "UnsupportedJS", InvalidReact = "InvalidReact", InvalidConfig = "InvalidConfig", CannotPreserveMemoization = "CannotPreserveMemoization", Todo = "Todo", Invariant = "Invariant" } type CompilerDiagnosticOptions = { category: ErrorCategory; severity: ErrorSeverity; reason: string; description: string; details: Array; suggestions?: Array | null | undefined; }; type CompilerDiagnosticDetail = { kind: 'error'; loc: SourceLocation | null; message: string; } | { kind: 'hint'; message: string; }; declare enum CompilerSuggestionOperation { InsertBefore = 0, InsertAfter = 1, Remove = 2, Replace = 3 } type CompilerSuggestion = { op: CompilerSuggestionOperation.InsertAfter | CompilerSuggestionOperation.InsertBefore | CompilerSuggestionOperation.Replace; range: [number, number]; description: string; text: string; } | { op: CompilerSuggestionOperation.Remove; range: [number, number]; description: string; }; type CompilerErrorDetailOptions = { category: ErrorCategory; severity: ErrorSeverity; reason: string; description?: string | null | undefined; loc: SourceLocation | null; suggestions?: Array | null | undefined; }; type PrintErrorMessageOptions = { eslint: boolean; }; export class CompilerDiagnostic { options: CompilerDiagnosticOptions; constructor(options: CompilerDiagnosticOptions); static create(options: Omit): CompilerDiagnostic; get reason(): CompilerDiagnosticOptions['reason']; get description(): CompilerDiagnosticOptions['description']; get severity(): CompilerDiagnosticOptions['severity']; get suggestions(): CompilerDiagnosticOptions['suggestions']; get category(): ErrorCategory; withDetail(detail: CompilerDiagnosticDetail): CompilerDiagnostic; primaryLocation(): SourceLocation | null; printErrorMessage(source: string, options: PrintErrorMessageOptions): string; toString(): string; } export class CompilerErrorDetail { options: CompilerErrorDetailOptions; constructor(options: CompilerErrorDetailOptions); get reason(): CompilerErrorDetailOptions['reason']; get description(): CompilerErrorDetailOptions['description']; get severity(): CompilerErrorDetailOptions['severity']; get loc(): CompilerErrorDetailOptions['loc']; get suggestions(): CompilerErrorDetailOptions['suggestions']; get category(): ErrorCategory; primaryLocation(): SourceLocation | null; printErrorMessage(source: string, options: PrintErrorMessageOptions): string; toString(): string; } export class CompilerError extends Error { details: Array; printedMessage: string | null; static invariant(condition: unknown, options: Omit): asserts condition; static throwDiagnostic(options: CompilerDiagnosticOptions): never; static throwTodo(options: Omit): never; static throwInvalidJS(options: Omit): never; static throwInvalidReact(options: Omit): never; static throwInvalidConfig(options: Omit): never; static throw(options: CompilerErrorDetailOptions): never; constructor(...args: Array); get message(): string; set message(_message: string); toString(): string; withPrintedMessage(source: string, options: PrintErrorMessageOptions): CompilerError; printErrorMessage(source: string, options: PrintErrorMessageOptions): string; merge(other: CompilerError): void; pushDiagnostic(diagnostic: CompilerDiagnostic): void; push(options: CompilerErrorDetailOptions): CompilerErrorDetail; pushErrorDetail(detail: CompilerErrorDetail): CompilerErrorDetail; hasErrors(): boolean; asResult(): Result; isCritical(): boolean; } declare enum ErrorCategory { Hooks = "Hooks", CapitalizedCalls = "CapitalizedCalls", StaticComponents = "StaticComponents", UseMemo = "UseMemo", Factories = "Factories", PreserveManualMemo = "PreserveManualMemo", Immutability = "Immutability", Globals = "Globals", Refs = "Refs", EffectDependencies = "EffectDependencies", EffectSetState = "EffectSetState", EffectDerivationsOfState = "EffectDerivationsOfState", ErrorBoundaries = "ErrorBoundaries", Purity = "Purity", RenderSetState = "RenderSetState", Invariant = "Invariant", Todo = "Todo", Syntax = "Syntax", UnsupportedSyntax = "UnsupportedSyntax", Config = "Config", Gating = "Gating", Suppression = "Suppression", AutomaticEffectDependencies = "AutomaticEffectDependencies", Fire = "Fire", FBT = "FBT" } type LintRule = { category: ErrorCategory; name: string; description: string; recommended: boolean; }; type CodegenFunction = { type: 'CodegenFunction'; id: Identifier$1 | null; params: FunctionDeclaration['params']; body: BlockStatement; generator: boolean; async: boolean; loc: SourceLocation; memoSlotsUsed: number; memoBlocks: number; memoValues: number; prunedMemoBlocks: number; prunedMemoValues: number; outlined: Array<{ fn: CodegenFunction; type: ReactFunctionType | null; }>; hasInferredEffect: boolean; inferredEffectLocations: Set; hasFireRewrite: boolean; }; type CompilerPipelineValue = { kind: 'ast'; name: string; value: CodegenFunction; } | { kind: 'hir'; name: string; value: HIRFunction; } | { kind: 'reactive'; name: string; value: ReactiveFunction; } | { kind: 'debug'; name: string; value: string; }; declare const PanicThresholdOptionsSchema: z.ZodEnum<["all_errors", "critical_errors", "none"]>; type PanicThresholdOptions = z.infer; declare const DynamicGatingOptionsSchema: z.ZodObject<{ source: z.ZodString; }, "strip", z.ZodTypeAny, { source: string; }, { source: string; }>; type DynamicGatingOptions = z.infer; declare const CustomOptOutDirectiveSchema: z.ZodDefault>>; type CustomOptOutDirective = z.infer; type PluginOptions = { environment: EnvironmentConfig; logger: Logger | null; gating: ExternalFunction | null; dynamicGating: DynamicGatingOptions | null; panicThreshold: PanicThresholdOptions; noEmit: boolean; compilationMode: CompilationMode; eslintSuppressionRules: Array | null | undefined; flowSuppressions: boolean; ignoreUseNoForget: boolean; customOptOutDirectives: CustomOptOutDirective; sources: Array | ((filename: string) => boolean) | null; enableReanimatedCheck: boolean; target: CompilerReactTarget; }; declare const CompilerReactTargetSchema: z.ZodUnion<[z.ZodLiteral<"17">, z.ZodLiteral<"18">, z.ZodLiteral<"19">, z.ZodObject<{ kind: z.ZodLiteral<"donotuse_meta_internal">; runtimeModule: z.ZodDefault; }, "strip", z.ZodTypeAny, { kind: "donotuse_meta_internal"; runtimeModule: string; }, { kind: "donotuse_meta_internal"; runtimeModule?: string | undefined; }>]>; type CompilerReactTarget = z.infer; declare const CompilationModeSchema: z.ZodEnum<["infer", "syntax", "annotation", "all"]>; type CompilationMode = z.infer; type LoggerEvent = CompileSuccessEvent | CompileErrorEvent | CompileDiagnosticEvent | CompileSkipEvent | PipelineErrorEvent | TimingEvent | AutoDepsDecorationsEvent | AutoDepsEligibleEvent; type CompileErrorEvent = { kind: 'CompileError'; fnLoc: SourceLocation$1 | null; detail: CompilerErrorDetail | CompilerDiagnostic; }; type CompileDiagnosticEvent = { kind: 'CompileDiagnostic'; fnLoc: SourceLocation$1 | null; detail: Omit, 'suggestions'>; }; type CompileSuccessEvent = { kind: 'CompileSuccess'; fnLoc: SourceLocation$1 | null; fnName: string | null; memoSlots: number; memoBlocks: number; memoValues: number; prunedMemoBlocks: number; prunedMemoValues: number; }; type CompileSkipEvent = { kind: 'CompileSkip'; fnLoc: SourceLocation$1 | null; reason: string; loc: SourceLocation$1 | null; }; type PipelineErrorEvent = { kind: 'PipelineError'; fnLoc: SourceLocation$1 | null; data: string; }; type TimingEvent = { kind: 'Timing'; measurement: PerformanceMeasure; }; type AutoDepsDecorationsEvent = { kind: 'AutoDepsDecorations'; fnLoc: SourceLocation$1; decorations: Array; }; type AutoDepsEligibleEvent = { kind: 'AutoDepsEligible'; fnLoc: SourceLocation$1; depArrayLoc: SourceLocation$1; }; type Logger = { logEvent: (filename: string | null, event: LoggerEvent) => void; debugLogIRs?: (value: CompilerPipelineValue) => void; }; type BabelFn = NodePath | NodePath | NodePath; type SuppressionRange = { disableComment: Comment; enableComment: Comment | null; source: SuppressionSource; }; type SuppressionSource = 'Eslint' | 'Flow'; type ProgramContextOptions = { program: NodePath; suppressions: Array; opts: PluginOptions; filename: string | null; code: string | null; hasModuleScopeOptOut: boolean; }; export class ProgramContext { scope: Scope; opts: PluginOptions; filename: string | null; code: string | null; reactRuntimeModule: string; suppressions: Array; hasModuleScopeOptOut: boolean; alreadyCompiled: WeakSet | Set; knownReferencedNames: Set; imports: Map>; retryErrors: Array<{ fn: BabelFn; error: CompilerError; }>; inferredEffectLocations: Set; constructor({ program, suppressions, opts, filename, code, hasModuleScopeOptOut, }: ProgramContextOptions); isHookName(name: string): boolean; hasReference(name: string): boolean; newUid(name: string): string; addMemoCacheImport(): NonLocalImportSpecifier; addImportSpecifier({ source: module, importSpecifierName: specifier }: ExternalFunction, nameHint?: string): NonLocalImportSpecifier; addNewReference(name: string): void; assertGlobalBinding(name: string, localScope?: Scope): Result; logEvent(event: LoggerEvent): void; } declare global { let __DEV__: boolean | null | undefined; } declare function runBabelPluginReactCompiler(text: string, file: string, language: 'flow' | 'typescript', options: Partial | null, includeAst?: boolean): BabelFileResult; export { runBabelPluginReactCompiler }; export type { CompilerDiagnosticDetail, CompilerDiagnosticOptions, CompilerErrorDetailOptions, CompilerPipelineValue, EnvironmentConfig, ExternalFunction, Hook, LintRule, Logger, LoggerEvent, PluginOptions, SourceLocation };