forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kolite.d.ts
81 lines (61 loc) · 1.98 KB
/
kolite.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Type definitions for KoLite 1.1
// Project: https://github.com/CodeSeven/kolite
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="../knockout/knockout.d.ts" />
// Activity /////////////////////////////////////////////
interface KoLiteActivityOptions {
color?: any;
segments?: number;
space?: number;
length?: number;
width?: number;
speed?: number;
align?: string;
valign?: string;
padding?: number;
}
interface KoLiteActivity {
(options: KoLiteActivityOptions): JQuery;
defaults: KoLiteActivityOptions;
getOpacity(options: { steps?: number; segments?: number; opacity?: number; }, i: number): number;
}
interface KnockoutBindingHandlers {
activity: KnockoutBindingHandler;
}
interface JQuery {
activity: KoLiteActivity;
activityEx(isLoading: boolean): JQuery;
}
// DirtyFlag /////////////////////////////////////////////
interface DirtyFlag {
isDirty: KnockoutComputed<boolean>;
new (objectToTrack: any, isInitiallyDirty?: boolean, hashFunction?: () => any);
reset(): void;
}
interface KnockoutStatic {
DirtyFlag: DirtyFlag;
}
// Command /////////////////////////////////////////////
interface KoliteCommand {
canExecute: KnockoutComputed<boolean>;
execute(...args: any[]): any;
}
interface KoliteAsyncCommand extends KoliteCommand {
isExecuting: KnockoutObservable<boolean>;
}
interface KoLiteCommandOptions {
execute(...args: any[]): any;
canExecute?: (isExecuting: boolean) => any;
}
interface KnockoutStatic {
command(options: KoLiteCommandOptions): KoliteCommand;
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
}
interface KnockoutUtils {
wrapAccessor(accessor): Function;
}
interface KnockoutBindingHandlers {
command: KnockoutBindingHandler;
}