I'd like to write a specification for a set of Typescript functions with the implementations in a separate file, and then have tsc check that the actual implementations match the specification.
Something like this:
f-spec.ts:
export declare function foo(s: string, i: int): int;
and then in another source file:
f.ts:
// import { foo } from './f-spec' <<< Doesn't work, gives error
export foo(s: string, i: int) { return i }
When I actually try to include that import, I get an error "Import declaration conflicts with local definition".
How should I declare the function in one file and implement it in a separate file? (Yes, I'm an old C++ guy and thinking about this as if it were a C++ header file, I know. But this is how I need it in this case.)