Description
While the structure that the plugin seed creates is very handy for plugins that are destined to add some functionality with native libraries, there is no clear path to enhance existing functionality.
For example, let's say I wanted to add a new method to the EXISTING View
class, I need a plugin that creates the new method, appends the new method to the existing structure, and adds the necessary typescript definitions.
If I wanted to add a fadeIn
method to the existing View
class, I need to add this typescript definition:
import { View } from 'tns-core-modules/ui/core/view';
declare module 'tns-core-modules/ui/core/view' {
interface View {
fadeIn(duration?: string | number): Promise<void>;
}
}
...
Then I need to add the extra method to the existing View prototype.
import * as viewModule from 'tns-core-modules/ui/core/view';
viewModule.View.prototype.fadeIn = function(duration) {
...
}
So in this case I also don't need the extra platforms/android
and platforms/ios
folders or the files within.
This is one example of a plugin and would be great if it's supported.