-split KnockoutComputedDefine interface

-fix wrong inheritance of KnockoutNativeTemplateEngine
This commit is contained in:
ltlombardi
2018-12-21 09:23:15 -02:00
parent 37c37a0e2a
commit cee64fdbc2

View File

@@ -196,7 +196,7 @@ interface KnockoutComputedStatic {
* @param context Defines the value of 'this' when evaluating the computed observable
* @param options An object with further properties for the computed observable
*/
<T>(evaluatorFunction: () => T, context?: any, options?: any): KnockoutComputed<T>;
<T>(evaluatorFunction: () => T, context?: any, options?: KnockoutComputedOptions<T>): KnockoutComputed<T>;
/**
* Creates computed observable
* @param options An object that defines the computed observable options and behavior
@@ -300,11 +300,7 @@ interface KnockoutObservable<T> extends KnockoutReadonlyObservable<T> {
extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable<T>;
}
interface KnockoutComputedDefine<T> {
/**
* A function that is used to evaluate the computed observables current value.
*/
read(): T;
interface KnockoutComputedOptions<T> {
/**
* Makes the computed observable writable. This is a function that receives values that other code is trying to write to your computed observable.
* Its up to you to supply custom logic to handle the incoming values, typically by writing the values to some underlying observable(s).
@@ -336,6 +332,13 @@ interface KnockoutComputedDefine<T> {
pure?: boolean;
}
interface KnockoutComputedDefine<T> extends KnockoutComputedOptions<T> {
/**
* A function that is used to evaluate the computed observables current value.
*/
read(): T;
}
interface KnockoutBindingContext {
$parent: any;
$parents: any[];
@@ -583,7 +586,7 @@ interface KnockoutTemplateSources {
// nativeTemplateEngine.js
//////////////////////////////////
interface KnockoutNativeTemplateEngine {
interface KnockoutNativeTemplateEngine extends KnockoutTemplateEngine {
renderTemplateSource(templateSource: Object, bindingContext?: KnockoutBindingContext, options?: Object): any[];
}
@@ -592,7 +595,7 @@ interface KnockoutNativeTemplateEngine {
// templateEngine.js
//////////////////////////////////
interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine {
interface KnockoutTemplateEngine {
createJavaScriptEvaluatorBlock(script: string): string;