Design API methods with structured object parameters instead of ordered parameters or loose typing. Use proper TypeScript types rather than any, and consider parameter patterns that enhance safety and flexibility.

Key principles:

Example transformation:

// Before: Ordered parameters with loose typing
page.goto = async (url: string, options?: any) => { ... }

// After: Proper typing and structured approach
page.goto = async (url: string, options?: GotoOptions) => { ... }

// Before: Multiple ordered parameters
resolveLLMClient(llmClient, modelName, requestId)

// After: Object parameter with proper typing
resolveLLMClient({ 
  llmProvider, 
  modelName, 
  requestId 
}: { 
  llmClient?: LLMClient, 
  modelName?: AvailableModel, 
  requestId?: string 
})

This approach improves API discoverability, reduces parameter ordering mistakes, and makes future extensions easier without breaking existing code.