From b608af8cfde83f34cd16985e61dc8361a2b5c33e Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Fri, 11 Sep 2015 13:54:52 +0300 Subject: [PATCH] Fix public declarations for the "ui/builder/special-properties" module. --- ui/builder/component-builder.d.ts | 3 --- ui/builder/special-properties.d.ts | 7 +++++++ ui/builder/special-properties.ts | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 ui/builder/special-properties.d.ts diff --git a/ui/builder/component-builder.d.ts b/ui/builder/component-builder.d.ts index 6249d9938..24711fc29 100644 --- a/ui/builder/component-builder.d.ts +++ b/ui/builder/component-builder.d.ts @@ -4,9 +4,6 @@ declare module "ui/builder/component-builder" { export function getComponentModule(elementName: string, namespace: string, attributes: Object, exports: Object): ComponentModule; export function setPropertyValue(instance: view.View, instanceModuleExports: Object, pageExports: Object, propertyName: string, propertyValue: string) : void; - export var specialProperties: Array; - export function setSpecialPropertyValue(instance: view.View, propertyName: string, propertyValue: string): boolean; - export interface ComponentModule { component: view.View; exports: any; diff --git a/ui/builder/special-properties.d.ts b/ui/builder/special-properties.d.ts new file mode 100644 index 000000000..66ed2b3be --- /dev/null +++ b/ui/builder/special-properties.d.ts @@ -0,0 +1,7 @@ +declare module "ui/builder/special-properties" { + import view = require("ui/core/view"); + + export type PropertySetter = (instance: view.View, propertyValue: string) => void; + export function registerSpecialProperty(name: string, setter: PropertySetter): void; + export function getSpecialPropertySetter(name: string): PropertySetter; +} diff --git a/ui/builder/special-properties.ts b/ui/builder/special-properties.ts index 77806ed28..83596513d 100644 --- a/ui/builder/special-properties.ts +++ b/ui/builder/special-properties.ts @@ -8,7 +8,7 @@ function specialPropertyKey(name: string) { return name.toLowerCase(); } -export function registerSpecialProperty(name: string, setter: PropertySetter) { +export function registerSpecialProperty(name: string, setter: PropertySetter): void { let propertyKey = specialPropertyKey(name); if (specialProperties.has(propertyKey)) { throw new Error(`Property for ${propertyKey} already registered`);