[knockout] Update KnockoutComponentTypes.Loader.getConfig signature (#15065)

* [knockout] Update KnockoutComponentTypes.Loader.getConfig signature

Callback in method signature is missing a null type, so when trying to call the callback with null (which is a valid scenario), strict null check fails.

* [knockout] Fix failing build of tests with TypeScript 2.0

*  [knockout] Fix failing build of tests with TypeScript 2.0

* [knockout] Fix failing build of tests with TypeScript 2.0

* [knockout] Fix failing build of tests with TypeScript 2.0
This commit is contained in:
Péter Kovács
2017-03-10 17:09:55 -08:00
committed by Mohamed Hegazy
parent b6c328979c
commit 4aae472c0f
2 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -658,7 +658,7 @@ declare namespace KnockoutComponentTypes {
}
interface Loader {
getConfig? (componentName: string, callback: (result: ComponentConfig) => void): void;
getConfig? (componentName: string, callback: (result: ComponentConfig | null) => void): void;
loadComponent? (componentName: string, config: ComponentConfig, callback: (result: Definition) => void): void;
loadTemplate? (componentName: string, templateConfig: any, callback: (result: Node[]) => void): void;
loadViewModel? (componentName: string, viewModelConfig: any, callback: (result: any) => void): void;
+20 -1
View File
@@ -1,12 +1,31 @@
/// <reference types="jasmine" />
/// <reference types="knockout.mapping" />
// Jasmine definitions
declare function describe(desc: string, f: () => void): void;
declare function it(desc: string, f: () => void): void;
declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void;
declare function expect(spy: Function): jasmine.Matchers;
declare function expect(actual: any): jasmine.Matchers;
interface DoneFn extends Function {
(): void;
/** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */
fail: (message?: Error|string) => void;
}
declare namespace jasmine {
interface Matchers {
toEqual(expected: any, expectationFailOutput?: any): boolean;
toBeDefined(expectationFailOutput?: any): boolean;
toBeNull(expectationFailOutput?: any): boolean;
toContainHtml(expected: string): boolean;
toContainText(expected: string): boolean;
not: Matchers;
}
}
//End Jasmine definitions
var dummyTemplateEngine = function (templates?) {
var inMemoryTemplates = templates || {};