I want to generate a definition file for pnotify.
/// <reference path="./jquery.d.ts"/>
interface pnotifyDefaults {
styling?: string;
history?: boolean;
}
interface pnotifyInterface {
defaults?: pnotifyDefaults
}
interface JQueryStatic {
pnotify(options: any): any;
pnotify: pnotifyInterface;
pnotify_remove_all(): void;
}
declare module 'jquery.pnotify' {
}
This accutally does not compile and the compiler complains:
Duplicate identifier 'pnotify'. Additional locations: jquery.pnotify.d.ts(15,5)
But how can I achieve that behaviour as in my js code I want to use pnotify like:
$.pnotify(opts)
But also like that:
$.pnotify.defaults.history = false;