mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 01:00:05 +00:00
-split KnockoutComputedDefine interface
-fix wrong inheritance of KnockoutNativeTemplateEngine
This commit is contained in:
19
types/knockout/index.d.ts
vendored
19
types/knockout/index.d.ts
vendored
@@ -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 observable’s 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.
|
||||
* 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<T> {
|
||||
pure?: boolean;
|
||||
}
|
||||
|
||||
interface KnockoutComputedDefine<T> extends KnockoutComputedOptions<T> {
|
||||
/**
|
||||
* 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user