I'm guessing you don't want to hear "don't do that", but that's probably the best advice. Using reserved words as identifiers isn't guaranteed to fail, but you shouldn't be surprised if some JavaScript environment somewhere balks at it. But never mind, we're going ahead with it.
So this is a bit of a strange one. I'd like to use a quoted string literal the way you can with a method or property name, as mentioned in the TypeScript spec:
String literals may be used to give properties names that are not valid identifiers
But that doesn't work for function names, which must be valid identifiers.
One thing you can apparently do is give the function a valid name and then export an alias to it:
declare namespace Http {
export type HttpOptions = ...
export type HttpPromise<T> = ...
export function get<T>(url: string, options?: HttpOptions): HttpPromise<T>;
function del<T>(url: string, options?: HttpOptions): HttpPromise<T>;
export { del as delete }; // no error
}
I say you can "apparently" do it because I can't find any documentation that indicates one way or another. I would have thought that the reserved word would fail in the as clause (and you can't quote it there either; del as "delete" is an error), but it seems to work:
Http.get('url') // okay
Http.delete('url') // apparently okay but you probably shouldn't
Http['delete']('url') // okay
Does that help?
Another idea is to use declaration merging, but again I'm kind of surprised it works. First declare the namespace with only the type aliases, and then merge in a declared constant of the same name with the properties. It's fragile and weird but it also works for me:
declare namespace Http {
export type HttpOptions = ...
export type HttpPromise<T> = ...
}
declare const Http: {
get<T>(url: string, options?: Http.HttpOptions): Http.HttpPromise<T>;
"delete"<T>(url: string, options?: Http.HttpOptions): Http.HttpPromise<T>;
}
Hope one of those works for you; good luck!