import { type AstNode } from './util'; /** * Options for the require-input-type-for-api-details rule. */ export interface FirebaseRequireInputTypeForApiDetailsRuleOptions { /** * Verb fragments that pair with the `ModelFunction` suffix to identify a CRUD function * type annotation. Defaults to {@link DEFAULT_CRUD_FUNCTION_TYPE_VERBS}. */ readonly typeVerbs?: readonly string[]; /** * Factory function name whose config object must declare `inputType`. Defaults to {@link DEFAULT_API_DETAILS_FACTORY_NAME}. */ readonly factoryName?: string; } /** * ESLint rule definition for require-input-type-for-api-details. */ export interface FirebaseRequireInputTypeForApiDetailsRuleDefinition { readonly meta: { readonly type: 'problem'; readonly fixable: undefined; readonly docs: { readonly description: string; readonly recommended: boolean; }; readonly messages: Readonly>; readonly schema: readonly object[]; }; create(context: { options: FirebaseRequireInputTypeForApiDetailsRuleOptions[]; report: (descriptor: { node: AstNode; messageId: string; data?: Record; }) => void; }): Record void>; } /** * ESLint rule that requires a CRUD function wrapped in `withApiDetails({ ... })` to declare an * `inputType` on the config object. `inputType` drives the MCP tool input schema; without it the * tool surfaces with no (or an auto-guessed) schema. * * The rule is purely syntactic and deliberately narrow to avoid false positives: * - It only fires on declarators typed as a CRUD function (`On(?:Call)?ModelFunction` or an * app-side `ModelFunction` alias) whose initializer is already a `withApiDetails(...)` call. * The missing-wrapper case is owned by `require-api-details-for-crud-function`. * - **Query** handlers are exempt — they consume standardized query/pagination params, not a * per-handler input type. * - Handlers whose input generic is empty (`{}`) or absent are exempt — there is no meaningful input * schema to declare. (The input generic sits at index 1 for canonical `On...ModelFunction` names * and index 0 for app-side aliases — a syntactic heuristic keyed on the `On` prefix.) * - Configs built with a spread (`{ ...base, fn }`) are skipped because the spread's contents cannot * be verified statically. * * There is no auto-fix (the rule cannot synthesize an `inputType` value). To intentionally omit * `inputType`, use an inline `// eslint-disable-next-line` comment. * * @example * ```ts * // OK — declares inputType * export const fooCreate: FooCreateModelFunction = withApiDetails({ * inputType: createFooParamsType, fn: async (req) => ({}) * }); * * // WARN — missingInputType (non-empty input generic, not a Query) * export const fooUpdate: FooUpdateModelFunction = withApiDetails({ * fn: async (req) => {} * }); * ``` */ export declare const FIREBASE_REQUIRE_INPUT_TYPE_FOR_API_DETAILS_RULE: FirebaseRequireInputTypeForApiDetailsRuleDefinition;