mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Merge pull request #3856 from NativeScript/delete-special-properties
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