Skip to content

Commit

Permalink
fix(all): improve several d.ts definitions with better type info
Browse files Browse the repository at this point in the history
Fixes #132
  • Loading branch information
EisenbergEffect committed Jul 15, 2015
1 parent a21b0ab commit 51cad25
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 323 deletions.
78 changes: 39 additions & 39 deletions dist/amd/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ declare module 'aurelia-templating' {
import core from 'core-js';
import { Metadata, Origin, Decorators } from 'aurelia-metadata';
import { relativeToFile } from 'aurelia-path';
import { TemplateRegistryEntry, Loader } from 'aurelia-loader';
import { Container } from 'aurelia-dependency-injection';
import { Loader, TemplateRegistryEntry } from 'aurelia-loader';
import { bindingMode, ObserverLocator, ValueConverterResource, EventManager } from 'aurelia-binding';
import { bindingMode, ObserverLocator, BindingExpression, Binding, ValueConverterResource, EventManager } from 'aurelia-binding';
import { TaskQueue } from 'aurelia-task-queue';
import * as LogManager from 'aurelia-logging';
export const animationEvent: any;
Expand Down Expand Up @@ -92,27 +92,27 @@ declare module 'aurelia-templating' {
export function hyphenate(name: any): any;
export function nextElementSibling(element: any): any;
export class ViewStrategy {
static metadataKey: any;
makeRelativeTo(baseUrl: any): any;
static normalize(value: any): any;
static getDefault(target: any): any;
static metadataKey: string;
makeRelativeTo(baseUrl: string): any;
static normalize(value: string | ViewStrategy): any;
static getDefault(target: any): ViewStrategy;
}
export class UseViewStrategy extends ViewStrategy {
constructor(path: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
makeRelativeTo(file: any): any;
constructor(path: string);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
makeRelativeTo(file: string): any;
}
export class ConventionalViewStrategy extends ViewStrategy {
constructor(moduleId: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
static convertModuleIdToViewUrl(moduleId: any): any;
constructor(moduleId: string);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
static convertModuleIdToViewUrl(moduleId: string): string;
}
export class NoViewStrategy extends ViewStrategy {
loadViewFactory(): any;
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
}
export class TemplateRegistryViewStrategy extends ViewStrategy {
constructor(moduleId: any, registryEntry: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
constructor(moduleId: string, registryEntry: TemplateRegistryEntry);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
}
export class BindingLanguage {
inspectAttribute(resources: any, attrName: any, attrValue: any): any;
Expand Down Expand Up @@ -202,11 +202,11 @@ declare module 'aurelia-templating' {
}
export class ViewEngine {
static inject(): any;
constructor(loader: any, container: any, viewCompiler: any, moduleAnalyzer: any, appResources: any);
loadViewFactory(urlOrRegistryEntry: any, compileOptions: any, associatedModuleId: any, loadContext: any): any;
loadTemplateResources(viewRegistryEntry: any, associatedModuleId: any, loadContext: any): any;
importViewModelResource(moduleImport: any, moduleMember: any): any;
importViewResources(moduleIds: any, names: any, resources: any, associatedModuleId: any, loadContext: any): any;
constructor(loader: Loader, container: Container, viewCompiler: ViewCompiler, moduleAnalyzer: ModuleAnalyzer, appResources: ResourceRegistry);
loadViewFactory(urlOrRegistryEntry: string | TemplateRegistryEntry, compileOptions?: Object, associatedModuleId?: string, loadContext?: string[]): Promise<ViewFactory>;
loadTemplateResources(viewRegistryEntry: TemplateRegistryEntry, associatedModuleId?: string, loadContext?: string[]): Promise<ResourceRegistry>;
importViewModelResource(moduleImport: string, moduleMember: string): Promise<ResourceDescription>;
importViewResources(moduleIds: string[], names: string[], resources: ResourceRegistry, associatedModuleId?: string, loadContext?: string[]): Promise<ResourceRegistry>;
}
export class BehaviorInstance {
constructor(behavior: any, executionContext: any, instruction: any);
Expand Down Expand Up @@ -235,32 +235,32 @@ declare module 'aurelia-templating' {
}
export class HtmlBehaviorResource {
constructor();
static convention(name: any, existing: any): any;
addChildBinding(behavior: any): any;
analyze(container: any, target: any): any;
load(container: any, target: any, viewStrategy: any, transientView: any, loadContext: any): any;
register(registry: any, name: any): any;
compile(compiler: any, resources: any, node: any, instruction: any, parentNode: any): any;
create(container: any, instruction?: any, element?: any, bindings?: any): any;
ensurePropertiesDefined(instance: any, lookup: any): any;
static convention(name: string, existing?: HtmlBehaviorResource): any;
addChildBinding(behavior: BindingExpression): any;
analyze(container: Container, target: Function): any;
load(container: Container, target: Function, viewStrategy?: ViewStrategy, transientView?: boolean, loadContext?: string[]): Promise<HtmlBehaviorResource>;
register(registry: ResourceRegistry, name?: string): any;
compile(compiler: ViewCompiler, resources: ResourceRegistry, node?: Node, instruction?: Object, parentNode?: Node): Node;
create(container: Container, instruction?: Object, element?: Element, bindings?: Binding[]): BehaviorInstance;
ensurePropertiesDefined(instance: Object, lookup: Object): any;
}
export class ResourceModule {
constructor(moduleId: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any, loadContext: any): any;
constructor(moduleId: string);
analyze(container: Container): any;
register(registry: ResourceRegistry, name?: string): any;
load(container: Container, loadContext?: string[]): Promise;
}
export class ResourceDescription {
constructor(key: any, exportedValue: any, resourceTypeMeta: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any, loadContext: any): any;
static get(resource: any, key?: any): any;
constructor(key: string, exportedValue: any, resourceTypeMeta: Object);
analyze(container: Container): any;
register(registry: ResourceRegistry, name?: string): any;
load(container: Container, loadContext?: string[]): Promise | void;
static get(resource: any, key?: string): ResourceDescription;
}
export class ModuleAnalyzer {
constructor();
getAnalysis(moduleId: any): any;
analyze(moduleId: any, moduleInstance: any, viewModelMember: any): any;
getAnalysis(moduleId: string): ResourceModule;
analyze(moduleId: string, moduleInstance: any, viewModelMember?: string): ResourceModule;
}
export class ChildObserver {
constructor(config: any);
Expand Down
4 changes: 2 additions & 2 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-binding', 'aurelia-task-queue', 'aurelia-logging'], function (exports, _coreJs, _aureliaMetadata, _aureliaPath, _aureliaDependencyInjection, _aureliaLoader, _aureliaBinding, _aureliaTaskQueue, _aureliaLogging) {
define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-loader', 'aurelia-dependency-injection', 'aurelia-binding', 'aurelia-task-queue', 'aurelia-logging'], function (exports, _coreJs, _aureliaMetadata, _aureliaPath, _aureliaLoader, _aureliaDependencyInjection, _aureliaBinding, _aureliaTaskQueue, _aureliaLogging) {
'use strict';

exports.__esModule = true;
Expand Down Expand Up @@ -242,7 +242,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen

_inherits(NoViewStrategy, _ViewStrategy3);

NoViewStrategy.prototype.loadViewFactory = function loadViewFactory() {
NoViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options, loadContext) {
return Promise.resolve(null);
};

Expand Down
78 changes: 39 additions & 39 deletions dist/commonjs/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ declare module 'aurelia-templating' {
import core from 'core-js';
import { Metadata, Origin, Decorators } from 'aurelia-metadata';
import { relativeToFile } from 'aurelia-path';
import { TemplateRegistryEntry, Loader } from 'aurelia-loader';
import { Container } from 'aurelia-dependency-injection';
import { Loader, TemplateRegistryEntry } from 'aurelia-loader';
import { bindingMode, ObserverLocator, ValueConverterResource, EventManager } from 'aurelia-binding';
import { bindingMode, ObserverLocator, BindingExpression, Binding, ValueConverterResource, EventManager } from 'aurelia-binding';
import { TaskQueue } from 'aurelia-task-queue';
import * as LogManager from 'aurelia-logging';
export const animationEvent: any;
Expand Down Expand Up @@ -92,27 +92,27 @@ declare module 'aurelia-templating' {
export function hyphenate(name: any): any;
export function nextElementSibling(element: any): any;
export class ViewStrategy {
static metadataKey: any;
makeRelativeTo(baseUrl: any): any;
static normalize(value: any): any;
static getDefault(target: any): any;
static metadataKey: string;
makeRelativeTo(baseUrl: string): any;
static normalize(value: string | ViewStrategy): any;
static getDefault(target: any): ViewStrategy;
}
export class UseViewStrategy extends ViewStrategy {
constructor(path: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
makeRelativeTo(file: any): any;
constructor(path: string);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
makeRelativeTo(file: string): any;
}
export class ConventionalViewStrategy extends ViewStrategy {
constructor(moduleId: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
static convertModuleIdToViewUrl(moduleId: any): any;
constructor(moduleId: string);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
static convertModuleIdToViewUrl(moduleId: string): string;
}
export class NoViewStrategy extends ViewStrategy {
loadViewFactory(): any;
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
}
export class TemplateRegistryViewStrategy extends ViewStrategy {
constructor(moduleId: any, registryEntry: any);
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
constructor(moduleId: string, registryEntry: TemplateRegistryEntry);
loadViewFactory(viewEngine: ViewEngine, options: Object, loadContext?: string[]): Promise<ViewFactory>;
}
export class BindingLanguage {
inspectAttribute(resources: any, attrName: any, attrValue: any): any;
Expand Down Expand Up @@ -202,11 +202,11 @@ declare module 'aurelia-templating' {
}
export class ViewEngine {
static inject(): any;
constructor(loader: any, container: any, viewCompiler: any, moduleAnalyzer: any, appResources: any);
loadViewFactory(urlOrRegistryEntry: any, compileOptions: any, associatedModuleId: any, loadContext: any): any;
loadTemplateResources(viewRegistryEntry: any, associatedModuleId: any, loadContext: any): any;
importViewModelResource(moduleImport: any, moduleMember: any): any;
importViewResources(moduleIds: any, names: any, resources: any, associatedModuleId: any, loadContext: any): any;
constructor(loader: Loader, container: Container, viewCompiler: ViewCompiler, moduleAnalyzer: ModuleAnalyzer, appResources: ResourceRegistry);
loadViewFactory(urlOrRegistryEntry: string | TemplateRegistryEntry, compileOptions?: Object, associatedModuleId?: string, loadContext?: string[]): Promise<ViewFactory>;
loadTemplateResources(viewRegistryEntry: TemplateRegistryEntry, associatedModuleId?: string, loadContext?: string[]): Promise<ResourceRegistry>;
importViewModelResource(moduleImport: string, moduleMember: string): Promise<ResourceDescription>;
importViewResources(moduleIds: string[], names: string[], resources: ResourceRegistry, associatedModuleId?: string, loadContext?: string[]): Promise<ResourceRegistry>;
}
export class BehaviorInstance {
constructor(behavior: any, executionContext: any, instruction: any);
Expand Down Expand Up @@ -235,32 +235,32 @@ declare module 'aurelia-templating' {
}
export class HtmlBehaviorResource {
constructor();
static convention(name: any, existing: any): any;
addChildBinding(behavior: any): any;
analyze(container: any, target: any): any;
load(container: any, target: any, viewStrategy: any, transientView: any, loadContext: any): any;
register(registry: any, name: any): any;
compile(compiler: any, resources: any, node: any, instruction: any, parentNode: any): any;
create(container: any, instruction?: any, element?: any, bindings?: any): any;
ensurePropertiesDefined(instance: any, lookup: any): any;
static convention(name: string, existing?: HtmlBehaviorResource): any;
addChildBinding(behavior: BindingExpression): any;
analyze(container: Container, target: Function): any;
load(container: Container, target: Function, viewStrategy?: ViewStrategy, transientView?: boolean, loadContext?: string[]): Promise<HtmlBehaviorResource>;
register(registry: ResourceRegistry, name?: string): any;
compile(compiler: ViewCompiler, resources: ResourceRegistry, node?: Node, instruction?: Object, parentNode?: Node): Node;
create(container: Container, instruction?: Object, element?: Element, bindings?: Binding[]): BehaviorInstance;
ensurePropertiesDefined(instance: Object, lookup: Object): any;
}
export class ResourceModule {
constructor(moduleId: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any, loadContext: any): any;
constructor(moduleId: string);
analyze(container: Container): any;
register(registry: ResourceRegistry, name?: string): any;
load(container: Container, loadContext?: string[]): Promise;
}
export class ResourceDescription {
constructor(key: any, exportedValue: any, resourceTypeMeta: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any, loadContext: any): any;
static get(resource: any, key?: any): any;
constructor(key: string, exportedValue: any, resourceTypeMeta: Object);
analyze(container: Container): any;
register(registry: ResourceRegistry, name?: string): any;
load(container: Container, loadContext?: string[]): Promise | void;
static get(resource: any, key?: string): ResourceDescription;
}
export class ModuleAnalyzer {
constructor();
getAnalysis(moduleId: any): any;
analyze(moduleId: any, moduleInstance: any, viewModelMember: any): any;
getAnalysis(moduleId: string): ResourceModule;
analyze(moduleId: string, moduleInstance: any, viewModelMember?: string): ResourceModule;
}
export class ChildObserver {
constructor(config: any);
Expand Down
6 changes: 3 additions & 3 deletions dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ var _aureliaMetadata = require('aurelia-metadata');

var _aureliaPath = require('aurelia-path');

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaLoader = require('aurelia-loader');

var _aureliaDependencyInjection = require('aurelia-dependency-injection');

var _aureliaBinding = require('aurelia-binding');

var _aureliaTaskQueue = require('aurelia-task-queue');
Expand Down Expand Up @@ -261,7 +261,7 @@ var NoViewStrategy = (function (_ViewStrategy3) {

_inherits(NoViewStrategy, _ViewStrategy3);

NoViewStrategy.prototype.loadViewFactory = function loadViewFactory() {
NoViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options, loadContext) {
return Promise.resolve(null);
};

Expand Down
Loading

6 comments on commit 51cad25

@Souldrinker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weren't you supposed to have type information on the promises on row 251 and 257 in the d.ts file like you have on all other promises in the d.ts files? When I upgraded to templating 0.13.6 I started to get TypeScript compile errors saying "Generic type references must include all type arguments.". Changing "Promise" to "Promise" in those two places got rid of the errors...

@EisenbergEffect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Souldrinker They don't actually return any data, so I'm not sure what the type parameters should be. Should it be Promise<void>? Is that valid?

@Souldrinker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yes, I don't get any complaints from the compiler when I changed to Promise<void> so that seems to work.

@EisenbergEffect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Give me a few minutes and I'll get it out :)

@EisenbergEffect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Souldrinker I just published v0.13.7. See if that works for you.

@Souldrinker
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, looks good, thanks :)

Please sign in to comment.