interface AstNode { readonly type: string; [key: string]: any; } /** * ESLint rule definition for no-enum-literal-cast. */ export interface UtilNoEnumLiteralCastRuleDefinition { readonly meta: { readonly type: 'problem'; readonly fixable: 'code'; readonly docs: { readonly description: string; readonly recommended: boolean; }; readonly messages: { readonly useEnumMember: string; readonly unsafeEnumCast: string; }; readonly schema: readonly object[]; }; create(context: { report: (descriptor: { node: AstNode; messageId: string; data?: Record; fix?: (fixer: AstNode) => AstNode | AstNode[]; }) => void; sourceCode: AstNode; }): Record void>; } /** * ESLint rule that flags a numeric/string literal asserted onto an enum type — e.g. * `layer: 0 as PromptLayer` — and steers it to the named member (`PromptLayer.REPLY_PROTOCOL`). * * The cast is doubly harmful: it bypasses type-checking (any in-range *or* out-of-range number * satisfies `n as SomeEnum`, so `99 as PromptLayer` compiles silently) and it hides intent behind a * magic number. The rule is type-aware: it fires ONLY when the assertion target resolves to a real * `enum` / `const enum`, so legitimate branded-primitive aliases (`30 as EntityId`, * `7001 as ConceptId`) — which have no named members and for which the cast is the sanctioned form — * are never touched. * * When the literal matches a member, the fix rewrites the assertion to `Enum.MEMBER` and, when the * enum is bound via `import type` / `import { type … }`, converts that binding to a value import so * the rewritten value reference compiles. When the literal matches NO member, the rule reports the * unsafe cast without a fix (there is no correct member to substitute). * * Requires type information — it no-ops in lint passes without it (no `projectService` / `project`). */ export declare const UTIL_NO_ENUM_LITERAL_CAST_RULE: UtilNoEnumLiteralCastRuleDefinition; export {};