forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appframework.d.ts
1318 lines (1145 loc) · 39.8 KB
/
appframework.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for AppFramework 2.0
// Project: http://app-framework-software.intel.com/
// Definitions by: kyo_ago <https://github.com/kyo-ago>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface appFrameworkStatic {
/**
* This is the internal appframework object that gets extended and added on to it
* This is also the start of our query selector engine
* @param {String|Element|Object|Array} selector
* @param {String|Element|Object} [context]
*/
(selector: string, context?: any): appFrameworkCollection;
(collection: appFrameworkCollection): appFrameworkCollection;
(element: HTMLElement): appFrameworkCollection;
(htmlString: string): appFrameworkCollection;
(object: any): appFrameworkCollection;
/**
* Checks to see if the parameter is a $afm object
```
var foo=$('#header');
$.is$(foo);
```
* @param {Object} element
* @return {Boolean}
* @title $.is$(param)
*/
is$(obj: any): boolean;
/**
* Map takes in elements and executes a callback function on each and returns a collection
```
$.map([1,2],function(ind){return ind+1});
```
* @param {Array|Object} elements
* @param {Function} callback
* @return {Object} appframework object with elements in it
* @title $.map(elements,callback)
*/
map(collection: any[], fn: (item: any, index: number) => any): any[];
/**
* Iterates through elements and executes a callback. Returns if false
```
$.each([1,2],function(ind){console.log(ind);});
```
* @param {Array|Object} elements
* @param {Function} callback
* @return {Array} elements
* @title $.each(elements,callback)
*/
each(collection: any[], fn: (index: number, item: any) => any): void;
each(collection: any, fn: (key: string, value: any) => any): void;
/**
* Extends an object with additional arguments
```
$.extend({foo:'bar'});
$.extend(element,{foo:'bar'});
```
* @param {Object} [target] element
* @param any number of additional arguments
* @return {Object} [target]
* @title $.extend(target,{params})
*/
extend(target: any, ...sources: any[]): any;
/**
* Checks to see if the parameter is an array
```
var arr=[];
$.isArray(arr);
```
* @param {Object} element
* @return {Boolean}
* @example $.isArray([1]);
* @title $.isArray(param)
*/
isArray(object: any): boolean;
/**
* Checks to see if the parameter is a function
```
var func=function(){};
$.isFunction(func);
```
* @param {Object} element
* @return {Boolean}
* @title $.isFunction(param)
*/
isFunction(object: any): boolean;
/**
* Checks to see if the parameter is a object
```
var foo={bar:'bar'};
$.isObject(foo);
```
* @param {Object} element
* @return {Boolean}
* @title $.isObject(param)
*/
isObject(object: any): boolean;
/**
* Prototype for afm object. Also extens $.fn
*/
fn: Object;
/* AJAX settings */
ajaxSettings: appFrameworkAjaxSettings;
/**
* Execute a jsonP call, allowing cross domain scripting
* options.url - URL to call
* options.success - Success function to call
* options.error - Error function to call
```
$.jsonP({url:'mysite.php?callback=?&foo=bar',success:function(){},error:function(){}});
```
* @param {Object} options
* @title $.jsonP(options)
*/
jsonP(options: appFrameworkAjaxSettings): {};
/**
* Execute an Ajax call with the given options
* options.type - Type of request
* options.beforeSend - function to execute before sending the request
* options.success - success callback
* options.error - error callback
* options.complete - complete callback - callled with a success or error
* options.timeout - timeout to wait for the request
* options.url - URL to make request against
* options.contentType - HTTP Request Content Type
* options.headers - Object of headers to set
* options.dataType - Data type of request
* options.data - data to pass into request. $.param is called on objects
```
var opts={
type:"GET",
success:function(data){},
url:"mypage.php",
data:{bar:'bar'},
}
$.ajax(opts);
```
* @param {Object} options
* @title $.ajax(options)
*/
ajax(options: appFrameworkAjaxSettings): XMLHttpRequest;
/**
* Shorthand call to an Ajax GET request
```
$.get("mypage.php?foo=bar",function(data){});
```
* @param {String} url to hit
* @param {Function} success
* @title $.get(url,success)
*/
get(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest;
/**
* Shorthand call to an Ajax POST request
```
$.post("mypage.php",{bar:'bar'},function(data){});
```
* @param {String} url to hit
* @param {Object} [data] to pass in
* @param {Function} success
* @param {String} [dataType]
* @title $.post(url,[data],success,[dataType])
*/
post(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest;
post(url: string, data: any, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void, dataType?: string): XMLHttpRequest;
/**
* Shorthand call to an Ajax request that expects a JSON response
```
$.getJSON("mypage.php",{bar:'bar'},function(data){});
```
* @param {String} url to hit
* @param {Object} [data]
* @param {Function} [success]
* @title $.getJSON(url,data,success)
*/
getJSON(url: string, fn: (data: any, status?: string, xhr?: XMLHttpRequest) => void): XMLHttpRequest;
getJSON(url: string, data: any, fn: (data: any, status: string, xhr: XMLHttpRequest) => void ): XMLHttpRequest;
/**
* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string
```
var obj={
foo:'foo',
bar:'bar'
}
var kvp=$.param(obj,'data');
```
* @param {Object} object
* @param {String} [prefix]
* @return {String} Key/value pair representation
* @title $.param(object,[prefix];
*/
param(object: any, prefix?: string): string;
/**
* Used for backwards compatibility. Uses native JSON.parse function
```
var obj=$.parseJSON("{\"bar\":\"bar\"}");
```
* @params {String} string
* @return {Object}
* @title $.parseJSON(string)
*/
parseJSON(str: string): any;
/**
* Helper function to convert XML into the DOM node representation
```
var xmlDoc=$.parseXML("<xml><foo>bar</foo></xml>");
```
* @param {String} string
* @return {Object} DOM nodes
* @title $.parseXML(string)
*/
parseXML(str: string): any;
/**
* Utility function to create a psuedo GUID
```
var id= $.uuid();
```
* @title $.uuid
*/
uuid(): string;
/**
* Gets the css matrix, or creates a fake one
```
$.getCssMatrix(domElement)
```
@returns matrix with postion
*/
getCssMatrix(node: HTMLElement): appFrameworkCssMatrix;
getCssMatrix(elem: appFrameworkCollection): appFrameworkCssMatrix;
/**
* $.create - a faster alertnative to $("<div id='main'>this is some text</div>");
```
$.create("div",{id:'main',innerHTML:'this is some text'});
$.create("<div id='main'>this is some text</div>");
```
* @param {String} DOM Element type or html
* @param [{Object}] properties to apply to the element
* @return {Object} Returns an appframework object
* @title $.create(type,[params])
*/
create(type: string, params?: any): appFrameworkCollection;
/**
* $.query - a faster alertnative to $("div");
```
$.query(".panel");
```
* @param {String} selector
* @param {Object} [context]
* @return {Object} Returns an appframework object
* @title $.query(selector,[context])
*/
query(selector: string, context?: any): appFrameworkCollection;
/**
* Creates a custom event to be used internally.
* @param {String} type
* @param {Object} [properties]
* @return {event} a custom event that can then be dispatched
* @title $.Event(type,props);
*/
Event(type: string, props: any): any;
/* The following are for events on objects */
/**
* Bind an event to an object instead of a DOM Node
```
$.bind(this,'event',function(){});
```
* @param {Object} object
* @param {String} event name
* @param {Function} function to execute
* @title $.bind(object,event,function);
*/
bind(object: any, event: string, fn: Function): void;
/**
* Trigger an event to an object instead of a DOM Node
```
$.trigger(this,'event',arguments);
```
* @param {Object} object
* @param {String} event name
* @param {Array} arguments
* @title $.trigger(object,event,argments);
*/
trigger(object: any, event: string, args?: any[]): void;
/**
* Unbind an event to an object instead of a DOM Node
```
$.unbind(this,'event',function(){});
```
* @param {Object} object
* @param {String} event name
* @param {Function} function to execute
* @title $.unbind(object,event,function);
*/
unbind(object: any, event: string, fn: Function): void;
/**
* Creates a proxy function so you can change the 'this' context in the function
* Update: now also allows multiple argument call or for you to pass your own arguments
```
var newObj={foo:bar}
$("#main").bind("click",$.proxy(function(evt){console.log(this)},newObj);
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj) )('foo', 'bar');
or
( $.proxy(function(foo, bar){console.log(this+foo+bar)}, newObj, ['foo', 'bar']) )();
```
* @param {Function} Callback
* @param {Object} Context
* @title $.proxy(callback,context);
*/
proxy(callback: Function, context: any): void;
/**
* Function to clean up node content to prevent memory leaks
```
$.cleanUpContent(node,itself,kill)
```
* @param {HTMLNode} node
* @param {Bool} kill itself
* @param {bool} Kill nodes
* @title $.cleanUpContent(node,itself,kill)
*/
cleanUpContent(node: HTMLElement, itself?: boolean, kill?: boolean): void;
/**
* This adds a command to execute in the JS stack, but is faster then setTimeout
```
$.asap(function,context,args)
```
* @param {Function} function
* @param {Object} context
* @param {Array} arguments
*/
asap(callback: Function, context?: any, args?: any[]): void;
/**
* this function executes javascript in HTML.
```
$.parseJS(content)
```
* @param {String|DOM} content
* @title $.parseJS(content);
*/
parseJS(content: string): void;
parseJS(content: HTMLElement): void;
/**
* Helper function to parse the user agent. Sets the following
* .os.webkit
* .os.android
* .os.ipad
* .os.iphone
* .os.webos
* .os.touchpad
* .os.blackberry
* .os.opera
* .os.fennec
* .os.ie
* .os.ieTouch
* .os.supportsTouch
* .os.playbook
* .feat.nativetouchScroll
* @api private
*/
os: {
webkit: boolean;
android: boolean;
androidICS: boolean;
ipad: boolean;
iphone: boolean;
ios7: boolean;
webos: boolean;
touchpad: boolean;
ios: boolean;
playbook: boolean;
blackberry: boolean;
blackberry10: boolean;
chrome: boolean;
opera: boolean;
fennec: boolean;
ie: boolean;
ieTouch: boolean;
supportsTouch: boolean;
};
feat: {
nativeTouchScroll: boolean;
cssPrefix: string;
cssTransformStart: string;
cssTransformEnd: string;
}
}
interface appFrameworkCollection {
reduce(callbackfn: (previousValue: appFrameworkCollection, currentValue: appFrameworkCollection, currentIndex: number, array: appFrameworkCollection[]) => appFrameworkCollection, initialValue?: appFrameworkCollection): appFrameworkCollection;
push(...items: appFrameworkCollection[]): number;
indexOf(searchElement: appFrameworkCollection, fromIndex?: number): number;
concat(...items: appFrameworkCollection[]): appFrameworkCollection[];
slice(start: number, end?: number): appFrameworkCollection[];
length: number;
/**
* This is a wrapper to $.map on the selected elements
```
$().map(function(){this.value+=ind});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().map(function)
*/
map(fn: (index: number, item: any) => any): appFrameworkCollection;
/**
* Iterates through all elements and applys a callback function
```
$().each(function(){console.log(this.value)});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().each(function)
*/
each(fn: (index: number, item: any) => any): appFrameworkCollection;
forEach(fn: (item: any, index: number) => any): void;
/**
* This is executed when DOMContentLoaded happens, or after if you've registered for it.
```
$(document).ready(function(){console.log('I'm ready');});
```
* @param {Function} callback
* @return {Object} an appframework object
* @title $().ready(function)
*/
ready(fn: Function): appFrameworkStatic;
/**
* Searches through the collection and reduces them to elements that match the selector
```
$("#foo").find('.bar');
$("#foo").find($('.bar'));
$("#foo").find($('.bar').get(0));
```
* @param {String|Object|Array} selector
* @return {Object} an appframework object filtered
* @title $().find(selector)
*/
find(selector: string): appFrameworkCollection;
/**
* Gets or sets the innerHTML for the collection.
* If used as a get, the first elements innerHTML is returned
```
$("#foo").html(); //gets the first elements html
$("#foo").html('new html');//sets the html
$("#foo").html('new html',false); //Do not do memory management cleanup
```
* @param {String} html to set
* @param {Bool} [cleanup] - set to false for performance tests and if you do not want to execute memory management cleanup
* @return {Object} an appframework object
* @title $().html([html])
*/
html(): string;
html(html: string): appFrameworkCollection;
html(html: string, cleanup: boolean): appFrameworkCollection;
/**
* Gets or sets the innerText for the collection.
* If used as a get, the first elements innerText is returned
```
$("#foo").text(); //gets the first elements text;
$("#foo").text('new text'); //sets the text
```
* @param {String} text to set
* @return {Object} an appframework object
* @title $().text([text])
*/
text(): string;
text(text: string): appFrameworkCollection;
/**
* Gets or sets a css property for the collection
* If used as a get, the first elements css property is returned
* This will add px to properties that need it.
```
$().css("background"); // Gets the first elements background
$().css("background","red") //Sets the elements background to red
```
* @param {String} attribute to get
* @param {String} value to set as
* @return {Object} an appframework object
* @title $().css(attribute,[value])
*/
css(property: string): any;
css(property: string, value: any): appFrameworkCollection;
css(properties: any): appFrameworkCollection;
/**
* Performs a css vendor specific transform:translate operation on the collection.
*
```
$("#main").cssTranslate('200px,0,0');
```
* @param {String} Transform values
* @return {Object} an appframework object
* @title $().vendorCss(value)
*/
vendorCss(transform: string): appFrameworkCollection;
/**
* Gets the computed style of CSS values
*
```
$("#main").computedStyle('display');
```
* @param {String} css property
* @return {Int|String|Float|} css vlaue
* @title $().computedStyle()
*/
computedStyle(css: string): appFrameworkCollection;
/**
* Sets the innerHTML of all elements to an empty string
```
$().empty();
```
* @return {Object} an appframework object
* @title $().empty()
*/
empty(): appFrameworkCollection;
/**
* Sets the elements display property to "none".
* This will also store the old property into an attribute for hide
```
$().hide();
```
* @return {Object} an appframework object
* @title $().hide()
*/
hide(): appFrameworkCollection;
/**
* Shows all the elements by setting the css display property
* We look to see if we were retaining an old style (like table-cell) and restore that, otherwise we set it to block
```
$().show();
```
* @return {Object} an appframework object
* @title $().show()
*/
show(): appFrameworkCollection;
/**
* Toggle the visibility of a div
```
$().toggle();
$().toggle(true); //force showing
```
* @param {Boolean} [show] -force the hiding or showing of the element
* @return {Object} an appframework object
* @title $().toggle([show])
*/
toggle(show?: boolean): appFrameworkCollection;
/**
* Gets or sets an elements value
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().value; //Gets the first elements value;
$().value="bar"; //Sets all elements value to bar
```
* @param {String} [value] to set
* @return {String|Object} A string as a getter, appframework object as a setter
* @title $().val([value])
*/
val(): string;
val(value: string): appFrameworkCollection;
/**
* Gets or sets an attribute on an element
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().attr("foo"); //Gets the first elements 'foo' attribute
$().attr("foo","bar");//Sets the elements 'foo' attribute to 'bar'
$().attr("foo",{bar:'bar'}) //Adds the object to an internal cache
```
* @param {String|Object} attribute to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
* @param {String|Array|Object|function} [value] to set
* @return {String|Object|Array|Function} If used as a getter, return the attribute value. If a setter, return an appframework object
* @title $().attr(attribute,[value])
*/
attr(attribute: string): any;
attr(attributeHash: Object): appFrameworkCollection;
attr(attribute: string, value: string): appFrameworkCollection;
attr(attribute: string, value: any): appFrameworkCollection;
/**
* Removes an attribute on the elements
```
$().removeAttr("foo");
```
* @param {String} attributes that can be space delimited
* @return {Object} appframework object
* @title $().removeAttr(attribute)
*/
removeAttr(attribute: string): appFrameworkCollection;
/**
* Gets or sets a property on an element
* If used as a getter, we return the first elements value. If nothing is in the collection, we return undefined
```
$().prop("foo"); //Gets the first elements 'foo' property
$().prop("foo","bar");//Sets the elements 'foo' property to 'bar'
$().prop("foo",{bar:'bar'}) //Adds the object to an internal cache
```
* @param {String|Object} property to act upon. If it's an object (hashmap), it will set the attributes based off the kvp.
* @param {String|Array|Object|function} [value] to set
* @return {String|Object|Array|Function} If used as a getter, return the property value. If a setter, return an appframework object
* @title $().prop(property,[value])
*/
prop(attribute: string): any;
prop(attributeHash: Object): appFrameworkCollection;
prop(attribute: string, value: string): appFrameworkCollection;
prop(attribute: string, value: any): appFrameworkCollection;
/**
* Removes a property on the elements
```
$().removeProp("foo");
```
* @param {String} properties that can be space delimited
* @return {Object} appframework object
* @title $().removeProp(attribute)
*/
removeProp(attribute: string): appFrameworkCollection;
/**
* Removes elements based off a selector
```
$().remove(); //Remove all
$().remove(".foo");//Remove off a string selector
var element=$("#foo").get(0);
$().remove(element); //Remove by an element
$().remove($(".foo")); //Remove by a collection
```
* @param {String|Object|Array} selector to filter against
* @return {Object} appframework object
* @title $().remove(selector)
*/
remove(): appFrameworkCollection;
remove(selector: string): appFrameworkCollection;
remove(element: HTMLElement): appFrameworkCollection;
remove(elements: any[]): appFrameworkCollection;
remove(elements: appFrameworkCollection): appFrameworkCollection;
/**
* Adds a css class to elements.
```
$().addClass("selected");
```
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().addClass(name)
*/
addClass(className: string): appFrameworkCollection;
/**
* Removes a css class from elements.
```
$().removeClass("foo"); //single class
$().removeClass("foo selected");//remove multiple classess
```
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().removeClass(name)
*/
removeClass(className: string): appFrameworkCollection;
/**
* Adds or removes a css class to elements.
```
$().toggleClass("selected");
```
* @param {String} classes that are space delimited
* @param {Boolean} [state] force toggle to add or remove classes
* @return {Object} appframework object
* @title $().toggleClass(name)
*/
toggleClass(name: string, state?: boolean): appFrameworkCollection;
/**
* Replaces a css class on elements.
```
$().replaceClass("on", "off");
```
* @param {String} classes that are space delimited
* @param {String} classes that are space delimited
* @return {Object} appframework object
* @title $().replaceClass(old, new)
*/
replaceClass(oldClassName: string, newClassName: string): appFrameworkCollection;
/**
* Checks to see if an element has a class.
```
$().hasClass('foo');
$().hasClass('foo',element);
```
* @param {String} class name to check against
* @param {Object} [element] to check against
* @return {Boolean}
* @title $().hasClass(name,[element])
*/
hasClass(className: string, element: HTMLElement): boolean;
/**
* Appends to the elements
* We boil everything down to an appframework object and then loop through that.
* If it's HTML, we create a dom element so we do not break event bindings.
* if it's a script tag, we evaluate it.
```
$().append("<div></div>"); //Creates the object from the string and appends it
$().append($("#foo")); //Append an object;
```
* @param {String|Object} Element/string to add
* @param {Boolean} [insert] insert or append
* @return {Object} appframework object
* @title $().append(element,[insert])
*/
append(content: any): appFrameworkCollection;
/**
* Appends the current collection to the selector
```
$().appendTo("#foo"); //Append an object;
```
* @param {String|Object} Selector to append to
* @param {Boolean} [insert] insert or append
* @title $().appendTo(element,[insert])
*/
appendTo(target: any): appFrameworkCollection;
/**
* Prepends the current collection to the selector
```
$().prependTo("#foo"); //Prepend an object;
```
* @param {String|Object} Selector to prepent to
* @title $().prependTo(element)
*/
prependTo(target: any): appFrameworkCollection;
/**
* Prepends to the elements
* This simply calls append and sets insert to true
```
$().prepend("<div></div>");//Creates the object from the string and appends it
$().prepend($("#foo")); //Prepends an object
```
* @param {String|Object} Element/string to add
* @return {Object} appframework object
* @title $().prepend(element)
*/
prepend(content: any): appFrameworkCollection;
/**
* Inserts collection before the target (adjacent)
```
$().insertBefore(af("#target"));
```
* @param {String|Object} Target
* @title $().insertBefore(target);
*/
insertBefore(target: any): appFrameworkCollection;
/**
* Inserts collection after the target (adjacent)
```
$().insertAfter(af("#target"));
```
* @param {String|Object} target
* @title $().insertAfter(target);
*/
insertAfter(target: any): void;
/**
* Returns the raw DOM element.
```
$().get(0); //returns the first element
$().get(2);// returns the third element
```
* @param {Int} [index]
* @return {Object} raw DOM element
* @title $().get([index])
*/
get(): HTMLElement[];
get(index: number): HTMLElement;
/**
* Returns the offset of the element, including traversing up the tree
```
$().offset();
```
* @return {Object} with left, top, width and height properties
* @title $().offset()
*/
offset(): {
left: number;
top: number;
right: number;
bottom: number;
width: number;
height: number;
};
/**
* returns the height of the element, including padding on IE
```
$().height();
```
* @return {string} height
* @title $().height()
*/
height(): string;
/**
* returns the width of the element, including padding on IE
```
$().width();
```
* @return {string} width
* @title $().width()
*/
width(): string;
/**
* Returns the parent nodes of the elements based off the selector
```
$("#foo").parent('.bar');
$("#foo").parent($('.bar'));
$("#foo").parent($('.bar').get(0));
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique parents
* @title $().parent(selector)
*/
parent(selector?: any): appFrameworkCollection;
/**
* Returns the parents of the elements based off the selector (traversing up until html document)
```
$("#foo").parents('.bar');
$("#foo").parents($('.bar'));
$("#foo").parents($('.bar').get(0));
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique parents
* @title $().parents(selector)
*/
parents(selector?: any): appFrameworkCollection;
/**
* Returns the child nodes of the elements based off the selector
```
$("#foo").children('.bar'); //Selector
$("#foo").children($('.bar')); //Objects
$("#foo").children($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique children
* @title $().children(selector)
*/
children(selector?: any): appFrameworkCollection;
/**
* Returns the siblings of the element based off the selector
```
$("#foo").siblings('.bar'); //Selector
$("#foo").siblings($('.bar')); //Objects
$("#foo").siblings($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} [selector]
* @return {Object} appframework object with unique siblings
* @title $().siblings(selector)
*/
siblings(selector?: any): appFrameworkCollection;
/**
* Returns the closest element based off the selector and optional context
```
$("#foo").closest('.bar'); //Selector
$("#foo").closest($('.bar')); //Objects
$("#foo").closest($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} selector
* @param {Object} [context]
* @return {Object} Returns an appframework object with the closest element based off the selector
* @title $().closest(selector,[context]);
*/
closest(selector?: any): appFrameworkCollection;
/**
* Filters elements based off the selector
```
$("#foo").filter('.bar'); //Selector
$("#foo").filter($('.bar')); //Objects
$("#foo").filter($('.bar').get(0)); //Single element
```
* @param {String|Array|Object} selector
* @return {Object} Returns an appframework object after the filter was run
* @title $().filter(selector);
*/
filter(selector?: any): appFrameworkCollection;
/**
* Basically the reverse of filter. Return all elements that do NOT match the selector
```
$("#foo").not('.bar'); //Selector
$("#foo").not($('.bar')); //Objects
$("#foo").not($('.bar').get(0)); //Single element
```