From 8ea1c5c74350f6a89133593e6548539af2380ad1 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 26 Mar 2015 11:49:25 +0200 Subject: [PATCH 1/3] missing TS defs added --- CrossPlatformModules.csproj | 22 +++++++------ ui/styling/css-selector.d.ts | 56 ++++++++++++++++++++++++++++++++++ ui/styling/style-property.d.ts | 19 ++++++++++++ 3 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 ui/styling/css-selector.d.ts create mode 100644 ui/styling/style-property.d.ts diff --git a/CrossPlatformModules.csproj b/CrossPlatformModules.csproj index 32ae99e50..862f8445a 100644 --- a/CrossPlatformModules.csproj +++ b/CrossPlatformModules.csproj @@ -250,15 +250,15 @@ - - location.d.ts - - - location.d.ts - - - location.d.ts - + + location.d.ts + + + location.d.ts + + + location.d.ts + @@ -394,7 +394,9 @@ + + @@ -1513,7 +1515,7 @@ False - + \ No newline at end of file diff --git a/ui/styling/css-selector.d.ts b/ui/styling/css-selector.d.ts new file mode 100644 index 000000000..f524d6363 --- /dev/null +++ b/ui/styling/css-selector.d.ts @@ -0,0 +1,56 @@ +declare module "ui/styling/css-selector" { + import view = require("ui/core/view"); + import cssParser = require("js-libs/reworkcss"); + import styleProperty = require("ui/styling/style-property"); + + export class CssSelector { + constructor(expression: string, declarations: cssParser.Declaration[]); + + expression: string; + + declarations(): Array<{ property: string; value: any }>; + + specificity: number; + + matches(view: view.View): boolean; + + apply(view: view.View); + + eachSetter(callback: (property: styleProperty.Property, resolvedValue: any) => void); + } + + class CssTypeSelector extends CssSelector { + specificity: number; + matches(view: view.View): boolean; + } + + class CssIdSelector extends CssSelector { + specificity: number; + matches(view: view.View): boolean; + } + + class CssClassSelector extends CssSelector { + specificity: number; + matches(view: view.View): boolean; + } + + export class CssVisualStateSelector extends CssSelector { + specificity: number; + + key: string; + + state: string; + + constructor(expression: string, declarations: cssParser.Declaration[]); + matches(view: view.View): boolean; + } + + export function createSelector(expression: string, declarations: cssParser.Declaration[]): CssSelector; + + class InlineStyleSelector extends CssSelector { + constructor(declarations: cssParser.Declaration[]); + apply(view: view.View); + } + + export function applyInlineSyle(view: view.View, declarations: cssParser.Declaration[]); +} \ No newline at end of file diff --git a/ui/styling/style-property.d.ts b/ui/styling/style-property.d.ts new file mode 100644 index 000000000..b2c9a27f2 --- /dev/null +++ b/ui/styling/style-property.d.ts @@ -0,0 +1,19 @@ +declare module "ui/styling/style-property" { + import definition = require("ui/styling"); + import observable = require("ui/core/dependency-observable"); + + export function getPropertyByName(name: string): Property; + + export function getPropertyByCssName(name: string): Property; + + export function eachProperty(callback: (property: Property) => void); + + export function eachInheritableProperty(callback: (property: Property) => void); + + export class Property extends observable.Property implements definition.Property { + + constructor(name: string, cssName: string, metadata: observable.PropertyMetadata, valueConverter?: (value: any) => any); + + cssName: string; + } +} \ No newline at end of file From 6700b98ce0c4be7d974dbe9083781e2e12482f39 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 26 Mar 2015 11:50:05 +0200 Subject: [PATCH 2/3] method definitions enabled for override (removed from @private) --- ui/core/bindable.d.ts | 3 ++- ui/core/dependency-observable.d.ts | 1 - ui/core/view.d.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/core/bindable.d.ts b/ui/core/bindable.d.ts index 3f4666f41..e8f756d49 100644 --- a/ui/core/bindable.d.ts +++ b/ui/core/bindable.d.ts @@ -65,9 +65,10 @@ */ unbind(property: string); + _onBindingContextChanged(oldValue: any, newValue: any); + //@private _updateTwoWayBinding(propertyName: string, value: any); - _onBindingContextChanged(oldValue: any, newValue: any); //@endprivate } } diff --git a/ui/core/dependency-observable.d.ts b/ui/core/dependency-observable.d.ts index 3c10cab7b..209dd9908 100644 --- a/ui/core/dependency-observable.d.ts +++ b/ui/core/dependency-observable.d.ts @@ -181,7 +181,6 @@ declare module "ui/core/dependency-observable" { * This routine allows for various value modifiers per Property, which is used for inheritance, data-binding and styling purposes. */ export class DependencyObservable extends observable.Observable { - //@private // TODO: Do we want to expose the get/setValue methods as public? /** * Gets a value for the property. diff --git a/ui/core/view.d.ts b/ui/core/view.d.ts index fa0349aae..215a36b55 100644 --- a/ui/core/view.d.ts +++ b/ui/core/view.d.ts @@ -368,6 +368,9 @@ declare module "ui/core/view" { onUnloaded(): void; isLoaded: boolean; + _addView(view: View); + _removeView(view: View); + // TODO: Implement logic for stripping these lines out //@private _domId: number; @@ -375,8 +378,6 @@ declare module "ui/core/view" { _isAddedToNativeVisualTree: boolean; - _addView(view: View); - _removeView(view: View); /** * Performs the core logic of adding a child view to the native visual tree. Returns true if the view's native representation has been successfully added, false otherwise. */ From b831ab09aa874067d24ffa42a69fbc5d63fadc02 Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Thu, 26 Mar 2015 11:50:27 +0200 Subject: [PATCH 3/3] empty comment remove (TS compile error) --- ui/styling/styling.d.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/styling/styling.d.ts b/ui/styling/styling.d.ts index 01c64dc82..fa935d446 100644 --- a/ui/styling/styling.d.ts +++ b/ui/styling/styling.d.ts @@ -1,7 +1,4 @@ -/** - * - */ -declare module "ui/styling" { +declare module "ui/styling" { import observable = require("ui/core/dependency-observable"); import color = require("color"); import view = require("ui/core/view");