Skip to content

Commit 568feb4

Browse files
author
Vladimir Enchev
committed
Merge pull request NativeScript#226 from NativeScript/TS-defs-
TypeScript definitions problems fixed
2 parents 849e0fc + b831ab0 commit 568feb4

File tree

7 files changed

+93
-18
lines changed

7 files changed

+93
-18
lines changed

CrossPlatformModules.csproj

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,15 @@
250250
<TypeScriptCompile Include="image-source\image-source.d.ts" />
251251
<TypeScriptCompile Include="js-libs\easysax\easysax.d.ts" />
252252
<TypeScriptCompile Include="location\location.d.ts" />
253-
<TypeScriptCompile Include="location\location-common.ts" >
254-
<DependentUpon>location.d.ts</DependentUpon>
255-
</TypeScriptCompile>
256-
<TypeScriptCompile Include="location\location.android.ts" >
257-
<DependentUpon>location.d.ts</DependentUpon>
258-
</TypeScriptCompile>
259-
<TypeScriptCompile Include="location\location.ios.ts" >
260-
<DependentUpon>location.d.ts</DependentUpon>
261-
</TypeScriptCompile>
253+
<TypeScriptCompile Include="location\location-common.ts">
254+
<DependentUpon>location.d.ts</DependentUpon>
255+
</TypeScriptCompile>
256+
<TypeScriptCompile Include="location\location.android.ts">
257+
<DependentUpon>location.d.ts</DependentUpon>
258+
</TypeScriptCompile>
259+
<TypeScriptCompile Include="location\location.ios.ts">
260+
<DependentUpon>location.d.ts</DependentUpon>
261+
</TypeScriptCompile>
262262
<TypeScriptCompile Include="apps\tests\app\pageNavigation.ts" />
263263
<TypeScriptCompile Include="apps\tests\pages\navigation\pageA-new-activity.ts" />
264264
<TypeScriptCompile Include="apps\tests\pages\navigation\pageA.ts" />
@@ -394,7 +394,9 @@
394394
<TypeScriptCompile Include="apps\TelerikNEXT\TelerikUI\side-bar\side-bar.android.ts" />
395395
<TypeScriptCompile Include="apps\TelerikNEXT\TelerikUI\side-bar\side-bar.d.ts" />
396396
<TypeScriptCompile Include="apps\TelerikNEXT\TelerikUI\side-bar\side-bar.ios.ts" />
397+
<TypeScriptCompile Include="ui\styling\css-selector.d.ts" />
397398
<TypeScriptCompile Include="ui\styling\css-selector.ts" />
399+
<TypeScriptCompile Include="ui\styling\style-property.d.ts" />
398400
<TypeScriptCompile Include="ui\styling\style.ts" />
399401
<TypeScriptCompile Include="ui\styling\visual-state.ts" />
400402
<TypeScriptCompile Include="ui\core\view-common.ts">
@@ -1513,7 +1515,7 @@
15131515
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
15141516
</WebProjectProperties>
15151517
</FlavorProperties>
1516-
<UserProperties ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2linear-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" />
1518+
<UserProperties ui_2scroll-view_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2editable-text-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2absolute-layout-demo_2package_1json__JSONSchema="http://json.schemastore.org/package" apps_2gallery-app_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2content-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2web-view_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2linear-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2absolute-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" ui_2layouts_2dock-layout_2package_1json__JSONSchema="" ui_2layouts_2grid-layout_2package_1json__JSONSchema="" ui_2layouts_2wrap-layout_2package_1json__JSONSchema="http://json.schemastore.org/package" />
15171519
</VisualStudio>
15181520
</ProjectExtensions>
15191521
</Project>

ui/core/bindable.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@
6565
*/
6666
unbind(property: string);
6767

68+
_onBindingContextChanged(oldValue: any, newValue: any);
69+
6870
//@private
6971
_updateTwoWayBinding(propertyName: string, value: any);
70-
_onBindingContextChanged(oldValue: any, newValue: any);
7172
//@endprivate
7273
}
7374
}

ui/core/dependency-observable.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ declare module "ui/core/dependency-observable" {
181181
* This routine allows for various value modifiers per Property, which is used for inheritance, data-binding and styling purposes.
182182
*/
183183
export class DependencyObservable extends observable.Observable {
184-
//@private
185184
// TODO: Do we want to expose the get/setValue methods as public?
186185
/**
187186
* Gets a value for the property.

ui/core/view.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,16 @@ declare module "ui/core/view" {
368368
onUnloaded(): void;
369369
isLoaded: boolean;
370370

371+
_addView(view: View);
372+
_removeView(view: View);
373+
371374
// TODO: Implement logic for stripping these lines out
372375
//@private
373376
_domId: number;
374377
_cssClasses: Array<string>;
375378

376379
_isAddedToNativeVisualTree: boolean;
377380

378-
_addView(view: View);
379-
_removeView(view: View);
380381
/**
381382
* 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.
382383
*/

ui/styling/css-selector.d.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
declare module "ui/styling/css-selector" {
2+
import view = require("ui/core/view");
3+
import cssParser = require("js-libs/reworkcss");
4+
import styleProperty = require("ui/styling/style-property");
5+
6+
export class CssSelector {
7+
constructor(expression: string, declarations: cssParser.Declaration[]);
8+
9+
expression: string;
10+
11+
declarations(): Array<{ property: string; value: any }>;
12+
13+
specificity: number;
14+
15+
matches(view: view.View): boolean;
16+
17+
apply(view: view.View);
18+
19+
eachSetter(callback: (property: styleProperty.Property, resolvedValue: any) => void);
20+
}
21+
22+
class CssTypeSelector extends CssSelector {
23+
specificity: number;
24+
matches(view: view.View): boolean;
25+
}
26+
27+
class CssIdSelector extends CssSelector {
28+
specificity: number;
29+
matches(view: view.View): boolean;
30+
}
31+
32+
class CssClassSelector extends CssSelector {
33+
specificity: number;
34+
matches(view: view.View): boolean;
35+
}
36+
37+
export class CssVisualStateSelector extends CssSelector {
38+
specificity: number;
39+
40+
key: string;
41+
42+
state: string;
43+
44+
constructor(expression: string, declarations: cssParser.Declaration[]);
45+
matches(view: view.View): boolean;
46+
}
47+
48+
export function createSelector(expression: string, declarations: cssParser.Declaration[]): CssSelector;
49+
50+
class InlineStyleSelector extends CssSelector {
51+
constructor(declarations: cssParser.Declaration[]);
52+
apply(view: view.View);
53+
}
54+
55+
export function applyInlineSyle(view: view.View, declarations: cssParser.Declaration[]);
56+
}

ui/styling/style-property.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
declare module "ui/styling/style-property" {
2+
import definition = require("ui/styling");
3+
import observable = require("ui/core/dependency-observable");
4+
5+
export function getPropertyByName(name: string): Property;
6+
7+
export function getPropertyByCssName(name: string): Property;
8+
9+
export function eachProperty(callback: (property: Property) => void);
10+
11+
export function eachInheritableProperty(callback: (property: Property) => void);
12+
13+
export class Property extends observable.Property implements definition.Property {
14+
15+
constructor(name: string, cssName: string, metadata: observable.PropertyMetadata, valueConverter?: (value: any) => any);
16+
17+
cssName: string;
18+
}
19+
}

ui/styling/styling.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/**
2-
*
3-
*/
4-
declare module "ui/styling" {
1+
declare module "ui/styling" {
52
import observable = require("ui/core/dependency-observable");
63
import color = require("color");
74
import view = require("ui/core/view");

0 commit comments

Comments
 (0)