Merge pull request #3856 from NativeScript/delete-special-properties

special-properties module removed
This commit is contained in:
Alexander Vakrilov
2017-03-30 13:39:05 +03:00
committed by GitHub
2 changed files with 0 additions and 28 deletions

View File

@ -1,5 +0,0 @@
import { View } from "ui/core/view";
export type PropertySetter = (instance: View, propertyValue: any) => void;
export function registerSpecialProperty(name: string, setter: PropertySetter): void;
export function getSpecialPropertySetter(name: string): PropertySetter;

View File

@ -1,23 +0,0 @@
import { View } from "../core/view";
export type PropertySetter = (instance: View, propertyValue: any) => void;
var specialProperties: Map<string, PropertySetter> = new Map<string, PropertySetter>();
function specialPropertyKey(name: string) {
return name.toLowerCase();
}
export function registerSpecialProperty(name: string, setter: PropertySetter): void {
let propertyKey = specialPropertyKey(name);
if (specialProperties.has(propertyKey)) {
throw new Error(`Property for ${propertyKey} already registered`);
} else {
specialProperties.set(propertyKey, setter);
}
}
export function getSpecialPropertySetter(name: string): PropertySetter {
let propertyKey = specialPropertyKey(name);
return specialProperties.get(propertyKey);
}