diff --git a/types/knockout/index.d.ts b/types/knockout/index.d.ts index 047258539a..fa0e195788 100644 --- a/types/knockout/index.d.ts +++ b/types/knockout/index.d.ts @@ -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 */ - (evaluatorFunction: () => T, context?: any, options?: any): KnockoutComputed; + (evaluatorFunction: () => T, context?: any, options?: KnockoutComputedOptions): KnockoutComputed; /** * Creates computed observable * @param options An object that defines the computed observable options and behavior @@ -300,11 +300,7 @@ interface KnockoutObservable extends KnockoutReadonlyObservable { extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable; } -interface KnockoutComputedDefine { - /** - * A function that is used to evaluate the computed observable’s current value. - */ - read(): T; +interface KnockoutComputedOptions { /** * Makes the computed observable writable. This is a function that receives values that other code is trying to write to your computed observable. * It’s 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 { pure?: boolean; } +interface KnockoutComputedDefine extends KnockoutComputedOptions { + /** + * A function that is used to evaluate the computed observable’s 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;