From b1e1b8b79d3c617c7eaf34ae2f8bd5e59cf4c220 Mon Sep 17 00:00:00 2001 From: Boris Yankov Date: Wed, 31 Oct 2012 02:09:37 +0200 Subject: [PATCH] File header comments stadardized --- Definitions/angular-1.0.d.ts | 3 +- Definitions/angular-cookies-1.0.d.ts | 5 +- Definitions/angular-mocks-1.0.d.ts | 5 +- Definitions/angular-sanitize-1.0.d.ts | 5 +- Definitions/async-0.1.d.ts | 1 + Definitions/backbone-0.9.d.ts | 5 +- Definitions/bootstrap-2.1.d.ts | 6 +- Definitions/chosen-0.9.d.ts | 1 + Definitions/ember-1.0.d.ts | 2 + Definitions/express-3.0.d.ts | 1 + Definitions/fancybox-2.1.d.ts | 1 + Definitions/globalize.d.ts | 97 ++++---- Definitions/handlebars-1.0.d.ts | 2 + Definitions/history-1.7.d.ts | 2 + Definitions/humane-3.0.d.ts | 1 + Definitions/impress-0.5.d.ts | 2 + Definitions/jasmine-1.2.d.ts | 2 + Definitions/jquerymobile-1.2.d.ts | 3 +- Definitions/jqueryui-1.9.d.ts | 3 + Definitions/knockback-0.16.d.ts | 346 +++++++++++++------------- Definitions/knockout-2.2.d.ts | 3 +- Definitions/knockoutmapping-2.0.d.ts | 4 +- Definitions/modernizr-2.6.d.ts | 4 +- Definitions/mustache-0.7.d.ts | 2 + Definitions/node_redis-0.8.d.ts | 1 + Definitions/qunit-1.10.d.ts | 1 + Definitions/sammyjs-0.7.d.ts | 1 + Definitions/spin-1.2.d.ts | 2 + Definitions/underscore-1.4.d.ts | 5 +- README.md | 1 + 30 files changed, 285 insertions(+), 232 deletions(-) diff --git a/Definitions/angular-1.0.d.ts b/Definitions/angular-1.0.d.ts index 540929e48..78947cde2 100644 --- a/Definitions/angular-1.0.d.ts +++ b/Definitions/angular-1.0.d.ts @@ -1,8 +1,9 @@ -// Type definitions for Angular JS 1.0.2 +// Type definitions for Angular JS 1.0 // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped + /// declare var angular: ng.IAngularStatic; diff --git a/Definitions/angular-cookies-1.0.d.ts b/Definitions/angular-cookies-1.0.d.ts index dc15927b2..5052774c6 100644 --- a/Definitions/angular-cookies-1.0.d.ts +++ b/Definitions/angular-cookies-1.0.d.ts @@ -1,9 +1,10 @@ -/// Type definitions for Angular JS 1.0.2 (ngCookies module) +/// Type definitions for Angular JS 1.0 (ngCookies module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// + +/// /////////////////////////////////////////////////////////////////////////////// // ngCookies module (angular-cookies.js) diff --git a/Definitions/angular-mocks-1.0.d.ts b/Definitions/angular-mocks-1.0.d.ts index 55f0e951b..55661043d 100644 --- a/Definitions/angular-mocks-1.0.d.ts +++ b/Definitions/angular-mocks-1.0.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Angular JS 1.0.2 (ngMock, ngMockE2E module) +// Type definitions for Angular JS 1.0 (ngMock, ngMockE2E module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// + +/// /////////////////////////////////////////////////////////////////////////////// // ngMock module (angular-mocks.js) diff --git a/Definitions/angular-sanitize-1.0.d.ts b/Definitions/angular-sanitize-1.0.d.ts index 3d1ef40bd..cf977ca90 100644 --- a/Definitions/angular-sanitize-1.0.d.ts +++ b/Definitions/angular-sanitize-1.0.d.ts @@ -1,9 +1,10 @@ -// Type definitions for Angular JS 1.0.2 (ngSanitize module) +// Type definitions for Angular JS 1.0 (ngSanitize module) // Project: http://angularjs.org // Definitions by: Diego Vilar // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// + +/// /////////////////////////////////////////////////////////////////////////////// // ngSanitize module (angular-sanitize.js) diff --git a/Definitions/async-0.1.d.ts b/Definitions/async-0.1.d.ts index 8c91d1882..835c10777 100644 --- a/Definitions/async-0.1.d.ts +++ b/Definitions/async-0.1.d.ts @@ -1,5 +1,6 @@ // Type definitions for Async 0.1 // Project: https://github.com/caolan/async +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/backbone-0.9.d.ts b/Definitions/backbone-0.9.d.ts index d57be877a..7db7e13ac 100644 --- a/Definitions/backbone-0.9.d.ts +++ b/Definitions/backbone-0.9.d.ts @@ -1,5 +1,8 @@ // Type definitions for Backbone 0.9 -// https://github.com/borisyankov/DefinitelyTyped +// Project: http://backbonejs.org/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module Backbone { diff --git a/Definitions/bootstrap-2.1.d.ts b/Definitions/bootstrap-2.1.d.ts index 8e475e732..2766919cb 100644 --- a/Definitions/bootstrap-2.1.d.ts +++ b/Definitions/bootstrap-2.1.d.ts @@ -1,7 +1,9 @@ // Type definitions for Bootstrap 2.1 -// https://github.com/borisyankov/DefinitelyTyped +// Project: http://twitter.github.com/bootstrap/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// interface ModalOptions { backdrop?: bool; diff --git a/Definitions/chosen-0.9.d.ts b/Definitions/chosen-0.9.d.ts index 680b9622e..29b2ca4ff 100644 --- a/Definitions/chosen-0.9.d.ts +++ b/Definitions/chosen-0.9.d.ts @@ -1,5 +1,6 @@ // Type definitions for Chosen.JQuery 0.9 // Project: http://harvesthq.github.com/chosen/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/ember-1.0.d.ts b/Definitions/ember-1.0.d.ts index d879996cf..ebf845066 100644 --- a/Definitions/ember-1.0.d.ts +++ b/Definitions/ember-1.0.d.ts @@ -1,7 +1,9 @@ // Type definitions for Ember.js 1.0.pre // Project: http://emberjs.com/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module "Ember" { export class CoreObject { diff --git a/Definitions/express-3.0.d.ts b/Definitions/express-3.0.d.ts index 00a3f1ce2..efe64e9ab 100644 --- a/Definitions/express-3.0.d.ts +++ b/Definitions/express-3.0.d.ts @@ -1,5 +1,6 @@ // Type definitions for Express 3.0 // Project: http://expressjs.com +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/fancybox-2.1.d.ts b/Definitions/fancybox-2.1.d.ts index c9892c96b..efe41273e 100644 --- a/Definitions/fancybox-2.1.d.ts +++ b/Definitions/fancybox-2.1.d.ts @@ -1,5 +1,6 @@ // Type definitions for fancyBox 2.1 // Project: https://github.com/fancyapps/fancyBox +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/globalize.d.ts b/Definitions/globalize.d.ts index 7cd83b8b6..016b3e0de 100644 --- a/Definitions/globalize.d.ts +++ b/Definitions/globalize.d.ts @@ -1,42 +1,45 @@ // Type definitions for Globalize -// https://github.com/borisyankov/DefinitelyTyped +// Project: https://github.com/jquery/globalize +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + interface GlobalizePercent { - pattern: string[]; - decimals: number; - groupSizes: number[]; - //",": string; - //".": string; + pattern: string[]; + decimals: number; + groupSizes: number[]; + //",": string; + //".": string; symbol: string; } interface GlobalizeCurrency { - pattern: string[]; - decimals: number; - groupSizes: number[]; - //",": string; - //".": string; + pattern: string[]; + decimals: number; + groupSizes: number[]; + //",": string; + //".": string; symbol: string; } interface GlobalizeNumberFormat { - pattern: string[]; - decimals: string; - //",": string; - //".": string; - groupSizes: number[]; - //"+": string; - //"-": string; - NaN: string; - negativeInfinity: string; - positiveInfinity: string; - percent: GlobalizePercent; + pattern: string[]; + decimals: string; + //",": string; + //".": string; + groupSizes: number[]; + //"+": string; + //"-": string; + NaN: string; + negativeInfinity: string; + positiveInfinity: string; + percent: GlobalizePercent; currency: GlobalizeCurrency; } interface GlobalizeEra { - name: string; - start: any; + name: string; + start: any; offset: number; } @@ -47,28 +50,28 @@ interface GlobalizeDays { } interface GlobalizePatterns { - d: string; - D: string; - t: string; - T: string; - f: string; - F: string; - M: string; - Y: string; + d: string; + D: string; + t: string; + T: string; + f: string; + F: string; + M: string; + Y: string; S: string; } interface GlobalizeCalendar { - name: string; - // "/": string, - // ":": string, - firstDay: number; - days: GlobalizeDays; - months: any[]; - AM: string[]; - PM: string[]; - eras: GlobalizeEra[]; - twoDigitYearMax: number; + name: string; + // "/": string, + // ":": string, + firstDay: number; + days: GlobalizeDays; + months: any[]; + AM: string[]; + PM: string[]; + eras: GlobalizeEra[]; + twoDigitYearMax: number; patterns: GlobalizePatterns; } @@ -77,11 +80,11 @@ interface GlobalizeCalendars { } interface GlobalizeCulture { - name: string; - englishName: string; - nativeName: string; - isRTL: bool; - language: string; + name: string; + englishName: string; + nativeName: string; + isRTL: bool; + language: string; numberFormat: GlobalizeNumberFormat; calendars: GlobalizeCalendars; messages: any; diff --git a/Definitions/handlebars-1.0.d.ts b/Definitions/handlebars-1.0.d.ts index 87b3c7caa..aa5e72086 100644 --- a/Definitions/handlebars-1.0.d.ts +++ b/Definitions/handlebars-1.0.d.ts @@ -1,7 +1,9 @@ // Type definitions for Handlebars 1.0 // Project: http://handlebarsjs.com/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + interface HandlebarsStatic { registerHelper(name: string, fn: Function, inverse?: bool): void; registerPartial(name: string, str): void; diff --git a/Definitions/history-1.7.d.ts b/Definitions/history-1.7.d.ts index 623dc6c6d..33855672a 100644 --- a/Definitions/history-1.7.d.ts +++ b/Definitions/history-1.7.d.ts @@ -1,7 +1,9 @@ // Type definitions for History.js // Project: https://github.com/balupton/History.js +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + interface HistoryAdapter { bind(element, event, callback); trigger(element, event); diff --git a/Definitions/humane-3.0.d.ts b/Definitions/humane-3.0.d.ts index aa3ff38e4..01c767a01 100644 --- a/Definitions/humane-3.0.d.ts +++ b/Definitions/humane-3.0.d.ts @@ -3,6 +3,7 @@ // Definitions by: https://github.com/jmvrbanac // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + interface HumaneOptions { queue?: string[]; baseCls?: string; diff --git a/Definitions/impress-0.5.d.ts b/Definitions/impress-0.5.d.ts index f80914425..58f82770f 100644 --- a/Definitions/impress-0.5.d.ts +++ b/Definitions/impress-0.5.d.ts @@ -1,7 +1,9 @@ // Type definitions for Impress.js 0.5 // Project: https://github.com/bartaz/impress.js +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + interface Impress { init(): void; getStep(step: any): any; diff --git a/Definitions/jasmine-1.2.d.ts b/Definitions/jasmine-1.2.d.ts index 4048cf0ed..896fd4e39 100644 --- a/Definitions/jasmine-1.2.d.ts +++ b/Definitions/jasmine-1.2.d.ts @@ -1,7 +1,9 @@ // Type definitions for Jasmine 1.2 // Project: http://pivotal.github.com/jasmine/ +// Definitions by: Boris Yankov // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + declare function describe(description: string, specDefinitions: Function): JasmineEnv; declare function xdescribe(description: string, specDefinitions: Function): JasmineEnv; diff --git a/Definitions/jquerymobile-1.2.d.ts b/Definitions/jquerymobile-1.2.d.ts index c8a7f0e1a..50a4b2f2c 100644 --- a/Definitions/jquerymobile-1.2.d.ts +++ b/Definitions/jquerymobile-1.2.d.ts @@ -1,9 +1,10 @@ // Type definitions for jQuery Mobile 1.2 // Project: http://jquerymobile.com/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// interface JQueryMobileEvent { (event: Event, ui): void; } diff --git a/Definitions/jqueryui-1.9.d.ts b/Definitions/jqueryui-1.9.d.ts index 5c6434586..5e9b69047 100644 --- a/Definitions/jqueryui-1.9.d.ts +++ b/Definitions/jqueryui-1.9.d.ts @@ -1,9 +1,12 @@ // Type definitions for jQueryUI 1.9 // Project: http://jqueryui.com/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + /// + // Widget ////////////////////////////////////////////////// interface Widget { diff --git a/Definitions/knockback-0.16.d.ts b/Definitions/knockback-0.16.d.ts index 2d52a9b8f..f6d3c6b4b 100644 --- a/Definitions/knockback-0.16.d.ts +++ b/Definitions/knockback-0.16.d.ts @@ -1,171 +1,177 @@ -/// -/// -declare module Knockback { - export interface EventWatcherOptions { - emitter : (newEmitter) => void; - update : (newValue) => void; - event_selector : string; - key? : string; - } - - export interface FactoryOptions { - factories: any; - } - - export interface StoreOptions { - creator: any; - path: string; - store: Store; - factory: Factory; - } - - export class Destroyable { - destroy(); - } - - export class ViewModel extends Destroyable { - constructor (model? : Backbone.Model , options? : ViewModelOptions, viewModel? : ViewModel ); - shareOptions() : ViewModelOptions; - extend(source: any); - model(): Backbone.Model; - } - - export class EventWatcher extends Destroyable { - useOptionsOrCreate(options, emitter : KnockoutObservableAny, obj : Backbone.Model, callback_options : any); - emitter(): Backbone.Model; - emitter(newEmitter : Backbone.Model); - registerCallbacks(obj: any, callback_info: any); - releaseCallbacks(obj: any); - } - - export class Factory { - constructor (parent_factory : any); - useOptionsOrCreate(options: FactoryOptions, obj: any, owner_path: string); - hasPath(path: string): bool; - addPathMapping(path: string, create_info); - addPathMappings(factories: any, owner_path: string); - hasPathMappings(factories: any, owner_path: string) : bool; - creatorForPath(obj: any, path: string); - } - - export class Store extends Destroyable { - constructor (model:Backbone.Model, options: StoreOptions); - useOptionsOrCreate(options: StoreOptions, obj: any, observable: KnockoutObservableAny); - clear(); - register(obj: Backbone.Model, observable: KnockoutObservableAny, options: StoreOptions); - findOrCreate(obj: Backbone.Model, options: StoreOptions); - } - - export class DefaultObservable extends Destroyable { - constructor (targetObservable: KnockoutObservableAny, defaultValue: any); - setToDefault(); - } - - export class FormattedObservable extends Destroyable { - constructor (format: string, args: any[]); - constructor (format: KnockoutObservableAny, args: any[]); - } - - export interface LocalizedObservable { - constructor (value: any, options: any, vm: any); - destroy(); - resetToCurrent(); - observedValue(value: any); - } - - export class TriggeredObservable extends Destroyable { - constructor (emitter: Backbone.ModelBase, event: string); - emitter() : Backbone.ModelBase; - emitter(newEmitter: Backbone.ModelBase); - } - - export class Statistics { - constructor (); - clear(); - addModelEvent(event: string); - modelEventsStatsString(); - register(key: string, obj: any); - unregister(key: string, obj: any); - registeredCount(type: any) : number; - registeredStatsString(success_message: string) : string; - } - - export interface OptionsBase { - path?: string; // the path to the value (used to create related observables from the factory). - store?: Store; // a store used to cache and share view models. - factory?: Factory; // a factory used to create view models. - options?: any; // a set of options merge into these options using _.defaults. Useful for extending options when deriving classes rather than merging them by hand. - } - - export interface ViewModelOptions extends OptionsBase { - internals?: string[]; // an array of atttributes that should be scoped with an underscore, eg. name -> _name - requires?: string[]; // an array of atttributes that will have kb.Observables created even if they do not exist on the Backbone.Model. Useful for binding Views that require specific observables to exist - keys?: string[]; // restricts the keys used on a model. Useful for reducing the number of kb.Observables created from a limited set of Backbone.Model attributes - if(objOrArray: any); // an array is supplied, excludes keys to exclude on the view model; for example, if you want to provide a custom implementation. If an Object, it provides options to the kb.Observable constructor. - path?: string; // the path to the value (used to create related observables from the factory). - factories?: any; // a map of dot-deliminated paths; for example {'models.name': kb.ViewModel} to either constructors or create functions. Signature: {'some.path': function(object, options)} - } - - export interface CollectionOptions extends OptionsBase { - models_only?: bool; // flag for skipping the creation of view models. The collection observable will be populated with (possibly sorted) models. - view_model?: any; // (Constructor) — the view model constructor used for models in the collection. Signature: constructor(model, options) - create?: any; // a function used to create a view model for models in the collection. Signature: create(model, options) - factories?: any; // a map of dot-deliminated paths; for example 'models.owner': kb.ViewModel to either constructors or create functions. Signature: 'some.path': function(object, options) - comparator?: any; //a function that is used to sort an object. Signature: function(model_a, model_b) returns negative value for ascending, 0 for equal, and positive for descending - sort_attribute?: string; // the name of an attribute. Default: resort on all changes to a model. - filters?: any; // filters can be individual ids (observable or simple) or arrays of ids, functions, or arrays of functions. - } - - export interface CollectionObservable extends KnockoutObservableArray { - collection() : Backbone.Collection; - destroy(); - shareOptions() : CollectionOptions; - filters(filter: any); - comparator(comparatorFunction: any); - sortAttribute(attr: string); - viewModelByModel(model: Backbone.Model) : ViewModel; - hasViewModels(): bool; - } - - export interface Utils { - wrappedObservable(obj: any) : any; - wrappedObservable(obj: any, value: any); - wrappedObject(obj: any) : any; - wrappedObject(obj: any, value: any); - wrappedModel(obj: any) : any; - wrappedModel(obj: any, value: any); - wrappedStore(obj: any) : any; - wrappedStore(obj: any, value: any); - wrappedFactory(obj: any) : any; - wrappedFactory(obj: any, value: any); - wrappedEventWatcher(obj: any) : any; - wrappedEventWatcher(obj: any, value: any); - wrappedDestroy(obj: any); - valueType(observable: KnockoutObservableAny) : any; - pathJoin(path1: string, path2: string): string; - optionsPathJoin(options: any, path: string): any; - inferCreator(value: any, factory: Factory, path: string, owner: any, key: string); - createFromDefaultCreator(obj: any, options?: any); - hasModelSignature(obj: any): bool; - hasCollectionSignature(obj: any): bool; - } - - export interface Static extends Utils { - collectionObservable(model?: Backbone.Collection, options?: CollectionOptions): CollectionObservable; - observable(model?: Backbone.Model, options?: any) : KnockoutObservableAny; - viewModel(model?: Backbone.Model, options?: any) : KnockoutObservableAny; - defaultObservable(targetObservable: KnockoutObservableAny, defaultValue: any) : KnockoutObservableAny; - formattedObservable(format: string, args: any[]) : KnockoutObservableAny; - formattedObservable(format: KnockoutObservableAny, args: any[]): KnockoutObservableAny; - localizedObservable(data: any, options: any): KnockoutObservableAny; - release(object: any, pre_release?: () => void ); - releaseKeys(object: any); - releaseOnNodeRemove(viewmodel: ViewModel, node: Element); - renderTemplate(template: string, viewModel: ViewModel, options: any); - renderAutoReleasedTemplate(template: string, viewModel: ViewModel, options: any); - applyBindings(viewModel: ViewModel, node?: Element); - } - -}; - +// Type definitions for knockback.js 0.16 +// Project: http://backbonejs.org/ +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// +/// + +declare module Knockback { + export interface EventWatcherOptions { + emitter : (newEmitter) => void; + update : (newValue) => void; + event_selector : string; + key? : string; + } + + export interface FactoryOptions { + factories: any; + } + + export interface StoreOptions { + creator: any; + path: string; + store: Store; + factory: Factory; + } + + export class Destroyable { + destroy(); + } + + export class ViewModel extends Destroyable { + constructor (model? : Backbone.Model , options? : ViewModelOptions, viewModel? : ViewModel ); + shareOptions() : ViewModelOptions; + extend(source: any); + model(): Backbone.Model; + } + + export class EventWatcher extends Destroyable { + useOptionsOrCreate(options, emitter : KnockoutObservableAny, obj : Backbone.Model, callback_options : any); + emitter(): Backbone.Model; + emitter(newEmitter : Backbone.Model); + registerCallbacks(obj: any, callback_info: any); + releaseCallbacks(obj: any); + } + + export class Factory { + constructor (parent_factory : any); + useOptionsOrCreate(options: FactoryOptions, obj: any, owner_path: string); + hasPath(path: string): bool; + addPathMapping(path: string, create_info); + addPathMappings(factories: any, owner_path: string); + hasPathMappings(factories: any, owner_path: string) : bool; + creatorForPath(obj: any, path: string); + } + + export class Store extends Destroyable { + constructor (model:Backbone.Model, options: StoreOptions); + useOptionsOrCreate(options: StoreOptions, obj: any, observable: KnockoutObservableAny); + clear(); + register(obj: Backbone.Model, observable: KnockoutObservableAny, options: StoreOptions); + findOrCreate(obj: Backbone.Model, options: StoreOptions); + } + + export class DefaultObservable extends Destroyable { + constructor (targetObservable: KnockoutObservableAny, defaultValue: any); + setToDefault(); + } + + export class FormattedObservable extends Destroyable { + constructor (format: string, args: any[]); + constructor (format: KnockoutObservableAny, args: any[]); + } + + export interface LocalizedObservable { + constructor (value: any, options: any, vm: any); + destroy(); + resetToCurrent(); + observedValue(value: any); + } + + export class TriggeredObservable extends Destroyable { + constructor (emitter: Backbone.ModelBase, event: string); + emitter() : Backbone.ModelBase; + emitter(newEmitter: Backbone.ModelBase); + } + + export class Statistics { + constructor (); + clear(); + addModelEvent(event: string); + modelEventsStatsString(); + register(key: string, obj: any); + unregister(key: string, obj: any); + registeredCount(type: any) : number; + registeredStatsString(success_message: string) : string; + } + + export interface OptionsBase { + path?: string; // the path to the value (used to create related observables from the factory). + store?: Store; // a store used to cache and share view models. + factory?: Factory; // a factory used to create view models. + options?: any; // a set of options merge into these options using _.defaults. Useful for extending options when deriving classes rather than merging them by hand. + } + + export interface ViewModelOptions extends OptionsBase { + internals?: string[]; // an array of atttributes that should be scoped with an underscore, eg. name -> _name + requires?: string[]; // an array of atttributes that will have kb.Observables created even if they do not exist on the Backbone.Model. Useful for binding Views that require specific observables to exist + keys?: string[]; // restricts the keys used on a model. Useful for reducing the number of kb.Observables created from a limited set of Backbone.Model attributes + if(objOrArray: any); // an array is supplied, excludes keys to exclude on the view model; for example, if you want to provide a custom implementation. If an Object, it provides options to the kb.Observable constructor. + path?: string; // the path to the value (used to create related observables from the factory). + factories?: any; // a map of dot-deliminated paths; for example {'models.name': kb.ViewModel} to either constructors or create functions. Signature: {'some.path': function(object, options)} + } + + export interface CollectionOptions extends OptionsBase { + models_only?: bool; // flag for skipping the creation of view models. The collection observable will be populated with (possibly sorted) models. + view_model?: any; // (Constructor) — the view model constructor used for models in the collection. Signature: constructor(model, options) + create?: any; // a function used to create a view model for models in the collection. Signature: create(model, options) + factories?: any; // a map of dot-deliminated paths; for example 'models.owner': kb.ViewModel to either constructors or create functions. Signature: 'some.path': function(object, options) + comparator?: any; //a function that is used to sort an object. Signature: function(model_a, model_b) returns negative value for ascending, 0 for equal, and positive for descending + sort_attribute?: string; // the name of an attribute. Default: resort on all changes to a model. + filters?: any; // filters can be individual ids (observable or simple) or arrays of ids, functions, or arrays of functions. + } + + export interface CollectionObservable extends KnockoutObservableArray { + collection() : Backbone.Collection; + destroy(); + shareOptions() : CollectionOptions; + filters(filter: any); + comparator(comparatorFunction: any); + sortAttribute(attr: string); + viewModelByModel(model: Backbone.Model) : ViewModel; + hasViewModels(): bool; + } + + export interface Utils { + wrappedObservable(obj: any) : any; + wrappedObservable(obj: any, value: any); + wrappedObject(obj: any) : any; + wrappedObject(obj: any, value: any); + wrappedModel(obj: any) : any; + wrappedModel(obj: any, value: any); + wrappedStore(obj: any) : any; + wrappedStore(obj: any, value: any); + wrappedFactory(obj: any) : any; + wrappedFactory(obj: any, value: any); + wrappedEventWatcher(obj: any) : any; + wrappedEventWatcher(obj: any, value: any); + wrappedDestroy(obj: any); + valueType(observable: KnockoutObservableAny) : any; + pathJoin(path1: string, path2: string): string; + optionsPathJoin(options: any, path: string): any; + inferCreator(value: any, factory: Factory, path: string, owner: any, key: string); + createFromDefaultCreator(obj: any, options?: any); + hasModelSignature(obj: any): bool; + hasCollectionSignature(obj: any): bool; + } + + export interface Static extends Utils { + collectionObservable(model?: Backbone.Collection, options?: CollectionOptions): CollectionObservable; + observable(model?: Backbone.Model, options?: any) : KnockoutObservableAny; + viewModel(model?: Backbone.Model, options?: any) : KnockoutObservableAny; + defaultObservable(targetObservable: KnockoutObservableAny, defaultValue: any) : KnockoutObservableAny; + formattedObservable(format: string, args: any[]) : KnockoutObservableAny; + formattedObservable(format: KnockoutObservableAny, args: any[]): KnockoutObservableAny; + localizedObservable(data: any, options: any): KnockoutObservableAny; + release(object: any, pre_release?: () => void ); + releaseKeys(object: any); + releaseOnNodeRemove(viewmodel: ViewModel, node: Element); + renderTemplate(template: string, viewModel: ViewModel, options: any); + renderAutoReleasedTemplate(template: string, viewModel: ViewModel, options: any); + applyBindings(viewModel: ViewModel, node?: Element); + } + +}; + declare var kb: Knockback.Static; \ No newline at end of file diff --git a/Definitions/knockout-2.2.d.ts b/Definitions/knockout-2.2.d.ts index 14a5395d2..51e15dd0b 100644 --- a/Definitions/knockout-2.2.d.ts +++ b/Definitions/knockout-2.2.d.ts @@ -1,6 +1,7 @@ // Type definitions for Knockout 2.2 // Project: http://knockoutjs.com -// https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface KnockoutSubscription { diff --git a/Definitions/knockoutmapping-2.0.d.ts b/Definitions/knockoutmapping-2.0.d.ts index 2b3b412f9..e8c5b519d 100644 --- a/Definitions/knockoutmapping-2.0.d.ts +++ b/Definitions/knockoutmapping-2.0.d.ts @@ -1,6 +1,8 @@ // Type definitions for Knockout.Mapping 2.0 // Project: https://github.com/SteveSanderson/knockout.mapping -// https://github.com/borisyankov/DefinitelyTyped +// Definitions by: Boris Yankov +// Definitions https://github.com/borisyankov/DefinitelyTyped + interface KnockoutMappingOptions { ignore; diff --git a/Definitions/modernizr-2.6.d.ts b/Definitions/modernizr-2.6.d.ts index 378b3fae9..61a374127 100644 --- a/Definitions/modernizr-2.6.d.ts +++ b/Definitions/modernizr-2.6.d.ts @@ -1,5 +1,7 @@ // Type definitions for Modernizr 2.6.2 -// https://github.com/borisyankov/DefinitelyTyped +// Project: http://modernizr.com/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped interface AudioBool { ogg: bool; diff --git a/Definitions/mustache-0.7.d.ts b/Definitions/mustache-0.7.d.ts index 9c5b9263b..1bc1a6cdd 100644 --- a/Definitions/mustache-0.7.d.ts +++ b/Definitions/mustache-0.7.d.ts @@ -1,7 +1,9 @@ // Type definitions for Mustache 0.7 // Project: https://github.com/janl/mustache.js +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + interface MustacheScanner { string: string; tail: string; diff --git a/Definitions/node_redis-0.8.d.ts b/Definitions/node_redis-0.8.d.ts index 4af9a2667..16fadff95 100644 --- a/Definitions/node_redis-0.8.d.ts +++ b/Definitions/node_redis-0.8.d.ts @@ -1,5 +1,6 @@ // Type definitions for node_redis 0.8 // Project: https://github.com/mranney/node_redis +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/qunit-1.10.d.ts b/Definitions/qunit-1.10.d.ts index c73845bf0..099ac905d 100644 --- a/Definitions/qunit-1.10.d.ts +++ b/Definitions/qunit-1.10.d.ts @@ -3,6 +3,7 @@ // Definitions by: Diullei Gomes // DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped + interface DoneCallbackObject { failed: number; passed: number; diff --git a/Definitions/sammyjs-0.7.d.ts b/Definitions/sammyjs-0.7.d.ts index 8582eb3cc..0edae0fb1 100644 --- a/Definitions/sammyjs-0.7.d.ts +++ b/Definitions/sammyjs-0.7.d.ts @@ -1,5 +1,6 @@ // Type definitions for Sammy.js // Project: http://sammyjs.org/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/Definitions/spin-1.2.d.ts b/Definitions/spin-1.2.d.ts index 6e0a368d2..8ba7d08af 100644 --- a/Definitions/spin-1.2.d.ts +++ b/Definitions/spin-1.2.d.ts @@ -1,7 +1,9 @@ // Type definitions for Spin.js 1.2 // Project: http://fgnass.github.com/spin.js/ +// Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped + interface SpinnerOptions { lines?: number; // The number of lines to draw length?: number; // The length of each line diff --git a/Definitions/underscore-1.4.d.ts b/Definitions/underscore-1.4.d.ts index f2f573f9d..de6ee5833 100644 --- a/Definitions/underscore-1.4.d.ts +++ b/Definitions/underscore-1.4.d.ts @@ -1,5 +1,8 @@ // Type definitions for Underscore 1.4.1 -// https://github.com/borisyankov/DefinitelyTyped +// Project: http://underscorejs.org/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + interface UnderscoreWrappedObject { value () : any; diff --git a/README.md b/README.md index b732bd80a..0ab1a07b3 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Complete * [jQuery](http://jquery.com/) (from TypeScript samples) * [jQuery Mobile](http://jquerymobile.com) * [jQuery UI](http://jqueryui.com/) +* [Knockback](http://kmalakoff.github.com/knockback/) (by [Marcel Binot](https://github.com/docgit) * [Knockout.js](http://knockoutjs.com/) * [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) * [linq.js](http://linqjs.codeplex.com/) (by Marcin Najder (https://github.com/marcinnajder))