mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
special-properties module removed
This commit is contained in:
@@ -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;
|
|
||||||
@@ -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);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user