No more ambient modules for tns-core-modules/* subpackages.

- Use path mappings in tsconfig.json to resolve module typings
- Only use ambient mobules for global API's
- Move single-file modules to a subdir with the same name so that
we can provide a hand-written typing next to it (via package.json)
- Delete all mentions of tns-core-modules.d.ts
- Delete reference d.ts assembly build steps. Not needed anymore.
- HACK! Use a <reference> for global typings in application.d.ts
to avoid publishing a separate @types/tns-core-modules package.
- Rename declarations.d.ts to tns-core-modules.d.ts to preserve
JS project mappings in references.d.ts (the only place we use those)
This commit is contained in:
Hristo Deshev
2017-03-02 13:50:23 +02:00
committed by Hristo Deshev
parent 1af8c6ca8e
commit b45cbe929b
230 changed files with 9170 additions and 10028 deletions

View File

@@ -1,19 +1,17 @@
//@private
declare module "ui/builder/binding-builder" {
export module bindingConstants {
export var sourceProperty: string;
export var targetProperty: string;
export var expression: string;
export var twoWay: string;
export var source: string;
export var bindingValueKey: string;
export var parentValueKey: string;
export var parentsValueKey: string;
export var newPropertyValueKey: string;
}
export function getBindingOptions(name: string, value: string): any;
export var parentsRegex: RegExp;
export module bindingConstants {
export var sourceProperty: string;
export var targetProperty: string;
export var expression: string;
export var twoWay: string;
export var source: string;
export var bindingValueKey: string;
export var parentValueKey: string;
export var parentsValueKey: string;
export var newPropertyValueKey: string;
}
export function getBindingOptions(name: string, value: string): any;
export var parentsRegex: RegExp;
}
//@endprivate

View File

@@ -1,18 +1,16 @@
declare module "ui/builder" {
import { View, Template, KeyedTemplate } from "ui/core/view";
import { Page } from "ui/page";
import { View, Template, KeyedTemplate } from "ui/core/view";
import { Page } from "ui/page";
export function loadPage(moduleNamePath: string, fileName: string, moduleExports?: any): Page;
export function load(fileName: string, exports?: any): View;
export function load(options: LoadOptions): View;
export function parse(value: string | Template, exports?: any): View;
export function parseMultipleTemplates(value: string, exports?: any): Array<KeyedTemplate>;
export function loadPage(moduleNamePath: string, fileName: string, moduleExports?: any): Page;
export function load(fileName: string, exports?: any): View;
export function load(options: LoadOptions): View;
export function parse(value: string | Template, exports?: any): View;
export function parseMultipleTemplates(value: string, exports?: any): Array<KeyedTemplate>;
export interface LoadOptions {
path: string;
name: string;
attributes?: any;
exports?: any;
page?: Page;
}
}
export interface LoadOptions {
path: string;
name: string;
attributes?: any;
exports?: any;
page?: Page;
}

View File

@@ -1,11 +0,0 @@
declare module "ui/builder/component-builder" {
import { View } from "ui/core/view";
export function getComponentModule(elementName: string, namespace: string, attributes: Object, exports: Object, moduleNamePath?: string): ComponentModule;
export function setPropertyValue(instance: View, instanceModuleExports: Object, pageExports: Object, propertyName: string, propertyValue: any): void;
export interface ComponentModule {
component: View;
exports: any;
}
}

View File

@@ -0,0 +1,9 @@
import { View } from "ui/core/view";
export function getComponentModule(elementName: string, namespace: string, attributes: Object, exports: Object, moduleNamePath?: string): ComponentModule;
export function setPropertyValue(instance: View, instanceModuleExports: Object, pageExports: Object, propertyName: string, propertyValue: any): void;
export interface ComponentModule {
component: View;
exports: any;
}

View File

@@ -5,7 +5,7 @@ import { View } from "ui/core/view";
// Types.
import { isEventOrGesture } from "ui/core/bindable";
import { File, path, knownFolders } from "file-system";
import { getBindingOptions, bindingConstants } from "./binding-builder";
import { getBindingOptions, bindingConstants } from "../binding-builder";
import { resolveFileName } from "file-system/file-name-resolver";
import * as debugModule from "utils/debug";
import * as platform from "platform";
@@ -225,4 +225,4 @@ function isKnownFunction(name: string, instance: View): boolean {
return instance.constructor
&& KNOWN_FUNCTIONS in instance.constructor
&& instance.constructor[KNOWN_FUNCTIONS].indexOf(name) !== -1;
}
}

View File

@@ -0,0 +1,5 @@
{
"name" : "component-builder",
"main" : "component-builder",
"types" : "component-builder.d.ts"
}

View File

@@ -1,2 +1,5 @@
{ "name" : "builder",
"main" : "builder" }
{
"name" : "builder",
"main" : "builder",
"types" : "builder.d.ts"
}

View File

@@ -1,7 +1,5 @@
declare module "ui/builder/special-properties" {
import { View } from "ui/core/view";
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;
}
export type PropertySetter = (instance: View, propertyValue: any) => void;
export function registerSpecialProperty(name: string, setter: PropertySetter): void;
export function getSpecialPropertySetter(name: string): PropertySetter;