taktik-polymer-typescript
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,77 +0,78 @@ | ||
define("taktik-polymer-typeScript", ["require", "exports", "reflect-metadata", "../type/element", "../type/shadow", "../type/polymer", "../type/iron-ajax", "../type/missing"], function (require, exports) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
; | ||
function customElement(tagname) { | ||
return (clazz) => { | ||
clazz.is = tagname; | ||
window[clazz.name] = clazz; // Register class in windows se that is can be use without IMD module loading. | ||
// Useful for import in pure JS project. | ||
window.customElements.define(tagname, clazz); | ||
/** | ||
* A TypeScript class decorator that defines a custom element with name | ||
* `tagname` and the decorated class. | ||
*/ | ||
import 'reflect-metadata'; | ||
import '../type/element'; | ||
import '../type/shadow'; | ||
import '../type/polymer'; | ||
import '../type/iron-ajax'; | ||
import '../type/missing'; | ||
; | ||
export function customElement(tagname) { | ||
return (clazz) => { | ||
clazz.is = tagname; | ||
window[clazz.name] = clazz; // Register class in windows se that is can be use without IMD module loading. | ||
// Useful for import in pure JS project. | ||
window.customElements.define(tagname, clazz); | ||
}; | ||
} | ||
/** | ||
* A TypeScript class decorator that declare a global class | ||
* `tagname` and the decorated class. | ||
*/ | ||
export function jsElement() { | ||
return (clazz) => { | ||
window[clazz.name] = clazz; // Register class in windows se that is can be use without IMD module loading. | ||
// Useful for import in pure JS project. | ||
}; | ||
} | ||
; | ||
/** | ||
* A TypeScript property decorator factory that defines this as a Polymer | ||
* property. | ||
* | ||
* This function must be invoked to return a decorator. | ||
*/ | ||
export function property(options) { | ||
return (proto, propName) => { | ||
const notify = (options && options.notify); | ||
const type = Reflect.getMetadata("design:type", proto, propName); | ||
const config = _ensureConfig(proto); | ||
config.properties[propName] = { | ||
type, | ||
notify, | ||
}; | ||
}; | ||
} | ||
export function domElement() { | ||
return (proto, propName) => { | ||
}; | ||
} | ||
/** | ||
* A TypeScript property decorator factory that causes the decorated method to | ||
* be called when a property changes. `targets` is either a single property | ||
* name, or a list of property names. | ||
* | ||
* This function must be invoked to return a decorator. | ||
*/ | ||
export function observe(targets) { | ||
return (proto, propName) => { | ||
const targetString = typeof targets === 'string' ? targets : targets.join(','); | ||
const config = _ensureConfig(proto); | ||
config.observers.push(`${propName}(${targetString})`); | ||
}; | ||
} | ||
function _ensureConfig(proto) { | ||
const ctor = proto.constructor; | ||
if (ctor.hasOwnProperty('__polymer_ts_config')) { | ||
return ctor.__polymer_ts_config; | ||
} | ||
exports.customElement = customElement; | ||
/** | ||
* A TypeScript class decorator that declare a global class | ||
* `tagname` and the decorated class. | ||
*/ | ||
function jsElement() { | ||
return (clazz) => { | ||
window[clazz.name] = clazz; // Register class in windows se that is can be use without IMD module loading. | ||
// Useful for import in pure JS project. | ||
}; | ||
} | ||
exports.jsElement = jsElement; | ||
; | ||
/** | ||
* A TypeScript property decorator factory that defines this as a Polymer | ||
* property. | ||
* | ||
* This function must be invoked to return a decorator. | ||
*/ | ||
function property(options) { | ||
return (proto, propName) => { | ||
const notify = (options && options.notify); | ||
const type = Reflect.getMetadata("design:type", proto, propName); | ||
const config = _ensureConfig(proto); | ||
config.properties[propName] = { | ||
type, | ||
notify, | ||
}; | ||
}; | ||
} | ||
exports.property = property; | ||
function domElement() { | ||
return (proto, propName) => { | ||
}; | ||
} | ||
exports.domElement = domElement; | ||
/** | ||
* A TypeScript property decorator factory that causes the decorated method to | ||
* be called when a property changes. `targets` is either a single property | ||
* name, or a list of property names. | ||
* | ||
* This function must be invoked to return a decorator. | ||
*/ | ||
function observe(targets) { | ||
return (proto, propName) => { | ||
const targetString = typeof targets === 'string' ? targets : targets.join(','); | ||
const config = _ensureConfig(proto); | ||
config.observers.push(`${propName}(${targetString})`); | ||
}; | ||
} | ||
exports.observe = observe; | ||
function _ensureConfig(proto) { | ||
const ctor = proto.constructor; | ||
if (ctor.hasOwnProperty('__polymer_ts_config')) { | ||
return ctor.__polymer_ts_config; | ||
} | ||
Object.defineProperty(ctor, 'config', { | ||
get() { return ctor.__polymer_ts_config; } | ||
}); | ||
const config = ctor.__polymer_ts_config = ctor.__polymer_ts_config || {}; | ||
config.properties = config.properties || {}; | ||
config.observers = config.observers || []; | ||
return config; | ||
} | ||
}); | ||
Object.defineProperty(ctor, 'config', { | ||
get() { return ctor.__polymer_ts_config; } | ||
}); | ||
const config = ctor.__polymer_ts_config = ctor.__polymer_ts_config || {}; | ||
config.properties = config.properties || {}; | ||
config.observers = config.observers || []; | ||
return config; | ||
} |
{ | ||
"name": "taktik-polymer-typescript", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Module providing development facilities for ozone polymer type script modules.", | ||
@@ -21,5 +21,4 @@ "main": "dist/src/index.js", | ||
"@types/reflect-metadata": "0.0.5", | ||
"ozone-type": "git+https://git@bitbucket.taktik.be/scm/sandbox/ozone-type.git", | ||
"reflect-metadata": "^0.1.10" | ||
"ozone-type": "git+https://git@bitbucket.taktik.be/scm/sandbox/ozone-type.git" | ||
} | ||
} |
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
// Use of ES6 | ||
"module": "amd", | ||
// Module strategy that is likely to be use with official Polymer/typeScript support. See PolymerLabs/IMD | ||
"module": "es2015", | ||
"experimentalDecorators": true, | ||
@@ -19,5 +17,2 @@ // | ||
], | ||
"typeRoots": [ | ||
"./node_modules/@types" | ||
], | ||
"declaration": true, | ||
@@ -24,0 +19,0 @@ "outDir": "./dist", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3
0
56771
306
- Removedreflect-metadata@^0.1.10
- Removedreflect-metadata@0.1.14(transitive)