Ensure that API function signatures, return types, and interface implementations are consistent and properly declared. When modifying functions to be asynchronous or changing their return types, update both the implementation and any related type declarations to maintain contract integrity.
Key principles:
Example of proper async function declaration:
// Good: Declaration matches implementation
async fileStat(path: string, outsideJanDataFolder?: boolean): Promise<FileStat | undefined> {
// async implementation
}
// Good: Focused interface implementation
export default class JSONConversationalExtension
implements ThreadExtension, MessageExtension {
// implements specific feature contracts
}
This ensures API consumers can rely on consistent contracts and prevents runtime errors from signature mismatches.
Enter the URL of a public GitHub repository