diff --git a/src/plugins/plugin.ts b/src/plugins/plugin.ts index 4c007060b..71a6a9f17 100644 --- a/src/plugins/plugin.ts +++ b/src/plugins/plugin.ts @@ -317,3 +317,22 @@ export function CordovaProperty(target: Function, key: string, descriptor: Typed return descriptor; } + +/** + * @private + * @param target + * @param key + * @param descriptor + * @constructor + */ +export function InstanceProperty(target: Function, key: string, descriptor: TypedPropertyDescriptor) { + descriptor.get = function() { + return this._objectInstance[key]; + }; + + descriptor.get = function(...args: any[]) { + return this._objectInstance[key] = args[0]; + }; + + return descriptor; +} \ No newline at end of file