mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-19 05:03:32 +08:00
Merge pull request #8344 from flyfishMT/master
Updating kolite type definitions in light of kolite module updates (AMD)
This commit is contained in:
38
kolite/knockout.activity.d.ts
vendored
Normal file
38
kolite/knockout.activity.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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;
|
||||
}
|
||||
52
kolite/knockout.command.d.ts
vendored
Normal file
52
kolite/knockout.command.d.ts
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
// 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" />
|
||||
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// when not AMD, add to ko object
|
||||
interface KnockoutStatic {
|
||||
command(options: KoLiteCommandOptions): KoliteCommand;
|
||||
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
|
||||
}
|
||||
|
||||
// when using AMD, it is exported
|
||||
interface KnockoutCommandStatic {
|
||||
command(options: KoLiteCommandOptions): KoliteCommand;
|
||||
asyncCommand(options: KoLiteCommandOptions): KoliteAsyncCommand;
|
||||
}
|
||||
|
||||
interface KnockoutUtils {
|
||||
wrapAccessor(accessor: any): Function;
|
||||
}
|
||||
|
||||
interface KnockoutBindingHandlers {
|
||||
command: KnockoutBindingHandler;
|
||||
}
|
||||
|
||||
// Ambient declarations for typescript+requirejs
|
||||
declare var kocommand: KnockoutCommandStatic;
|
||||
declare module 'kocommand'{
|
||||
export = kocommand;
|
||||
}
|
||||
|
||||
30
kolite/knockout.dirtyFlag.d.ts
vendored
Normal file
30
kolite/knockout.dirtyFlag.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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" />
|
||||
|
||||
// DirtyFlag /////////////////////////////////////////////
|
||||
|
||||
interface DirtyFlag {
|
||||
isDirty: KnockoutComputed<boolean>;
|
||||
new (objectToTrack: any, isInitiallyDirty?: boolean, hashFunction?: () => any): any;
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
interface KnockoutStatic {
|
||||
DirtyFlag: DirtyFlag;
|
||||
}
|
||||
|
||||
interface KnockoutDirtyFlagStatic {
|
||||
DirtyFlag: DirtyFlag;
|
||||
}
|
||||
|
||||
// AMD
|
||||
declare var kodirtyflag: KnockoutDirtyFlagStatic;
|
||||
declare module 'kodirtyflag'{
|
||||
export = kodirtyflag;
|
||||
}
|
||||
78
kolite/kolite.d.ts
vendored
78
kolite/kolite.d.ts
vendored
@@ -4,78 +4,6 @@
|
||||
// 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;
|
||||
}
|
||||
/// <reference path="knockout.activity.d.ts" />
|
||||
/// <reference path="knockout.command.d.ts" />
|
||||
/// <reference path="knockout.dirtyFlag.d.ts" />
|
||||
|
||||
Reference in New Issue
Block a user