Fix public declarations for the "ui/builder/special-properties" module.

This commit is contained in:
Hristo Deshev
2015-09-11 13:54:52 +03:00
parent bfb81088a3
commit b608af8cfd
3 changed files with 8 additions and 4 deletions

View File

@ -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<string>;
export function setSpecialPropertyValue(instance: view.View, propertyName: string, propertyValue: string): boolean;
export interface ComponentModule {
component: view.View;
exports: any;

7
ui/builder/special-properties.d.ts vendored Normal file
View File

@ -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;
}

View File

@ -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`);