X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions docs/typescript-definition-package/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
readTypeScriptModules.sourceFiles = [
'angular2/angular2.ts',
'angular2/core.ts',
'angular2/web_worker/worker.ts',
'angular2/web_worker/ui.ts',
'angular2/router.ts',
Expand All @@ -50,31 +51,46 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
createTypeDefinitionFile.typeDefinitions = [
{
id: 'angular2/angular2',
references: ['../es6-promise/es6-promise.d.ts'],
references: [
'./core.d.ts',
'./http.d.ts',
'./router.d.ts'
],
modules: {
'angular2/angular2': {namespace: 'ng', id: 'angular2/angular2'},
'angular2/web_worker/worker': {namespace: 'ngWorker', id: 'angular2/web_worker/worker'},
'angular2/web_worker/ui': {namespace: 'ngUi', id: 'angular2/web_worker/ui'}
'angular2/angular2': {
namespace: 'ng',
id: 'angular2/angular2'
}
}
},
{
id: 'angular2/core',
references: [
'../es6-promise/es6-promise.d.ts'
],
modules: {
'angular2/core': {namespace: 'ng', id: 'angular2/core'}
}
},
{
id: 'angular2/router',
references: ['./angular2.d.ts'],
remapTypes: {Type: 'ng.Type', InjectableReference: 'ng.InjectableReference'},
references: ['./core.d.ts'],
remapTypes: {Type: 'ng.Type', InjectableReference: 'ng.InjectableReference', StringMap: 'ng.StringMap'},
modules: {'angular2/router': {namespace: 'ngRouter', id: 'angular2/router'}}
},
{
id: 'angular2/http',
references: ['./angular2.d.ts'],
remapTypes: {Type: 'ng.Type', Observable: 'ng.Observable', EventEmitter: 'ng.EventEmitter', InjectableReference: 'ng.InjectableReference' },
references: ['./core.d.ts'],
remapTypes: {Type: 'ng.Type', Observable: 'ng.Observable', EventEmitter: 'ng.EventEmitter', InjectableReference: 'ng.InjectableReference', StringMap: 'ng.StringMap' },

modules: {'angular2/http': {namespace: 'ngHttp', id: 'angular2/http'}}
},
{
id: 'angular2/test_lib',
references: ['./angular2.d.ts', '../jasmine/jasmine.d.ts'],
references: ['./core.d.ts', '../jasmine/jasmine.d.ts'],
remapTypes: { Type: 'ng.Type', Binding: 'ng.Binding', ViewMetadata: 'ng.ViewMetadata', Injector: 'ng.Injector',
Predicate: 'ng.Predicate', ElementRef: 'ng.ElementRef', DebugElement: 'ng.DebugElement',
InjectableReference: 'ng.InjectableReference' },
InjectableReference: 'ng.InjectableReference', StringMap: 'ng.StringMap' },
modules: {'angular2/test_lib': {namespace: 'ngTestLib', id: 'angular2/test_lib'}}
}
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ module.exports = function createTypeDefinitionFile(log, convertPrivateClassesToI
function(moduleDocs, props, alias) {
moduleDocs[props.id] = {
id: alias,
doc: null, namespace: props.namespace,
doc: null,
namespace: props.namespace,
references: def.references
};
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{% extends '../type-definition.template.html' %}
{% block staticDeclarations %}

interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}



// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

// ***********************************************************
// This file is generated by the Angular build process.
// Please do not create manual edits or send pull requests
// modifying this file.
// ***********************************************************
{% for alias, module in doc.moduleDocs %}

{% for reference in module.references %}
///<reference path="{$ reference $}"/>
{% endfor %}

declare module {$ module.namespace $} {
// See https://github.com/Microsoft/TypeScript/issues/1168
class BaseException /* extends Error */ {
message: string;
stack: string;
toString(): string;
}
interface InjectableReference {}

}

declare module "{$ alias $}" {
export = {$ module.namespace $};
}

{% endfor %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends '../type-definition.template.html' %}
{% block staticDeclarations %}

interface Map<K,V> {}

{% for alias, module in doc.moduleDocs %}
declare module {$ module.namespace $} {
interface StringMap<K,V> extends Map<K,V> {}
// See https://github.com/Microsoft/TypeScript/issues/1168
class BaseException /* extends Error */ {
message: string;
stack: string;
toString(): string;
}
interface InjectableReference {}
}
{% endfor %}
{% endblock %}
4 changes: 2 additions & 2 deletions modules/angular2/angular2.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './core';
export * from './profile';
export * from './lifecycle_hooks';
export * from './bootstrap';
export * from './http';
export * from './router';
1 change: 1 addition & 0 deletions modules/angular2/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export * from './src/core/directives';
export * from './src/core/forms';
export * from './src/core/debug';
export * from './src/core/change_detection';
export * from './src/core/profile';
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export {
wtfStartTimeRange,
wtfEndTimeRange,
WtfScopeFn
} from './src/core/profile/profile';
} from './profile/profile';
198 changes: 197 additions & 1 deletion modules/angular2/test/public_api_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,203 @@ const NG_API = [
'wtfCreateScope',
'wtfEndTimeRange',
'wtfLeave',
'wtfStartTimeRange'
'wtfStartTimeRange',

// Begin Router Exports
'APP_BASE_HREF',
'AsyncRoute',
'AuxRoute',
'CanActivate',
'ComponentInstruction',
'ComponentInstruction.componentType',
'ComponentInstruction.resolveComponentType',
'ComponentInstruction.routeData',
'ComponentInstruction.specificity',
'ComponentInstruction.terminal',
'HashLocationStrategy',
'HashLocationStrategy.back',
'HashLocationStrategy.constructor',
'HashLocationStrategy.forward',
'HashLocationStrategy.getBaseHref',
'HashLocationStrategy.onPopState',
'HashLocationStrategy.path',
'HashLocationStrategy.pushState',
'Instruction',
'Instruction.replaceChild',
'Location',
'Location.back',
'Location.forward',
'Location.go',
'Location.normalize',
'Location.normalizeAbsolutely',
'Location.path',
'Location.subscribe',
'LocationStrategy',
'LocationStrategy.back',
'LocationStrategy.forward',
'LocationStrategy.getBaseHref',
'LocationStrategy.onPopState',
'LocationStrategy.path',
'LocationStrategy.pushState',
'PathLocationStrategy',
'PathLocationStrategy.back',
'PathLocationStrategy.constructor',
'PathLocationStrategy.forward',
'PathLocationStrategy.getBaseHref',
'PathLocationStrategy.onPopState',
'PathLocationStrategy.path',
'PathLocationStrategy.pushState',
'ROUTER_BINDINGS',
'ROUTER_DIRECTIVES',
'ROUTER_PRIMARY_COMPONENT',
'ROUTE_DATA',
'Redirect',
'RootRouter',
'RootRouter.auxRouter',
'RootRouter.childRouter',
'RootRouter.commit',
'RootRouter.config',
'RootRouter.constructor',
'RootRouter.deactivate',
'RootRouter.generate',
'RootRouter.isRouteActive',
'RootRouter.navigate',
'RootRouter.navigateByInstruction',
'RootRouter.navigateByUrl',
'RootRouter.recognize',
'RootRouter.registerAuxOutlet',
'RootRouter.registerPrimaryOutlet',
'RootRouter.renavigate',
'RootRouter.subscribe',
'Route',
'RouteConfig',
'RouteParams',
'RouteParams.get',
'RouteRegistry',
'RouteRegistry.config',
'RouteRegistry.configFromComponent',
'RouteRegistry.generate',
'RouteRegistry.recognize',
'Router',
'Router.auxRouter',
'Router.childRouter',
'Router.commit',
'Router.config',
'Router.deactivate',
'Router.generate',
'Router.isRouteActive',
'Router.navigate',
'Router.navigateByInstruction',
'Router.navigateByUrl',
'Router.recognize',
'Router.registerAuxOutlet',
'Router.registerPrimaryOutlet',
'Router.renavigate',
'Router.subscribe',
'RouterLink',
'RouterLink.isRouteActive',
'RouterLink.onClick',
'RouterLink.routeParams',
'RouterOutlet',
'RouterOutlet.activate',
'RouterOutlet.canDeactivate',
'RouterOutlet.canReuse',
'RouterOutlet.deactivate',
'RouterOutlet.reuse',
'Url',
'Url.segmentToString',
'Url.toString',
'routerBindings',
// End Router Exports

// Begin Http Exports
'BaseRequestOptions',
'BaseRequestOptions.constructor',
'BaseRequestOptions.merge',
'BaseResponseOptions',
'BaseResponseOptions.constructor',
'BaseResponseOptions.merge',
'BrowserXhr',
'BrowserXhr.build',
'Connection',
'Connection.dispose',
'ConnectionBackend',
'ConnectionBackend.createConnection',
'HTTP_BINDINGS',
'Headers',
'Headers.append',
'Headers.delete',
'Headers.entries',
'Headers.forEach',
'Headers.get',
'Headers.getAll',
'Headers.has',
'Headers.keys',
'Headers.set',
'Headers.values',
'Http',
'Http.delete',
'Http.get',
'Http.head',
'Http.patch',
'Http.post',
'Http.put',
'Http.request',
'JSONPBackend',
'JSONPBackend.createConnection',
'JSONPConnection',
'JSONPConnection.dispose',
'JSONPConnection.finished',
'JSONP_BINDINGS',
'Jsonp',
'Jsonp.constructor',
'Jsonp.delete',
'Jsonp.get',
'Jsonp.head',
'Jsonp.patch',
'Jsonp.post',
'Jsonp.put',
'Jsonp.request',
'MockBackend',
'MockBackend.createConnection',
'MockBackend.resolveAllConnections',
'MockBackend.verifyNoPendingRequests',
'MockConnection',
'MockConnection.dispose',
'MockConnection.mockDownload',
'MockConnection.mockError',
'MockConnection.mockRespond',
'ReadyStates',
'Request',
'Request.text',
'RequestMethods',
'RequestOptions',
'RequestOptions.merge',
'Response',
'Response.arrayBuffer',
'Response.blob',
'Response.json',
'Response.text',
'ResponseOptions',
'ResponseOptions.merge',
'ResponseTypes',
'URLSearchParams',
'URLSearchParams.append',
'URLSearchParams.appendAll',
'URLSearchParams.clone',
'URLSearchParams.delete',
'URLSearchParams.get',
'URLSearchParams.getAll',
'URLSearchParams.has',
'URLSearchParams.replaceAll',
'URLSearchParams.set',
'URLSearchParams.setAll',
'URLSearchParams.toString',
'XHRBackend',
'XHRBackend.createConnection',
'XHRConnection',
'XHRConnection.dispose'
// End Http Exports
].sort();

export function main() {
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/web_worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export * from '../src/core/forms';
export * from '../src/core/debug';
export * from '../src/core/change_detection';

export * from '../profile';
export * from '../src/core/profile';
export * from '../src/web_workers/worker/application';
export * from '../src/web_workers/shared/client_message_broker';
export * from '../src/web_workers/shared/service_message_broker';
Expand Down
2 changes: 1 addition & 1 deletion typing_spec/router_spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///<reference path="../dist/docs/typings/angular2/angular2.d.ts"/>
///<reference path="../dist/docs/typings/angular2/core.d.ts"/>
///<reference path="../dist/docs/typings/angular2/router.d.ts"/>

import {Component, bootstrap, View} from 'angular2/angular2';
Expand Down
X Tutup