forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chocolatechipjs.d.ts
1484 lines (1295 loc) · 45.4 KB
/
chocolatechipjs.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 chocolatechip v4.0.4
// Project: https://github.com/chocolatechipui/ChocolateChipJS
// Definitions by: Robert Biggs <http://chocolatechip-ui.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface ChocolateChipStatic {
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param selector A string containing a selector expression
* @param context A DOM HTMLElement to use as context
* @return HTMLElement[]
*/
(selector: string | HTMLElement | Document, context?: HTMLElement | ChocolateChipElementArray): ChocolateChipElementArray;
/**
* Binds a function to be executed when the DOM has finished loading.
*
* @param callback A function to execute after the DOM is ready.
* @return void
*/
(callback: () => any): void;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param element A DOM element to wrap in an array.
* @return HTMLElement[]
*/
(element: HTMLElement): ChocolateChipElementArray;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param elementArray An array of DOM elements to convert into a ChocolateChip Collection.
* @return HTMLElement[]
*/
(elementArray: ChocolateChipElementArray): ChocolateChipElementArray;
/**
* Accepts the document element and returns it wrapped in an array.
*
* @param document The document object.
* @return document[]
*/
(document: Document): Document[];
/**
* If no argument is provided, return the document as a ChocolateChipElementArray.
* @return Document[]
*/
(): Document[];
/**
* Extend the ChocolateChipJS object itself with the provided object.
*
* @param object The object to add to ChocolateChipJS.
* @return The ChocolateChipJS object.
*/
extend(object: Object): Object;
/**
* Extend a target object with another object.
*
* @param target An object to extend.
* @param object The object to add to the target.
* @return The extended object.
*/
extend(target: Object, object: Object): Object;
/**
* The base for extending ChocolateChipJS collections, which are arrays of elements.
*/
fn: {
/**
* This method adds the provided object to the Array prototype to make it available to all arrays of HTML elements.
*
* @param object And object to add to element arrays.
* @return The extended array of elements.
*/
extend(object: Object): HTMLElement[];
};
/**
* Contains the version of ChocolateChipJS in use.
*/
version: string;
/**
* Contains the name of the library (ChocolateChip).
*/
libraryName: string;
/**
* An empty function.
*
* @return void.
*/
noop(): void;
/**
* Uuid number.
*/
uuid: number;
/**
* Create a random number to use as a uuid.
*
* @return number.
*/
uuidNum(): number;
/**
* Creates a uuid using uuidNum().
*
* @return A string.
*/
makeUuid(): string;
/**
* Create a ChocolateChip collection object by creating elements from an HTML string.
*
* @param selector
* @return any
*/
make(selector: string): ChocolateChipElementArray;
/**
* Create a ChocolateChip collection object by creating elements from an HTML string. This is an alias for $.make.
*
* @param selector
* @return any
*/
html(selector: string): ChocolateChipElementArray;
/**
* Replace one element with another.
*
* @param new HTMLElement
* @param old HTMLElement
* @return HTMLElement[]
*/
replace(newElement: ChocolateChipElementArray, oldElement: ChocolateChipElementArray): void;
/**
* Load a JavaScript file from a url, then execute it.
*
* @param url A string containing the URL where the script resides.
* @param callback A callback function that is executed after the script loads.
* @return void
*/
require(url: string, callback: Function): Function;
/**
* Process JavaScript returned by Ajax request. An optional name can be used to create a custom variable name by which the data is exposed, otherwise it is exposed with the variable "data".
*
* @param url A string containing the URL where the script resides.
* @param callback A callback function that is executed after the script loads.
* @return Function
*/
processJSON(json: string, name?: string): any;
/**
* This method takes a referenced form and serializes its element names and values, which it returns as a string. This is required if you want to send form data.
*
* @param element A string, HTML element or ChocolateChipElementArray containing a reference to a from.
* @return An encode string form element names and values.
*/
serialize(element: any): string;
/**
* Parse the data in a Promise response as JSON.
*
* @param response The response from a Promise.
* @result
*/
json(reponse: Response): JSON;
/**
* This method will defer the execution of a function until the call stack is clear.
*
* @param callback A function to execute.
* @param duration The number of milliseconds to delay execution.
* @return any
*/
delay(callback: Function, duration?: number): any;
/**
* The method will defer the execution of its callback until the call stack is clear.
*
* @param callback A callback to execute after a delay.
* @return Function.
*/
defer(callback: Function): Function;
/**
* This method makes sure a method always returns an array. If no values are available to return, it returns and empty array. This is to make sure that methods that expect a chainable array will not throw and exception.
*
* @param result The result of a method to test if it can be returned in an array.
* @return An array holding the results of a method, otherwise an empty array.
*/
returnResult(result: HTMLElement[]): any[];
/**
* This method allows you to execute a callback on each item in an array of elements.
*
* @param array An array of elements.
* @param callback A callback to execute on each element. This has two parameters: the context, followed by the index of the current iteration.
*/
each<T>(array: T[], callback: (ctx: T, idx: number) => any): any;
/**
* This method will concatenate strings or values as a cleaner alternative to using the '+' operator.
*
* @param string or number A comma separated series of strings to concatenate.
* @return string
*/
concat(...string: string[]): string;
/**
* This method takes a space-delimited string of words and returns it as an array where the individual words are indices.
*
* @param string Any string with values separated by spaces.
* @return string[]
*/
w(string: string): string[];
/**
* This method converts a string of hyphenated tokens into a camel cased string.
*
* @param string A string of hyphenated tokens.
* @return string
*/
camelize(string: string): string;
/**
* This method converts a camel case string into lowercase with hyphens.
*
* @param string A camel case string.
* @return string
*/
deCamelize(string: string): string;
/**
* This method capitalizes the first letter of a string.
*
* @param string A string.
* @param boolean A boolean value.
* @return string
*/
capitalize(string: string, boolean?: boolean): string;
/**
* Determine whether the argument is a string.
*
* @param obj Object to test whether or not it is a string.
* @return boolean
*/
isString(obj: any): boolean;
/**
* Determine whether the argument is an array.
*
* @param obj Object to test whether or not it is an array.
* @return boolean
*/
isArray(obj: any): boolean;
/**
* Determine whether the argument is a function.
*
* @param obj Object to test whether or not it is an function.
* @return boolean
*/
isFunction(obj: any): boolean;
/**
* Determine whether the argument is an object.
*
* @param obj Object to test whether or not it is an object.
* @return boolean
*/
isObject(obj: any): boolean;
/**
* Determine whether the argument is an empty object.
*
* @param obj Object to test whether or not it is an empty object.
* @return boolean
*/
isEmptyObject(obj: any): boolean;
/**
* Determine whether the argument is an empty object.
*
* @param obj Object to test whether or not it is an empty object.
* @return boolean
*/
isEmptyObject(obj: any): boolean;
/**
* Determine whether the argument is a number.
*
* @param obj Object to test whether or not it is a number.
* @return boolean
*/
isNumber(obj: any): boolean;
/**
* Determine whether the argument is an integer.
*
* @param obj Object to test whether or not it is an integer.
* @return boolean
*/
isInteger(obj: any): boolean;
/**
* Determine whether the argument is a float.
*
* @param obj Object to test whether or not it is a float.
* @return boolean
*/
isFloat(obj: any): boolean;
/**
* Whether device is iPhone.
*/
isiPhone: boolean;
/**
* Whether device is iPad.
*/
isiPad: boolean;
/**
* Whether device is iPod.
*/
isiPod: boolean;
/**
* Whether OS is iOS.
*/
isiOS: boolean;
/**
* Whether OS is Android
*/
isAndroid: boolean;
/**
* Whether OS is WebOS.
*/
isWebOS: boolean;
/**
* Whether OS is Blackberry.
*/
isBlackberry: boolean;
/**
* Whether OS supports touch events.
*/
isTouchEnabled: boolean;
/**
* Whether there is a network connection.
*/
isOnline: boolean;
/**
* Whether app is running in stanalone mode.
*/
isStandalone: boolean;
/**
* Whether OS is iOS 6.
*/
isiOS6: boolean;
/**
* Whether OS i iOS 7.
*/
isiOS7: boolean;
/**
* Whether OS is Windows.
*/
isWin: boolean;
/**
* Whether device is Windows Phone.
*/
isWinPhone: boolean;
/**
* Whether browser is IE10.
*/
isIE10: boolean;
/**
* Whether browser is IE11.
*/
isIE11: boolean;
/**
* Whether browser is Webkit based.
*/
isWebkit: boolean;
/**
* Whether browser is running on mobile device.
*/
isMobile: boolean;
/**
* Whether browser is running on desktop.
*/
isDesktop: boolean;
/**
* Whether browser is Safari.
*/
isSafari: boolean;
/**
* Whether browser is Chrome.
*/
isChrome: boolean;
/**
* Is native Android browser (not mobile Chrome).
*/
isNativeAndroid: boolean;
/**
* Serialize
*/
serialize(form: HTMLFormElement | ChocolateChipElementArray): string;
/**
* Grabs values from a form and converts them into a JSON object.
*
* @param rootNode: string | HTMLElement A form whose values you want to convert to JSON.
* @param delimiter string A delimiter to namespace your form values. The default is "."
* You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first".
*/
form2JSON(rootNode: string | HTMLElement, delimiter: string): Object;
/**
* Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs.
* Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic.
*
* @param topic string A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters.
* @data any You can receive any type: string, number, array, object, etc.
* @return any
*/
subscribe(topic: string, callback: (topic: string, data: any) => any): boolean;
/**
* Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately.
*
* @param topic string The name of the topic to unsubscribe from.
* @return void
*/
unsubscribe(topic: string): void;
/**
* Publish a topic with data for the topic's subscribers to receive.
*
* @param topic string The topic you wish to publish.
* @param data The data to send with the publication. This can be of any type: string, number, array, object, etc.
* @return void
*/
publish(topic: string, data: any): string;
/**
* Object used to store string templates and parsed templates.
*
* @param string A string defining the template.
* @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]].
* @return void
*/
templates: Object;
/**
* This method returns a parsed template.
*
*/
template: {
/**
* This method parses a string and an optoinal variable name and returns a parsed template in the form of a function. You can then pass this function data to get rendered nodes.
*
* @param template A string of markup to use as a template.
* @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]].
* @return A function.
*/
(template: string, variable?: string): Function;
/**
* The repeater method used to rendering iterable template data.
*/
repeater: {
/**
* Use this method to render declarative temlate repeaters. This expects a "data-repeater" attribute whose value points to data stored on $.template.data.
*/
(): void;
/**
* A method to repeated output a template.
*
* @param element The target container into which the content will be inserted.
* @param template A string of markup.
* @param data The iterable data the template will consume.
* @return void.
*/
(element: ChocolateChipElementArray, template: string, data: any): void;
}
/**
* An object that holds the reference to the controller for a repeater.
* This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object.
* Example: $.template.data["myRepeater"] = [{name: "Joe"}, {name: "Sue"}];
*
*/
data: any;
/**
* Use this value to output an index value in a template repeater.
*/
index: number;
};
/**
* ATENTION: DO NOT TOUCH! This is the ChocolateChipJS cache. This is used to store details about registered events and data. You should not touch any of these values, even though they are exposed, as this can seriously impair the behavior of your app.
*
* data: this is used by $(element).data() to store data.
* events: this is used by the event system.
*/
chch_cache: {
/**
* DO NOT TOUCH! This hold data stored by $(element).data().
*/
data: {};
/**
* DO NOT TOUCH! This stores information about registered events.
*/
events: {
keys: any[];
values: any[];
set: Function;
hasKey: Function;
_delete: Function;
}
}
}
/**
* Interface for ChocolateChipJS Element Collections.
*/
interface ChocolateChipElementArray extends Array<HTMLElement> {
/**
* Iterate over an Array object, executing a function for each matched element.
*
* @param Function
* @return void
*/
each(func: (ctx: any, idx: number) => void): void;
/**
* Sorts an array and removes duplicates before returning it.
*
* @return Array
*/
unique(): ChocolateChipElementArray;
/**
* This method returns the element at the position in the array indicated by the argument. This is a zero-based number.
* When dealing with document nodes, this allows you to cherry pick a node from its collection based on its
* position amongst its siblings.
*
* @param number Index value indicating the node you wish to access from a collection. This is zero-based.
* @return HTMLElement
*/
eq(index: number): ChocolateChipElementArray;
/**
* Search for a given element from among the matched elements on a collection.
* This method returns the index value as an integer.
*
* @return number
*/
index(): number;
/**
* Search for a given element from among the matched elements on a collection.
* This method returns the index value as an integer.
*
* @param selector A selector representing an element to look for in a collection of elements.
* @return number
*/
index(selector: string | HTMLElement[]): number;
/**
* Check the current matched set of elements against a selector or element and return it
* if it matches the given arguments.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
is(selector: string): ChocolateChipElementArray;
/**
* Check the current matched set of elements against a selector or element and return it
* if it matches the given arguments.
*
* @param elements One or more elements to match the current set of elements against.
* @ return HTMLElement[]
*/
is(element: any): ChocolateChipElementArray;
/**
* Check the current matched set of elements against a selector or element and return it
* if it does not match the given arguments.
*
* @param selector A string containing a selector expression to match elements against.
* @ return HTMLElement[]
*/
isnt(selector: string): ChocolateChipElementArray;
/**
* Check the current matched set of elements against a selector or element and return it
* if it does not match the given arguments.
*
* @param elements One or more elements to match the current set of elements against.
* @ return HTMLElement[]
*/
isnt(element: any): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
*
* @param selector A string containing a selector expression to match elements against.
* @ return HTMLElement[]
*/
has(selector: string): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
*
* @param contained A DOM element to match elements against.
* @ return HTMLElement[]
*/
has(contained: HTMLElement): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element.
*
* @param selector A string containing a selector expression to match elements against.
* @ return HTMLElement[]
*/
hasnt(selector: string): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element.
*
* @param contained A DOM element to match elements against.
* @ return HTMLElement[]
*/
hasnt(contained: HTMLElement): ChocolateChipElementArray;
/**
* Get the descendants of each element in the current set of matched elements, filtered by a selector or element.
*
* @param selector A string containing a selector expression to match elements against.
* @ return HTMLElement[]
*/
find(selector: string): ChocolateChipElementArray;
/**
* Get the descendants of each element in the current set of matched elements, filtered by a selector or element.
*
* @param element An element to match elements against.
* @ return HTMLElement[]
*/
find(element: HTMLElement): ChocolateChipElementArray;
/**
* Get the immediately preceding sibling of each element in the set of matched elements.
*
* @ return HTMLElement[]
*/
prev(): ChocolateChipElementArray;
/**
* Get the immediately following sibling of each element in the set of matched elements.
*
* @ return HTMLElement[]
*/
next(): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to the first in the set.
*/
first(): ChocolateChipElementArray;
/**
* Reduce the set of matched elements to the last in the set.
*
* @return HTMLElement[]
*/
last(): ChocolateChipElementArray;
/**
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
children(selector?: string): ChocolateChipElementArray;
/**
* Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
* If multiple elements have the same parent, only one instance of the parent is returned.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
parent(selector?: string): ChocolateChipElementArray;
/**
* For each element in the set, get the first element that matches the selector by testing the element
* itself and traversing up through its ancestors in the DOM tree, or, if a number is provided,
* retrieving that ancestor based on its distance from the element.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
ancestor(selector: string | number): ChocolateChipElementArray;
/**
* For each element in the set, get the first element that matches the selector by testing the element
* itself and traversing up through its ancestors in the DOM tree.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
closest(selector: string | number): ChocolateChipElementArray;
/**
* Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
*
* @param selector A string containing a selector expression to match elements against.
* @return HTMLElement[]
*/
siblings(selector?: string): ChocolateChipElementArray;
/**
* Get the HTML contents of the first element in the set of matched elements.
*
* @return HTMLElement[]
*/
html(): ChocolateChipElementArray;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @param htmlString A string of HTML to set as the content of each matched element.
* @return HTMLElement[]
*/
html(htmlString: string): ChocolateChipElementArray;
/**
* Get the value of style properties for the first element in the set of matched elements.
*
* @param propertyName A CSS property.
* @return string
*/
css(propertyName: string): string;
/**
* Set one or more CSS properties for the set of matched elements using a quoted string.
*
* @param propertyName A CSS property name.
* @param value A value to set for the property.
* @return HTMLElement[]
*/
css(propertyName: string, value: string): ChocolateChipElementArray;
/**
* Set one or more CSS properties for the set of matched elements.
*
* @param properties An object of property-value pairs to set.
* @return HTMLElement[]
*/
css(properties: Object): ChocolateChipElementArray;
/**
* Get the value of an attribute for the first element in the set of matched elements.
*
* @param attributeName The name of the attribute to get.
* @return string
*/
attr(attributeName: string): string;
/**
* Set an attribute for the set of matched elements.
*
* @param attributeName A string indicating the attribute to set.
* @param value A string indicating the value to set the attribute to.
* @return HTMLElement[]
*/
attr(attributeName: string, value: string): ChocolateChipElementArray;
/**
* Remove an attribute from a node.
*
* @param attributeName A string indicating the attribute to remove.
* @return HTMLElement[]
*/
removeAttr(attributeName: string): ChocolateChipElementArray;
/**
* Return any of the matched elements that have the given attribute.
*
* @param className The class name to search for.
* @return HTMLElement[]
*/
hasAttr(attributeName: string): ChocolateChipElementArray;
/**
* Test whether an attribute exists on the first element in the set of matched elements. The value returned is a boolean.
*
* @param attributeName The name of the attribute to get.
* @return boolean
*/
prop(propertyName: string): boolean;
/**
* Set an property for the set of matched elements.
*
* @param propertyName A string indicating the property to set.
* @param value A string indicating the value to set the property to.
* @return HTMLElement[]
*/
prop(propertyName: string, value: any | boolean): ChocolateChipElementArray;
/**
* Remove an element property.
*
* @param property The property to remove.
* @return HTMLElement[]
*/
removeProp(property: string): ChocolateChipElementArray;
/**
* Adds the specified class(es) to each of the set of matched elements.
*
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
* @return HTMLElement[]
*/
addClass(className: string): ChocolateChipElementArray;
/**
* Remove a single class or multiple classes from each element in the set of matched elements.
*
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
* @return HTMLElement[]
*/
removeClass(className?: string): ChocolateChipElementArray;
/**
* Add or remove a classe from each element in the set of matched elements, depending on whether the class is present or not.
*
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
* @return HTMLElement[]
*/
toggleClass(className: string, swtch?: boolean): ChocolateChipElementArray;
/**
* Return any of the matched elements that have the given class.
*
* @param className The class name to search for.
* @return HTMLElement[]
*/
hasClass(className: string): ChocolateChipElementArray;
/**
* Store arbitrary data associated with the matched elements.
*
* @param key A string naming the piece of data to set.
* @param value The new data value; it can be any Javascript type including Array or Object.
* @return HTMLElement[]
*/
data(key: string, value: any): ChocolateChipElementArray;
/**
* Return the value at the named data store for the first element in the element collection, as set by
* data(name).
*
* @param key Name of the data stored.
* @return any
*/
data(key: string): any;
/**
* Remove the value at the named data store for the first element in the element collection, as set by data(name, value).
*
* @param key Name of the data stored.
* @return any
*/
removeData(key?: string): any;
/**
* Store string data associated with the matched elements.
*
* @param key A string naming the piece of data to set.
* @param value The new data value; it must be a string. You can convert JSON into a string to use with this.
* @return HTMLElement[]
*/
dataset(key: string, value: any): ChocolateChipElementArray;
/**
* Retrieve a dataset key's value for the first element in the element collection.
*
* @param key A string naming the piece of data to set.
* @return HTMLElement[]
*/
dataset(key: string): ChocolateChipElementArray;
/**
* Return the value at the named data store for the first element in the element collection, as set by data(name, value).
*
* @param key Name of the data stored.
* @return any
*/
data(key: string): any;
/**
* Store arbitrary data associated with the matched element.
*
* @param key A string naming the piece of data to set.
* @param value The new data value; it can be any Javascript type including Array or Object.
* @return HTMLElement[]
*/
data(key: string, value?: any): ChocolateChipElementArray;
/**
* Get the current value of the first element in the set of matched elements.
*/
val(): any;
/**
* Set the value of each element in the set of matched elements.
*
* @param value A string of text or an array of strings corresponding to the value of each matched element
* to set as selected/checked.
* @return any
*/
val(value: string): ChocolateChipElementArray;
/**
* Set the property of an element to enabled by removing the "disabled" attribute.
*
* @return HTMLElement[]
*/
enable(): ChocolateChipElementArray;
/**
* Set the property of an element to "disabled".
*
* @return HTMLElement[]
*/
disable(): ChocolateChipElementArray;
/**
* Display the matched elements.
*
* @param speed A string or number determining how long the animation will run.
* @param callback A function to call once the animation is complete.
* @return HTMLElement[]
*/
show(duration?: number | string, callback?: Function): ChocolateChipElementArray;
/**
* Hide the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param callback A function to call once the animation is complete.
* @return HTMLElement[]
*/
hide(duration?: number | string, callback?: Function): ChocolateChipElementArray;