Merge pull request #406 from sumegizoltan/master

New definition of jquery.tagsmanager plugin.
This commit is contained in:
Diullei Gomes
2013-04-03 05:27:32 -07:00

View File

@@ -4,28 +4,69 @@
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface TagsManagerOptions {
prefilled?: any;
CapitalizeFirstLetter?: bool;
preventSubmitOnEnter?: bool;
typeahead?: bool;
typeaheadAjaxSource?: string;
typeaheadSource?: any;
typeaheadAjaxPolling?: bool;
AjaxPush?: string; //url
delimeters?: number[];
backspace?: number[];
blinkBGColor_1?: string;
blinkBGColor_2?: string;
hiddenTagListName?: string;
maxTags?: number;
deleteTagsOnBackspace?: bool;
tagsContainer?: HTMLElement;
tagCloseIcon?: string;
tagClass?: string;
interface ITagsManagerOptions {
prefilled?: any;
CapitalizeFirstLetter?: bool;
preventSubmitOnEnter?: bool;
isClearInputOnEsc?: bool;
typeahead?: bool;
typeaheadAjaxSource?: string;
typeaheadAjaxPolling?: bool;
typeaheadDelegate?: Function;
typeaheadOverrides?: ITypeaheadOverrides;
typeaheadSource?: any;
AjaxPush?: string; //url
delimeters?: number[];
backspace?: number[];
maxTags?: number;
blinkBGColor_1?: string;
blinkBGColor_2?: string;
hiddenTagListName?: string;
hiddenTagListId?: string;
deleteTagsOnBackspace?: bool;
tagsContainer?: HTMLElement;
tagCloseIcon?: string;
tagClass?: string;
validator: Function;
}
interface ITypeaheadOverrides {
instanceSelectHandler?: Function;
selectedClass?: string;
select?: Function;
}
interface ITagsManager {
tagManagerOptions: ITagsManagerOptions;
obj: JQuery;
objName: string;
queuedTag: string;
delimeters: number[];
backspace: number[];
tagToManipulate: string;
initialize(context: JQuery,
options?: ITagsManagerOptions,
tagToManipulate?: string): void;
setupTypeahead(): void;
onTypeaheadAjaxSuccess(data: any, isSetTypeaheadSource: bool, process?: Function): void;
ajaxPolling(query: string, process: Function): void;
setTypeaheadSource(source: any): void;
trimTag(tag: string): string;
popTag(): void;
empty(): void;
refreshHiddenTagList(): void;
spliceTag(tagId: number, eventData: any): void;
pushTag(tag: string, objToPush: any, isValid: bool): void;
setOptions(options: ITagsManagerOptions): void;
setContext(context: JQuery, tagToManipulate?: string): void;
processCommand(context: JQuery, command: string, tagToManipulate?: string): JQuery;
processTags(command?: string, context?: JQuery, tagToManipulate?: string): JQuery;
}
interface JQuery {
tagsManager(options: TagsManagerOptions): JQuery;
tagsManager(options?: ITagsManagerOptions): JQuery;
tagsManager(command: string, tagToManipulate?: string): JQuery;
}
}