/**
 * Recover the TS type of each event handler's first parameter, then
 * produce `eventsPropsCode` (source text) and `eventsPropsSchema` (JSON
 * Schema) for use in PieMetadata.
 *
 * Event handlers can be declared in three forms — all are handled here:
 *
 *   1. Inline arrow / function expression:
 *        methods={{ click: (e: ClickEvt) => doIt(e) }}
 *
 *   2. Shorthand property whose name matches a variable in scope:
 *        const click = (e: ClickEvt) => doIt(e)
 *        methods={{ click }}
 *
 *   3. Method declaration:
 *        methods={{ click(e: ClickEvt) { doIt(e) } }}
 *
 * In all three the parameter's type annotation is the source of truth.
 */
import { type SchemaContext } from './schemaContext';
import type { JSONSchema } from '../types';
/**
 * Follow a JSX shorthand or identifier reference back to the function
 * declaration and return its first parameter node.
 *
 * ASSUMES: `identifier` is an AST `Identifier` node.
 *
 * RETURNS: the `Parameter` AST node, or `null` if:
 *   - the symbol can't be resolved by the checker.
 *   - the declaration isn't a function-like form we recognize even
 *     after unwrapping known wrappers.
 *
 * RESOLVES:
 *   - `FunctionDeclaration` — `function foo(p) {}`
 *   - `VariableDeclaration` initializer reducible to ArrowFunction /
 *     FunctionExpr via `unwrapToFunctionExpression`. That covers:
 *       const f = (e) => ...
 *       const f = useCallback((e) => ..., [])
 *       const f = ((e) => ...) as Handler
 *       const f = ((e) => ...) satisfies Handler
 *       const f = (<Handler>((e) => ...))
 *   - `MethodDeclaration` / `MethodSignature`
 *   - Alias symbols (re-exports) are unwrapped via `getAliasedSymbol`.
 */
/**
 * Result of resolving a handler reference to its declared function shape.
 *
 *  - `{ kind: 'parameter', node }` — function has at least one parameter;
 *    `node` is the first one (we use its type as the event payload type).
 *  - `{ kind: 'no-payload' }` — function takes zero parameters; the event
 *    is legitimate but has no payload (schema = empty object).
 *  - `null` — couldn't resolve the reference back to a function shape
 *    we recognize (the caller decides whether to error).
 */
export type HandlerResolution = {
    kind: 'parameter';
    node: any;
} | {
    kind: 'no-payload';
} | null;
/**
 * Follow an identifier (shorthand or initializer reference) back to the
 * declaring function and report its handler shape.
 *
 * `shorthandParent` should be the `ShorthandPropertyAssignment` itself
 * when the identifier comes from a `{ name }` shorthand — required for
 * `getShorthandAssignmentValueSymbol` to resolve the variable.
 */
export declare const followIdentifierToFunction: (ctx: SchemaContext, identifier: any, shorthandParent?: any) => HandlerResolution;
/**
 * Render a function parameter as `{ code, schema }`.
 *
 * ASSUMES: `parameter` is an AST `Parameter` node; `sourceFile` is the
 * `SourceFile` containing it (for `getText` to return original text).
 *
 * RETURNS:
 *   - `code`: the explicit type annotation if present (e.g.
 *     `"{ tab: string }"`), or the checker-inferred type as a string
 *     when the parameter is untyped.
 *   - `schema`: JSON Schema. Strategy:
 *       1. If annotation is a `TypeReferenceNode` (`Foo`) — try
 *          `buildSchemaForType(ctx, "Foo")` (via typescript-json-schema).
 *       2. Otherwise — fall back to `typeToSchema(checker.getTypeAtLocation(typeNode))`
 *          which walks the TS Type directly (handles inline literals).
 *   - `null` schema when neither path produces a result.
 */
export declare const schemaForParameter: (ctx: SchemaContext, parameter: any, sourceFile: any) => {
    code: string;
    schema: JSONSchema | null;
};
/**
 * Walk `<PieCard methods={…}>` JSX literals in every file, restrict to
 * the previously-extracted `events` set, and recover each handler's
 * parameter type as `{ code, schema }`.
 *
 * ASSUMES:
 *   - `events` is the list of event-name strings already discovered by
 *     `extractEvents` (which itself enforces the inline-object-literal
 *     rule). This pass tolerates the same shape — anything else is
 *     skipped without throwing.
 *   - `ctx` includes all `files` (so `getSourceFile()` succeeds).
 *
 * RETURNS:
 *   - `code`: `{ eventName: typeText }`. May be empty for events whose
 *     handler can't be statically resolved (e.g. `useCallback`-wrapped).
 *   - `schema`: `{ eventName: JSONSchema }`. Same caveat.
 *
 * EDGE CASES:
 *   - Spread / variable `methods={…}` is silently skipped here
 *     (because `extractEvents` already strictly rejected those, the
 *     unreachable case is defensive).
 *   - Events listed in `events[]` but not present as keys in the JSX
 *     are absent from the result (no synthetic entry).
 */
export declare const extractEventsPayloads: (ctx: SchemaContext, files: string[], events: string[]) => {
    code: Record<string, string>;
    schema: Record<string, JSONSchema>;
};
//# sourceMappingURL=extractEventsPayloads.d.ts.map