forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathknockout.es5.d.ts
37 lines (31 loc) · 1.26 KB
/
knockout.es5.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Type definitions for Knockout-ES5
// Project: https://github.com/SteveSanderson/knockout-es5
// Definitions by: Sebastián Galiano <https://github.com/sgaliano/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../knockout/knockout.d.ts" />
interface KnockoutStatic {
track<T>(obj: T, propertyNames?: Array<string>): T;
untrack(obj: any, propertyNames?: Array<string>): void;
defineProperty<T>(obj: T, propertyName: string, evaluator: Function): T;
defineProperty<T>(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T;
getObservable(obj: any, propertyName: string): KnockoutObservable<any>;
valueHasMutated(obj: any, propertyName: string): void;
es5: KnockoutEs5;
}
interface KnockoutEs5 {
getAllObservablesForObject<T>(obj: T, createIfNotDefined?: boolean): T;
notifyWhenPresentOrFutureArrayValuesMutate<T>(ko: KnockoutStatic, observable: KnockoutObservable<T>): void;
isTracked<T>(obj: T, propertyName: string): boolean;
}
interface KnockoutDefinePropertyOptions {
get(): any;
set?(value: any): void;
}
interface Array<T> {
remove(item: T): T[];
removeAll(items: T[]): T[];
removeAll(): T[];
destroy(item: T): void;
destroyAll(items: T[]): void;
destroyAll(): void;
}