DefinitelyTyped/types/kolite/knockout.command.d.ts
Mathias Lykkegaard Lorenzen d7b5cd9707 knockout.mapping better strong typing when mapping objects back and forth (#19119)
* Update index.d.ts

removed fromjs overload that no longer exists in latest knockout.mapping, and added much better type safety for "fromJS".

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* Update index.d.ts

* fix for typescript version.

* more typescript versioning fixes.

* fix for minor bug.

* yet another test fix.

* yet another test fix.
2017-11-15 11:12:34 +00:00

53 lines
1.4 KiB
TypeScript

// Type definitions for KoLite 1.1
// Project: https://github.com/CodeSeven/kolite
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery" />
/// <reference types="knockout" />
// 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;
}