// In your app
import { AppDate, extendAppDate } from "@ma.vu/appdate";
extendAppDate({
formatLong(this: AppDate) {
return this.format("dddd, DD. MMMM");
},
});
// Augment types
declare module "@ma.vu/appdate" {
interface AppDate {
formatLong(): string;
}
}
// Now you can use it
AppDate.now().formatLong(); // "ponedjeljak, 06. januar"
Extend AppDate prototype with custom methods. Use TypeScript module augmentation to add type definitions.