Version Description
- Improved PHP 7 support.
- Added a few more menu icons.
- Added tabs to the settings page: "Admin Menu" and "Settings". These tabs replace the heading buttons that were previously used to switch between the menu editor and general plugin settings.
- Added basic support for the special "customize" and "delete_site" meta capabilities.
- Fixed a bug that prevented menu items with an empty slug (i.e. no URL) from showing up.
- Fixed a bug where collapsing menu properties would flag the "Icon URL" field as having a custom value even if you hadn't actually changed it.
- Fixed a rare WPML conflict that sometimes caused the admin menu to use a mix of different languages.
- Improved compatibility with buggy plugins and themes that throw JavaScript errors in their DOM-ready handlers.
- Renamed jquery.cookie.js to jquery.biscuit.js as a workaround for servers with overly aggressive ModSecurity configuration. Apparently, some servers block access to any URL that contains the text ".cookie".
- Added a compatibility workaround for the DW Question & Answer plugin. The hidden "Welcome", "Changelog" and "Credits" menu items should no longer show up when you activate AME.
- Added locking to reduce the risk of triggering a race condition when saving menu settings.
- Removed the non-functional "Embed WP page" option.
- Tested up to WordPress 4.5-RC1.
Download this release
Release Info
Developer | whiteshadow |
Plugin | Admin Menu Editor |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6
- css/menu-editor.css +18 -4
- css/menu-editor.scss +24 -5
- includes/PHP-CSS-Parser/CHANGELOG.md +49 -1
- includes/PHP-CSS-Parser/README.md +36 -23
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php +15 -3
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php +1 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php +40 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/Document.php +80 -69
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php +56 -48
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/OutputFormat.php +289 -0
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Parser.php +16 -12
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Parsing/OutputException.php +9 -0
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/AtRule.php +3 -2
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/CSSNamespace.php +5 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Charset.php +5 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Import.php +5 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Selector.php +29 -30
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Renderable.php +8 -0
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Rule/Rule.php +6 -2
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php +11 -3
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php +26 -3
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php +27 -3
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/CSSFunction.php +5 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/{String.php → CSSString.php} +6 -2
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Color.php +9 -6
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Size.php +5 -1
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/URL.php +7 -3
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php +5 -2
- includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/ValueList.php +6 -2
- includes/ameArray.php +11 -0
- includes/editor-page.php +36 -29
- includes/generate-menu-dashicons.php +1 -1
- includes/menu-editor-core.php +189 -76
- includes/menu-item.php +25 -13
- includes/menu.php +1 -1
- includes/reflection-callable.php +62 -0
- includes/settings-page.php +4 -4
- includes/shadow_plugin_framework.php +30 -13
- js/actor-manager.js +331 -0
- js/actor-manager.ts +425 -0
- js/admin-helpers.js +9 -0
- js/common.d.ts +3 -0
- js/jquery-json.d.ts +4 -0
- js/{jquery.cookie.js → jquery.biscuit.js} +0 -0
- js/jquery.d.ts +3203 -0
- js/jquery.json.js +196 -152
- js/knockout.d.ts +631 -0
- js/knockout.js +123 -0
- js/lodash-3.10.d.ts +15041 -0
- js/menu-editor.js +258 -539
- menu-editor.php +5 -1
- modules/actor-selector/actor-selector-template.php +6 -0
- modules/actor-selector/actor-selector.js +196 -0
- modules/actor-selector/actor-selector.php +61 -0
- modules/actor-selector/actor-selector.ts +260 -0
- readme.txt +17 -2
css/menu-editor.css
CHANGED
@@ -1,6 +1,11 @@
|
|
1 |
/* Admin Menu Editor CSS file */
|
2 |
#ws_menu_editor {
|
3 |
min-width: 780px; }
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
.ws_main_container {
|
6 |
margin: 2px;
|
@@ -117,12 +122,21 @@
|
|
117 |
#ws_menu_editor #ws_save_menu {
|
118 |
margin-bottom: 20px; }
|
119 |
|
120 |
-
#ws_menu_editor #ws_export_menu {
|
121 |
-
margin-top: 12px; }
|
122 |
-
|
123 |
#ws_menu_editor #ws_toggle_editor_layout {
|
124 |
display: none; }
|
125 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
/*
|
127 |
* Menu components and widgets
|
128 |
*/
|
@@ -511,7 +525,7 @@ select.ws_dropdown optgroup option {
|
|
511 |
position: absolute; }
|
512 |
|
513 |
#ws_icon_selector.ws_with_more_icons {
|
514 |
-
width:
|
515 |
|
516 |
#ws_icon_selector .ws_icon_extra {
|
517 |
display: none; }
|
1 |
/* Admin Menu Editor CSS file */
|
2 |
#ws_menu_editor {
|
3 |
min-width: 780px; }
|
4 |
+
#ws_menu_editor #ws_actor_selector {
|
5 |
+
margin-top: 6px; }
|
6 |
+
|
7 |
+
.ame-is-free-version #ws_menu_editor {
|
8 |
+
margin-top: 9px; }
|
9 |
|
10 |
.ws_main_container {
|
11 |
margin: 2px;
|
122 |
#ws_menu_editor #ws_save_menu {
|
123 |
margin-bottom: 20px; }
|
124 |
|
|
|
|
|
|
|
125 |
#ws_menu_editor #ws_toggle_editor_layout {
|
126 |
display: none; }
|
127 |
|
128 |
+
#ws_menu_editor .ws_sidebar_button_separator {
|
129 |
+
display: block;
|
130 |
+
height: 4px;
|
131 |
+
margin: 0;
|
132 |
+
padding: 0; }
|
133 |
+
|
134 |
+
/*
|
135 |
+
* Page heading and tabs
|
136 |
+
*/
|
137 |
+
#ws_ame_editor_heading {
|
138 |
+
float: left; }
|
139 |
+
|
140 |
/*
|
141 |
* Menu components and widgets
|
142 |
*/
|
525 |
position: absolute; }
|
526 |
|
527 |
#ws_icon_selector.ws_with_more_icons {
|
528 |
+
width: 540px; }
|
529 |
|
530 |
#ws_icon_selector .ws_icon_extra {
|
531 |
display: none; }
|
css/menu-editor.scss
CHANGED
@@ -2,6 +2,14 @@
|
|
2 |
|
3 |
#ws_menu_editor {
|
4 |
min-width: 780px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
}
|
6 |
|
7 |
.ws_main_container {
|
@@ -172,14 +180,25 @@
|
|
172 |
margin-bottom: 20px;
|
173 |
}
|
174 |
|
175 |
-
#ws_menu_editor #ws_export_menu {
|
176 |
-
margin-top: 12px;
|
177 |
-
}
|
178 |
-
|
179 |
#ws_menu_editor #ws_toggle_editor_layout {
|
180 |
display: none;
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
/*
|
184 |
* Menu components and widgets
|
185 |
*/
|
@@ -694,7 +713,7 @@ select.ws_dropdown optgroup option {
|
|
694 |
}
|
695 |
|
696 |
#ws_icon_selector.ws_with_more_icons {
|
697 |
-
width:
|
698 |
}
|
699 |
|
700 |
#ws_icon_selector .ws_icon_extra {
|
2 |
|
3 |
#ws_menu_editor {
|
4 |
min-width: 780px;
|
5 |
+
|
6 |
+
#ws_actor_selector {
|
7 |
+
margin-top: 6px;
|
8 |
+
}
|
9 |
+
}
|
10 |
+
|
11 |
+
.ame-is-free-version #ws_menu_editor {
|
12 |
+
margin-top: 9px;
|
13 |
}
|
14 |
|
15 |
.ws_main_container {
|
180 |
margin-bottom: 20px;
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
183 |
#ws_menu_editor #ws_toggle_editor_layout {
|
184 |
display: none;
|
185 |
}
|
186 |
|
187 |
+
#ws_menu_editor .ws_sidebar_button_separator {
|
188 |
+
display: block;
|
189 |
+
height: 4px;
|
190 |
+
margin: 0;
|
191 |
+
padding: 0;
|
192 |
+
}
|
193 |
+
|
194 |
+
/*
|
195 |
+
* Page heading and tabs
|
196 |
+
*/
|
197 |
+
|
198 |
+
#ws_ame_editor_heading {
|
199 |
+
float: left;
|
200 |
+
}
|
201 |
+
|
202 |
/*
|
203 |
* Menu components and widgets
|
204 |
*/
|
713 |
}
|
714 |
|
715 |
#ws_icon_selector.ws_with_more_icons {
|
716 |
+
width: 540px;
|
717 |
}
|
718 |
|
719 |
#ws_icon_selector .ws_icon_extra {
|
includes/PHP-CSS-Parser/CHANGELOG.md
CHANGED
@@ -1,5 +1,36 @@
|
|
1 |
# Revision History
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## 5.0
|
4 |
|
5 |
### 5.0.0 (2013-03-20)
|
@@ -74,6 +105,23 @@
|
|
74 |
* *No backwards-incompatible changes*
|
75 |
* *No deprecations*
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
## 4.0
|
78 |
|
79 |
### 4.0.0 (2013-03-19)
|
@@ -118,4 +166,4 @@ Initial release of a stable public API.
|
|
118 |
|
119 |
## 0.9
|
120 |
|
121 |
-
Last version not to use PSR-0 project organization semantics.
|
1 |
# Revision History
|
2 |
|
3 |
+
## 7.0
|
4 |
+
|
5 |
+
### 7.0.0 (2015-08-24)
|
6 |
+
|
7 |
+
* Compatibility with PHP 7. Well timed, eh?
|
8 |
+
|
9 |
+
#### Deprecations
|
10 |
+
|
11 |
+
* The `Sabberworm\CSS\Value\String` class has been renamed to `Sabberworm\CSS\Value\CSSString`.
|
12 |
+
|
13 |
+
### 7.0.1 (2015-12-25)
|
14 |
+
|
15 |
+
* No more suppressed `E_NOTICE`
|
16 |
+
* *No deprecations*
|
17 |
+
|
18 |
+
## 6.0
|
19 |
+
|
20 |
+
### 6.0.0 (2014-07-03)
|
21 |
+
|
22 |
+
* Format output using Sabberworm\CSS\OutputFormat
|
23 |
+
* *No backwards-incompatible changes*
|
24 |
+
|
25 |
+
#### Deprecations
|
26 |
+
|
27 |
+
* The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
|
28 |
+
|
29 |
+
### 6.0.1 (2015-08-24)
|
30 |
+
|
31 |
+
* Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
|
32 |
+
* *No deprecations*
|
33 |
+
|
34 |
## 5.0
|
35 |
|
36 |
### 5.0.0 (2013-03-20)
|
105 |
* *No backwards-incompatible changes*
|
106 |
* *No deprecations*
|
107 |
|
108 |
+
### 5.1.2 (2013-10-30)
|
109 |
+
|
110 |
+
* Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as “/** Perfectly valid **/”
|
111 |
+
* *No backwards-incompatible changes*
|
112 |
+
* *No deprecations*
|
113 |
+
|
114 |
+
### 5.2.0 (2014-06-30)
|
115 |
+
|
116 |
+
* Support removing a selector from a declaration block using `$oBlock->removeSelector($mSelector)`
|
117 |
+
* Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering
|
118 |
+
|
119 |
+
* *No deprecations*
|
120 |
+
|
121 |
+
#### Backwards-incompatible changes
|
122 |
+
|
123 |
+
* Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid ` {…}` into the CSS document.
|
124 |
+
|
125 |
## 4.0
|
126 |
|
127 |
### 4.0.0 (2013-03-19)
|
166 |
|
167 |
## 0.9
|
168 |
|
169 |
+
Last version not to use PSR-0 project organization semantics.
|
includes/PHP-CSS-Parser/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
PHP CSS Parser
|
2 |
--------------
|
3 |
|
|
|
|
|
4 |
A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.
|
5 |
|
6 |
## Usage
|
@@ -61,6 +63,10 @@ The resulting data structure consists mainly of five basic types: `CSSList`, `Ru
|
|
61 |
* `Document` – representing the root of a CSS file.
|
62 |
* `MediaQuery` – represents a subsection of a CSSList that only applies to a output device matching the contained media query.
|
63 |
|
|
|
|
|
|
|
|
|
64 |
#### RuleSet
|
65 |
|
66 |
`RuleSet` is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:
|
@@ -70,17 +76,19 @@ The resulting data structure consists mainly of five basic types: `CSSList`, `Ru
|
|
70 |
|
71 |
Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`) while a `RuleSet` can only contain `Rule`s.
|
72 |
|
|
|
|
|
73 |
#### Rule
|
74 |
|
75 |
`Rule`s just have a key (the rule) and a value. These values are all instances of a `Value`.
|
76 |
|
77 |
#### Value
|
78 |
|
79 |
-
`Value` is an abstract class that only defines the `
|
80 |
|
81 |
* `Size` – consists of a numeric `size` value and a unit.
|
82 |
* `Color` – colors can be input in the form #rrggbb, #rgb or schema(val1, val2, …) but are always stored as an array of ('s' => val1, 'c' => val2, 'h' => val3, …) and output in the second form.
|
83 |
-
* `
|
84 |
* `URL` – URLs in CSS; always output in URL("") notation.
|
85 |
|
86 |
There is another abstract subclass of `Value`, `ValueList`. A `ValueList` represents a lists of `Value`s, separated by some separation character (mostly `,`, whitespace, or `/`). There are two types of `ValueList`s:
|
@@ -88,12 +96,6 @@ There is another abstract subclass of `Value`, `ValueList`. A `ValueList` repres
|
|
88 |
* `RuleValueList` – The default type, used to represent all multi-valued rules like `font: bold 12px/3 Helvetica, Verdana, sans-serif;` (where the value would be a whitespace-separated list of the primitive value `bold`, a slash-separated list and a comma-separated list).
|
89 |
* `CSSFunction` – A special kind of value that also contains a function name and where the values are the function’s arguments. Also handles equals-sign-separated argument lists like `filter: alpha(opacity=90);`.
|
90 |
|
91 |
-
To access the items stored in a `CSSList` – like the document you got back when calling `$oCssParser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
|
92 |
-
|
93 |
-
To append a new item (selector, media query, etc.) to an existing `CSSList`, construct it using the constructor for this class and use the `append($oItem)` method.
|
94 |
-
|
95 |
-
If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $oRule)`, `getRules()` and `removeRule($mRule)` (which accepts either a Rule instance or a rule name; optionally suffixed by a dash to remove all related rules).
|
96 |
-
|
97 |
#### Convenience methods
|
98 |
|
99 |
There are a few convenience methods on Document to ease finding, manipulating and deleting rules:
|
@@ -104,8 +106,7 @@ There are a few convenience methods on Document to ease finding, manipulating an
|
|
104 |
|
105 |
## To-Do
|
106 |
|
107 |
-
* More convenience methods [like `selectorsWithElement($sId/Class/TagName)`, `
|
108 |
-
* Options for output (compact, verbose, etc.)
|
109 |
* Real multibyte support. Currently only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
|
110 |
* Named color support (using `Color` instead of an anonymous string literal)
|
111 |
|
@@ -144,11 +145,23 @@ There are a few convenience methods on Document to ease finding, manipulating an
|
|
144 |
|
145 |
### Output
|
146 |
|
147 |
-
To output the entire CSS document into a variable, just use `->
|
148 |
|
149 |
$oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
|
150 |
$oCssDocument = $oCssParser->parse();
|
151 |
-
print $oCssDocument->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
## Examples
|
154 |
|
@@ -180,8 +193,8 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
180 |
[0]=>
|
181 |
object(Sabberworm\CSS\Property\Charset)#6 (1) {
|
182 |
["sCharset":"Sabberworm\CSS\Property\Charset":private]=>
|
183 |
-
object(Sabberworm\CSS\Value\
|
184 |
-
["sString":"Sabberworm\CSS\Value\
|
185 |
string(5) "utf-8"
|
186 |
}
|
187 |
}
|
@@ -198,8 +211,8 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
198 |
["sRule":"Sabberworm\CSS\Rule\Rule":private]=>
|
199 |
string(11) "font-family"
|
200 |
["mValue":"Sabberworm\CSS\Rule\Rule":private]=>
|
201 |
-
object(Sabberworm\CSS\Value\
|
202 |
-
["sString":"Sabberworm\CSS\Value\
|
203 |
string(10) "CrassRoots"
|
204 |
}
|
205 |
["bIsImportant":"Sabberworm\CSS\Rule\Rule":private]=>
|
@@ -215,8 +228,8 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
215 |
["mValue":"Sabberworm\CSS\Rule\Rule":private]=>
|
216 |
object(Sabberworm\CSS\Value\URL)#11 (1) {
|
217 |
["oURL":"Sabberworm\CSS\Value\URL":private]=>
|
218 |
-
object(Sabberworm\CSS\Value\
|
219 |
-
["sString":"Sabberworm\CSS\Value\
|
220 |
string(15) "../media/cr.ttf"
|
221 |
}
|
222 |
}
|
@@ -351,7 +364,7 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
351 |
}
|
352 |
}
|
353 |
|
354 |
-
#### Output (`
|
355 |
|
356 |
@charset "utf-8";@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}html, body {font-size: 1.6em;}
|
357 |
@keyframes mymove {from {top: 0px;}
|
@@ -456,8 +469,8 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
456 |
[1]=>
|
457 |
string(9) "Helvetica"
|
458 |
[2]=>
|
459 |
-
object(Sabberworm\CSS\Value\
|
460 |
-
["sString":"Sabberworm\CSS\Value\
|
461 |
string(9) "Gill Sans"
|
462 |
}
|
463 |
[3]=>
|
@@ -487,7 +500,7 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
487 |
}
|
488 |
}
|
489 |
|
490 |
-
#### Output (`
|
491 |
|
492 |
#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,"Gill Sans",sans-serif;color: red !important;}
|
493 |
|
@@ -504,7 +517,7 @@ To output the entire CSS document into a variable, just use `->__toString()`:
|
|
504 |
## Misc
|
505 |
|
506 |
* Legacy Support: The latest pre-PSR-0 version of this project can be checked with the `0.9.0` tag.
|
507 |
-
* Running Tests: To run all unit tests for this project, have `phpunit` installed
|
508 |
|
509 |
## License
|
510 |
|
1 |
PHP CSS Parser
|
2 |
--------------
|
3 |
|
4 |
+
[![build status](https://travis-ci.org/sabberworm/PHP-CSS-Parser.png)](https://travis-ci.org/sabberworm/PHP-CSS-Parser) [![HHVM Status](http://hhvm.h4cc.de/badge/sabberworm/php-css-parser.png)](http://hhvm.h4cc.de/package/sabberworm/php-css-parser)
|
5 |
+
|
6 |
A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.
|
7 |
|
8 |
## Usage
|
63 |
* `Document` – representing the root of a CSS file.
|
64 |
* `MediaQuery` – represents a subsection of a CSSList that only applies to a output device matching the contained media query.
|
65 |
|
66 |
+
To access the items stored in a `CSSList` – like the document you got back when calling `$oCssParser->parse()` –, use `getContents()`, then iterate over that collection and use instanceof to check whether you’re dealing with another `CSSList`, a `RuleSet`, a `Import` or a `Charset`.
|
67 |
+
|
68 |
+
To append a new item (selector, media query, etc.) to an existing `CSSList`, construct it using the constructor for this class and use the `append($oItem)` method.
|
69 |
+
|
70 |
#### RuleSet
|
71 |
|
72 |
`RuleSet` is a container for individual rules. The most common form of a rule set is one constrained by a selector. The following concrete subtypes exist:
|
76 |
|
77 |
Note: A `CSSList` can contain other `CSSList`s (and `Import`s as well as a `Charset`) while a `RuleSet` can only contain `Rule`s.
|
78 |
|
79 |
+
If you want to manipulate a `RuleSet`, use the methods `addRule(Rule $oRule)`, `getRules()` and `removeRule($mRule)` (which accepts either a Rule instance or a rule name; optionally suffixed by a dash to remove all related rules).
|
80 |
+
|
81 |
#### Rule
|
82 |
|
83 |
`Rule`s just have a key (the rule) and a value. These values are all instances of a `Value`.
|
84 |
|
85 |
#### Value
|
86 |
|
87 |
+
`Value` is an abstract class that only defines the `render` method. The concrete subclasses for atomic value types are:
|
88 |
|
89 |
* `Size` – consists of a numeric `size` value and a unit.
|
90 |
* `Color` – colors can be input in the form #rrggbb, #rgb or schema(val1, val2, …) but are always stored as an array of ('s' => val1, 'c' => val2, 'h' => val3, …) and output in the second form.
|
91 |
+
* `CSSString` – this is just a wrapper for quoted strings to distinguish them from keywords; always output with double quotes.
|
92 |
* `URL` – URLs in CSS; always output in URL("") notation.
|
93 |
|
94 |
There is another abstract subclass of `Value`, `ValueList`. A `ValueList` represents a lists of `Value`s, separated by some separation character (mostly `,`, whitespace, or `/`). There are two types of `ValueList`s:
|
96 |
* `RuleValueList` – The default type, used to represent all multi-valued rules like `font: bold 12px/3 Helvetica, Verdana, sans-serif;` (where the value would be a whitespace-separated list of the primitive value `bold`, a slash-separated list and a comma-separated list).
|
97 |
* `CSSFunction` – A special kind of value that also contains a function name and where the values are the function’s arguments. Also handles equals-sign-separated argument lists like `filter: alpha(opacity=90);`.
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
#### Convenience methods
|
100 |
|
101 |
There are a few convenience methods on Document to ease finding, manipulating and deleting rules:
|
106 |
|
107 |
## To-Do
|
108 |
|
109 |
+
* More convenience methods [like `selectorsWithElement($sId/Class/TagName)`, `attributesOfType($sType)`, `removeAttributesOfType($sType)`]
|
|
|
110 |
* Real multibyte support. Currently only multibyte charsets whose first 255 code points take up only one byte and are identical with ASCII are supported (yes, UTF-8 fits this description).
|
111 |
* Named color support (using `Color` instead of an anonymous string literal)
|
112 |
|
145 |
|
146 |
### Output
|
147 |
|
148 |
+
To output the entire CSS document into a variable, just use `->render()`:
|
149 |
|
150 |
$oCssParser = new Sabberworm\CSS\Parser(file_get_contents('somefile.css'));
|
151 |
$oCssDocument = $oCssParser->parse();
|
152 |
+
print $oCssDocument->render();
|
153 |
+
|
154 |
+
If you want to format the output, pass an instance of type `Sabberworm\CSS\OutputFormat`:
|
155 |
+
|
156 |
+
$oFormat = Sabberworm\CSS\OutputFormat::create()->indentWithSpaces(4)->setSpaceBetweenRules("\n");
|
157 |
+
print $oCssDocument->render($oFormat);
|
158 |
+
|
159 |
+
Or use one of the predefined formats:
|
160 |
+
|
161 |
+
print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createPretty());
|
162 |
+
print $oCssDocument->render(Sabberworm\CSS\OutputFormat::createCompact());
|
163 |
+
|
164 |
+
To see what you can do with output formatting, look at the tests in `tests/Sabberworm/CSS/OutputFormatTest.php`.
|
165 |
|
166 |
## Examples
|
167 |
|
193 |
[0]=>
|
194 |
object(Sabberworm\CSS\Property\Charset)#6 (1) {
|
195 |
["sCharset":"Sabberworm\CSS\Property\Charset":private]=>
|
196 |
+
object(Sabberworm\CSS\Value\CSSString)#5 (1) {
|
197 |
+
["sString":"Sabberworm\CSS\Value\CSSString":private]=>
|
198 |
string(5) "utf-8"
|
199 |
}
|
200 |
}
|
211 |
["sRule":"Sabberworm\CSS\Rule\Rule":private]=>
|
212 |
string(11) "font-family"
|
213 |
["mValue":"Sabberworm\CSS\Rule\Rule":private]=>
|
214 |
+
object(Sabberworm\CSS\Value\CSSString)#9 (1) {
|
215 |
+
["sString":"Sabberworm\CSS\Value\CSSString":private]=>
|
216 |
string(10) "CrassRoots"
|
217 |
}
|
218 |
["bIsImportant":"Sabberworm\CSS\Rule\Rule":private]=>
|
228 |
["mValue":"Sabberworm\CSS\Rule\Rule":private]=>
|
229 |
object(Sabberworm\CSS\Value\URL)#11 (1) {
|
230 |
["oURL":"Sabberworm\CSS\Value\URL":private]=>
|
231 |
+
object(Sabberworm\CSS\Value\CSSString)#12 (1) {
|
232 |
+
["sString":"Sabberworm\CSS\Value\CSSString":private]=>
|
233 |
string(15) "../media/cr.ttf"
|
234 |
}
|
235 |
}
|
364 |
}
|
365 |
}
|
366 |
|
367 |
+
#### Output (`render()`)
|
368 |
|
369 |
@charset "utf-8";@font-face {font-family: "CrassRoots";src: url("../media/cr.ttf");}html, body {font-size: 1.6em;}
|
370 |
@keyframes mymove {from {top: 0px;}
|
469 |
[1]=>
|
470 |
string(9) "Helvetica"
|
471 |
[2]=>
|
472 |
+
object(Sabberworm\CSS\Value\CSSString)#14 (1) {
|
473 |
+
["sString":"Sabberworm\CSS\Value\CSSString":private]=>
|
474 |
string(9) "Gill Sans"
|
475 |
}
|
476 |
[3]=>
|
500 |
}
|
501 |
}
|
502 |
|
503 |
+
#### Output (`render()`)
|
504 |
|
505 |
#header {margin: 10px 2em 1cm 2%;font-family: Verdana,Helvetica,"Gill Sans",sans-serif;color: red !important;}
|
506 |
|
517 |
## Misc
|
518 |
|
519 |
* Legacy Support: The latest pre-PSR-0 version of this project can be checked with the `0.9.0` tag.
|
520 |
+
* Running Tests: To run all unit tests for this project, have `phpunit` installed and run `phpunit .`.
|
521 |
|
522 |
## License
|
523 |
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/AtRuleBlockList.php
CHANGED
@@ -5,7 +5,7 @@ namespace Sabberworm\CSS\CSSList;
|
|
5 |
use Sabberworm\CSS\Property\AtRule;
|
6 |
|
7 |
/**
|
8 |
-
* A
|
9 |
*/
|
10 |
class AtRuleBlockList extends CSSBlockList implements AtRule {
|
11 |
|
@@ -27,10 +27,22 @@ class AtRuleBlockList extends CSSBlockList implements AtRule {
|
|
27 |
}
|
28 |
|
29 |
public function __toString() {
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$sResult .= '}';
|
33 |
return $sResult;
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
36 |
}
|
5 |
use Sabberworm\CSS\Property\AtRule;
|
6 |
|
7 |
/**
|
8 |
+
* A BlockList constructed by an unknown @-rule. @media rules are rendered into AtRuleBlockList objects.
|
9 |
*/
|
10 |
class AtRuleBlockList extends CSSBlockList implements AtRule {
|
11 |
|
27 |
}
|
28 |
|
29 |
public function __toString() {
|
30 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
31 |
+
}
|
32 |
+
|
33 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
34 |
+
$sArgs = $this->sArgs;
|
35 |
+
if($sArgs) {
|
36 |
+
$sArgs = ' ' . $sArgs;
|
37 |
+
}
|
38 |
+
$sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
39 |
+
$sResult .= parent::render($oOutputFormat);
|
40 |
$sResult .= '}';
|
41 |
return $sResult;
|
42 |
}
|
43 |
|
44 |
+
public function isRootList() {
|
45 |
+
return false;
|
46 |
+
}
|
47 |
+
|
48 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSBlockList.php
CHANGED
@@ -52,7 +52,7 @@ abstract class CSSBlockList extends CSSList {
|
|
52 |
}
|
53 |
}
|
54 |
} else {
|
55 |
-
//Non-List Value or
|
56 |
$aResult[] = $oElement;
|
57 |
}
|
58 |
}
|
52 |
}
|
53 |
}
|
54 |
} else {
|
55 |
+
//Non-List Value or CSSString (CSS identifier)
|
56 |
$aResult[] = $oElement;
|
57 |
}
|
58 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/CSSList.php
CHANGED
@@ -33,9 +33,16 @@ abstract class CSSList {
|
|
33 |
$iKey = array_search($oItemToRemove, $this->aContents, true);
|
34 |
if ($iKey !== false) {
|
35 |
unset($this->aContents[$iKey]);
|
|
|
36 |
}
|
|
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
39 |
public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false) {
|
40 |
if ($mSelector instanceof DeclarationBlock) {
|
41 |
$mSelector = $mSelector->getSelectors();
|
@@ -62,12 +69,44 @@ abstract class CSSList {
|
|
62 |
}
|
63 |
|
64 |
public function __toString() {
|
|
|
|
|
|
|
|
|
65 |
$sResult = '';
|
|
|
|
|
|
|
|
|
|
|
66 |
foreach ($this->aContents as $oContent) {
|
67 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
|
|
69 |
return $sResult;
|
70 |
}
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
public function getContents() {
|
73 |
return $this->aContents;
|
33 |
$iKey = array_search($oItemToRemove, $this->aContents, true);
|
34 |
if ($iKey !== false) {
|
35 |
unset($this->aContents[$iKey]);
|
36 |
+
return true;
|
37 |
}
|
38 |
+
return false;
|
39 |
}
|
40 |
|
41 |
+
/**
|
42 |
+
* Removes a declaration block from the CSS list if it matches all given selectors.
|
43 |
+
* @param array|string $mSelector The selectors to match.
|
44 |
+
* @param boolean $bRemoveAll Whether to stop at the first declaration block found or remove all blocks
|
45 |
+
*/
|
46 |
public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false) {
|
47 |
if ($mSelector instanceof DeclarationBlock) {
|
48 |
$mSelector = $mSelector->getSelectors();
|
69 |
}
|
70 |
|
71 |
public function __toString() {
|
72 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
73 |
+
}
|
74 |
+
|
75 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
76 |
$sResult = '';
|
77 |
+
$bIsFirst = true;
|
78 |
+
$oNextLevel = $oOutputFormat;
|
79 |
+
if(!$this->isRootList()) {
|
80 |
+
$oNextLevel = $oOutputFormat->nextLevel();
|
81 |
+
}
|
82 |
foreach ($this->aContents as $oContent) {
|
83 |
+
$sRendered = $oOutputFormat->safely(function() use ($oNextLevel, $oContent) {
|
84 |
+
return $oContent->render($oNextLevel);
|
85 |
+
});
|
86 |
+
if($sRendered === null) {
|
87 |
+
continue;
|
88 |
+
}
|
89 |
+
if($bIsFirst) {
|
90 |
+
$bIsFirst = false;
|
91 |
+
$sResult .= $oNextLevel->spaceBeforeBlocks();
|
92 |
+
} else {
|
93 |
+
$sResult .= $oNextLevel->spaceBetweenBlocks();
|
94 |
+
}
|
95 |
+
$sResult .= $sRendered;
|
96 |
+
}
|
97 |
+
|
98 |
+
if(!$bIsFirst) {
|
99 |
+
// Had some output
|
100 |
+
$sResult .= $oOutputFormat->spaceAfterBlocks();
|
101 |
}
|
102 |
+
|
103 |
return $sResult;
|
104 |
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Return true if the list can not be further outdented. Only important when rendering.
|
108 |
+
*/
|
109 |
+
public abstract function isRootList();
|
110 |
|
111 |
public function getContents() {
|
112 |
return $this->aContents;
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/Document.php
CHANGED
@@ -7,81 +7,92 @@ namespace Sabberworm\CSS\CSSList;
|
|
7 |
*/
|
8 |
class Document extends CSSBlockList {
|
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 |
}
|
7 |
*/
|
8 |
class Document extends CSSBlockList {
|
9 |
|
10 |
+
/**
|
11 |
+
* Gets all DeclarationBlock objects recursively.
|
12 |
+
*/
|
13 |
+
public function getAllDeclarationBlocks() {
|
14 |
+
$aResult = array();
|
15 |
+
$this->allDeclarationBlocks($aResult);
|
16 |
+
return $aResult;
|
17 |
+
}
|
18 |
|
19 |
+
/**
|
20 |
+
* @deprecated use getAllDeclarationBlocks()
|
21 |
+
*/
|
22 |
+
public function getAllSelectors() {
|
23 |
+
return $this->getAllDeclarationBlocks();
|
24 |
+
}
|
25 |
|
26 |
+
/**
|
27 |
+
* Returns all RuleSet objects found recursively in the tree.
|
28 |
+
*/
|
29 |
+
public function getAllRuleSets() {
|
30 |
+
$aResult = array();
|
31 |
+
$this->allRuleSets($aResult);
|
32 |
+
return $aResult;
|
33 |
+
}
|
34 |
|
35 |
+
/**
|
36 |
+
* Returns all Value objects found recursively in the tree.
|
37 |
+
* @param (object|string) $mElement the CSSList or RuleSet to start the search from (defaults to the whole document). If a string is given, it is used as rule name filter (@see{RuleSet->getRules()}).
|
38 |
+
* @param (bool) $bSearchInFunctionArguments whether to also return Value objects used as Function arguments.
|
39 |
+
*/
|
40 |
+
public function getAllValues($mElement = null, $bSearchInFunctionArguments = false) {
|
41 |
+
$sSearchString = null;
|
42 |
+
if ($mElement === null) {
|
43 |
+
$mElement = $this;
|
44 |
+
} else if (is_string($mElement)) {
|
45 |
+
$sSearchString = $mElement;
|
46 |
+
$mElement = $this;
|
47 |
+
}
|
48 |
+
$aResult = array();
|
49 |
+
$this->allValues($mElement, $aResult, $sSearchString, $bSearchInFunctionArguments);
|
50 |
+
return $aResult;
|
51 |
+
}
|
52 |
|
53 |
+
/**
|
54 |
+
* Returns all Selector objects found recursively in the tree.
|
55 |
+
* Note that this does not yield the full DeclarationBlock that the selector belongs to (and, currently, there is no way to get to that).
|
56 |
+
* @param $sSpecificitySearch An optional filter by specificity. May contain a comparison operator and a number or just a number (defaults to "==").
|
57 |
+
* @example getSelectorsBySpecificity('>= 100')
|
58 |
+
*/
|
59 |
+
public function getSelectorsBySpecificity($sSpecificitySearch = null) {
|
60 |
+
if (is_numeric($sSpecificitySearch) || is_numeric($sSpecificitySearch[0])) {
|
61 |
+
$sSpecificitySearch = "== $sSpecificitySearch";
|
62 |
+
}
|
63 |
+
$aResult = array();
|
64 |
+
$this->allSelectors($aResult, $sSpecificitySearch);
|
65 |
+
return $aResult;
|
66 |
+
}
|
67 |
|
68 |
+
/**
|
69 |
+
* Expands all shorthand properties to their long value
|
70 |
+
*/
|
71 |
+
public function expandShorthands() {
|
72 |
+
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
|
73 |
+
$oDeclaration->expandShorthands();
|
74 |
+
}
|
75 |
+
}
|
76 |
|
77 |
+
/**
|
78 |
+
* Create shorthands properties whenever possible
|
79 |
+
*/
|
80 |
+
public function createShorthands() {
|
81 |
+
foreach ($this->getAllDeclarationBlocks() as $oDeclaration) {
|
82 |
+
$oDeclaration->createShorthands();
|
83 |
+
}
|
84 |
+
}
|
85 |
|
86 |
+
// Override render() to make format argument optional
|
87 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat = null) {
|
88 |
+
if($oOutputFormat === null) {
|
89 |
+
$oOutputFormat = new \Sabberworm\CSS\OutputFormat();
|
90 |
+
}
|
91 |
+
return parent::render($oOutputFormat);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function isRootList() {
|
95 |
+
return true;
|
96 |
+
}
|
97 |
|
98 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/CSSList/KeyFrame.php
CHANGED
@@ -1,48 +1,56 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace Sabberworm\CSS\CSSList;
|
4 |
-
|
5 |
-
use Sabberworm\CSS\Property\AtRule;
|
6 |
-
|
7 |
-
class KeyFrame extends CSSList implements AtRule {
|
8 |
-
|
9 |
-
private $vendorKeyFrame;
|
10 |
-
private $animationName;
|
11 |
-
|
12 |
-
public function __construct() {
|
13 |
-
parent::__construct();
|
14 |
-
$this->vendorKeyFrame = null;
|
15 |
-
$this->animationName = null;
|
16 |
-
}
|
17 |
-
|
18 |
-
public function setVendorKeyFrame($vendorKeyFrame) {
|
19 |
-
$this->vendorKeyFrame = $vendorKeyFrame;
|
20 |
-
}
|
21 |
-
|
22 |
-
public function getVendorKeyFrame() {
|
23 |
-
return $this->vendorKeyFrame;
|
24 |
-
}
|
25 |
-
|
26 |
-
public function setAnimationName($animationName) {
|
27 |
-
$this->animationName = $animationName;
|
28 |
-
}
|
29 |
-
|
30 |
-
public function getAnimationName() {
|
31 |
-
return $this->animationName;
|
32 |
-
}
|
33 |
-
|
34 |
-
public function __toString() {
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
return $
|
43 |
-
}
|
44 |
-
|
45 |
-
public function
|
46 |
-
return
|
47 |
-
}
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\CSSList;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Property\AtRule;
|
6 |
+
|
7 |
+
class KeyFrame extends CSSList implements AtRule {
|
8 |
+
|
9 |
+
private $vendorKeyFrame;
|
10 |
+
private $animationName;
|
11 |
+
|
12 |
+
public function __construct() {
|
13 |
+
parent::__construct();
|
14 |
+
$this->vendorKeyFrame = null;
|
15 |
+
$this->animationName = null;
|
16 |
+
}
|
17 |
+
|
18 |
+
public function setVendorKeyFrame($vendorKeyFrame) {
|
19 |
+
$this->vendorKeyFrame = $vendorKeyFrame;
|
20 |
+
}
|
21 |
+
|
22 |
+
public function getVendorKeyFrame() {
|
23 |
+
return $this->vendorKeyFrame;
|
24 |
+
}
|
25 |
+
|
26 |
+
public function setAnimationName($animationName) {
|
27 |
+
$this->animationName = $animationName;
|
28 |
+
}
|
29 |
+
|
30 |
+
public function getAnimationName() {
|
31 |
+
return $this->animationName;
|
32 |
+
}
|
33 |
+
|
34 |
+
public function __toString() {
|
35 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
36 |
+
}
|
37 |
+
|
38 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
39 |
+
$sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
40 |
+
$sResult .= parent::render($oOutputFormat);
|
41 |
+
$sResult .= '}';
|
42 |
+
return $sResult;
|
43 |
+
}
|
44 |
+
|
45 |
+
public function isRootList() {
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
public function atRuleName() {
|
50 |
+
return $this->vendorKeyFrame;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function atRuleArgs() {
|
54 |
+
return $this->animationName;
|
55 |
+
}
|
56 |
+
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/OutputFormat.php
ADDED
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parsing\OutputException;
|
6 |
+
|
7 |
+
class OutputFormat {
|
8 |
+
/**
|
9 |
+
* Value format
|
10 |
+
*/
|
11 |
+
// " means double-quote, ' means single-quote
|
12 |
+
public $sStringQuotingType = '"';
|
13 |
+
// Output RGB colors in hash notation if possible
|
14 |
+
public $bRGBHashNotation = true;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Declaration format
|
18 |
+
*/
|
19 |
+
// Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
|
20 |
+
public $bSemicolonAfterLastRule = true;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Spacing
|
24 |
+
* Note that these strings are not sanity-checked: the value should only consist of whitespace
|
25 |
+
* Any newline character will be indented according to the current level.
|
26 |
+
* The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
|
27 |
+
*/
|
28 |
+
public $sSpaceAfterRuleName = ' ';
|
29 |
+
|
30 |
+
public $sSpaceBeforeRules = '';
|
31 |
+
public $sSpaceAfterRules = '';
|
32 |
+
public $sSpaceBetweenRules = '';
|
33 |
+
|
34 |
+
public $sSpaceBeforeBlocks = '';
|
35 |
+
public $sSpaceAfterBlocks = '';
|
36 |
+
public $sSpaceBetweenBlocks = "\n";
|
37 |
+
|
38 |
+
// This is what’s printed before and after the comma if a declaration block contains multiple selectors.
|
39 |
+
public $sSpaceBeforeSelectorSeparator = '';
|
40 |
+
public $sSpaceAfterSelectorSeparator = ' ';
|
41 |
+
// This is what’s printed after the comma of value lists
|
42 |
+
public $sSpaceBeforeListArgumentSeparator = '';
|
43 |
+
public $sSpaceAfterListArgumentSeparator = '';
|
44 |
+
|
45 |
+
public $sSpaceBeforeOpeningBrace = ' ';
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Indentation
|
49 |
+
*/
|
50 |
+
// Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
|
51 |
+
public $sIndentation = "\t";
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Output exceptions.
|
55 |
+
*/
|
56 |
+
public $bIgnoreExceptions = false;
|
57 |
+
|
58 |
+
|
59 |
+
private $oFormatter = null;
|
60 |
+
private $oNextLevelFormat = null;
|
61 |
+
private $iIndentationLevel = 0;
|
62 |
+
|
63 |
+
public function __construct() {
|
64 |
+
}
|
65 |
+
|
66 |
+
public function get($sName) {
|
67 |
+
$aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
|
68 |
+
foreach($aVarPrefixes as $sPrefix) {
|
69 |
+
$sFieldName = $sPrefix.ucfirst($sName);
|
70 |
+
if(isset($this->$sFieldName)) {
|
71 |
+
return $this->$sFieldName;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
return null;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function set($aNames, $mValue) {
|
78 |
+
$aVarPrefixes = array('a', 's', 'm', 'b', 'f', 'o', 'c', 'i');
|
79 |
+
if(is_string($aNames) && strpos($aNames, '*') !== false) {
|
80 |
+
$aNames = array(str_replace('*', 'Before', $aNames), str_replace('*', 'Between', $aNames), str_replace('*', 'After', $aNames));
|
81 |
+
} else if(!is_array($aNames)) {
|
82 |
+
$aNames = array($aNames);
|
83 |
+
}
|
84 |
+
foreach($aVarPrefixes as $sPrefix) {
|
85 |
+
$bDidReplace = false;
|
86 |
+
foreach($aNames as $sName) {
|
87 |
+
$sFieldName = $sPrefix.ucfirst($sName);
|
88 |
+
if(isset($this->$sFieldName)) {
|
89 |
+
$this->$sFieldName = $mValue;
|
90 |
+
$bDidReplace = true;
|
91 |
+
}
|
92 |
+
}
|
93 |
+
if($bDidReplace) {
|
94 |
+
return $this;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
// Break the chain so the user knows this option is invalid
|
98 |
+
return false;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function __call($sMethodName, $aArguments) {
|
102 |
+
if(strpos($sMethodName, 'set') === 0) {
|
103 |
+
return $this->set(substr($sMethodName, 3), $aArguments[0]);
|
104 |
+
} else if(strpos($sMethodName, 'get') === 0) {
|
105 |
+
return $this->get(substr($sMethodName, 3));
|
106 |
+
} else if(method_exists('\\Sabberworm\\CSS\\OutputFormatter', $sMethodName)) {
|
107 |
+
return call_user_func_array(array($this->getFormatter(), $sMethodName), $aArguments);
|
108 |
+
} else {
|
109 |
+
throw new \Exception('Unknown OutputFormat method called: '.$sMethodName);
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
public function indentWithTabs($iNumber = 1) {
|
114 |
+
return $this->setIndentation(str_repeat("\t", $iNumber));
|
115 |
+
}
|
116 |
+
|
117 |
+
public function indentWithSpaces($iNumber = 2) {
|
118 |
+
return $this->setIndentation(str_repeat(" ", $iNumber));
|
119 |
+
}
|
120 |
+
|
121 |
+
public function nextLevel() {
|
122 |
+
if($this->oNextLevelFormat === null) {
|
123 |
+
$this->oNextLevelFormat = clone $this;
|
124 |
+
$this->oNextLevelFormat->iIndentationLevel++;
|
125 |
+
$this->oNextLevelFormat->oFormatter = null;
|
126 |
+
}
|
127 |
+
return $this->oNextLevelFormat;
|
128 |
+
}
|
129 |
+
|
130 |
+
public function beLenient() {
|
131 |
+
$this->bIgnoreExceptions = true;
|
132 |
+
}
|
133 |
+
|
134 |
+
public function getFormatter() {
|
135 |
+
if($this->oFormatter === null) {
|
136 |
+
$this->oFormatter = new OutputFormatter($this);
|
137 |
+
}
|
138 |
+
return $this->oFormatter;
|
139 |
+
}
|
140 |
+
|
141 |
+
public function level() {
|
142 |
+
return $this->iIndentationLevel;
|
143 |
+
}
|
144 |
+
|
145 |
+
public static function create() {
|
146 |
+
return new OutputFormat();
|
147 |
+
}
|
148 |
+
|
149 |
+
public static function createCompact() {
|
150 |
+
return self::create()->set('Space*Rules', "")->set('Space*Blocks', "")->setSpaceAfterRuleName('')->setSpaceBeforeOpeningBrace('')->setSpaceAfterSelectorSeparator('');
|
151 |
+
}
|
152 |
+
|
153 |
+
public static function createPretty() {
|
154 |
+
return self::create()->set('Space*Rules', "\n")->set('Space*Blocks', "\n")->setSpaceBetweenBlocks("\n\n")->set('SpaceAfterListArgumentSeparator', array('default' => '', ',' => ' '));
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
class OutputFormatter {
|
159 |
+
private $oFormat;
|
160 |
+
|
161 |
+
public function __construct(OutputFormat $oFormat) {
|
162 |
+
$this->oFormat = $oFormat;
|
163 |
+
}
|
164 |
+
|
165 |
+
public function space($sName, $sType = null) {
|
166 |
+
$sSpaceString = $this->oFormat->get("Space$sName");
|
167 |
+
// If $sSpaceString is an array, we have multple values configured depending on the type of object the space applies to
|
168 |
+
if(is_array($sSpaceString)) {
|
169 |
+
if($sType !== null && isset($sSpaceString[$sType])) {
|
170 |
+
$sSpaceString = $sSpaceString[$sType];
|
171 |
+
} else {
|
172 |
+
$sSpaceString = reset($sSpaceString);
|
173 |
+
}
|
174 |
+
}
|
175 |
+
return $this->prepareSpace($sSpaceString);
|
176 |
+
}
|
177 |
+
|
178 |
+
public function spaceAfterRuleName() {
|
179 |
+
return $this->space('AfterRuleName');
|
180 |
+
}
|
181 |
+
|
182 |
+
public function spaceBeforeRules() {
|
183 |
+
return $this->space('BeforeRules');
|
184 |
+
}
|
185 |
+
|
186 |
+
public function spaceAfterRules() {
|
187 |
+
return $this->space('AfterRules');
|
188 |
+
}
|
189 |
+
|
190 |
+
public function spaceBetweenRules() {
|
191 |
+
return $this->space('BetweenRules');
|
192 |
+
}
|
193 |
+
|
194 |
+
public function spaceBeforeBlocks() {
|
195 |
+
return $this->space('BeforeBlocks');
|
196 |
+
}
|
197 |
+
|
198 |
+
public function spaceAfterBlocks() {
|
199 |
+
return $this->space('AfterBlocks');
|
200 |
+
}
|
201 |
+
|
202 |
+
public function spaceBetweenBlocks() {
|
203 |
+
return $this->space('BetweenBlocks');
|
204 |
+
}
|
205 |
+
|
206 |
+
public function spaceBeforeSelectorSeparator() {
|
207 |
+
return $this->space('BeforeSelectorSeparator');
|
208 |
+
}
|
209 |
+
|
210 |
+
public function spaceAfterSelectorSeparator() {
|
211 |
+
return $this->space('AfterSelectorSeparator');
|
212 |
+
}
|
213 |
+
|
214 |
+
public function spaceBeforeListArgumentSeparator($sSeparator) {
|
215 |
+
return $this->space('BeforeListArgumentSeparator', $sSeparator);
|
216 |
+
}
|
217 |
+
|
218 |
+
public function spaceAfterListArgumentSeparator($sSeparator) {
|
219 |
+
return $this->space('AfterListArgumentSeparator', $sSeparator);
|
220 |
+
}
|
221 |
+
|
222 |
+
public function spaceBeforeOpeningBrace() {
|
223 |
+
return $this->space('BeforeOpeningBrace');
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Runs the given code, either swallowing or passing exceptions, depending on the bIgnoreExceptions setting.
|
228 |
+
*/
|
229 |
+
public function safely($cCode) {
|
230 |
+
if($this->oFormat->get('IgnoreExceptions')) {
|
231 |
+
// If output exceptions are ignored, run the code with exception guards
|
232 |
+
try {
|
233 |
+
return $cCode();
|
234 |
+
} catch (OutputException $e) {
|
235 |
+
return null;
|
236 |
+
} //Do nothing
|
237 |
+
} else {
|
238 |
+
// Run the code as-is
|
239 |
+
return $cCode();
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Clone of the implode function but calls ->render with the current output format instead of __toString()
|
245 |
+
*/
|
246 |
+
public function implode($sSeparator, $aValues, $bIncreaseLevel = false) {
|
247 |
+
$sResult = '';
|
248 |
+
$oFormat = $this->oFormat;
|
249 |
+
if($bIncreaseLevel) {
|
250 |
+
$oFormat = $oFormat->nextLevel();
|
251 |
+
}
|
252 |
+
$bIsFirst = true;
|
253 |
+
foreach($aValues as $mValue) {
|
254 |
+
if($bIsFirst) {
|
255 |
+
$bIsFirst = false;
|
256 |
+
} else {
|
257 |
+
$sResult .= $sSeparator;
|
258 |
+
}
|
259 |
+
if($mValue instanceof \Sabberworm\CSS\Renderable) {
|
260 |
+
$sResult .= $mValue->render($oFormat);
|
261 |
+
} else {
|
262 |
+
$sResult .= $mValue;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
return $sResult;
|
266 |
+
}
|
267 |
+
|
268 |
+
public function removeLastSemicolon($sString) {
|
269 |
+
if($this->oFormat->get('SemicolonAfterLastRule')) {
|
270 |
+
return $sString;
|
271 |
+
}
|
272 |
+
$sString = explode(';', $sString);
|
273 |
+
if(count($sString) < 2) {
|
274 |
+
return $sString[0];
|
275 |
+
}
|
276 |
+
$sLast = array_pop($sString);
|
277 |
+
$sNextToLast = array_pop($sString);
|
278 |
+
array_push($sString, $sNextToLast.$sLast);
|
279 |
+
return implode(';', $sString);
|
280 |
+
}
|
281 |
+
|
282 |
+
private function prepareSpace($sSpaceString) {
|
283 |
+
return str_replace("\n", "\n".$this->indent(), $sSpaceString);
|
284 |
+
}
|
285 |
+
|
286 |
+
private function indent() {
|
287 |
+
return str_repeat($this->oFormat->sIndentation, $this->oFormat->level());
|
288 |
+
}
|
289 |
+
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Parser.php
CHANGED
@@ -17,7 +17,7 @@ use Sabberworm\CSS\Value\RuleValueList;
|
|
17 |
use Sabberworm\CSS\Value\Size;
|
18 |
use Sabberworm\CSS\Value\Color;
|
19 |
use Sabberworm\CSS\Value\URL;
|
20 |
-
use Sabberworm\CSS\Value\
|
21 |
use Sabberworm\CSS\Rule\Rule;
|
22 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
23 |
|
@@ -139,13 +139,13 @@ class Parser {
|
|
139 |
if ($sPrefix !== null && !is_string($sPrefix)) {
|
140 |
throw new \Exception('Wrong namespace prefix '.$sPrefix);
|
141 |
}
|
142 |
-
if (!($mUrl instanceof
|
143 |
throw new \Exception('Wrong namespace url of invalid type '.$mUrl);
|
144 |
}
|
145 |
return new CSSNamespace($mUrl, $sPrefix);
|
146 |
} else {
|
147 |
//Unknown other at rule (font-face or such)
|
148 |
-
$sArgs = $this->consumeUntil('{', false, true);
|
149 |
$this->consumeWhiteSpace();
|
150 |
$bUseRuleSet = true;
|
151 |
foreach($this->blockRules as $sBlockRuleName) {
|
@@ -214,7 +214,7 @@ class Parser {
|
|
214 |
}
|
215 |
$this->consume($sQuote);
|
216 |
}
|
217 |
-
return new
|
218 |
}
|
219 |
|
220 |
private function parseCharacter($bIsForIdentifier) {
|
@@ -414,9 +414,12 @@ class Parser {
|
|
414 |
|
415 |
$sUnit = null;
|
416 |
foreach ($this->aSizeUnits as $iLength => &$aValues) {
|
417 |
-
|
418 |
-
|
419 |
-
|
|
|
|
|
|
|
420 |
}
|
421 |
}
|
422 |
return new Size(floatval($sSize), $sUnit, $bForColor);
|
@@ -518,7 +521,7 @@ class Parser {
|
|
518 |
}
|
519 |
|
520 |
private function consumeExpression($mExpression) {
|
521 |
-
$aMatches;
|
522 |
if (preg_match($mExpression, $this->inputLeft(), $aMatches, PREG_OFFSET_CAPTURE) === 1) {
|
523 |
return $this->consume($aMatches[0][0]);
|
524 |
}
|
@@ -546,10 +549,10 @@ class Parser {
|
|
546 |
|
547 |
private function consumeComment() {
|
548 |
if ($this->comes('/*')) {
|
549 |
-
$this->consume(
|
550 |
-
while ($this->
|
551 |
-
if ($this->comes('
|
552 |
-
$this->consume(
|
553 |
return true;
|
554 |
}
|
555 |
}
|
@@ -567,6 +570,7 @@ class Parser {
|
|
567 |
$start = $this->iCurrentPosition;
|
568 |
|
569 |
while (($char = $this->consume(1)) !== '') {
|
|
|
570 |
if (in_array($char, $aEnd)) {
|
571 |
if ($bIncludeEnd) {
|
572 |
$out .= $char;
|
17 |
use Sabberworm\CSS\Value\Size;
|
18 |
use Sabberworm\CSS\Value\Color;
|
19 |
use Sabberworm\CSS\Value\URL;
|
20 |
+
use Sabberworm\CSS\Value\CSSString;
|
21 |
use Sabberworm\CSS\Rule\Rule;
|
22 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
23 |
|
139 |
if ($sPrefix !== null && !is_string($sPrefix)) {
|
140 |
throw new \Exception('Wrong namespace prefix '.$sPrefix);
|
141 |
}
|
142 |
+
if (!($mUrl instanceof CSSString || $mUrl instanceof URL)) {
|
143 |
throw new \Exception('Wrong namespace url of invalid type '.$mUrl);
|
144 |
}
|
145 |
return new CSSNamespace($mUrl, $sPrefix);
|
146 |
} else {
|
147 |
//Unknown other at rule (font-face or such)
|
148 |
+
$sArgs = trim($this->consumeUntil('{', false, true));
|
149 |
$this->consumeWhiteSpace();
|
150 |
$bUseRuleSet = true;
|
151 |
foreach($this->blockRules as $sBlockRuleName) {
|
214 |
}
|
215 |
$this->consume($sQuote);
|
216 |
}
|
217 |
+
return new CSSString($sResult);
|
218 |
}
|
219 |
|
220 |
private function parseCharacter($bIsForIdentifier) {
|
414 |
|
415 |
$sUnit = null;
|
416 |
foreach ($this->aSizeUnits as $iLength => &$aValues) {
|
417 |
+
$sKey = strtolower($this->peek($iLength));
|
418 |
+
if(array_key_exists($sKey, $aValues)) {
|
419 |
+
if (($sUnit = $aValues[$sKey]) !== null) {
|
420 |
+
$this->consume($iLength);
|
421 |
+
break;
|
422 |
+
}
|
423 |
}
|
424 |
}
|
425 |
return new Size(floatval($sSize), $sUnit, $bForColor);
|
521 |
}
|
522 |
|
523 |
private function consumeExpression($mExpression) {
|
524 |
+
$aMatches = null;
|
525 |
if (preg_match($mExpression, $this->inputLeft(), $aMatches, PREG_OFFSET_CAPTURE) === 1) {
|
526 |
return $this->consume($aMatches[0][0]);
|
527 |
}
|
549 |
|
550 |
private function consumeComment() {
|
551 |
if ($this->comes('/*')) {
|
552 |
+
$this->consume(1);
|
553 |
+
while ($this->consume(1) !== '') {
|
554 |
+
if ($this->comes('*/')) {
|
555 |
+
$this->consume(2);
|
556 |
return true;
|
557 |
}
|
558 |
}
|
570 |
$start = $this->iCurrentPosition;
|
571 |
|
572 |
while (($char = $this->consume(1)) !== '') {
|
573 |
+
$this->consumeComment();
|
574 |
if (in_array($char, $aEnd)) {
|
575 |
if ($bIncludeEnd) {
|
576 |
$out .= $char;
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Parsing/OutputException.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Parsing;
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Thrown if the CSS parsers attempts to print something invalid
|
7 |
+
*/
|
8 |
+
class OutputException extends \Exception {
|
9 |
+
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/AtRule.php
CHANGED
@@ -2,12 +2,13 @@
|
|
2 |
|
3 |
namespace Sabberworm\CSS\Property;
|
4 |
|
5 |
-
|
|
|
|
|
6 |
const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
|
7 |
// Since there are more set rules than block rules, we’re whitelisting the block rules and have anything else be treated as a set rule.
|
8 |
const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation'; //…and more font-specific ones (to be used inside font-feature-values)
|
9 |
|
10 |
public function atRuleName();
|
11 |
public function atRuleArgs();
|
12 |
-
public function __toString();
|
13 |
}
|
2 |
|
3 |
namespace Sabberworm\CSS\Property;
|
4 |
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
+
|
7 |
+
interface AtRule extends Renderable {
|
8 |
const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
|
9 |
// Since there are more set rules than block rules, we’re whitelisting the block rules and have anything else be treated as a set rule.
|
10 |
const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation'; //…and more font-specific ones (to be used inside font-feature-values)
|
11 |
|
12 |
public function atRuleName();
|
13 |
public function atRuleArgs();
|
|
|
14 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/CSSNamespace.php
CHANGED
@@ -15,7 +15,11 @@ class CSSNamespace implements AtRule {
|
|
15 |
}
|
16 |
|
17 |
public function __toString() {
|
18 |
-
return
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
public function getUrl() {
|
15 |
}
|
16 |
|
17 |
public function __toString() {
|
18 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
19 |
+
}
|
20 |
+
|
21 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
22 |
+
return '@namespace '.($this->sPrefix === null ? '' : $this->sPrefix.' ').$this->mUrl->render($oOutputFormat).';';
|
23 |
}
|
24 |
|
25 |
public function getUrl() {
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Charset.php
CHANGED
@@ -26,7 +26,11 @@ class Charset implements AtRule {
|
|
26 |
}
|
27 |
|
28 |
public function __toString() {
|
29 |
-
return
|
|
|
|
|
|
|
|
|
30 |
}
|
31 |
|
32 |
public function atRuleName() {
|
26 |
}
|
27 |
|
28 |
public function __toString() {
|
29 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
30 |
+
}
|
31 |
+
|
32 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
33 |
+
return "@charset {$this->sCharset->render($oOutputFormat)};";
|
34 |
}
|
35 |
|
36 |
public function atRuleName() {
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Import.php
CHANGED
@@ -25,7 +25,11 @@ class Import implements AtRule {
|
|
25 |
}
|
26 |
|
27 |
public function __toString() {
|
28 |
-
return
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
public function atRuleName() {
|
25 |
}
|
26 |
|
27 |
public function __toString() {
|
28 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
29 |
+
}
|
30 |
+
|
31 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
32 |
+
return "@import ".$this->oLocation->render($oOutputFormat).($this->sMediaQuery === null ? '' : ' '.$this->sMediaQuery).';';
|
33 |
}
|
34 |
|
35 |
public function atRuleName() {
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Property/Selector.php
CHANGED
@@ -7,34 +7,33 @@ namespace Sabberworm\CSS\Property;
|
|
7 |
*/
|
8 |
class Selector {
|
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 |
-
)/ix';
|
38 |
|
39 |
private $sSelector;
|
40 |
private $iSpecificity;
|
@@ -63,7 +62,7 @@ class Selector {
|
|
63 |
if ($this->iSpecificity === null) {
|
64 |
$a = 0;
|
65 |
/// @todo should exclude \# as well as "#"
|
66 |
-
$aMatches;
|
67 |
$b = substr_count($this->sSelector, '#');
|
68 |
$c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
|
69 |
$d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
|
@@ -72,4 +71,4 @@ class Selector {
|
|
72 |
return $this->iSpecificity;
|
73 |
}
|
74 |
|
75 |
-
}
|
7 |
*/
|
8 |
class Selector {
|
9 |
|
10 |
+
//Regexes for specificity calculations
|
11 |
+
const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
|
12 |
+
(\.[\w]+) # classes
|
13 |
+
|
|
14 |
+
\[(\w+) # attributes
|
15 |
+
|
|
16 |
+
(\:( # pseudo classes
|
17 |
+
link|visited|active
|
18 |
+
|hover|focus
|
19 |
+
|lang
|
20 |
+
|target
|
21 |
+
|enabled|disabled|checked|indeterminate
|
22 |
+
|root
|
23 |
+
|nth-child|nth-last-child|nth-of-type|nth-last-of-type
|
24 |
+
|first-child|last-child|first-of-type|last-of-type
|
25 |
+
|only-child|only-of-type
|
26 |
+
|empty|contains
|
27 |
+
))
|
28 |
+
/ix';
|
29 |
+
|
30 |
+
const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
|
31 |
+
((^|[\s\+\>\~]+)[\w]+ # elements
|
32 |
+
|
|
33 |
+
\:{1,2}( # pseudo-elements
|
34 |
+
after|before|first-letter|first-line|selection
|
35 |
+
))
|
36 |
+
/ix';
|
|
|
37 |
|
38 |
private $sSelector;
|
39 |
private $iSpecificity;
|
62 |
if ($this->iSpecificity === null) {
|
63 |
$a = 0;
|
64 |
/// @todo should exclude \# as well as "#"
|
65 |
+
$aMatches = null;
|
66 |
$b = substr_count($this->sSelector, '#');
|
67 |
$c = preg_match_all(self::NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX, $this->sSelector, $aMatches);
|
68 |
$d = preg_match_all(self::ELEMENTS_AND_PSEUDO_ELEMENTS_RX, $this->sSelector, $aMatches);
|
71 |
return $this->iSpecificity;
|
72 |
}
|
73 |
|
74 |
+
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Renderable.php
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS;
|
4 |
+
|
5 |
+
interface Renderable {
|
6 |
+
public function __toString();
|
7 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
|
8 |
+
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Rule/Rule.php
CHANGED
@@ -126,9 +126,13 @@ class Rule {
|
|
126 |
}
|
127 |
|
128 |
public function __toString() {
|
129 |
-
|
|
|
|
|
|
|
|
|
130 |
if ($this->mValue instanceof Value) { //Can also be a ValueList
|
131 |
-
$sResult .= $this->mValue->
|
132 |
} else {
|
133 |
$sResult .= $this->mValue;
|
134 |
}
|
126 |
}
|
127 |
|
128 |
public function __toString() {
|
129 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
130 |
+
}
|
131 |
+
|
132 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
133 |
+
$sResult = "{$this->sRule}:{$oOutputFormat->spaceAfterRuleName()}";
|
134 |
if ($this->mValue instanceof Value) { //Can also be a ValueList
|
135 |
+
$sResult .= $this->mValue->render($oOutputFormat);
|
136 |
} else {
|
137 |
$sResult .= $this->mValue;
|
138 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/AtRuleSet.php
CHANGED
@@ -5,7 +5,7 @@ namespace Sabberworm\CSS\RuleSet;
|
|
5 |
use Sabberworm\CSS\Property\AtRule;
|
6 |
|
7 |
/**
|
8 |
-
* A RuleSet constructed by an unknown @-rule. @font-face rules are rendered into
|
9 |
*/
|
10 |
class AtRuleSet extends RuleSet implements AtRule {
|
11 |
|
@@ -27,8 +27,16 @@ class AtRuleSet extends RuleSet implements AtRule {
|
|
27 |
}
|
28 |
|
29 |
public function __toString() {
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
$sResult .= '}';
|
33 |
return $sResult;
|
34 |
}
|
5 |
use Sabberworm\CSS\Property\AtRule;
|
6 |
|
7 |
/**
|
8 |
+
* A RuleSet constructed by an unknown @-rule. @font-face rules are rendered into AtRuleSet objects.
|
9 |
*/
|
10 |
class AtRuleSet extends RuleSet implements AtRule {
|
11 |
|
27 |
}
|
28 |
|
29 |
public function __toString() {
|
30 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
31 |
+
}
|
32 |
+
|
33 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
34 |
+
$sArgs = $this->sArgs;
|
35 |
+
if($sArgs) {
|
36 |
+
$sArgs = ' ' . $sArgs;
|
37 |
+
}
|
38 |
+
$sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{";
|
39 |
+
$sResult .= parent::render($oOutputFormat);
|
40 |
$sResult .= '}';
|
41 |
return $sResult;
|
42 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php
CHANGED
@@ -9,6 +9,7 @@ use Sabberworm\CSS\Value\Value;
|
|
9 |
use Sabberworm\CSS\Value\Size;
|
10 |
use Sabberworm\CSS\Value\Color;
|
11 |
use Sabberworm\CSS\Value\URL;
|
|
|
12 |
|
13 |
/**
|
14 |
* Declaration blocks are the parts of a css file which denote the rules belonging to a selector.
|
@@ -36,6 +37,20 @@ class DeclarationBlock extends RuleSet {
|
|
36 |
}
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* @deprecated use getSelectors()
|
41 |
*/
|
@@ -576,9 +591,17 @@ class DeclarationBlock extends RuleSet {
|
|
576 |
}
|
577 |
|
578 |
public function __toString() {
|
579 |
-
|
580 |
-
|
581 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
582 |
return $sResult;
|
583 |
}
|
584 |
|
9 |
use Sabberworm\CSS\Value\Size;
|
10 |
use Sabberworm\CSS\Value\Color;
|
11 |
use Sabberworm\CSS\Value\URL;
|
12 |
+
use Sabberworm\CSS\Parsing\OutputException;
|
13 |
|
14 |
/**
|
15 |
* Declaration blocks are the parts of a css file which denote the rules belonging to a selector.
|
37 |
}
|
38 |
}
|
39 |
|
40 |
+
// remove one of the selector of the block
|
41 |
+
public function removeSelector($mSelector) {
|
42 |
+
if($mSelector instanceof Selector) {
|
43 |
+
$mSelector = $mSelector->getSelector();
|
44 |
+
}
|
45 |
+
foreach($this->aSelectors as $iKey => $oSelector) {
|
46 |
+
if($oSelector->getSelector() === $mSelector) {
|
47 |
+
unset($this->aSelectors[$iKey]);
|
48 |
+
return true;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
/**
|
55 |
* @deprecated use getSelectors()
|
56 |
*/
|
591 |
}
|
592 |
|
593 |
public function __toString() {
|
594 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
595 |
+
}
|
596 |
+
|
597 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
598 |
+
if(count($this->aSelectors) === 0) {
|
599 |
+
// If all the selectors have been removed, this declaration block becomes invalid
|
600 |
+
throw new OutputException("Attempt to print declaration block with missing selector");
|
601 |
+
}
|
602 |
+
$sResult = $oOutputFormat->implode($oOutputFormat->spaceBeforeSelectorSeparator() . ',' . $oOutputFormat->spaceAfterSelectorSeparator(), $this->aSelectors) . $oOutputFormat->spaceBeforeOpeningBrace() . '{';
|
603 |
+
$sResult .= parent::render($oOutputFormat);
|
604 |
+
$sResult .= '}';
|
605 |
return $sResult;
|
606 |
}
|
607 |
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/RuleSet/RuleSet.php
CHANGED
@@ -3,12 +3,13 @@
|
|
3 |
namespace Sabberworm\CSS\RuleSet;
|
4 |
|
5 |
use Sabberworm\CSS\Rule\Rule;
|
|
|
6 |
|
7 |
/**
|
8 |
* RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
|
9 |
* However, unknown At-Rules (like @font-face) are also rule sets.
|
10 |
*/
|
11 |
-
abstract class RuleSet {
|
12 |
|
13 |
private $aRules;
|
14 |
|
@@ -83,13 +84,36 @@ abstract class RuleSet {
|
|
83 |
}
|
84 |
|
85 |
public function __toString() {
|
|
|
|
|
|
|
|
|
86 |
$sResult = '';
|
|
|
87 |
foreach ($this->aRules as $aRules) {
|
88 |
foreach($aRules as $oRule) {
|
89 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
}
|
92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
}
|
3 |
namespace Sabberworm\CSS\RuleSet;
|
4 |
|
5 |
use Sabberworm\CSS\Rule\Rule;
|
6 |
+
use Sabberworm\CSS\Renderable;
|
7 |
|
8 |
/**
|
9 |
* RuleSet is a generic superclass denoting rules. The typical example for rule sets are declaration block.
|
10 |
* However, unknown At-Rules (like @font-face) are also rule sets.
|
11 |
*/
|
12 |
+
abstract class RuleSet implements Renderable {
|
13 |
|
14 |
private $aRules;
|
15 |
|
84 |
}
|
85 |
|
86 |
public function __toString() {
|
87 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
88 |
+
}
|
89 |
+
|
90 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
91 |
$sResult = '';
|
92 |
+
$bIsFirst = true;
|
93 |
foreach ($this->aRules as $aRules) {
|
94 |
foreach($aRules as $oRule) {
|
95 |
+
$sRendered = $oOutputFormat->safely(function() use ($oRule, $oOutputFormat) {
|
96 |
+
return $oRule->render($oOutputFormat->nextLevel());
|
97 |
+
});
|
98 |
+
if($sRendered === null) {
|
99 |
+
continue;
|
100 |
+
}
|
101 |
+
if($bIsFirst) {
|
102 |
+
$bIsFirst = false;
|
103 |
+
$sResult .= $oOutputFormat->nextLevel()->spaceBeforeRules();
|
104 |
+
} else {
|
105 |
+
$sResult .= $oOutputFormat->nextLevel()->spaceBetweenRules();
|
106 |
+
}
|
107 |
+
$sResult .= $sRendered;
|
108 |
}
|
109 |
}
|
110 |
+
|
111 |
+
if(!$bIsFirst) {
|
112 |
+
// Had some output
|
113 |
+
$sResult .= $oOutputFormat->spaceAfterRules();
|
114 |
+
}
|
115 |
+
|
116 |
+
return $oOutputFormat->removeLastSemicolon($sResult);
|
117 |
}
|
118 |
|
119 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/CSSFunction.php
CHANGED
@@ -28,7 +28,11 @@ class CSSFunction extends ValueList {
|
|
28 |
}
|
29 |
|
30 |
public function __toString() {
|
31 |
-
$
|
|
|
|
|
|
|
|
|
32 |
return "{$this->sName}({$aArguments})";
|
33 |
}
|
34 |
|
28 |
}
|
29 |
|
30 |
public function __toString() {
|
31 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
32 |
+
}
|
33 |
+
|
34 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
35 |
+
$aArguments = parent::render($oOutputFormat);
|
36 |
return "{$this->sName}({$aArguments})";
|
37 |
}
|
38 |
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/{String.php → CSSString.php}
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
namespace Sabberworm\CSS\Value;
|
4 |
|
5 |
-
class
|
6 |
|
7 |
private $sString;
|
8 |
|
@@ -19,9 +19,13 @@ class String extends PrimitiveValue {
|
|
19 |
}
|
20 |
|
21 |
public function __toString() {
|
|
|
|
|
|
|
|
|
22 |
$sString = addslashes($this->sString);
|
23 |
$sString = str_replace("\n", '\A', $sString);
|
24 |
-
return
|
25 |
}
|
26 |
|
27 |
}
|
2 |
|
3 |
namespace Sabberworm\CSS\Value;
|
4 |
|
5 |
+
class CSSString extends PrimitiveValue {
|
6 |
|
7 |
private $sString;
|
8 |
|
19 |
}
|
20 |
|
21 |
public function __toString() {
|
22 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
23 |
+
}
|
24 |
+
|
25 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
26 |
$sString = addslashes($this->sString);
|
27 |
$sString = str_replace("\n", '\A', $sString);
|
28 |
+
return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType();
|
29 |
}
|
30 |
|
31 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Color.php
CHANGED
@@ -22,17 +22,20 @@ class Color extends CSSFunction {
|
|
22 |
}
|
23 |
|
24 |
public function __toString() {
|
|
|
|
|
|
|
|
|
25 |
// Shorthand RGB color values
|
26 |
-
|
27 |
-
if(implode('', array_keys($this->aComponents)) === 'rgb') {
|
28 |
$sResult = sprintf(
|
29 |
'%02x%02x%02x',
|
30 |
-
$this->aComponents['r']->
|
31 |
-
$this->aComponents['g']->
|
32 |
-
$this->aComponents['b']->
|
33 |
);
|
34 |
return '#'.(($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5]) ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
|
35 |
}
|
36 |
-
return parent::
|
37 |
}
|
38 |
}
|
22 |
}
|
23 |
|
24 |
public function __toString() {
|
25 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
26 |
+
}
|
27 |
+
|
28 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
29 |
// Shorthand RGB color values
|
30 |
+
if($oOutputFormat->getRGBHashNotation() && implode('', array_keys($this->aComponents)) === 'rgb') {
|
|
|
31 |
$sResult = sprintf(
|
32 |
'%02x%02x%02x',
|
33 |
+
$this->aComponents['r']->getSize(),
|
34 |
+
$this->aComponents['g']->getSize(),
|
35 |
+
$this->aComponents['b']->getSize()
|
36 |
);
|
37 |
return '#'.(($sResult[0] == $sResult[1]) && ($sResult[2] == $sResult[3]) && ($sResult[4] == $sResult[5]) ? "$sResult[0]$sResult[2]$sResult[4]" : $sResult);
|
38 |
}
|
39 |
+
return parent::render($oOutputFormat);
|
40 |
}
|
41 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Size.php
CHANGED
@@ -5,7 +5,7 @@ namespace Sabberworm\CSS\Value;
|
|
5 |
class Size extends PrimitiveValue {
|
6 |
|
7 |
const ABSOLUTE_SIZE_UNITS = 'px/cm/mm/mozmm/in/pt/pc/vh/vw/vm/vmin/vmax/rem'; //vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport)
|
8 |
-
const RELATIVE_SIZE_UNITS = '%/em/ex/ch';
|
9 |
const NON_SIZE_UNITS = 'deg/grad/rad/s/ms/turns/Hz/kHz';
|
10 |
|
11 |
private $fSize;
|
@@ -60,6 +60,10 @@ class Size extends PrimitiveValue {
|
|
60 |
}
|
61 |
|
62 |
public function __toString() {
|
|
|
|
|
|
|
|
|
63 |
$l = localeconv();
|
64 |
$sPoint = preg_quote($l['decimal_point'], '/');
|
65 |
return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
|
5 |
class Size extends PrimitiveValue {
|
6 |
|
7 |
const ABSOLUTE_SIZE_UNITS = 'px/cm/mm/mozmm/in/pt/pc/vh/vw/vm/vmin/vmax/rem'; //vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport)
|
8 |
+
const RELATIVE_SIZE_UNITS = '%/em/ex/ch/fr';
|
9 |
const NON_SIZE_UNITS = 'deg/grad/rad/s/ms/turns/Hz/kHz';
|
10 |
|
11 |
private $fSize;
|
60 |
}
|
61 |
|
62 |
public function __toString() {
|
63 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
64 |
+
}
|
65 |
+
|
66 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
67 |
$l = localeconv();
|
68 |
$sPoint = preg_quote($l['decimal_point'], '/');
|
69 |
return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/URL.php
CHANGED
@@ -7,11 +7,11 @@ class URL extends PrimitiveValue {
|
|
7 |
|
8 |
private $oURL;
|
9 |
|
10 |
-
public function __construct(
|
11 |
$this->oURL = $oURL;
|
12 |
}
|
13 |
|
14 |
-
public function setURL(
|
15 |
$this->oURL = $oURL;
|
16 |
}
|
17 |
|
@@ -20,7 +20,11 @@ class URL extends PrimitiveValue {
|
|
20 |
}
|
21 |
|
22 |
public function __toString() {
|
23 |
-
return
|
|
|
|
|
|
|
|
|
24 |
}
|
25 |
|
26 |
}
|
7 |
|
8 |
private $oURL;
|
9 |
|
10 |
+
public function __construct(CSSString $oURL) {
|
11 |
$this->oURL = $oURL;
|
12 |
}
|
13 |
|
14 |
+
public function setURL(CSSString $oURL) {
|
15 |
$this->oURL = $oURL;
|
16 |
}
|
17 |
|
20 |
}
|
21 |
|
22 |
public function __toString() {
|
23 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
24 |
+
}
|
25 |
+
|
26 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
27 |
+
return "url({$this->oURL->render($oOutputFormat)})";
|
28 |
}
|
29 |
|
30 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/Value.php
CHANGED
@@ -2,7 +2,10 @@
|
|
2 |
|
3 |
namespace Sabberworm\CSS\Value;
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
|
|
|
|
|
|
8 |
}
|
2 |
|
3 |
namespace Sabberworm\CSS\Value;
|
4 |
|
5 |
+
use Sabberworm\CSS\Renderable;
|
6 |
|
7 |
+
abstract class Value implements Renderable {
|
8 |
+
//Methods are commented out because re-declaring them here is a fatal error in PHP < 5.3.9
|
9 |
+
//public abstract function __toString();
|
10 |
+
//public abstract function render(\Sabberworm\CSS\OutputFormat $oOutputFormat);
|
11 |
}
|
includes/PHP-CSS-Parser/lib/Sabberworm/CSS/Value/ValueList.php
CHANGED
@@ -35,8 +35,12 @@ abstract class ValueList extends Value {
|
|
35 |
$this->sSeparator = $sSeparator;
|
36 |
}
|
37 |
|
38 |
-
function __toString() {
|
39 |
-
return
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
}
|
35 |
$this->sSeparator = $sSeparator;
|
36 |
}
|
37 |
|
38 |
+
public function __toString() {
|
39 |
+
return $this->render(new \Sabberworm\CSS\OutputFormat());
|
40 |
+
}
|
41 |
+
|
42 |
+
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
43 |
+
return $oOutputFormat->implode($oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator), $this->aComponents);
|
44 |
}
|
45 |
|
46 |
}
|
includes/ameArray.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Array utility functions, a la Lodash.
|
5 |
+
*/
|
6 |
+
class ameArray {
|
7 |
+
public static function get($array, $path, $default = null) {
|
8 |
+
//todo
|
9 |
+
return $default;
|
10 |
+
}
|
11 |
+
}
|
includes/editor-page.php
CHANGED
@@ -9,6 +9,13 @@ $is_second_toolbar_visible = isset($_COOKIE['ame-show-second-toolbar']) && (intv
|
|
9 |
$is_compact_layout_enabled = isset($_COOKIE['ame-compact-layout']) && (intval($_COOKIE['ame-compact-layout']) === 1);
|
10 |
$is_multisite = is_multisite();
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
$icons = array(
|
13 |
'cut' => '/gnome-icon-theme/edit-cut-blue.png',
|
14 |
'copy' => '/gion/edit-copy.png',
|
@@ -47,13 +54,13 @@ if ( !apply_filters('admin_menu_editor_is_pro', false) ){
|
|
47 |
}
|
48 |
|
49 |
?>
|
50 |
-
<div class="
|
51 |
-
<?php echo '<', WPMenuEditor::$admin_heading_tag, '>'; ?>
|
52 |
<?php echo apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'); ?>
|
53 |
-
<a href="<?php echo esc_attr($editor_data['settings_page_url']); ?>" class="add-new-h2" id="ws_plugin_settings_button"
|
54 |
-
title="Configure plugin settings">Settings</a>
|
55 |
<?php echo '</', WPMenuEditor::$admin_heading_tag, '>'; ?>
|
56 |
|
|
|
|
|
57 |
<?php
|
58 |
if ( !empty($_GET['message']) ){
|
59 |
if ( intval($_GET['message']) == 1 ){
|
@@ -68,7 +75,6 @@ $extrasDirectory = dirname(__FILE__) . '/../extras';
|
|
68 |
if ( apply_filters('admin_menu_editor_is_pro', false) ) {
|
69 |
include $extrasDirectory . '/menu-color-dialog.php';
|
70 |
include $extrasDirectory . '/copy-permissions-dialog.php';
|
71 |
-
include $extrasDirectory . '/modules/visible-users/visible-users-template.php';
|
72 |
}
|
73 |
|
74 |
function ame_output_sort_buttons($icons) {
|
@@ -84,7 +90,7 @@ function ame_output_sort_buttons($icons) {
|
|
84 |
|
85 |
?>
|
86 |
|
87 |
-
<div id='ws_menu_editor' class="<?php
|
88 |
if ( $is_compact_layout_enabled ) {
|
89 |
echo 'ws_compact_layout';
|
90 |
} else {
|
@@ -92,12 +98,7 @@ function ame_output_sort_buttons($icons) {
|
|
92 |
}
|
93 |
?>">
|
94 |
|
95 |
-
|
96 |
-
<ul id="ws_actor_selector" class="subsubsub" style="display: none;">
|
97 |
-
<!-- Contents will be generated by JS -->
|
98 |
-
</ul>
|
99 |
-
<div class="clear"></div>
|
100 |
-
</div>
|
101 |
|
102 |
<div>
|
103 |
|
@@ -246,7 +247,6 @@ function ame_output_sort_buttons($icons) {
|
|
246 |
<input type="hidden" name="data" id="ws_data" value="">
|
247 |
<input type="hidden" name="data_length" id="ws_data_length" value="">
|
248 |
<input type="hidden" name="selected_actor" id="ws_selected_actor" value="">
|
249 |
-
<input type="hidden" name="visible_users" id="ws_visible_users_json" value="">
|
250 |
<input type="button" id='ws_save_menu' class="button-primary ws_main_button" value="Save Changes" />
|
251 |
</form>
|
252 |
|
@@ -394,23 +394,35 @@ function ame_output_sort_buttons($icons) {
|
|
394 |
//The rest of Dashicons. Some icons were manually removed as they wouldn't look good as menu icons.
|
395 |
$dashicons = array(
|
396 |
'admin-site', 'admin-home',
|
397 |
-
'align-center', 'align-left', 'align-none', 'align-right',
|
398 |
-
'
|
399 |
-
'
|
|
|
|
|
400 |
'editor-distractionfree', 'editor-help', 'editor-insertmore',
|
401 |
'editor-justify', 'editor-kitchensink', 'editor-ol', 'editor-paste-text',
|
402 |
'editor-paste-word', 'editor-quote', 'editor-removeformatting', 'editor-rtl', 'editor-spellcheck',
|
403 |
'editor-ul', 'editor-unlink', 'editor-video',
|
404 |
-
'email', 'email-alt', 'exerpt-view', '
|
|
|
405 |
'format-audio', 'format-chat', 'format-gallery', 'format-image', 'format-quote', 'format-status',
|
406 |
-
'format-video', 'forms', 'googleplus', '
|
407 |
-
'
|
408 |
-
'
|
409 |
-
'
|
410 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
411 |
'share-alt2', 'share1', 'shield', 'shield-alt', 'slides', 'smartphone', 'smiley', 'sort', 'sos', 'star-empty',
|
412 |
-
'star-filled', 'star-half', '
|
413 |
-
'
|
|
|
|
|
414 |
'welcome-comments', 'welcome-learn-more', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-write-blog',
|
415 |
'wordpress', 'wordpress-alt', 'yes'
|
416 |
);
|
@@ -557,8 +569,3 @@ if ( apply_filters('admin_menu_editor_is_pro', false) ) {
|
|
557 |
var defaultMenu = <?php echo $editor_data['default_menu_js']; ?>;
|
558 |
var customMenu = <?php echo $editor_data['custom_menu_js']; ?>;
|
559 |
</script>
|
560 |
-
|
561 |
-
<?php
|
562 |
-
|
563 |
-
//Let the Pro version script output it's extra HTML & scripts.
|
564 |
-
do_action('admin_menu_editor-footer');
|
9 |
$is_compact_layout_enabled = isset($_COOKIE['ame-compact-layout']) && (intval($_COOKIE['ame-compact-layout']) === 1);
|
10 |
$is_multisite = is_multisite();
|
11 |
|
12 |
+
$wrap_classes = array('wrap');
|
13 |
+
if ( $is_pro_version ) {
|
14 |
+
$wrap_classes[] = 'ame-is-pro-version';
|
15 |
+
} else {
|
16 |
+
$wrap_classes[] = 'ame-is-free-version';
|
17 |
+
}
|
18 |
+
|
19 |
$icons = array(
|
20 |
'cut' => '/gnome-icon-theme/edit-cut-blue.png',
|
21 |
'copy' => '/gion/edit-copy.png',
|
54 |
}
|
55 |
|
56 |
?>
|
57 |
+
<div class="<?php echo esc_attr(implode(' ', $wrap_classes)); ?>">
|
58 |
+
<?php echo '<', WPMenuEditor::$admin_heading_tag, ' id="ws_ame_editor_heading">'; ?>
|
59 |
<?php echo apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'); ?>
|
|
|
|
|
60 |
<?php echo '</', WPMenuEditor::$admin_heading_tag, '>'; ?>
|
61 |
|
62 |
+
<?php do_action('admin_menu_editor-display_tabs'); ?>
|
63 |
+
|
64 |
<?php
|
65 |
if ( !empty($_GET['message']) ){
|
66 |
if ( intval($_GET['message']) == 1 ){
|
75 |
if ( apply_filters('admin_menu_editor_is_pro', false) ) {
|
76 |
include $extrasDirectory . '/menu-color-dialog.php';
|
77 |
include $extrasDirectory . '/copy-permissions-dialog.php';
|
|
|
78 |
}
|
79 |
|
80 |
function ame_output_sort_buttons($icons) {
|
90 |
|
91 |
?>
|
92 |
|
93 |
+
<div id='ws_menu_editor' style="visibility: hidden;" class="<?php
|
94 |
if ( $is_compact_layout_enabled ) {
|
95 |
echo 'ws_compact_layout';
|
96 |
} else {
|
98 |
}
|
99 |
?>">
|
100 |
|
101 |
+
<?php include dirname(__FILE__) . '/../modules/actor-selector/actor-selector-template.php'; ?>
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
<div>
|
104 |
|
247 |
<input type="hidden" name="data" id="ws_data" value="">
|
248 |
<input type="hidden" name="data_length" id="ws_data_length" value="">
|
249 |
<input type="hidden" name="selected_actor" id="ws_selected_actor" value="">
|
|
|
250 |
<input type="button" id='ws_save_menu' class="button-primary ws_main_button" value="Save Changes" />
|
251 |
</form>
|
252 |
|
394 |
//The rest of Dashicons. Some icons were manually removed as they wouldn't look good as menu icons.
|
395 |
$dashicons = array(
|
396 |
'admin-site', 'admin-home',
|
397 |
+
'album', 'align-center', 'align-left', 'align-none', 'align-right',
|
398 |
+
'analytics', 'archive', 'art', 'awards', 'backup', 'book', 'book-alt',
|
399 |
+
'building', 'businessman', 'calendar', 'calendar-alt', 'camera', 'carrot',
|
400 |
+
'cart', 'category', 'chart-area', 'chart-bar', 'chart-line', 'chart-pie',
|
401 |
+
'clipboard', 'clock', 'cloud', 'desktop', 'dismiss', 'download', 'edit', 'editor-code', 'editor-contract', 'editor-customchar',
|
402 |
'editor-distractionfree', 'editor-help', 'editor-insertmore',
|
403 |
'editor-justify', 'editor-kitchensink', 'editor-ol', 'editor-paste-text',
|
404 |
'editor-paste-word', 'editor-quote', 'editor-removeformatting', 'editor-rtl', 'editor-spellcheck',
|
405 |
'editor-ul', 'editor-unlink', 'editor-video',
|
406 |
+
'email', 'email-alt', 'exerpt-view', 'external', 'facebook',
|
407 |
+
'facebook-alt', 'feedback', 'filter', 'flag', 'format-aside',
|
408 |
'format-audio', 'format-chat', 'format-gallery', 'format-image', 'format-quote', 'format-status',
|
409 |
+
'format-video', 'forms', 'googleplus', 'grid-view', 'groups',
|
410 |
+
'hammer', 'heart', 'hidden', 'id', 'id-alt', 'image-crop', 'image-filter',
|
411 |
+
'image-flip-horizontal', 'image-flip-vertical', 'image-rotate',
|
412 |
+
'image-rotate-left', 'image-rotate-right', 'images-alt',
|
413 |
+
'images-alt2', 'index-card', 'info', 'leftright', 'lightbulb', 'list-view',
|
414 |
+
'location', 'location-alt', 'lock', 'marker',
|
415 |
+
'media-archive', 'media-audio', 'media-code', 'media-default', 'media-video', 'megaphone',
|
416 |
+
'menu', 'microphone', 'migrate', 'minus', 'money', 'nametag', 'networking', 'no',
|
417 |
+
'no-alt', 'palmtree', 'performance', 'phone', 'playlist-audio',
|
418 |
+
'playlist-video', 'plus', 'plus-alt', 'portfolio', 'post-status', 'post-trash',
|
419 |
+
'pressthis', 'products', 'redo', 'rss', 'schedule',
|
420 |
+
'screenoptions', 'search', 'share', 'share-alt',
|
421 |
'share-alt2', 'share1', 'shield', 'shield-alt', 'slides', 'smartphone', 'smiley', 'sort', 'sos', 'star-empty',
|
422 |
+
'star-filled', 'star-half', 'sticky', 'store', 'tablet', 'tag',
|
423 |
+
'tagcloud', 'testimonial', 'text', 'thumbs-down', 'thumbs-up', 'translation', 'twitter', 'undo',
|
424 |
+
'universal-access', 'universal-access-alt', 'unlock',
|
425 |
+
'update', 'upload', 'vault', 'video-alt', 'video-alt2', 'video-alt3', 'visibility', 'warning', 'welcome-add-page',
|
426 |
'welcome-comments', 'welcome-learn-more', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-write-blog',
|
427 |
'wordpress', 'wordpress-alt', 'yes'
|
428 |
);
|
569 |
var defaultMenu = <?php echo $editor_data['default_menu_js']; ?>;
|
570 |
var customMenu = <?php echo $editor_data['custom_menu_js']; ?>;
|
571 |
</script>
|
|
|
|
|
|
|
|
|
|
includes/generate-menu-dashicons.php
CHANGED
@@ -49,7 +49,7 @@ foreach($blocks as $block) {
|
|
49 |
foreach($rules as $rule) {
|
50 |
/** @var Sabberworm\CSS\Rule\Rule $rule */
|
51 |
$value = $rule->getValue();
|
52 |
-
if ($value instanceof Sabberworm\CSS\Value\
|
53 |
//The parser defaults to UTF-8. Convert the char to a hexadecimal escape code
|
54 |
//so we don't have to worry about our CSS charset.
|
55 |
$char = ltrim(bin2hex(iconv('UTF-8', 'UCS-4', $value->getString())), '0');
|
49 |
foreach($rules as $rule) {
|
50 |
/** @var Sabberworm\CSS\Rule\Rule $rule */
|
51 |
$value = $rule->getValue();
|
52 |
+
if ($value instanceof Sabberworm\CSS\Value\CSSString) {
|
53 |
//The parser defaults to UTF-8. Convert the char to a hexadecimal escape code
|
54 |
//so we don't have to worry about our CSS charset.
|
55 |
$char = ltrim(bin2hex(iconv('UTF-8', 'UCS-4', $value->getString())), '0');
|
includes/menu-editor-core.php
CHANGED
@@ -92,6 +92,16 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
92 |
*/
|
93 |
private $menu_url_blacklist = array();
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
function init(){
|
96 |
$this->sitewide_options = true;
|
97 |
|
@@ -172,6 +182,10 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
172 |
//BuddyPress 2.3.4
|
173 |
'index.php?page=bp-about' => true,
|
174 |
'index.php?page=bp-credits' => true,
|
|
|
|
|
|
|
|
|
175 |
);
|
176 |
|
177 |
//AJAXify screen options
|
@@ -216,6 +230,25 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
216 |
add_action('deleted_user_meta', array($this, 'clear_user_role_cache'), 10, 2);
|
217 |
//There's also a "set_user_role" hook, but it's only called by WP_User::set_role and not WP_User::add_role.
|
218 |
//It's also redundant - WP_User::set_role updates user meta, so the above hooks already cover it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
|
221 |
function init_finish() {
|
@@ -312,7 +345,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
312 |
apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
|
313 |
apply_filters('admin_menu_editor-capability', 'manage_options'),
|
314 |
'menu_editor',
|
315 |
-
array(
|
316 |
);
|
317 |
//Output our JS & CSS on that page only
|
318 |
add_action("admin_print_scripts-$page", array($this, 'enqueue_scripts'), 1);
|
@@ -332,6 +365,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
332 |
|
333 |
//Make a placeholder for our screen options (hacky)
|
334 |
add_meta_box("ws-ame-screen-options", "[AME placeholder]", '__return_false', $page);
|
|
|
|
|
|
|
335 |
}
|
336 |
|
337 |
//Store the "original" menus for later use in the editor
|
@@ -350,7 +386,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
350 |
}
|
351 |
|
352 |
//Generate item templates from the default menu.
|
353 |
-
$templateBuilder = new
|
354 |
$this->item_templates = $templateBuilder->build(
|
355 |
$this->default_wp_menu,
|
356 |
$this->default_wp_submenu,
|
@@ -572,11 +608,18 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
572 |
//jQuery Form plugin. This is a more recent version than the one included with WP.
|
573 |
wp_register_auto_versioned_script('ame-jquery-form', plugins_url('js/jquery.form.js', $this->plugin_file), array('jquery'));
|
574 |
//jQuery cookie plugin
|
575 |
-
wp_register_auto_versioned_script('jquery-cookie', plugins_url('js/jquery.
|
576 |
|
577 |
//Lodash library
|
578 |
wp_register_auto_versioned_script('ame-lodash', plugins_url('js/lodash.min.js', $this->plugin_file));
|
579 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
580 |
//Modules
|
581 |
wp_register_auto_versioned_script(
|
582 |
'ame-access-editor',
|
@@ -592,7 +635,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
592 |
'jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-ui-tabs',
|
593 |
'ame-jquery-form', 'jquery-ui-droppable', 'jquery-qtip',
|
594 |
'jquery-sort', 'jquery-json', 'jquery-cookie',
|
595 |
-
'wp-color-picker', 'ame-lodash', 'ame-access-editor',
|
|
|
596 |
);
|
597 |
wp_register_auto_versioned_script(
|
598 |
'menu-editor',
|
@@ -600,27 +644,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
600 |
apply_filters('admin_menu_editor-editor_script_dependencies', $editor_dependencies)
|
601 |
);
|
602 |
|
603 |
-
|
604 |
-
if ( $this->is_settings_page() ) {
|
605 |
-
wp_enqueue_script('jquery-qtip');
|
606 |
-
return;
|
607 |
-
}
|
608 |
-
|
609 |
-
//Add all scripts to our editor page, but not the settings sub-section
|
610 |
-
//that shares the same page slug. Some of the scripts would crash otherwise.
|
611 |
-
if ( !$this->is_editor_page() ) {
|
612 |
-
return;
|
613 |
-
}
|
614 |
-
|
615 |
-
wp_enqueue_script('menu-editor');
|
616 |
-
|
617 |
-
//We use WordPress media uploader to let the user upload custom menu icons (WP 3.5+).
|
618 |
-
if ( function_exists('wp_enqueue_media') ) {
|
619 |
-
wp_enqueue_media();
|
620 |
-
}
|
621 |
-
|
622 |
-
//Remove the default jQuery Form plugin to prevent conflicts with our custom version.
|
623 |
-
wp_dequeue_script('jquery-form');
|
624 |
|
625 |
//Actors (roles and users) are used in the permissions UI, so we need to pass them along.
|
626 |
$actors = array();
|
@@ -666,14 +690,39 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
666 |
//Compatibility workaround: Get the real roles of the current user even if other plugins corrupt the list.
|
667 |
$users[$current_user->get('user_login')]['roles'] = array_values($this->get_user_roles($current_user));
|
668 |
|
669 |
-
|
670 |
-
|
671 |
-
|
|
|
672 |
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
|
678 |
$showExtraIcons = (boolean)$this->options['show_extra_icons'];
|
679 |
if ( isset($_COOKIE['ame-show-extra-icons']) && is_numeric($_COOKIE['ame-show-extra-icons']) ) {
|
@@ -709,11 +758,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
709 |
'embeddedPageTemplateId' => ameMenuItem::embeddedPageTemplateId,
|
710 |
|
711 |
'actors' => $actors,
|
712 |
-
'roles' => $roles,
|
713 |
-
'users' => $users,
|
714 |
'currentUserLogin' => $current_user->get('user_login'),
|
715 |
'selectedActor' => isset($this->get['selected_actor']) ? strval($this->get['selected_actor']) : null,
|
716 |
-
'visibleUsers' => $visible_users,
|
717 |
|
718 |
'postTypes' => $this->get_post_type_details(),
|
719 |
'taxonomies' => $this->get_taxonomy_details(),
|
@@ -863,6 +909,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
863 |
$scheme = $this->options['ui_colour_scheme'];
|
864 |
wp_enqueue_style('menu-editor-colours-' . $scheme);
|
865 |
wp_enqueue_style('wp-color-picker');
|
|
|
|
|
866 |
}
|
867 |
|
868 |
/**
|
@@ -1006,21 +1054,21 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1006 |
'defaults' => $unclickableDefaults,
|
1007 |
);
|
1008 |
|
1009 |
-
$
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
|
|
|
|
1019 |
)
|
1020 |
-
)
|
1021 |
-
);
|
1022 |
|
1023 |
-
if ( $this->is_pro_version() ) {
|
1024 |
//The Pro version has a [wp-logout-url] shortcode. Lets make it easier o use
|
1025 |
//by adding it to the "Target page" dropdown.
|
1026 |
$logoutDefaults = array_merge(
|
@@ -1185,8 +1233,8 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1185 |
$positions_by_template[$template_id] = ameMenuItem::get($entry, 'position', 0);
|
1186 |
|
1187 |
//Add the new entry to the menu tree
|
1188 |
-
if (
|
1189 |
-
if (isset($tree[$template['defaults']['parent']])) {
|
1190 |
//Okay, insert the item.
|
1191 |
$tree[$template['defaults']['parent']]['items'][] = $entry;
|
1192 |
} else {
|
@@ -1200,7 +1248,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1200 |
|
1201 |
//Move orphaned items back to their original parents.
|
1202 |
foreach($orphans as $item) {
|
1203 |
-
$defaultParent =
|
1204 |
if ( isset($defaultParent) && isset($tree[$defaultParent]) ) {
|
1205 |
$tree[$defaultParent]['items'][] = $item;
|
1206 |
} else {
|
@@ -1441,7 +1489,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1441 |
* @return array Menu item in the internal format.
|
1442 |
*/
|
1443 |
private function prepare_for_output($item, $item_type = 'menu', $parent = array()) {
|
1444 |
-
$parent_file = isset($parent['file']) ? $parent['file'] :
|
1445 |
|
1446 |
// Special case : plugin pages that have been moved from a sub-menu to a different
|
1447 |
// menu or the top level. We'll need to adjust the file field to point to the correct URL.
|
@@ -1494,6 +1542,9 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1494 |
}
|
1495 |
}
|
1496 |
|
|
|
|
|
|
|
1497 |
//Apply defaults & filters
|
1498 |
$item = ameMenuItem::apply_defaults($item);
|
1499 |
$item = ameMenuItem::apply_filters($item, $item_type, $parent_file); //may cause side-effects
|
@@ -1531,7 +1582,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1531 |
|
1532 |
//Used later to determine the current page based on URL.
|
1533 |
if ( empty($item['url']) ) {
|
1534 |
-
$original_parent =
|
1535 |
$item['url'] = ameMenuItem::generate_url($item['file'], $original_parent);
|
1536 |
}
|
1537 |
|
@@ -1550,7 +1601,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1550 |
}
|
1551 |
|
1552 |
//WPML support: Use translated menu titles where available.
|
1553 |
-
if ( !$item['separator'] && function_exists('icl_t') ) {
|
1554 |
$item['menu_title'] = icl_t(
|
1555 |
self::WPML_CONTEXT,
|
1556 |
$this->get_wpml_name_for($item, 'menu_title'),
|
@@ -1674,7 +1725,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1674 |
}
|
1675 |
|
1676 |
$action = isset($this->post['action']) ? $this->post['action'] : (isset($this->get['action']) ? $this->get['action'] : '');
|
1677 |
-
do_action('admin_menu_editor-header', $action);
|
1678 |
|
1679 |
if ( !empty($action) ) {
|
1680 |
$this->handle_form_submission($this->post, $action);
|
@@ -1692,14 +1743,19 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1692 |
}
|
1693 |
}
|
1694 |
|
1695 |
-
|
1696 |
-
if ( $sub_section === 'settings' ) {
|
1697 |
$this->display_plugin_settings_ui();
|
1698 |
-
} else if ($
|
1699 |
require dirname(__FILE__) . '/generate-menu-dashicons.php';
|
1700 |
-
} else {
|
1701 |
$this->display_editor_ui();
|
|
|
|
|
1702 |
}
|
|
|
|
|
|
|
|
|
1703 |
}
|
1704 |
|
1705 |
private function handle_form_submission($post, $action = '') {
|
@@ -1745,15 +1801,6 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1745 |
//Save the custom menu
|
1746 |
$this->set_custom_menu($menu);
|
1747 |
|
1748 |
-
//Save the list of visible users.
|
1749 |
-
if ( isset($this->post['visible_users']) && is_string($this->post['visible_users']) ) {
|
1750 |
-
$visible_users = json_decode($this->post['visible_users']);
|
1751 |
-
if ( is_array($visible_users) ) {
|
1752 |
-
$this->options['visible_users'] = array_unique(array_map('strval', $visible_users));
|
1753 |
-
$this->save_options();
|
1754 |
-
}
|
1755 |
-
}
|
1756 |
-
|
1757 |
//Redirect back to the editor and display the success message.
|
1758 |
//Also, automatically select the last selected actor (convenience feature).
|
1759 |
$query = array('message' => 1);
|
@@ -1917,6 +1964,24 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1917 |
require dirname(__FILE__) . '/editor-page.php';
|
1918 |
}
|
1919 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1920 |
/**
|
1921 |
* Display the plugin settings page.
|
1922 |
*/
|
@@ -1949,7 +2014,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1949 |
protected function is_editor_page() {
|
1950 |
return is_admin()
|
1951 |
&& isset($this->get['page']) && ($this->get['page'] == 'menu_editor')
|
1952 |
-
&& (
|
1953 |
}
|
1954 |
|
1955 |
/**
|
@@ -1959,7 +2024,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
1959 |
*/
|
1960 |
protected function is_settings_page() {
|
1961 |
return is_admin()
|
1962 |
-
&&
|
1963 |
&& isset($this->get['page']) && ($this->get['page'] == 'menu_editor');
|
1964 |
}
|
1965 |
|
@@ -2009,6 +2074,12 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2009 |
|
2010 |
if ( $item['template_id'] !== '' ) {
|
2011 |
$required_cap = ameMenuItem::get($item, 'access_level');
|
|
|
|
|
|
|
|
|
|
|
|
|
2012 |
foreach ($item['grant_access'] as $grant => $has_access) {
|
2013 |
if ( $has_access ) {
|
2014 |
if ( !isset($caps[$grant]) ) {
|
@@ -2039,6 +2110,15 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2039 |
return $array1;
|
2040 |
}
|
2041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2042 |
/**
|
2043 |
* Create a virtual 'super_admin' capability that only super admins have.
|
2044 |
* This function accomplishes that by by filtering 'user_has_cap' calls.
|
@@ -2251,6 +2331,11 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2251 |
return false;
|
2252 |
}
|
2253 |
|
|
|
|
|
|
|
|
|
|
|
2254 |
if ( $this->user_cap_cache_enabled && isset($this->cached_user_caps[$capability]) ) {
|
2255 |
return $this->cached_user_caps[$capability];
|
2256 |
}
|
@@ -2581,12 +2666,30 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2581 |
}
|
2582 |
}
|
2583 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2584 |
public function enqueue_helper_scripts() {
|
2585 |
wp_enqueue_script(
|
2586 |
'ame-helper-script',
|
2587 |
plugins_url('js/admin-helpers.js', $this->plugin_file),
|
2588 |
-
array('jquery'),
|
2589 |
-
'
|
2590 |
);
|
2591 |
|
2592 |
//The helper script needs to know the custom page heading (if any) to apply it.
|
@@ -2626,6 +2729,16 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2626 |
return null;
|
2627 |
}
|
2628 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2629 |
|
2630 |
/**
|
2631 |
* Log a security-related message.
|
@@ -2697,7 +2810,7 @@ class WPMenuEditor extends MenuEd_ShadowPluginFramework {
|
|
2697 |
|
2698 |
/**
|
2699 |
* Prepare WPML translation strings for all menu and page titles
|
2700 |
-
* in the specified menu.
|
2701 |
*
|
2702 |
* @param array $custom_menu
|
2703 |
* @return array Associative array of strings that can be translated, indexed by unique name.
|
@@ -3158,9 +3271,9 @@ class ameMenuTemplateBuilder {
|
|
3158 |
*
|
3159 |
* @param array $wpItem
|
3160 |
* @param int $position
|
3161 |
-
* @param string $parent
|
3162 |
*/
|
3163 |
-
private function addItem($wpItem, $position, $parent =
|
3164 |
$item = ameMenuItem::fromWpItem($wpItem, $position, $parent);
|
3165 |
|
3166 |
//Skip separators.
|
@@ -3175,7 +3288,7 @@ class ameMenuTemplateBuilder {
|
|
3175 |
}
|
3176 |
|
3177 |
$name = $this->sanitizeMenuTitle($item['menu_title']);
|
3178 |
-
if (
|
3179 |
$this->parentNames[$item['file']] = $name;
|
3180 |
} else {
|
3181 |
$name = $this->parentNames[$parent] . ' -> ' . $name;
|
92 |
*/
|
93 |
private $menu_url_blacklist = array();
|
94 |
|
95 |
+
/**
|
96 |
+
* @var array Menu editor page tabs.
|
97 |
+
*/
|
98 |
+
private $tabs = array();
|
99 |
+
|
100 |
+
/**
|
101 |
+
* @var string The slug of the current settings tab, if any.
|
102 |
+
*/
|
103 |
+
private $current_tab = '';
|
104 |
+
|
105 |
function init(){
|
106 |
$this->sitewide_options = true;
|
107 |
|
182 |
//BuddyPress 2.3.4
|
183 |
'index.php?page=bp-about' => true,
|
184 |
'index.php?page=bp-credits' => true,
|
185 |
+
//DW Question Answer 1.3.8.1
|
186 |
+
'index.php?page=dwqa-about' => true,
|
187 |
+
'index.php?page=dwqa-changelog' => true,
|
188 |
+
'index.php?page=dwqa-credits' => true,
|
189 |
);
|
190 |
|
191 |
//AJAXify screen options
|
230 |
add_action('deleted_user_meta', array($this, 'clear_user_role_cache'), 10, 2);
|
231 |
//There's also a "set_user_role" hook, but it's only called by WP_User::set_role and not WP_User::add_role.
|
232 |
//It's also redundant - WP_User::set_role updates user meta, so the above hooks already cover it.
|
233 |
+
|
234 |
+
add_action('admin_menu_editor-display_tabs', array($this, 'display_editor_tabs'));
|
235 |
+
|
236 |
+
//Modules
|
237 |
+
include dirname(__FILE__) . '/../modules/actor-selector/actor-selector.php';
|
238 |
+
new ameActorSelector($this);
|
239 |
+
|
240 |
+
$proModuleDirectory = AME_ROOT_DIR . '/extras/modules';
|
241 |
+
if ( @is_dir($proModuleDirectory) ) {
|
242 |
+
if ( is_file($proModuleDirectory . '/dashboard-widget-editor/load.php') ) {
|
243 |
+
require_once $proModuleDirectory . '/dashboard-widget-editor/load.php';
|
244 |
+
new ameWidgetEditor($this);
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
//Set up the tabs for the menu editor page.
|
249 |
+
$this->tabs = apply_filters('admin_menu_editor-tabs', array( 'editor' => 'Admin Menu', ));
|
250 |
+
//The "Settings" tab is always last.
|
251 |
+
$this->tabs['settings'] = 'Settings';
|
252 |
}
|
253 |
|
254 |
function init_finish() {
|
345 |
apply_filters('admin_menu_editor-self_menu_title', 'Menu Editor'),
|
346 |
apply_filters('admin_menu_editor-capability', 'manage_options'),
|
347 |
'menu_editor',
|
348 |
+
array($this, 'page_menu_editor')
|
349 |
);
|
350 |
//Output our JS & CSS on that page only
|
351 |
add_action("admin_print_scripts-$page", array($this, 'enqueue_scripts'), 1);
|
365 |
|
366 |
//Make a placeholder for our screen options (hacky)
|
367 |
add_meta_box("ws-ame-screen-options", "[AME placeholder]", '__return_false', $page);
|
368 |
+
|
369 |
+
//Determine the current menu editor page tab.
|
370 |
+
$this->current_tab = isset($this->get['sub_section']) ? strval($this->get['sub_section']) : 'editor';
|
371 |
}
|
372 |
|
373 |
//Store the "original" menus for later use in the editor
|
386 |
}
|
387 |
|
388 |
//Generate item templates from the default menu.
|
389 |
+
$templateBuilder = new ameMenuTemplateBuilder();
|
390 |
$this->item_templates = $templateBuilder->build(
|
391 |
$this->default_wp_menu,
|
392 |
$this->default_wp_submenu,
|
608 |
//jQuery Form plugin. This is a more recent version than the one included with WP.
|
609 |
wp_register_auto_versioned_script('ame-jquery-form', plugins_url('js/jquery.form.js', $this->plugin_file), array('jquery'));
|
610 |
//jQuery cookie plugin
|
611 |
+
wp_register_auto_versioned_script('jquery-cookie', plugins_url('js/jquery.biscuit.js', $this->plugin_file), array('jquery'));
|
612 |
|
613 |
//Lodash library
|
614 |
wp_register_auto_versioned_script('ame-lodash', plugins_url('js/lodash.min.js', $this->plugin_file));
|
615 |
|
616 |
+
//Actor manager.
|
617 |
+
wp_register_auto_versioned_script(
|
618 |
+
'ame-actor-manager',
|
619 |
+
plugins_url('js/actor-manager.js', $this->plugin_file),
|
620 |
+
array('ame-lodash')
|
621 |
+
);
|
622 |
+
|
623 |
//Modules
|
624 |
wp_register_auto_versioned_script(
|
625 |
'ame-access-editor',
|
635 |
'jquery', 'jquery-ui-sortable', 'jquery-ui-dialog', 'jquery-ui-tabs',
|
636 |
'ame-jquery-form', 'jquery-ui-droppable', 'jquery-qtip',
|
637 |
'jquery-sort', 'jquery-json', 'jquery-cookie',
|
638 |
+
'wp-color-picker', 'ame-lodash', 'ame-access-editor', 'ame-actor-manager',
|
639 |
+
'ame-actor-selector',
|
640 |
);
|
641 |
wp_register_auto_versioned_script(
|
642 |
'menu-editor',
|
644 |
apply_filters('admin_menu_editor-editor_script_dependencies', $editor_dependencies)
|
645 |
);
|
646 |
|
647 |
+
do_action('admin_menu_editor-enqueue_scripts-' . $this->current_tab);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
|
649 |
//Actors (roles and users) are used in the permissions UI, so we need to pass them along.
|
650 |
$actors = array();
|
690 |
//Compatibility workaround: Get the real roles of the current user even if other plugins corrupt the list.
|
691 |
$users[$current_user->get('user_login')]['roles'] = array_values($this->get_user_roles($current_user));
|
692 |
|
693 |
+
$actors['user:' . $current_user->get('user_login')] = sprintf(
|
694 |
+
'Current user (%s)',
|
695 |
+
$current_user->get('user_login')
|
696 |
+
);
|
697 |
|
698 |
+
$actor_data = array(
|
699 |
+
'roles' => $roles,
|
700 |
+
'users' => $users,
|
701 |
+
'isMultisite' => is_multisite(),
|
702 |
+
);
|
703 |
+
wp_localize_script('ame-actor-manager', 'wsAmeActorData', $actor_data);
|
704 |
+
|
705 |
+
//Add only certain scripts to the settings sub-section.
|
706 |
+
if ( $this->is_settings_page() ) {
|
707 |
+
wp_enqueue_script('jquery-qtip');
|
708 |
+
return;
|
709 |
+
}
|
710 |
+
|
711 |
+
//Add all scripts to our editor page, but not the settings sub-section
|
712 |
+
//that shares the same page slug. Some of the scripts would crash otherwise.
|
713 |
+
if ( !$this->is_editor_page() ) {
|
714 |
+
return;
|
715 |
+
}
|
716 |
+
|
717 |
+
wp_enqueue_script('menu-editor');
|
718 |
+
|
719 |
+
//We use WordPress media uploader to let the user upload custom menu icons (WP 3.5+).
|
720 |
+
if ( function_exists('wp_enqueue_media') ) {
|
721 |
+
wp_enqueue_media();
|
722 |
+
}
|
723 |
+
|
724 |
+
//Remove the default jQuery Form plugin to prevent conflicts with our custom version.
|
725 |
+
wp_dequeue_script('jquery-form');
|
726 |
|
727 |
$showExtraIcons = (boolean)$this->options['show_extra_icons'];
|
728 |
if ( isset($_COOKIE['ame-show-extra-icons']) && is_numeric($_COOKIE['ame-show-extra-icons']) ) {
|
758 |
'embeddedPageTemplateId' => ameMenuItem::embeddedPageTemplateId,
|
759 |
|
760 |
'actors' => $actors,
|
|
|
|
|
761 |
'currentUserLogin' => $current_user->get('user_login'),
|
762 |
'selectedActor' => isset($this->get['selected_actor']) ? strval($this->get['selected_actor']) : null,
|
|
|
763 |
|
764 |
'postTypes' => $this->get_post_type_details(),
|
765 |
'taxonomies' => $this->get_taxonomy_details(),
|
909 |
$scheme = $this->options['ui_colour_scheme'];
|
910 |
wp_enqueue_style('menu-editor-colours-' . $scheme);
|
911 |
wp_enqueue_style('wp-color-picker');
|
912 |
+
|
913 |
+
do_action('admin_menu_editor-enqueue_styles-' . $this->current_tab);
|
914 |
}
|
915 |
|
916 |
/**
|
1054 |
'defaults' => $unclickableDefaults,
|
1055 |
);
|
1056 |
|
1057 |
+
if ( $this->is_pro_version() ) {
|
1058 |
+
$templates[ameMenuItem::embeddedPageTemplateId] = array(
|
1059 |
+
'name' => '< Embed WP page >',
|
1060 |
+
'used' => true,
|
1061 |
+
'defaults' => array_merge(
|
1062 |
+
$itemDefaults,
|
1063 |
+
array(
|
1064 |
+
'file' => '#automatically-generated',
|
1065 |
+
'url' => '#automatically-generated',
|
1066 |
+
'menu_title' => 'Embedded Page',
|
1067 |
+
'page_heading' => ameMenuItem::embeddedPagePlaceholderHeading,
|
1068 |
+
)
|
1069 |
)
|
1070 |
+
);
|
|
|
1071 |
|
|
|
1072 |
//The Pro version has a [wp-logout-url] shortcode. Lets make it easier o use
|
1073 |
//by adding it to the "Target page" dropdown.
|
1074 |
$logoutDefaults = array_merge(
|
1233 |
$positions_by_template[$template_id] = ameMenuItem::get($entry, 'position', 0);
|
1234 |
|
1235 |
//Add the new entry to the menu tree
|
1236 |
+
if ( isset($template['defaults']['parent']) ) {
|
1237 |
+
if ( isset($tree[$template['defaults']['parent']]) ) {
|
1238 |
//Okay, insert the item.
|
1239 |
$tree[$template['defaults']['parent']]['items'][] = $entry;
|
1240 |
} else {
|
1248 |
|
1249 |
//Move orphaned items back to their original parents.
|
1250 |
foreach($orphans as $item) {
|
1251 |
+
$defaultParent = $item['defaults']['parent'];
|
1252 |
if ( isset($defaultParent) && isset($tree[$defaultParent]) ) {
|
1253 |
$tree[$defaultParent]['items'][] = $item;
|
1254 |
} else {
|
1489 |
* @return array Menu item in the internal format.
|
1490 |
*/
|
1491 |
private function prepare_for_output($item, $item_type = 'menu', $parent = array()) {
|
1492 |
+
$parent_file = isset($parent['file']) ? $parent['file'] : null;
|
1493 |
|
1494 |
// Special case : plugin pages that have been moved from a sub-menu to a different
|
1495 |
// menu or the top level. We'll need to adjust the file field to point to the correct URL.
|
1542 |
}
|
1543 |
}
|
1544 |
|
1545 |
+
//WPML support: Translate only custom titles. See further below.
|
1546 |
+
$hasCustomMenuTitle = isset($item['menu_title']);
|
1547 |
+
|
1548 |
//Apply defaults & filters
|
1549 |
$item = ameMenuItem::apply_defaults($item);
|
1550 |
$item = ameMenuItem::apply_filters($item, $item_type, $parent_file); //may cause side-effects
|
1582 |
|
1583 |
//Used later to determine the current page based on URL.
|
1584 |
if ( empty($item['url']) ) {
|
1585 |
+
$original_parent = isset($item['defaults']['parent']) ? $item['defaults']['parent'] : $parent_file;
|
1586 |
$item['url'] = ameMenuItem::generate_url($item['file'], $original_parent);
|
1587 |
}
|
1588 |
|
1601 |
}
|
1602 |
|
1603 |
//WPML support: Use translated menu titles where available.
|
1604 |
+
if ( !$item['separator'] && $hasCustomMenuTitle && function_exists('icl_t') ) {
|
1605 |
$item['menu_title'] = icl_t(
|
1606 |
self::WPML_CONTEXT,
|
1607 |
$this->get_wpml_name_for($item, 'menu_title'),
|
1725 |
}
|
1726 |
|
1727 |
$action = isset($this->post['action']) ? $this->post['action'] : (isset($this->get['action']) ? $this->get['action'] : '');
|
1728 |
+
do_action('admin_menu_editor-header', $action, $this->post);
|
1729 |
|
1730 |
if ( !empty($action) ) {
|
1731 |
$this->handle_form_submission($this->post, $action);
|
1743 |
}
|
1744 |
}
|
1745 |
|
1746 |
+
if ( $this->current_tab === 'settings' ) {
|
|
|
1747 |
$this->display_plugin_settings_ui();
|
1748 |
+
} else if ( $this->current_tab == 'generate-menu-dashicons' ) {
|
1749 |
require dirname(__FILE__) . '/generate-menu-dashicons.php';
|
1750 |
+
} else if ( $this->current_tab === 'editor' ) {
|
1751 |
$this->display_editor_ui();
|
1752 |
+
} else {
|
1753 |
+
do_action('admin_menu_editor-section-' . $this->current_tab);
|
1754 |
}
|
1755 |
+
|
1756 |
+
//Let the Pro version script output it's extra HTML & scripts.
|
1757 |
+
do_action('admin_menu_editor-footer');
|
1758 |
+
do_action('admin_menu_editor-footer-' . $this->current_tab, $action);
|
1759 |
}
|
1760 |
|
1761 |
private function handle_form_submission($post, $action = '') {
|
1801 |
//Save the custom menu
|
1802 |
$this->set_custom_menu($menu);
|
1803 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1804 |
//Redirect back to the editor and display the success message.
|
1805 |
//Also, automatically select the last selected actor (convenience feature).
|
1806 |
$query = array('message' => 1);
|
1964 |
require dirname(__FILE__) . '/editor-page.php';
|
1965 |
}
|
1966 |
|
1967 |
+
/**
|
1968 |
+
* Display the tabs for the settings page.
|
1969 |
+
*/
|
1970 |
+
public function display_editor_tabs() {
|
1971 |
+
echo '<h2 class="nav-tab-wrapper">';
|
1972 |
+
foreach($this->tabs as $slug => $title) {
|
1973 |
+
printf(
|
1974 |
+
'<a href="%s" id="%s" class="nav-tab%s">%s</a>',
|
1975 |
+
esc_attr(add_query_arg('sub_section', $slug, admin_url($this->settings_link))),
|
1976 |
+
esc_attr('ws_ame_' . $slug . '_tab'),
|
1977 |
+
$slug === $this->current_tab ? ' nav-tab-active' : '',
|
1978 |
+
$title
|
1979 |
+
);
|
1980 |
+
}
|
1981 |
+
echo '</h2>';
|
1982 |
+
echo '<div class="clear"></div>';
|
1983 |
+
}
|
1984 |
+
|
1985 |
/**
|
1986 |
* Display the plugin settings page.
|
1987 |
*/
|
2014 |
protected function is_editor_page() {
|
2015 |
return is_admin()
|
2016 |
&& isset($this->get['page']) && ($this->get['page'] == 'menu_editor')
|
2017 |
+
&& ($this->current_tab === 'editor');
|
2018 |
}
|
2019 |
|
2020 |
/**
|
2024 |
*/
|
2025 |
protected function is_settings_page() {
|
2026 |
return is_admin()
|
2027 |
+
&& ($this->current_tab === 'settings')
|
2028 |
&& isset($this->get['page']) && ($this->get['page'] == 'menu_editor');
|
2029 |
}
|
2030 |
|
2074 |
|
2075 |
if ( $item['template_id'] !== '' ) {
|
2076 |
$required_cap = ameMenuItem::get($item, 'access_level');
|
2077 |
+
|
2078 |
+
$required_cap = self::map_basic_meta_cap($required_cap);
|
2079 |
+
//Why not just call map_meta_cap? Because it needs a user ID and we may be working on a role.
|
2080 |
+
//Also, map_meta_cap is complex and filter-able, so it's hard to verify that it will work reliably
|
2081 |
+
//in a non-standard context.
|
2082 |
+
|
2083 |
foreach ($item['grant_access'] as $grant => $has_access) {
|
2084 |
if ( $has_access ) {
|
2085 |
if ( !isset($caps[$grant]) ) {
|
2110 |
return $array1;
|
2111 |
}
|
2112 |
|
2113 |
+
private static function map_basic_meta_cap($capability) {
|
2114 |
+
if ( $capability === 'customize' ) {
|
2115 |
+
return 'edit_theme_options';
|
2116 |
+
} elseif ( $capability === 'delete_site' ) {
|
2117 |
+
return 'manage_options';
|
2118 |
+
}
|
2119 |
+
return $capability;
|
2120 |
+
}
|
2121 |
+
|
2122 |
/**
|
2123 |
* Create a virtual 'super_admin' capability that only super admins have.
|
2124 |
* This function accomplishes that by by filtering 'user_has_cap' calls.
|
2331 |
return false;
|
2332 |
}
|
2333 |
|
2334 |
+
//Everybody has the "exist" cap.
|
2335 |
+
if ( $capability === 'exist' ) {
|
2336 |
+
return true;
|
2337 |
+
}
|
2338 |
+
|
2339 |
if ( $this->user_cap_cache_enabled && isset($this->cached_user_caps[$capability]) ) {
|
2340 |
return $this->cached_user_caps[$capability];
|
2341 |
}
|
2666 |
}
|
2667 |
}
|
2668 |
|
2669 |
+
/**
|
2670 |
+
* Get POST parameters for the current request.
|
2671 |
+
*
|
2672 |
+
* @return array
|
2673 |
+
*/
|
2674 |
+
public function get_post_params() {
|
2675 |
+
return $this->post;
|
2676 |
+
}
|
2677 |
+
|
2678 |
+
/**
|
2679 |
+
* Get query parameters for the current request.
|
2680 |
+
*
|
2681 |
+
* @return array
|
2682 |
+
*/
|
2683 |
+
public function get_query_params() {
|
2684 |
+
return $this->get;
|
2685 |
+
}
|
2686 |
+
|
2687 |
public function enqueue_helper_scripts() {
|
2688 |
wp_enqueue_script(
|
2689 |
'ame-helper-script',
|
2690 |
plugins_url('js/admin-helpers.js', $this->plugin_file),
|
2691 |
+
array('jquery', 'common'),
|
2692 |
+
'20160402'
|
2693 |
);
|
2694 |
|
2695 |
//The helper script needs to know the custom page heading (if any) to apply it.
|
2729 |
return null;
|
2730 |
}
|
2731 |
|
2732 |
+
/**
|
2733 |
+
* Update a plugin configuration value. Saves immediately.
|
2734 |
+
*
|
2735 |
+
* @param string $name
|
2736 |
+
* @param mixed $value
|
2737 |
+
*/
|
2738 |
+
public function set_plugin_option($name, $value) {
|
2739 |
+
$this->options[$name] = $value;
|
2740 |
+
$this->save_options();
|
2741 |
+
}
|
2742 |
|
2743 |
/**
|
2744 |
* Log a security-related message.
|
2810 |
|
2811 |
/**
|
2812 |
* Prepare WPML translation strings for all menu and page titles
|
2813 |
+
* in the specified menu. Includes only custom titles.
|
2814 |
*
|
2815 |
* @param array $custom_menu
|
2816 |
* @return array Associative array of strings that can be translated, indexed by unique name.
|
3271 |
*
|
3272 |
* @param array $wpItem
|
3273 |
* @param int $position
|
3274 |
+
* @param string|null $parent
|
3275 |
*/
|
3276 |
+
private function addItem($wpItem, $position, $parent = null) {
|
3277 |
$item = ameMenuItem::fromWpItem($wpItem, $position, $parent);
|
3278 |
|
3279 |
//Skip separators.
|
3288 |
}
|
3289 |
|
3290 |
$name = $this->sanitizeMenuTitle($item['menu_title']);
|
3291 |
+
if ( $parent === null ) {
|
3292 |
$this->parentNames[$item['file']] = $name;
|
3293 |
} else {
|
3294 |
$name = $this->parentNames[$parent] . ' -> ' . $name;
|
includes/menu-item.php
CHANGED
@@ -35,12 +35,12 @@ abstract class ameMenuItem {
|
|
35 |
*
|
36 |
* @param array $item An menu item.
|
37 |
* @param int $position The position (index) of the the menu item.
|
38 |
-
* @param string $parent The slug of the parent menu that owns this item.
|
39 |
* @return array
|
40 |
*/
|
41 |
-
public static function fromWpItem($item, $position = 0, $parent =
|
42 |
static $separator_count = 0;
|
43 |
-
$default_css_class =
|
44 |
$item = array(
|
45 |
'menu_title' => strval($item[0]),
|
46 |
'access_level' => strval($item[1]), //= required capability
|
@@ -58,8 +58,8 @@ abstract class ameMenuItem {
|
|
58 |
$item['access_level'] = $dummyUser->translate_level_to_cap($item['access_level']);
|
59 |
}
|
60 |
|
61 |
-
if (
|
62 |
-
$item['separator'] =
|
63 |
//WP 3.0 in multisite mode has two separators with the same filename. Fix by reindexing separators.
|
64 |
if ( $item['separator'] ) {
|
65 |
$item['file'] = 'separator_' . ($separator_count++);
|
@@ -70,10 +70,10 @@ abstract class ameMenuItem {
|
|
70 |
}
|
71 |
|
72 |
//Flag plugin pages
|
73 |
-
$item['is_plugin_page'] = (get_plugin_page_hook($item['file'], $parent) != null);
|
74 |
|
75 |
if ( !$item['separator'] ) {
|
76 |
-
$item['url'] = self::generate_url($item['file'], $parent);
|
77 |
}
|
78 |
|
79 |
$item['template_id'] = self::template_id($item, $parent);
|
@@ -96,7 +96,7 @@ abstract class ameMenuItem {
|
|
96 |
'file' => '',
|
97 |
'page_heading' => '',
|
98 |
'position' => 0,
|
99 |
-
'parent' =>
|
100 |
|
101 |
//Fields that apply only to top level menus.
|
102 |
'css_class' => 'menu-top',
|
@@ -204,12 +204,12 @@ abstract class ameMenuItem {
|
|
204 |
* in the same sub-menu, this combination is not necessarily unique.
|
205 |
*
|
206 |
* @param array|string $item The menu item in question.
|
207 |
-
* @param string $parent_file The parent menu. If omitted, $item['defaults']['parent'] will be used.
|
208 |
* @return string Template ID, or an empty string if this is a custom item.
|
209 |
*/
|
210 |
-
public static function template_id($item, $parent_file =
|
211 |
if (is_string($item)) {
|
212 |
-
return $parent_file . '>' . $item;
|
213 |
}
|
214 |
|
215 |
if ( self::get($item, 'custom') ) {
|
@@ -228,7 +228,7 @@ abstract class ameMenuItem {
|
|
228 |
$item_file = self::get($item, 'file');
|
229 |
}
|
230 |
|
231 |
-
if (
|
232 |
if ( isset($item['defaults']['parent']) ) {
|
233 |
$parent_file = $item['defaults']['parent'];
|
234 |
} else {
|
@@ -248,7 +248,19 @@ abstract class ameMenuItem {
|
|
248 |
$item_file = remove_query_arg('return', $item_file);
|
249 |
}
|
250 |
|
251 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
}
|
253 |
|
254 |
/**
|
35 |
*
|
36 |
* @param array $item An menu item.
|
37 |
* @param int $position The position (index) of the the menu item.
|
38 |
+
* @param string|null $parent The slug of the parent menu that owns this item. Null for top level menus.
|
39 |
* @return array
|
40 |
*/
|
41 |
+
public static function fromWpItem($item, $position = 0, $parent = null) {
|
42 |
static $separator_count = 0;
|
43 |
+
$default_css_class = ($parent === null) ? 'menu-top' : '';
|
44 |
$item = array(
|
45 |
'menu_title' => strval($item[0]),
|
46 |
'access_level' => strval($item[1]), //= required capability
|
58 |
$item['access_level'] = $dummyUser->translate_level_to_cap($item['access_level']);
|
59 |
}
|
60 |
|
61 |
+
if ( $parent === null ) {
|
62 |
+
$item['separator'] = (strpos($item['css_class'], 'wp-menu-separator') !== false);
|
63 |
//WP 3.0 in multisite mode has two separators with the same filename. Fix by reindexing separators.
|
64 |
if ( $item['separator'] ) {
|
65 |
$item['file'] = 'separator_' . ($separator_count++);
|
70 |
}
|
71 |
|
72 |
//Flag plugin pages
|
73 |
+
$item['is_plugin_page'] = (get_plugin_page_hook($item['file'], strval($parent)) != null);
|
74 |
|
75 |
if ( !$item['separator'] ) {
|
76 |
+
$item['url'] = self::generate_url($item['file'], strval($parent));
|
77 |
}
|
78 |
|
79 |
$item['template_id'] = self::template_id($item, $parent);
|
96 |
'file' => '',
|
97 |
'page_heading' => '',
|
98 |
'position' => 0,
|
99 |
+
'parent' => null,
|
100 |
|
101 |
//Fields that apply only to top level menus.
|
102 |
'css_class' => 'menu-top',
|
204 |
* in the same sub-menu, this combination is not necessarily unique.
|
205 |
*
|
206 |
* @param array|string $item The menu item in question.
|
207 |
+
* @param string|null $parent_file The parent menu. If omitted, $item['defaults']['parent'] will be used.
|
208 |
* @return string Template ID, or an empty string if this is a custom item.
|
209 |
*/
|
210 |
+
public static function template_id($item, $parent_file = null){
|
211 |
if (is_string($item)) {
|
212 |
+
return strval($parent_file) . '>' . $item;
|
213 |
}
|
214 |
|
215 |
if ( self::get($item, 'custom') ) {
|
228 |
$item_file = self::get($item, 'file');
|
229 |
}
|
230 |
|
231 |
+
if ( $parent_file === null ) {
|
232 |
if ( isset($item['defaults']['parent']) ) {
|
233 |
$parent_file = $item['defaults']['parent'];
|
234 |
} else {
|
248 |
$item_file = remove_query_arg('return', $item_file);
|
249 |
}
|
250 |
|
251 |
+
//Special case: A menu item can have an empty slug. This is technically very wrong, but it works (sort of)
|
252 |
+
//as long as the item has at least one submenu. This has happened at least once in practice. A user had
|
253 |
+
//a theme based on the Redux framework, and inexplicably the framework was configured to use an empty page slug.
|
254 |
+
if ( empty($item['separator']) ) {
|
255 |
+
if ( $item_file === '' ) {
|
256 |
+
$item_file = '[ame-no-slug]';
|
257 |
+
}
|
258 |
+
if ( $parent_file === '' ) {
|
259 |
+
$parent_file = '[ame-no-slug]';
|
260 |
+
}
|
261 |
+
}
|
262 |
+
|
263 |
+
return strval($parent_file) . '>' . $item_file;
|
264 |
}
|
265 |
|
266 |
/**
|
includes/menu.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
abstract class ameMenu {
|
3 |
const format_name = 'Admin Menu Editor menu';
|
4 |
-
const format_version = '6.
|
5 |
|
6 |
/**
|
7 |
* Load an admin menu from a JSON string.
|
1 |
<?php
|
2 |
abstract class ameMenu {
|
3 |
const format_name = 'Admin Menu Editor menu';
|
4 |
+
const format_version = '6.4';
|
5 |
|
6 |
/**
|
7 |
* Load an admin menu from a JSON string.
|
includes/reflection-callable.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class AmeReflectionCallable {
|
4 |
+
/**
|
5 |
+
* @var callable
|
6 |
+
*/
|
7 |
+
private $callback;
|
8 |
+
|
9 |
+
/**
|
10 |
+
* @var ReflectionFunctionAbstract
|
11 |
+
*/
|
12 |
+
private $reflection;
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* AmeReflectionCallable constructor.
|
17 |
+
*
|
18 |
+
* @param callable $callback
|
19 |
+
*/
|
20 |
+
public function __construct($callback) {
|
21 |
+
$this->callback = $callback;
|
22 |
+
$this->reflection = $this->getReflectionFunction($callback);
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* @param callable $callback
|
27 |
+
* @return ReflectionFunctionAbstract
|
28 |
+
*/
|
29 |
+
private function getReflectionFunction($callback) {
|
30 |
+
//Closure or a simple function name.
|
31 |
+
if ( $callback instanceof Closure || (is_string($callback) && strpos($callback, '::') === false) ) {
|
32 |
+
return new ReflectionFunction($callback);
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( is_string($callback) ) {
|
36 |
+
//ClassName::method
|
37 |
+
$callback = explode('::', $callback, 2);
|
38 |
+
} elseif ( is_object($callback) && method_exists($callback, '__invoke') ) {
|
39 |
+
//A callable object that has the magical __invoke method.
|
40 |
+
$callback = array($callback, '__invoke');
|
41 |
+
}
|
42 |
+
|
43 |
+
if (is_object($callback[0])) {
|
44 |
+
$reflectionObject = new ReflectionObject($callback[0]);
|
45 |
+
} else {
|
46 |
+
$reflectionObject = new ReflectionClass($callback[0]);
|
47 |
+
}
|
48 |
+
|
49 |
+
return $reflectionObject->getMethod($callback[1]);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Get the file name where the callable was defined.
|
54 |
+
*
|
55 |
+
* May return false for native PHP functions like 'strlen'.
|
56 |
+
*
|
57 |
+
* @return string|false
|
58 |
+
*/
|
59 |
+
public function getFileName() {
|
60 |
+
return $this->reflection->getFileName();
|
61 |
+
}
|
62 |
+
}
|
includes/settings-page.php
CHANGED
@@ -16,12 +16,12 @@ $isProVersion = apply_filters('admin_menu_editor_is_pro', false);
|
|
16 |
?>
|
17 |
|
18 |
<div class="wrap">
|
19 |
-
<<?php echo WPMenuEditor::$admin_heading_tag;
|
20 |
-
<?php echo apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'); ?>
|
21 |
-
<a href="<?php echo esc_attr($editor_page_url); ?>" class="add-new-h2"
|
22 |
-
title="Back to Admin Menu Editor">Editor</a>
|
23 |
</<?php echo WPMenuEditor::$admin_heading_tag; ?>>
|
24 |
|
|
|
|
|
25 |
<form method="post" action="<?php echo esc_attr($formActionUrl); ?>" id="ws_plugin_settings_form">
|
26 |
|
27 |
<table class="form-table">
|
16 |
?>
|
17 |
|
18 |
<div class="wrap">
|
19 |
+
<<?php echo WPMenuEditor::$admin_heading_tag; ?> id="ws_ame_editor_heading">
|
20 |
+
<?php echo apply_filters('admin_menu_editor-self_page_title', 'Menu Editor'); ?>
|
|
|
|
|
21 |
</<?php echo WPMenuEditor::$admin_heading_tag; ?>>
|
22 |
|
23 |
+
<?php do_action('admin_menu_editor-display_tabs'); ?>
|
24 |
+
|
25 |
<form method="post" action="<?php echo esc_attr($formActionUrl); ?>" id="ws_plugin_settings_form">
|
26 |
|
27 |
<table class="form-table">
|
includes/shadow_plugin_framework.php
CHANGED
@@ -6,13 +6,10 @@
|
|
6 |
*/
|
7 |
|
8 |
//Load JSON functions for PHP < 5.2
|
9 |
-
if ( !(function_exists('json_encode') && function_exists('json_decode')) && !
|
10 |
-
$class_json_path = ABSPATH.WPINC.'/class-json.php';
|
11 |
-
$class_moxiecode_json_path = ABSPATH.WPINC.'/js/tinymce/plugins/spellchecker/classes/utils/JSON.php';
|
12 |
if ( file_exists($class_json_path) ){
|
13 |
require $class_json_path;
|
14 |
-
} elseif ( file_exists($class_moxiecode_json_path) ) {
|
15 |
-
require $class_moxiecode_json_path;
|
16 |
}
|
17 |
}
|
18 |
|
@@ -150,14 +147,40 @@ class MenuEd_ShadowPluginFramework {
|
|
150 |
$stored_options = $this->json_encode($stored_options);
|
151 |
}
|
152 |
|
153 |
-
if ( $this->sitewide_options ) {
|
154 |
-
return
|
155 |
} else {
|
156 |
return update_option($this->option_name, $stored_options);
|
157 |
}
|
158 |
}
|
159 |
return false;
|
160 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
|
163 |
/**
|
@@ -175,9 +198,6 @@ class MenuEd_ShadowPluginFramework {
|
|
175 |
$flag = $assoc?SERVICES_JSON_LOOSE_TYPE:0;
|
176 |
$json = new Services_JSON($flag);
|
177 |
return( $json->decode($data) );
|
178 |
-
} elseif ( class_exists('Moxiecode_JSON') ){
|
179 |
-
$json = new Moxiecode_JSON();
|
180 |
-
return $json->decode($data);
|
181 |
} else {
|
182 |
trigger_error('No JSON parser available', E_USER_ERROR);
|
183 |
return null;
|
@@ -197,9 +217,6 @@ class MenuEd_ShadowPluginFramework {
|
|
197 |
if ( class_exists('Services_JSON') ){
|
198 |
$json = new Services_JSON();
|
199 |
return( $json->encodeUnsafe($data) );
|
200 |
-
} elseif ( class_exists('Moxiecode_JSON') ){
|
201 |
-
$json = new Moxiecode_JSON();
|
202 |
-
return $json->encode($data);
|
203 |
} else {
|
204 |
trigger_error('No JSON parser available', E_USER_ERROR);
|
205 |
return '';
|
6 |
*/
|
7 |
|
8 |
//Load JSON functions for PHP < 5.2
|
9 |
+
if ( !(function_exists('json_encode') && function_exists('json_decode')) && !class_exists('Services_JSON') ){
|
10 |
+
$class_json_path = ABSPATH . WPINC . '/class-json.php';
|
|
|
11 |
if ( file_exists($class_json_path) ){
|
12 |
require $class_json_path;
|
|
|
|
|
13 |
}
|
14 |
}
|
15 |
|
147 |
$stored_options = $this->json_encode($stored_options);
|
148 |
}
|
149 |
|
150 |
+
if ( $this->sitewide_options && is_multisite() ) {
|
151 |
+
return self::atomic_update_site_option($this->option_name, $stored_options);
|
152 |
} else {
|
153 |
return update_option($this->option_name, $stored_options);
|
154 |
}
|
155 |
}
|
156 |
return false;
|
157 |
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Like update_site_option, but simulates record locking by using the MySQL GET_LOCK() function.
|
161 |
+
*
|
162 |
+
* The goal is to reduce the risk of triggering a race condition in update_site_option.
|
163 |
+
* It would be better to use real transactions, but many (most?) WordPress sites use storage engines
|
164 |
+
* that don't support transactions, like MyISAM.
|
165 |
+
*
|
166 |
+
* @param string $option_name
|
167 |
+
* @param mixed $data
|
168 |
+
* @return bool
|
169 |
+
*/
|
170 |
+
public static function atomic_update_site_option($option_name, $data) {
|
171 |
+
global $wpdb; /** @var wpdb $wpdb */
|
172 |
+
$lock = 'ame.' . (is_multisite() ? $wpdb->sitemeta : $wpdb->options ) . '.' . $option_name;
|
173 |
+
|
174 |
+
//Lock. Note that we're being really optimistic and not checking the return value.
|
175 |
+
$wpdb->query($wpdb->prepare("SELECT GET_LOCK(%s, %d)", $lock, 5));
|
176 |
+
//Update.
|
177 |
+
$updated = update_site_option($option_name, $data);
|
178 |
+
//Unlock.
|
179 |
+
$wpdb->query($wpdb->prepare('SELECT RELEASE_LOCK(%s)', $lock));
|
180 |
+
|
181 |
+
return $updated;
|
182 |
+
|
183 |
+
}
|
184 |
|
185 |
|
186 |
/**
|
198 |
$flag = $assoc?SERVICES_JSON_LOOSE_TYPE:0;
|
199 |
$json = new Services_JSON($flag);
|
200 |
return( $json->decode($data) );
|
|
|
|
|
|
|
201 |
} else {
|
202 |
trigger_error('No JSON parser available', E_USER_ERROR);
|
203 |
return null;
|
217 |
if ( class_exists('Services_JSON') ){
|
218 |
$json = new Services_JSON();
|
219 |
return( $json->encodeUnsafe($data) );
|
|
|
|
|
|
|
220 |
} else {
|
221 |
trigger_error('No JSON parser available', E_USER_ERROR);
|
222 |
return '';
|
js/actor-manager.js
ADDED
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/// <reference path="lodash-3.10.d.ts" />
|
2 |
+
/// <reference path="common.d.ts" />
|
3 |
+
var __extends = (this && this.__extends) || function (d, b) {
|
4 |
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
5 |
+
function __() { this.constructor = d; }
|
6 |
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
7 |
+
};
|
8 |
+
var AmeBaseActor = (function () {
|
9 |
+
function AmeBaseActor(id, displayName, capabilities) {
|
10 |
+
this.displayName = '[Error: No displayName set]';
|
11 |
+
this.groupActors = [];
|
12 |
+
this.actorTypeSpecificity = 0;
|
13 |
+
this.id = id;
|
14 |
+
this.displayName = displayName;
|
15 |
+
this.capabilities = capabilities;
|
16 |
+
}
|
17 |
+
/**
|
18 |
+
* Get the capability setting directly from this actor, ignoring capabilities
|
19 |
+
* granted by roles, the Super Admin flag, or the grantedCapabilities feature.
|
20 |
+
*
|
21 |
+
* Returns NULL for capabilities that are neither explicitly granted nor denied.
|
22 |
+
*
|
23 |
+
* @param {string} capability
|
24 |
+
* @returns {boolean|null}
|
25 |
+
*/
|
26 |
+
AmeBaseActor.prototype.hasOwnCap = function (capability) {
|
27 |
+
if (this.capabilities.hasOwnProperty(capability)) {
|
28 |
+
return this.capabilities[capability];
|
29 |
+
}
|
30 |
+
return null;
|
31 |
+
};
|
32 |
+
AmeBaseActor.getActorSpecificity = function (actorId) {
|
33 |
+
var actorType = actorId.substring(0, actorId.indexOf(':')), specificity = 0;
|
34 |
+
switch (actorType) {
|
35 |
+
case 'role':
|
36 |
+
specificity = 1;
|
37 |
+
break;
|
38 |
+
case 'special':
|
39 |
+
specificity = 2;
|
40 |
+
break;
|
41 |
+
case 'user':
|
42 |
+
specificity = 10;
|
43 |
+
break;
|
44 |
+
default:
|
45 |
+
specificity = 0;
|
46 |
+
}
|
47 |
+
return specificity;
|
48 |
+
};
|
49 |
+
return AmeBaseActor;
|
50 |
+
}());
|
51 |
+
var AmeRole = (function (_super) {
|
52 |
+
__extends(AmeRole, _super);
|
53 |
+
function AmeRole(roleId, displayName, capabilities) {
|
54 |
+
_super.call(this, 'role:' + roleId, displayName, capabilities);
|
55 |
+
this.actorTypeSpecificity = 1;
|
56 |
+
this.name = roleId;
|
57 |
+
}
|
58 |
+
return AmeRole;
|
59 |
+
}(AmeBaseActor));
|
60 |
+
var AmeUser = (function (_super) {
|
61 |
+
__extends(AmeUser, _super);
|
62 |
+
function AmeUser(userLogin, displayName, capabilities, roles, isSuperAdmin) {
|
63 |
+
if (isSuperAdmin === void 0) { isSuperAdmin = false; }
|
64 |
+
_super.call(this, 'user:' + userLogin, displayName, capabilities);
|
65 |
+
this.isSuperAdmin = false;
|
66 |
+
this.actorTypeSpecificity = 10;
|
67 |
+
this.userLogin = userLogin;
|
68 |
+
this.roles = roles;
|
69 |
+
this.isSuperAdmin = isSuperAdmin;
|
70 |
+
if (this.isSuperAdmin) {
|
71 |
+
this.groupActors.push(AmeSuperAdmin.permanentActorId);
|
72 |
+
}
|
73 |
+
for (var i = 0; i < this.roles.length; i++) {
|
74 |
+
this.groupActors.push('role:' + this.roles[i]);
|
75 |
+
}
|
76 |
+
}
|
77 |
+
return AmeUser;
|
78 |
+
}(AmeBaseActor));
|
79 |
+
var AmeSuperAdmin = (function (_super) {
|
80 |
+
__extends(AmeSuperAdmin, _super);
|
81 |
+
function AmeSuperAdmin() {
|
82 |
+
_super.call(this, AmeSuperAdmin.permanentActorId, 'Super Admin', {});
|
83 |
+
this.actorTypeSpecificity = 2;
|
84 |
+
}
|
85 |
+
AmeSuperAdmin.prototype.hasOwnCap = function (capability) {
|
86 |
+
//The Super Admin has all possible capabilities except the special "do_not_allow" flag.
|
87 |
+
return (capability !== 'do_not_allow');
|
88 |
+
};
|
89 |
+
AmeSuperAdmin.permanentActorId = 'special:super_admin';
|
90 |
+
return AmeSuperAdmin;
|
91 |
+
}(AmeBaseActor));
|
92 |
+
var AmeActorManager = (function () {
|
93 |
+
function AmeActorManager(roles, users, isMultisite) {
|
94 |
+
var _this = this;
|
95 |
+
if (isMultisite === void 0) { isMultisite = false; }
|
96 |
+
this.roles = {};
|
97 |
+
this.users = {};
|
98 |
+
this.grantedCapabilities = {};
|
99 |
+
this.isMultisite = false;
|
100 |
+
this.isMultisite = !!isMultisite;
|
101 |
+
AmeActorManager._.forEach(roles, function (roleDetails, id) {
|
102 |
+
var role = new AmeRole(id, roleDetails.name, roleDetails.capabilities);
|
103 |
+
_this.roles[role.name] = role;
|
104 |
+
});
|
105 |
+
AmeActorManager._.forEach(users, function (userDetails) {
|
106 |
+
var user = new AmeUser(userDetails.user_login, userDetails.display_name, userDetails.capabilities, userDetails.roles, userDetails.is_super_admin);
|
107 |
+
_this.users[user.userLogin] = user;
|
108 |
+
});
|
109 |
+
if (this.isMultisite) {
|
110 |
+
this.superAdmin = new AmeSuperAdmin();
|
111 |
+
}
|
112 |
+
}
|
113 |
+
AmeActorManager.prototype.actorCanAccess = function (actorId, grantAccess, defaultCapability) {
|
114 |
+
if (defaultCapability === void 0) { defaultCapability = null; }
|
115 |
+
if (grantAccess.hasOwnProperty(actorId)) {
|
116 |
+
return grantAccess[actorId];
|
117 |
+
}
|
118 |
+
if (defaultCapability !== null) {
|
119 |
+
return this.hasCap(actorId, defaultCapability, grantAccess);
|
120 |
+
}
|
121 |
+
return true;
|
122 |
+
};
|
123 |
+
AmeActorManager.prototype.getActor = function (actorId) {
|
124 |
+
if (actorId === AmeSuperAdmin.permanentActorId) {
|
125 |
+
return this.superAdmin;
|
126 |
+
}
|
127 |
+
var separator = actorId.indexOf(':'), actorType = actorId.substring(0, separator), actorKey = actorId.substring(separator + 1);
|
128 |
+
if (actorType === 'role') {
|
129 |
+
return this.roles.hasOwnProperty(actorKey) ? this.roles[actorKey] : null;
|
130 |
+
}
|
131 |
+
else if (actorType === 'user') {
|
132 |
+
return this.users.hasOwnProperty(actorKey) ? this.users[actorKey] : null;
|
133 |
+
}
|
134 |
+
throw {
|
135 |
+
name: 'InvalidActorException',
|
136 |
+
message: "There is no actor with that ID, or the ID is invalid.",
|
137 |
+
value: actorId
|
138 |
+
};
|
139 |
+
};
|
140 |
+
AmeActorManager.prototype.actorExists = function (actorId) {
|
141 |
+
try {
|
142 |
+
return (this.getActor(actorId) !== null);
|
143 |
+
}
|
144 |
+
catch (exception) {
|
145 |
+
if (exception.hasOwnProperty('name') && (exception.name === 'InvalidActorException')) {
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
else {
|
149 |
+
throw exception;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
};
|
153 |
+
AmeActorManager.prototype.hasCap = function (actorId, capability, context) {
|
154 |
+
context = context || {};
|
155 |
+
return this.actorHasCap(actorId, capability, [context, this.grantedCapabilities]);
|
156 |
+
};
|
157 |
+
AmeActorManager.prototype.hasCapByDefault = function (actorId, capability) {
|
158 |
+
return this.actorHasCap(actorId, capability);
|
159 |
+
};
|
160 |
+
AmeActorManager.prototype.actorHasCap = function (actorId, capability, contextList) {
|
161 |
+
//It's like the chain-of-responsibility pattern.
|
162 |
+
//Everybody has the "exist" cap and it can't be removed or overridden by plugins.
|
163 |
+
if (capability === 'exist') {
|
164 |
+
return true;
|
165 |
+
}
|
166 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
167 |
+
//Step #1: Check temporary context - unsaved caps, etc. Optional.
|
168 |
+
//Step #2: Check granted capabilities. Default on, but can be skipped.
|
169 |
+
if (contextList) {
|
170 |
+
//Check for explicit settings first.
|
171 |
+
var result = null, actorValue, len = contextList.length;
|
172 |
+
for (var i = 0; i < len; i++) {
|
173 |
+
if (contextList[i].hasOwnProperty(actorId)) {
|
174 |
+
actorValue = contextList[i][actorId];
|
175 |
+
if (typeof actorValue === 'boolean') {
|
176 |
+
//Context: grant_access[actorId] = boolean. Necessary because enabling a menu item for a role
|
177 |
+
//should also enable it for all users who have that role (unless explicitly disabled for a user).
|
178 |
+
return actorValue;
|
179 |
+
}
|
180 |
+
else if (actorValue.hasOwnProperty(capability)) {
|
181 |
+
//Context: grantedCapabilities[actor][capability] = boolean|[boolean, ...]
|
182 |
+
result = actorValue[capability];
|
183 |
+
return (typeof result === 'boolean') ? result : result[0];
|
184 |
+
}
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
//Step #3: Check owned/default capabilities. Always checked.
|
189 |
+
var actor = this.getActor(actorId), hasOwnCap = actor.hasOwnCap(capability);
|
190 |
+
if (hasOwnCap !== null) {
|
191 |
+
return hasOwnCap;
|
192 |
+
}
|
193 |
+
//Step #4: Users can get a capability through their roles or the "super admin" flag.
|
194 |
+
//Only users can have inherited capabilities, so if this actor is not a user, we're done.
|
195 |
+
if (actor instanceof AmeUser) {
|
196 |
+
//Note that Super Admin has priority. If the user is a super admin, their roles are ignored.
|
197 |
+
if (actor.isSuperAdmin) {
|
198 |
+
return this.actorHasCap('special:super_admin', capability, contextList);
|
199 |
+
}
|
200 |
+
//Check if any of the user's roles have the capability.
|
201 |
+
result = false;
|
202 |
+
for (var index = 0; index < actor.roles.length; index++) {
|
203 |
+
result = result || this.actorHasCap('role:' + actor.roles[index], capability, contextList);
|
204 |
+
}
|
205 |
+
return result;
|
206 |
+
}
|
207 |
+
return false;
|
208 |
+
};
|
209 |
+
AmeActorManager.mapMetaCap = function (capability) {
|
210 |
+
if (capability === 'customize') {
|
211 |
+
return 'edit_theme_options';
|
212 |
+
}
|
213 |
+
else if (capability === 'delete_site') {
|
214 |
+
return 'manage_options';
|
215 |
+
}
|
216 |
+
return capability;
|
217 |
+
};
|
218 |
+
/* -------------------------------
|
219 |
+
* Roles
|
220 |
+
* ------------------------------- */
|
221 |
+
AmeActorManager.prototype.getRoles = function () {
|
222 |
+
return this.roles;
|
223 |
+
};
|
224 |
+
AmeActorManager.prototype.roleExists = function (roleId) {
|
225 |
+
return this.roles.hasOwnProperty(roleId);
|
226 |
+
};
|
227 |
+
;
|
228 |
+
AmeActorManager.prototype.getSuperAdmin = function () {
|
229 |
+
return this.superAdmin;
|
230 |
+
};
|
231 |
+
/* -------------------------------
|
232 |
+
* Users
|
233 |
+
* ------------------------------- */
|
234 |
+
AmeActorManager.prototype.getUsers = function () {
|
235 |
+
return this.users;
|
236 |
+
};
|
237 |
+
AmeActorManager.prototype.getUser = function (login) {
|
238 |
+
return this.users.hasOwnProperty(login) ? this.users[login] : null;
|
239 |
+
};
|
240 |
+
AmeActorManager.prototype.addUsers = function (newUsers) {
|
241 |
+
var _this = this;
|
242 |
+
AmeActorManager._.forEach(newUsers, function (user) {
|
243 |
+
_this.users[user.userLogin] = user;
|
244 |
+
});
|
245 |
+
};
|
246 |
+
AmeActorManager.prototype.getGroupActorsFor = function (userLogin) {
|
247 |
+
return this.users[userLogin].groupActors;
|
248 |
+
};
|
249 |
+
/* -------------------------------
|
250 |
+
* Granted capability manipulation
|
251 |
+
* ------------------------------- */
|
252 |
+
AmeActorManager.prototype.setGrantedCapabilities = function (newGrants) {
|
253 |
+
this.grantedCapabilities = AmeActorManager._.cloneDeep(newGrants);
|
254 |
+
};
|
255 |
+
AmeActorManager.prototype.getGrantedCapabilities = function () {
|
256 |
+
return this.grantedCapabilities;
|
257 |
+
};
|
258 |
+
/**
|
259 |
+
* Grant or deny a capability to an actor.
|
260 |
+
*/
|
261 |
+
AmeActorManager.prototype.setCap = function (actor, capability, hasCap, sourceType, sourceName) {
|
262 |
+
AmeActorManager.setCapInContext(this.grantedCapabilities, actor, capability, hasCap, sourceType, sourceName);
|
263 |
+
};
|
264 |
+
AmeActorManager.setCapInContext = function (context, actor, capability, hasCap, sourceType, sourceName) {
|
265 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
266 |
+
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
267 |
+
_.set(context, [actor, capability], grant);
|
268 |
+
};
|
269 |
+
AmeActorManager.prototype.resetCap = function (actor, capability) {
|
270 |
+
AmeActorManager.resetCapInContext(this.grantedCapabilities, actor, capability);
|
271 |
+
};
|
272 |
+
AmeActorManager.resetCapInContext = function (context, actor, capability) {
|
273 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
274 |
+
if (_.has(context, [actor, capability])) {
|
275 |
+
delete context[actor][capability];
|
276 |
+
}
|
277 |
+
};
|
278 |
+
/**
|
279 |
+
* Remove redundant granted capabilities.
|
280 |
+
*
|
281 |
+
* For example, if user "jane" has been granted the "edit_posts" capability both directly and via the Editor role,
|
282 |
+
* the direct grant is redundant. We can remove it. Jane will still have "edit_posts" because she's an editor.
|
283 |
+
*/
|
284 |
+
AmeActorManager.prototype.pruneGrantedUserCapabilities = function () {
|
285 |
+
var _this = this;
|
286 |
+
var _ = AmeActorManager._, pruned = _.cloneDeep(this.grantedCapabilities), context = [pruned];
|
287 |
+
var actorKeys = _(pruned).keys().filter(function (actorId) {
|
288 |
+
//Skip users that are not loaded.
|
289 |
+
var actor = _this.getActor(actorId);
|
290 |
+
if (actor === null) {
|
291 |
+
return false;
|
292 |
+
}
|
293 |
+
return (actor instanceof AmeUser);
|
294 |
+
}).value();
|
295 |
+
_.forEach(actorKeys, function (actor) {
|
296 |
+
_.forEach(_.keys(pruned[actor]), function (capability) {
|
297 |
+
var grant = pruned[actor][capability];
|
298 |
+
delete pruned[actor][capability];
|
299 |
+
var hasCap = _.isArray(grant) ? grant[0] : grant, hasCapWhenPruned = _this.actorHasCap(actor, capability, context);
|
300 |
+
if (hasCap !== hasCapWhenPruned) {
|
301 |
+
pruned[actor][capability] = grant; //Restore.
|
302 |
+
}
|
303 |
+
});
|
304 |
+
});
|
305 |
+
this.setGrantedCapabilities(pruned);
|
306 |
+
return pruned;
|
307 |
+
};
|
308 |
+
;
|
309 |
+
/**
|
310 |
+
* Compare the specificity of two actors.
|
311 |
+
*
|
312 |
+
* Returns 1 if the first actor is more specific than the second, 0 if they're both
|
313 |
+
* equally specific, and -1 if the second actor is more specific.
|
314 |
+
*
|
315 |
+
* @return {Number}
|
316 |
+
*/
|
317 |
+
AmeActorManager.compareActorSpecificity = function (actor1, actor2) {
|
318 |
+
var delta = AmeBaseActor.getActorSpecificity(actor1) - AmeBaseActor.getActorSpecificity(actor2);
|
319 |
+
if (delta !== 0) {
|
320 |
+
delta = (delta > 0) ? 1 : -1;
|
321 |
+
}
|
322 |
+
return delta;
|
323 |
+
};
|
324 |
+
;
|
325 |
+
AmeActorManager._ = wsAmeLodash;
|
326 |
+
return AmeActorManager;
|
327 |
+
}());
|
328 |
+
if (typeof wsAmeActorData !== 'undefined') {
|
329 |
+
AmeActors = new AmeActorManager(wsAmeActorData.roles, wsAmeActorData.users, wsAmeActorData.isMultisite);
|
330 |
+
}
|
331 |
+
//# sourceMappingURL=actor-manager.js.map
|
js/actor-manager.ts
ADDED
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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<reference path="lodash-3.10.d.ts" />
|
2 |
+
/// <reference path="common.d.ts" />
|
3 |
+
|
4 |
+
declare var wsAmeActorData: any;
|
5 |
+
declare var wsAmeLodash: _.LoDashStatic;
|
6 |
+
declare var AmeActors: AmeActorManager;
|
7 |
+
|
8 |
+
interface CapabilityMap {
|
9 |
+
[capabilityName: string] : boolean;
|
10 |
+
}
|
11 |
+
|
12 |
+
abstract class AmeBaseActor {
|
13 |
+
public id: string;
|
14 |
+
public displayName: string = '[Error: No displayName set]';
|
15 |
+
public capabilities: CapabilityMap;
|
16 |
+
|
17 |
+
groupActors: string[] = [];
|
18 |
+
|
19 |
+
protected actorTypeSpecificity: Number = 0;
|
20 |
+
|
21 |
+
constructor(id: string, displayName: string, capabilities: CapabilityMap) {
|
22 |
+
this.id = id;
|
23 |
+
this.displayName = displayName;
|
24 |
+
this.capabilities = capabilities;
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Get the capability setting directly from this actor, ignoring capabilities
|
29 |
+
* granted by roles, the Super Admin flag, or the grantedCapabilities feature.
|
30 |
+
*
|
31 |
+
* Returns NULL for capabilities that are neither explicitly granted nor denied.
|
32 |
+
*
|
33 |
+
* @param {string} capability
|
34 |
+
* @returns {boolean|null}
|
35 |
+
*/
|
36 |
+
hasOwnCap(capability: string): boolean {
|
37 |
+
if (this.capabilities.hasOwnProperty(capability)) {
|
38 |
+
return this.capabilities[capability];
|
39 |
+
}
|
40 |
+
return null;
|
41 |
+
}
|
42 |
+
|
43 |
+
static getActorSpecificity(actorId: string) {
|
44 |
+
var actorType = actorId.substring(0, actorId.indexOf(':')),
|
45 |
+
specificity = 0;
|
46 |
+
switch (actorType) {
|
47 |
+
case 'role':
|
48 |
+
specificity = 1;
|
49 |
+
break;
|
50 |
+
case 'special':
|
51 |
+
specificity = 2;
|
52 |
+
break;
|
53 |
+
case 'user':
|
54 |
+
specificity = 10;
|
55 |
+
break;
|
56 |
+
default:
|
57 |
+
specificity = 0;
|
58 |
+
}
|
59 |
+
return specificity;
|
60 |
+
}
|
61 |
+
}
|
62 |
+
|
63 |
+
class AmeRole extends AmeBaseActor {
|
64 |
+
name: string;
|
65 |
+
protected actorTypeSpecificity = 1;
|
66 |
+
|
67 |
+
constructor(roleId: string, displayName: string, capabilities: CapabilityMap) {
|
68 |
+
super('role:' + roleId, displayName, capabilities);
|
69 |
+
this.name = roleId;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
class AmeUser extends AmeBaseActor {
|
74 |
+
userLogin: string;
|
75 |
+
roles: string[];
|
76 |
+
isSuperAdmin: boolean = false;
|
77 |
+
groupActors: string[];
|
78 |
+
|
79 |
+
protected actorTypeSpecificity = 10;
|
80 |
+
|
81 |
+
constructor(
|
82 |
+
userLogin: string,
|
83 |
+
displayName: string,
|
84 |
+
capabilities: CapabilityMap,
|
85 |
+
roles: string[],
|
86 |
+
isSuperAdmin: boolean = false
|
87 |
+
) {
|
88 |
+
super('user:' + userLogin, displayName, capabilities);
|
89 |
+
|
90 |
+
this.userLogin = userLogin;
|
91 |
+
this.roles = roles;
|
92 |
+
this.isSuperAdmin = isSuperAdmin;
|
93 |
+
|
94 |
+
if (this.isSuperAdmin) {
|
95 |
+
this.groupActors.push(AmeSuperAdmin.permanentActorId);
|
96 |
+
}
|
97 |
+
for (var i = 0; i < this.roles.length; i++) {
|
98 |
+
this.groupActors.push('role:' + this.roles[i]);
|
99 |
+
}
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
class AmeSuperAdmin extends AmeBaseActor {
|
104 |
+
static permanentActorId = 'special:super_admin';
|
105 |
+
protected actorTypeSpecificity = 2;
|
106 |
+
|
107 |
+
constructor() {
|
108 |
+
super(AmeSuperAdmin.permanentActorId, 'Super Admin', {});
|
109 |
+
}
|
110 |
+
|
111 |
+
hasOwnCap(capability: string): boolean {
|
112 |
+
//The Super Admin has all possible capabilities except the special "do_not_allow" flag.
|
113 |
+
return (capability !== 'do_not_allow');
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
interface AmeGrantedCapabilityMap {
|
118 |
+
[actorId: string]: {
|
119 |
+
[capability: string] : any
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
class AmeActorManager {
|
124 |
+
private static _ = wsAmeLodash;
|
125 |
+
|
126 |
+
private roles: {[roleId: string] : AmeRole} = {};
|
127 |
+
private users: {[userLogin: string] : AmeUser} = {};
|
128 |
+
private grantedCapabilities: AmeGrantedCapabilityMap = {};
|
129 |
+
|
130 |
+
private isMultisite: boolean = false;
|
131 |
+
private superAdmin: AmeSuperAdmin;
|
132 |
+
|
133 |
+
constructor(roles, users, isMultisite: boolean = false) {
|
134 |
+
this.isMultisite = !!isMultisite;
|
135 |
+
|
136 |
+
AmeActorManager._.forEach(roles, (roleDetails, id) => {
|
137 |
+
var role = new AmeRole(id, roleDetails.name, roleDetails.capabilities);
|
138 |
+
this.roles[role.name] = role;
|
139 |
+
});
|
140 |
+
|
141 |
+
AmeActorManager._.forEach(users, (userDetails) => {
|
142 |
+
var user = new AmeUser(
|
143 |
+
userDetails.user_login,
|
144 |
+
userDetails.display_name,
|
145 |
+
userDetails.capabilities,
|
146 |
+
userDetails.roles,
|
147 |
+
userDetails.is_super_admin
|
148 |
+
);
|
149 |
+
this.users[user.userLogin] = user;
|
150 |
+
});
|
151 |
+
|
152 |
+
if (this.isMultisite) {
|
153 |
+
this.superAdmin = new AmeSuperAdmin();
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
actorCanAccess(
|
158 |
+
actorId: string,
|
159 |
+
grantAccess: {[actorId: string] : boolean},
|
160 |
+
defaultCapability: string = null
|
161 |
+
): boolean {
|
162 |
+
if (grantAccess.hasOwnProperty(actorId)) {
|
163 |
+
return grantAccess[actorId];
|
164 |
+
}
|
165 |
+
if (defaultCapability !== null) {
|
166 |
+
return this.hasCap(actorId, defaultCapability, grantAccess);
|
167 |
+
}
|
168 |
+
return true;
|
169 |
+
}
|
170 |
+
|
171 |
+
getActor(actorId): AmeBaseActor {
|
172 |
+
if (actorId === AmeSuperAdmin.permanentActorId) {
|
173 |
+
return this.superAdmin;
|
174 |
+
}
|
175 |
+
|
176 |
+
var separator = actorId.indexOf(':'),
|
177 |
+
actorType = actorId.substring(0, separator),
|
178 |
+
actorKey = actorId.substring(separator + 1);
|
179 |
+
|
180 |
+
if (actorType === 'role') {
|
181 |
+
return this.roles.hasOwnProperty(actorKey) ? this.roles[actorKey] : null;
|
182 |
+
} else if (actorType === 'user') {
|
183 |
+
return this.users.hasOwnProperty(actorKey) ? this.users[actorKey] : null;
|
184 |
+
}
|
185 |
+
|
186 |
+
throw {
|
187 |
+
name: 'InvalidActorException',
|
188 |
+
message: "There is no actor with that ID, or the ID is invalid.",
|
189 |
+
value: actorId
|
190 |
+
};
|
191 |
+
}
|
192 |
+
|
193 |
+
actorExists(actorId: string): boolean {
|
194 |
+
try {
|
195 |
+
return (this.getActor(actorId) !== null);
|
196 |
+
} catch (exception) {
|
197 |
+
if (exception.hasOwnProperty('name') && (exception.name === 'InvalidActorException')) {
|
198 |
+
return false;
|
199 |
+
} else {
|
200 |
+
throw exception;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
hasCap(actorId, capability, context?: {[actor: string] : any}): boolean {
|
206 |
+
context = context || {};
|
207 |
+
return this.actorHasCap(actorId, capability, [context, this.grantedCapabilities]);
|
208 |
+
}
|
209 |
+
|
210 |
+
hasCapByDefault(actorId, capability) {
|
211 |
+
return this.actorHasCap(actorId, capability);
|
212 |
+
}
|
213 |
+
|
214 |
+
private actorHasCap(actorId: string, capability: string, contextList?: Array<Object>): boolean {
|
215 |
+
//It's like the chain-of-responsibility pattern.
|
216 |
+
|
217 |
+
//Everybody has the "exist" cap and it can't be removed or overridden by plugins.
|
218 |
+
if (capability === 'exist') {
|
219 |
+
return true;
|
220 |
+
}
|
221 |
+
|
222 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
223 |
+
|
224 |
+
//Step #1: Check temporary context - unsaved caps, etc. Optional.
|
225 |
+
//Step #2: Check granted capabilities. Default on, but can be skipped.
|
226 |
+
if (contextList) {
|
227 |
+
//Check for explicit settings first.
|
228 |
+
var result = null, actorValue, len = contextList.length;
|
229 |
+
for (var i = 0; i < len; i++) {
|
230 |
+
if (contextList[i].hasOwnProperty(actorId)) {
|
231 |
+
actorValue = contextList[i][actorId];
|
232 |
+
if (typeof actorValue === 'boolean') {
|
233 |
+
//Context: grant_access[actorId] = boolean. Necessary because enabling a menu item for a role
|
234 |
+
//should also enable it for all users who have that role (unless explicitly disabled for a user).
|
235 |
+
return actorValue;
|
236 |
+
} else if (actorValue.hasOwnProperty(capability)) {
|
237 |
+
//Context: grantedCapabilities[actor][capability] = boolean|[boolean, ...]
|
238 |
+
result = actorValue[capability];
|
239 |
+
return (typeof result === 'boolean') ? result : result[0];
|
240 |
+
}
|
241 |
+
}
|
242 |
+
}
|
243 |
+
}
|
244 |
+
|
245 |
+
//Step #3: Check owned/default capabilities. Always checked.
|
246 |
+
var actor = this.getActor(actorId),
|
247 |
+
hasOwnCap = actor.hasOwnCap(capability);
|
248 |
+
if (hasOwnCap !== null) {
|
249 |
+
return hasOwnCap;
|
250 |
+
}
|
251 |
+
|
252 |
+
//Step #4: Users can get a capability through their roles or the "super admin" flag.
|
253 |
+
//Only users can have inherited capabilities, so if this actor is not a user, we're done.
|
254 |
+
if (actor instanceof AmeUser) {
|
255 |
+
//Note that Super Admin has priority. If the user is a super admin, their roles are ignored.
|
256 |
+
if (actor.isSuperAdmin) {
|
257 |
+
return this.actorHasCap('special:super_admin', capability, contextList);
|
258 |
+
}
|
259 |
+
|
260 |
+
//Check if any of the user's roles have the capability.
|
261 |
+
result = false;
|
262 |
+
for (var index = 0; index < actor.roles.length; index++) {
|
263 |
+
result = result || this.actorHasCap('role:' + actor.roles[index], capability, contextList);
|
264 |
+
}
|
265 |
+
return result;
|
266 |
+
}
|
267 |
+
|
268 |
+
return false;
|
269 |
+
}
|
270 |
+
|
271 |
+
private static mapMetaCap(capability: string): string {
|
272 |
+
if (capability === 'customize') {
|
273 |
+
return 'edit_theme_options';
|
274 |
+
} else if (capability === 'delete_site') {
|
275 |
+
return 'manage_options';
|
276 |
+
}
|
277 |
+
return capability;
|
278 |
+
}
|
279 |
+
|
280 |
+
/* -------------------------------
|
281 |
+
* Roles
|
282 |
+
* ------------------------------- */
|
283 |
+
|
284 |
+
getRoles() {
|
285 |
+
return this.roles;
|
286 |
+
}
|
287 |
+
|
288 |
+
roleExists(roleId: string): boolean {
|
289 |
+
return this.roles.hasOwnProperty(roleId);
|
290 |
+
};
|
291 |
+
|
292 |
+
getSuperAdmin() : AmeSuperAdmin {
|
293 |
+
return this.superAdmin;
|
294 |
+
}
|
295 |
+
|
296 |
+
/* -------------------------------
|
297 |
+
* Users
|
298 |
+
* ------------------------------- */
|
299 |
+
|
300 |
+
getUsers() {
|
301 |
+
return this.users;
|
302 |
+
}
|
303 |
+
|
304 |
+
getUser(login: string) {
|
305 |
+
return this.users.hasOwnProperty(login) ? this.users[login] : null;
|
306 |
+
}
|
307 |
+
|
308 |
+
addUsers(newUsers: AmeUser[]) {
|
309 |
+
AmeActorManager._.forEach(newUsers, (user) => {
|
310 |
+
this.users[user.userLogin] = user;
|
311 |
+
});
|
312 |
+
}
|
313 |
+
|
314 |
+
getGroupActorsFor(userLogin: string) {
|
315 |
+
return this.users[userLogin].groupActors;
|
316 |
+
}
|
317 |
+
|
318 |
+
/* -------------------------------
|
319 |
+
* Granted capability manipulation
|
320 |
+
* ------------------------------- */
|
321 |
+
|
322 |
+
setGrantedCapabilities(newGrants) {
|
323 |
+
this.grantedCapabilities = AmeActorManager._.cloneDeep(newGrants);
|
324 |
+
}
|
325 |
+
|
326 |
+
getGrantedCapabilities(): AmeGrantedCapabilityMap {
|
327 |
+
return this.grantedCapabilities;
|
328 |
+
}
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Grant or deny a capability to an actor.
|
332 |
+
*/
|
333 |
+
setCap(actor: string, capability: string, hasCap: boolean, sourceType?, sourceName?) {
|
334 |
+
AmeActorManager.setCapInContext(this.grantedCapabilities, actor, capability, hasCap, sourceType, sourceName);
|
335 |
+
}
|
336 |
+
|
337 |
+
static setCapInContext(
|
338 |
+
context: AmeGrantedCapabilityMap,
|
339 |
+
actor: string,
|
340 |
+
capability: string,
|
341 |
+
hasCap: boolean,
|
342 |
+
sourceType?: string,
|
343 |
+
sourceName?: string
|
344 |
+
) {
|
345 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
346 |
+
|
347 |
+
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
348 |
+
_.set(context, [actor, capability], grant);
|
349 |
+
}
|
350 |
+
|
351 |
+
resetCap(actor: string, capability: string) {
|
352 |
+
AmeActorManager.resetCapInContext(this.grantedCapabilities, actor, capability);
|
353 |
+
}
|
354 |
+
|
355 |
+
static resetCapInContext(context: AmeGrantedCapabilityMap, actor: string, capability: string) {
|
356 |
+
capability = AmeActorManager.mapMetaCap(capability);
|
357 |
+
|
358 |
+
if (_.has(context, [actor, capability])) {
|
359 |
+
delete context[actor][capability];
|
360 |
+
}
|
361 |
+
}
|
362 |
+
|
363 |
+
/**
|
364 |
+
* Remove redundant granted capabilities.
|
365 |
+
*
|
366 |
+
* For example, if user "jane" has been granted the "edit_posts" capability both directly and via the Editor role,
|
367 |
+
* the direct grant is redundant. We can remove it. Jane will still have "edit_posts" because she's an editor.
|
368 |
+
*/
|
369 |
+
pruneGrantedUserCapabilities(): AmeGrantedCapabilityMap {
|
370 |
+
var _ = AmeActorManager._,
|
371 |
+
pruned = _.cloneDeep(this.grantedCapabilities),
|
372 |
+
context = [pruned];
|
373 |
+
|
374 |
+
var actorKeys = _(pruned).keys().filter((actorId) => {
|
375 |
+
//Skip users that are not loaded.
|
376 |
+
var actor = this.getActor(actorId);
|
377 |
+
if (actor === null) {
|
378 |
+
return false;
|
379 |
+
}
|
380 |
+
return (actor instanceof AmeUser);
|
381 |
+
}).value();
|
382 |
+
|
383 |
+
_.forEach(actorKeys, (actor) => {
|
384 |
+
_.forEach(_.keys(pruned[actor]), (capability) => {
|
385 |
+
var grant = pruned[actor][capability];
|
386 |
+
delete pruned[actor][capability];
|
387 |
+
|
388 |
+
var hasCap = _.isArray(grant) ? grant[0] : grant,
|
389 |
+
hasCapWhenPruned = this.actorHasCap(actor, capability, context);
|
390 |
+
|
391 |
+
if (hasCap !== hasCapWhenPruned) {
|
392 |
+
pruned[actor][capability] = grant; //Restore.
|
393 |
+
}
|
394 |
+
});
|
395 |
+
});
|
396 |
+
|
397 |
+
this.setGrantedCapabilities(pruned);
|
398 |
+
return pruned;
|
399 |
+
};
|
400 |
+
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Compare the specificity of two actors.
|
404 |
+
*
|
405 |
+
* Returns 1 if the first actor is more specific than the second, 0 if they're both
|
406 |
+
* equally specific, and -1 if the second actor is more specific.
|
407 |
+
*
|
408 |
+
* @return {Number}
|
409 |
+
*/
|
410 |
+
static compareActorSpecificity(actor1: string, actor2: string): Number {
|
411 |
+
var delta = AmeBaseActor.getActorSpecificity(actor1) - AmeBaseActor.getActorSpecificity(actor2);
|
412 |
+
if (delta !== 0) {
|
413 |
+
delta = (delta > 0) ? 1 : -1;
|
414 |
+
}
|
415 |
+
return delta;
|
416 |
+
};
|
417 |
+
}
|
418 |
+
|
419 |
+
if (typeof wsAmeActorData !== 'undefined') {
|
420 |
+
AmeActors = new AmeActorManager(
|
421 |
+
wsAmeActorData.roles,
|
422 |
+
wsAmeActorData.users,
|
423 |
+
wsAmeActorData.isMultisite
|
424 |
+
);
|
425 |
+
}
|
js/admin-helpers.js
CHANGED
@@ -72,6 +72,15 @@
|
|
72 |
replaceAdminPageHeading(customPageHeading + '\t');
|
73 |
ameHideHeading.remove(); //Make the heading visible.
|
74 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
});
|
76 |
|
77 |
})(jQuery);
|
72 |
replaceAdminPageHeading(customPageHeading + '\t');
|
73 |
ameHideHeading.remove(); //Make the heading visible.
|
74 |
}
|
75 |
+
|
76 |
+
//On AME pages, move settings tabs after the heading. This is necessary to make them appear on the right side,
|
77 |
+
//and WordPress breaks that by moving notices like "Settings saved" after the first H1 (see common.js).
|
78 |
+
var menuEditorHeading = $('#ws_ame_editor_heading').first(),
|
79 |
+
menuEditorTabs = $('.nav-tab-wrapper').first();
|
80 |
+
menuEditorTabs = menuEditorTabs.add(menuEditorTabs.next('.clear'));
|
81 |
+
if ((menuEditorHeading.length > 0) && (menuEditorTabs.length > 0)) {
|
82 |
+
menuEditorTabs.insertAfter(menuEditorHeading);
|
83 |
+
}
|
84 |
});
|
85 |
|
86 |
})(jQuery);
|
js/common.d.ts
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
interface AmeDictionary<T> {
|
2 |
+
[mapKey: string] : T;
|
3 |
+
}
|
js/jquery-json.d.ts
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
interface JQueryStatic {
|
2 |
+
//This method is added by the jquery-json plugin.
|
3 |
+
toJSON: (data: any) => string;
|
4 |
+
}
|
js/{jquery.cookie.js → jquery.biscuit.js}
RENAMED
File without changes
|
js/jquery.d.ts
ADDED
@@ -0,0 +1,3203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Type definitions for jQuery 1.10.x / 2.0.x
|
2 |
+
// Project: http://jquery.com/
|
3 |
+
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton <https://github.com/Steve-Fenton>, Diullei Gomes <https://github.com/Diullei>, Tass Iliopoulos <https://github.com/tasoili>, Jason Swearingen <https://github.com/jasons-novaleaf>, Sean Hill <https://github.com/seanski>, Guus Goossens <https://github.com/Guuz>, Kelly Summerlin <https://github.com/ksummerlin>, Basarat Ali Syed <https://github.com/basarat>, Nicholas Wolverson <https://github.com/nwolverson>, Derek Cicerone <https://github.com/derekcicerone>, Andrew Gaspar <https://github.com/AndrewGaspar>, James Harrison Fisher <https://github.com/jameshfisher>, Seikichi Kondo <https://github.com/seikichi>, Benjamin Jackman <https://github.com/benjaminjackman>, Poul Sorensen <https://github.com/s093294>, Josh Strobl <https://github.com/JoshStrobl>, John Reilly <https://github.com/johnnyreilly/>, Dick van den Brink <https://github.com/DickvdBrink>
|
4 |
+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
5 |
+
|
6 |
+
/* *****************************************************************************
|
7 |
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
8 |
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
9 |
+
this file except in compliance with the License. You may obtain a copy of the
|
10 |
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
11 |
+
|
12 |
+
THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
13 |
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
14 |
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
15 |
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
16 |
+
|
17 |
+
See the Apache Version 2.0 License for specific language governing permissions
|
18 |
+
and limitations under the License.
|
19 |
+
***************************************************************************** */
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Interface for the AJAX setting that will configure the AJAX request
|
24 |
+
*/
|
25 |
+
interface JQueryAjaxSettings {
|
26 |
+
/**
|
27 |
+
* The content type sent in the request header that tells the server what kind of response it will accept in return. If the accepts setting needs modification, it is recommended to do so once in the $.ajaxSetup() method.
|
28 |
+
*/
|
29 |
+
accepts?: any;
|
30 |
+
/**
|
31 |
+
* By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().
|
32 |
+
*/
|
33 |
+
async?: boolean;
|
34 |
+
/**
|
35 |
+
* A pre-request callback function that can be used to modify the jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object before it is sent. Use this to set custom headers, etc. The jqXHR and settings objects are passed as arguments. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. As of jQuery 1.5, the beforeSend option will be called regardless of the type of request.
|
36 |
+
*/
|
37 |
+
beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
|
38 |
+
/**
|
39 |
+
* If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.
|
40 |
+
*/
|
41 |
+
cache?: boolean;
|
42 |
+
/**
|
43 |
+
* A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request ("success", "notmodified", "error", "timeout", "abort", or "parsererror"). As of jQuery 1.5, the complete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
|
44 |
+
*/
|
45 |
+
complete? (jqXHR: JQueryXHR, textStatus: string): any;
|
46 |
+
/**
|
47 |
+
* An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
|
48 |
+
*/
|
49 |
+
contents?: { [key: string]: any; };
|
50 |
+
//According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
|
51 |
+
// https://github.com/borisyankov/DefinitelyTyped/issues/742
|
52 |
+
/**
|
53 |
+
* When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.
|
54 |
+
*/
|
55 |
+
contentType?: any;
|
56 |
+
/**
|
57 |
+
* This object will be made the context of all Ajax-related callbacks. By default, the context is an object that represents the ajax settings used in the call ($.ajaxSettings merged with the settings passed to $.ajax).
|
58 |
+
*/
|
59 |
+
context?: any;
|
60 |
+
/**
|
61 |
+
* An object containing dataType-to-dataType converters. Each converter's value is a function that returns the transformed value of the response. (version added: 1.5)
|
62 |
+
*/
|
63 |
+
converters?: { [key: string]: any; };
|
64 |
+
/**
|
65 |
+
* If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. (version added: 1.5)
|
66 |
+
*/
|
67 |
+
crossDomain?: boolean;
|
68 |
+
/**
|
69 |
+
* Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
|
70 |
+
*/
|
71 |
+
data?: any;
|
72 |
+
/**
|
73 |
+
* A function to be used to handle the raw response data of XMLHttpRequest.This is a pre-filtering function to sanitize the response. You should return the sanitized data. The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter.
|
74 |
+
*/
|
75 |
+
dataFilter? (data: any, ty: any): any;
|
76 |
+
/**
|
77 |
+
* The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string).
|
78 |
+
*/
|
79 |
+
dataType?: string;
|
80 |
+
/**
|
81 |
+
* A function to be called if the request fails. The function receives three arguments: The jqXHR (in jQuery 1.4.x, XMLHttpRequest) object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, such as "Not Found" or "Internal Server Error." As of jQuery 1.5, the error setting can accept an array of functions. Each function will be called in turn. Note: This handler is not called for cross-domain script and cross-domain JSONP requests. This is an Ajax Event.
|
82 |
+
*/
|
83 |
+
error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
|
84 |
+
/**
|
85 |
+
* Whether to trigger global Ajax event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various Ajax Events.
|
86 |
+
*/
|
87 |
+
global?: boolean;
|
88 |
+
/**
|
89 |
+
* An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. (version added: 1.5)
|
90 |
+
*/
|
91 |
+
headers?: { [key: string]: any; };
|
92 |
+
/**
|
93 |
+
* Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header. In jQuery 1.4 this technique also checks the 'etag' specified by the server to catch unmodified data.
|
94 |
+
*/
|
95 |
+
ifModified?: boolean;
|
96 |
+
/**
|
97 |
+
* Allow the current environment to be recognized as "local," (e.g. the filesystem), even if jQuery does not recognize it as such by default. The following protocols are currently recognized as local: file, *-extension, and widget. If the isLocal setting needs modification, it is recommended to do so once in the $.ajaxSetup() method. (version added: 1.5.1)
|
98 |
+
*/
|
99 |
+
isLocal?: boolean;
|
100 |
+
/**
|
101 |
+
* Override the callback function name in a jsonp request. This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url. So {jsonp:'onJSONPLoad'} would result in 'onJSONPLoad=?' passed to the server. As of jQuery 1.5, setting the jsonp option to false prevents jQuery from adding the "?callback" string to the URL or attempting to use "=?" for transformation. In this case, you should also explicitly set the jsonpCallback setting. For example, { jsonp: false, jsonpCallback: "callbackName" }
|
102 |
+
*/
|
103 |
+
jsonp?: any;
|
104 |
+
/**
|
105 |
+
* Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
|
106 |
+
*/
|
107 |
+
jsonpCallback?: any;
|
108 |
+
/**
|
109 |
+
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
|
110 |
+
*/
|
111 |
+
method?: string;
|
112 |
+
/**
|
113 |
+
* A mime type to override the XHR mime type. (version added: 1.5.1)
|
114 |
+
*/
|
115 |
+
mimeType?: string;
|
116 |
+
/**
|
117 |
+
* A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
|
118 |
+
*/
|
119 |
+
password?: string;
|
120 |
+
/**
|
121 |
+
* By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send a DOMDocument, or other non-processed data, set this option to false.
|
122 |
+
*/
|
123 |
+
processData?: boolean;
|
124 |
+
/**
|
125 |
+
* Only applies when the "script" transport is used (e.g., cross-domain requests with "jsonp" or "script" dataType and "GET" type). Sets the charset attribute on the script tag used in the request. Used when the character set on the local page is not the same as the one on the remote script.
|
126 |
+
*/
|
127 |
+
scriptCharset?: string;
|
128 |
+
/**
|
129 |
+
* An object of numeric HTTP codes and functions to be called when the response has the corresponding code. f the request is successful, the status code functions take the same parameters as the success callback; if it results in an error (including 3xx redirect), they take the same parameters as the error callback. (version added: 1.5)
|
130 |
+
*/
|
131 |
+
statusCode?: { [key: string]: any; };
|
132 |
+
/**
|
133 |
+
* A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.
|
134 |
+
*/
|
135 |
+
success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
|
136 |
+
/**
|
137 |
+
* Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.
|
138 |
+
*/
|
139 |
+
timeout?: number;
|
140 |
+
/**
|
141 |
+
* Set this to true if you wish to use the traditional style of param serialization.
|
142 |
+
*/
|
143 |
+
traditional?: boolean;
|
144 |
+
/**
|
145 |
+
* The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
|
146 |
+
*/
|
147 |
+
type?: string;
|
148 |
+
/**
|
149 |
+
* A string containing the URL to which the request is sent.
|
150 |
+
*/
|
151 |
+
url?: string;
|
152 |
+
/**
|
153 |
+
* A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
|
154 |
+
*/
|
155 |
+
username?: string;
|
156 |
+
/**
|
157 |
+
* Callback for creating the XMLHttpRequest object. Defaults to the ActiveXObject when available (IE), the XMLHttpRequest otherwise. Override to provide your own implementation for XMLHttpRequest or enhancements to the factory.
|
158 |
+
*/
|
159 |
+
xhr?: any;
|
160 |
+
/**
|
161 |
+
* An object of fieldName-fieldValue pairs to set on the native XHR object. For example, you can use it to set withCredentials to true for cross-domain requests if needed. In jQuery 1.5, the withCredentials property was not propagated to the native XHR and thus CORS requests requiring it would ignore this flag. For this reason, we recommend using jQuery 1.5.1+ should you require the use of it. (version added: 1.5.1)
|
162 |
+
*/
|
163 |
+
xhrFields?: { [key: string]: any; };
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Interface for the jqXHR object
|
168 |
+
*/
|
169 |
+
interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
|
170 |
+
/**
|
171 |
+
* The .overrideMimeType() method may be used in the beforeSend() callback function, for example, to modify the response content-type header. As of jQuery 1.5.1, the jqXHR object also contains the overrideMimeType() method (it was available in jQuery 1.4.x, as well, but was temporarily removed in jQuery 1.5).
|
172 |
+
*/
|
173 |
+
overrideMimeType(mimeType: string): any;
|
174 |
+
/**
|
175 |
+
* Cancel the request.
|
176 |
+
*
|
177 |
+
* @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
|
178 |
+
*/
|
179 |
+
abort(statusText?: string): void;
|
180 |
+
/**
|
181 |
+
* Incorporates the functionality of the .done() and .fail() methods, allowing (as of jQuery 1.8) the underlying Promise to be manipulated. Refer to deferred.then() for implementation details.
|
182 |
+
*/
|
183 |
+
then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>;
|
184 |
+
/**
|
185 |
+
* Property containing the parsed response if the response Content-Type is json
|
186 |
+
*/
|
187 |
+
responseJSON?: any;
|
188 |
+
/**
|
189 |
+
* A function to be called if the request fails.
|
190 |
+
*/
|
191 |
+
error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Interface for the JQuery callback
|
196 |
+
*/
|
197 |
+
interface JQueryCallback {
|
198 |
+
/**
|
199 |
+
* Add a callback or a collection of callbacks to a callback list.
|
200 |
+
*
|
201 |
+
* @param callbacks A function, or array of functions, that are to be added to the callback list.
|
202 |
+
*/
|
203 |
+
add(callbacks: Function): JQueryCallback;
|
204 |
+
/**
|
205 |
+
* Add a callback or a collection of callbacks to a callback list.
|
206 |
+
*
|
207 |
+
* @param callbacks A function, or array of functions, that are to be added to the callback list.
|
208 |
+
*/
|
209 |
+
add(callbacks: Function[]): JQueryCallback;
|
210 |
+
|
211 |
+
/**
|
212 |
+
* Disable a callback list from doing anything more.
|
213 |
+
*/
|
214 |
+
disable(): JQueryCallback;
|
215 |
+
|
216 |
+
/**
|
217 |
+
* Determine if the callbacks list has been disabled.
|
218 |
+
*/
|
219 |
+
disabled(): boolean;
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Remove all of the callbacks from a list.
|
223 |
+
*/
|
224 |
+
empty(): JQueryCallback;
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Call all of the callbacks with the given arguments
|
228 |
+
*
|
229 |
+
* @param arguments The argument or list of arguments to pass back to the callback list.
|
230 |
+
*/
|
231 |
+
fire(...arguments: any[]): JQueryCallback;
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Determine if the callbacks have already been called at least once.
|
235 |
+
*/
|
236 |
+
fired(): boolean;
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Call all callbacks in a list with the given context and arguments.
|
240 |
+
*
|
241 |
+
* @param context A reference to the context in which the callbacks in the list should be fired.
|
242 |
+
* @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
|
243 |
+
*/
|
244 |
+
fireWith(context?: any, args?: any[]): JQueryCallback;
|
245 |
+
|
246 |
+
/**
|
247 |
+
* Determine whether a supplied callback is in a list
|
248 |
+
*
|
249 |
+
* @param callback The callback to search for.
|
250 |
+
*/
|
251 |
+
has(callback: Function): boolean;
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Lock a callback list in its current state.
|
255 |
+
*/
|
256 |
+
lock(): JQueryCallback;
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Determine if the callbacks list has been locked.
|
260 |
+
*/
|
261 |
+
locked(): boolean;
|
262 |
+
|
263 |
+
/**
|
264 |
+
* Remove a callback or a collection of callbacks from a callback list.
|
265 |
+
*
|
266 |
+
* @param callbacks A function, or array of functions, that are to be removed from the callback list.
|
267 |
+
*/
|
268 |
+
remove(callbacks: Function): JQueryCallback;
|
269 |
+
/**
|
270 |
+
* Remove a callback or a collection of callbacks from a callback list.
|
271 |
+
*
|
272 |
+
* @param callbacks A function, or array of functions, that are to be removed from the callback list.
|
273 |
+
*/
|
274 |
+
remove(callbacks: Function[]): JQueryCallback;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Allows jQuery Promises to interop with non-jQuery promises
|
279 |
+
*/
|
280 |
+
interface JQueryGenericPromise<T> {
|
281 |
+
/**
|
282 |
+
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
|
283 |
+
*
|
284 |
+
* @param doneFilter A function that is called when the Deferred is resolved.
|
285 |
+
* @param failFilter An optional function that is called when the Deferred is rejected.
|
286 |
+
*/
|
287 |
+
then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
|
291 |
+
*
|
292 |
+
* @param doneFilter A function that is called when the Deferred is resolved.
|
293 |
+
* @param failFilter An optional function that is called when the Deferred is rejected.
|
294 |
+
*/
|
295 |
+
then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Interface for the JQuery promise/deferred callbacks
|
300 |
+
*/
|
301 |
+
interface JQueryPromiseCallback<T> {
|
302 |
+
(value?: T, ...args: any[]): void;
|
303 |
+
}
|
304 |
+
|
305 |
+
interface JQueryPromiseOperator<T, U> {
|
306 |
+
(callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
|
307 |
+
}
|
308 |
+
|
309 |
+
/**
|
310 |
+
* Interface for the JQuery promise, part of callbacks
|
311 |
+
*/
|
312 |
+
interface JQueryPromise<T> extends JQueryGenericPromise<T> {
|
313 |
+
/**
|
314 |
+
* Determine the current state of a Deferred object.
|
315 |
+
*/
|
316 |
+
state(): string;
|
317 |
+
/**
|
318 |
+
* Add handlers to be called when the Deferred object is either resolved or rejected.
|
319 |
+
*
|
320 |
+
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
|
321 |
+
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
|
322 |
+
*/
|
323 |
+
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
|
324 |
+
/**
|
325 |
+
* Add handlers to be called when the Deferred object is resolved.
|
326 |
+
*
|
327 |
+
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
|
328 |
+
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
|
329 |
+
*/
|
330 |
+
done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
|
331 |
+
/**
|
332 |
+
* Add handlers to be called when the Deferred object is rejected.
|
333 |
+
*
|
334 |
+
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
|
335 |
+
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
|
336 |
+
*/
|
337 |
+
fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
|
338 |
+
/**
|
339 |
+
* Add handlers to be called when the Deferred object generates progress notifications.
|
340 |
+
*
|
341 |
+
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
|
342 |
+
*/
|
343 |
+
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
|
344 |
+
|
345 |
+
// Deprecated - given no typings
|
346 |
+
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
|
347 |
+
}
|
348 |
+
|
349 |
+
/**
|
350 |
+
* Interface for the JQuery deferred, part of callbacks
|
351 |
+
*/
|
352 |
+
interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
|
353 |
+
/**
|
354 |
+
* Determine the current state of a Deferred object.
|
355 |
+
*/
|
356 |
+
state(): string;
|
357 |
+
/**
|
358 |
+
* Add handlers to be called when the Deferred object is either resolved or rejected.
|
359 |
+
*
|
360 |
+
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
|
361 |
+
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
|
362 |
+
*/
|
363 |
+
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
|
364 |
+
/**
|
365 |
+
* Add handlers to be called when the Deferred object is resolved.
|
366 |
+
*
|
367 |
+
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
|
368 |
+
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
|
369 |
+
*/
|
370 |
+
done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
|
371 |
+
/**
|
372 |
+
* Add handlers to be called when the Deferred object is rejected.
|
373 |
+
*
|
374 |
+
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
|
375 |
+
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
|
376 |
+
*/
|
377 |
+
fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
|
378 |
+
/**
|
379 |
+
* Add handlers to be called when the Deferred object generates progress notifications.
|
380 |
+
*
|
381 |
+
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
|
382 |
+
*/
|
383 |
+
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Call the progressCallbacks on a Deferred object with the given args.
|
387 |
+
*
|
388 |
+
* @param args Optional arguments that are passed to the progressCallbacks.
|
389 |
+
*/
|
390 |
+
notify(value?: any, ...args: any[]): JQueryDeferred<T>;
|
391 |
+
|
392 |
+
/**
|
393 |
+
* Call the progressCallbacks on a Deferred object with the given context and args.
|
394 |
+
*
|
395 |
+
* @param context Context passed to the progressCallbacks as the this object.
|
396 |
+
* @param args Optional arguments that are passed to the progressCallbacks.
|
397 |
+
*/
|
398 |
+
notifyWith(context: any, value?: any[]): JQueryDeferred<T>;
|
399 |
+
|
400 |
+
/**
|
401 |
+
* Reject a Deferred object and call any failCallbacks with the given args.
|
402 |
+
*
|
403 |
+
* @param args Optional arguments that are passed to the failCallbacks.
|
404 |
+
*/
|
405 |
+
reject(value?: any, ...args: any[]): JQueryDeferred<T>;
|
406 |
+
/**
|
407 |
+
* Reject a Deferred object and call any failCallbacks with the given context and args.
|
408 |
+
*
|
409 |
+
* @param context Context passed to the failCallbacks as the this object.
|
410 |
+
* @param args An optional array of arguments that are passed to the failCallbacks.
|
411 |
+
*/
|
412 |
+
rejectWith(context: any, value?: any[]): JQueryDeferred<T>;
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Resolve a Deferred object and call any doneCallbacks with the given args.
|
416 |
+
*
|
417 |
+
* @param value First argument passed to doneCallbacks.
|
418 |
+
* @param args Optional subsequent arguments that are passed to the doneCallbacks.
|
419 |
+
*/
|
420 |
+
resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
|
421 |
+
|
422 |
+
/**
|
423 |
+
* Resolve a Deferred object and call any doneCallbacks with the given context and args.
|
424 |
+
*
|
425 |
+
* @param context Context passed to the doneCallbacks as the this object.
|
426 |
+
* @param args An optional array of arguments that are passed to the doneCallbacks.
|
427 |
+
*/
|
428 |
+
resolveWith(context: any, value?: T[]): JQueryDeferred<T>;
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Return a Deferred's Promise object.
|
432 |
+
*
|
433 |
+
* @param target Object onto which the promise methods have to be attached
|
434 |
+
*/
|
435 |
+
promise(target?: any): JQueryPromise<T>;
|
436 |
+
|
437 |
+
// Deprecated - given no typings
|
438 |
+
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
|
439 |
+
}
|
440 |
+
|
441 |
+
/**
|
442 |
+
* Interface of the JQuery extension of the W3C event object
|
443 |
+
*/
|
444 |
+
interface BaseJQueryEventObject extends Event {
|
445 |
+
data: any;
|
446 |
+
delegateTarget: Element;
|
447 |
+
isDefaultPrevented(): boolean;
|
448 |
+
isImmediatePropagationStopped(): boolean;
|
449 |
+
isPropagationStopped(): boolean;
|
450 |
+
namespace: string;
|
451 |
+
originalEvent: Event;
|
452 |
+
preventDefault(): any;
|
453 |
+
relatedTarget: Element;
|
454 |
+
result: any;
|
455 |
+
stopImmediatePropagation(): void;
|
456 |
+
stopPropagation(): void;
|
457 |
+
target: Element;
|
458 |
+
pageX: number;
|
459 |
+
pageY: number;
|
460 |
+
which: number;
|
461 |
+
metaKey: boolean;
|
462 |
+
}
|
463 |
+
|
464 |
+
interface JQueryInputEventObject extends BaseJQueryEventObject {
|
465 |
+
altKey: boolean;
|
466 |
+
ctrlKey: boolean;
|
467 |
+
metaKey: boolean;
|
468 |
+
shiftKey: boolean;
|
469 |
+
}
|
470 |
+
|
471 |
+
interface JQueryMouseEventObject extends JQueryInputEventObject {
|
472 |
+
button: number;
|
473 |
+
clientX: number;
|
474 |
+
clientY: number;
|
475 |
+
offsetX: number;
|
476 |
+
offsetY: number;
|
477 |
+
pageX: number;
|
478 |
+
pageY: number;
|
479 |
+
screenX: number;
|
480 |
+
screenY: number;
|
481 |
+
}
|
482 |
+
|
483 |
+
interface JQueryKeyEventObject extends JQueryInputEventObject {
|
484 |
+
char: any;
|
485 |
+
charCode: number;
|
486 |
+
key: any;
|
487 |
+
keyCode: number;
|
488 |
+
}
|
489 |
+
|
490 |
+
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
|
491 |
+
}
|
492 |
+
|
493 |
+
/*
|
494 |
+
Collection of properties of the current browser
|
495 |
+
*/
|
496 |
+
|
497 |
+
interface JQuerySupport {
|
498 |
+
ajax?: boolean;
|
499 |
+
boxModel?: boolean;
|
500 |
+
changeBubbles?: boolean;
|
501 |
+
checkClone?: boolean;
|
502 |
+
checkOn?: boolean;
|
503 |
+
cors?: boolean;
|
504 |
+
cssFloat?: boolean;
|
505 |
+
hrefNormalized?: boolean;
|
506 |
+
htmlSerialize?: boolean;
|
507 |
+
leadingWhitespace?: boolean;
|
508 |
+
noCloneChecked?: boolean;
|
509 |
+
noCloneEvent?: boolean;
|
510 |
+
opacity?: boolean;
|
511 |
+
optDisabled?: boolean;
|
512 |
+
optSelected?: boolean;
|
513 |
+
scriptEval? (): boolean;
|
514 |
+
style?: boolean;
|
515 |
+
submitBubbles?: boolean;
|
516 |
+
tbody?: boolean;
|
517 |
+
}
|
518 |
+
|
519 |
+
interface JQueryParam {
|
520 |
+
/**
|
521 |
+
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
|
522 |
+
*
|
523 |
+
* @param obj An array or object to serialize.
|
524 |
+
*/
|
525 |
+
(obj: any): string;
|
526 |
+
|
527 |
+
/**
|
528 |
+
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
|
529 |
+
*
|
530 |
+
* @param obj An array or object to serialize.
|
531 |
+
* @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
|
532 |
+
*/
|
533 |
+
(obj: any, traditional: boolean): string;
|
534 |
+
}
|
535 |
+
|
536 |
+
/**
|
537 |
+
* The interface used to construct jQuery events (with $.Event). It is
|
538 |
+
* defined separately instead of inline in JQueryStatic to allow
|
539 |
+
* overriding the construction function with specific strings
|
540 |
+
* returning specific event objects.
|
541 |
+
*/
|
542 |
+
interface JQueryEventConstructor {
|
543 |
+
(name: string, eventProperties?: any): JQueryEventObject;
|
544 |
+
new (name: string, eventProperties?: any): JQueryEventObject;
|
545 |
+
}
|
546 |
+
|
547 |
+
/**
|
548 |
+
* The interface used to specify coordinates.
|
549 |
+
*/
|
550 |
+
interface JQueryCoordinates {
|
551 |
+
left: number;
|
552 |
+
top: number;
|
553 |
+
}
|
554 |
+
|
555 |
+
/**
|
556 |
+
* Elements in the array returned by serializeArray()
|
557 |
+
*/
|
558 |
+
interface JQuerySerializeArrayElement {
|
559 |
+
name: string;
|
560 |
+
value: string;
|
561 |
+
}
|
562 |
+
|
563 |
+
interface JQueryAnimationOptions {
|
564 |
+
/**
|
565 |
+
* A string or number determining how long the animation will run.
|
566 |
+
*/
|
567 |
+
duration?: any;
|
568 |
+
/**
|
569 |
+
* A string indicating which easing function to use for the transition.
|
570 |
+
*/
|
571 |
+
easing?: string;
|
572 |
+
/**
|
573 |
+
* A function to call once the animation is complete.
|
574 |
+
*/
|
575 |
+
complete?: Function;
|
576 |
+
/**
|
577 |
+
* A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
|
578 |
+
*/
|
579 |
+
step?: (now: number, tween: any) => any;
|
580 |
+
/**
|
581 |
+
* A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
|
582 |
+
*/
|
583 |
+
progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
|
584 |
+
/**
|
585 |
+
* A function to call when the animation begins. (version added: 1.8)
|
586 |
+
*/
|
587 |
+
start?: (animation: JQueryPromise<any>) => any;
|
588 |
+
/**
|
589 |
+
* A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
|
590 |
+
*/
|
591 |
+
done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
|
592 |
+
/**
|
593 |
+
* A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
|
594 |
+
*/
|
595 |
+
fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
|
596 |
+
/**
|
597 |
+
* A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
|
598 |
+
*/
|
599 |
+
always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
|
600 |
+
/**
|
601 |
+
* A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
|
602 |
+
*/
|
603 |
+
queue?: any;
|
604 |
+
/**
|
605 |
+
* A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
|
606 |
+
*/
|
607 |
+
specialEasing?: Object;
|
608 |
+
}
|
609 |
+
|
610 |
+
interface JQueryEasingFunction {
|
611 |
+
( percent: number ): number;
|
612 |
+
}
|
613 |
+
|
614 |
+
interface JQueryEasingFunctions {
|
615 |
+
[ name: string ]: JQueryEasingFunction;
|
616 |
+
linear: JQueryEasingFunction;
|
617 |
+
swing: JQueryEasingFunction;
|
618 |
+
}
|
619 |
+
|
620 |
+
/**
|
621 |
+
* Static members of jQuery (those on $ and jQuery themselves)
|
622 |
+
*/
|
623 |
+
interface JQueryStatic {
|
624 |
+
|
625 |
+
/**
|
626 |
+
* Perform an asynchronous HTTP (Ajax) request.
|
627 |
+
*
|
628 |
+
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
|
629 |
+
*/
|
630 |
+
ajax(settings: JQueryAjaxSettings): JQueryXHR;
|
631 |
+
/**
|
632 |
+
* Perform an asynchronous HTTP (Ajax) request.
|
633 |
+
*
|
634 |
+
* @param url A string containing the URL to which the request is sent.
|
635 |
+
* @param settings A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().
|
636 |
+
*/
|
637 |
+
ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
|
638 |
+
|
639 |
+
/**
|
640 |
+
* Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
|
641 |
+
*
|
642 |
+
* @param dataTypes An optional string containing one or more space-separated dataTypes
|
643 |
+
* @param handler A handler to set default values for future Ajax requests.
|
644 |
+
*/
|
645 |
+
ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
|
646 |
+
/**
|
647 |
+
* Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
|
648 |
+
*
|
649 |
+
* @param handler A handler to set default values for future Ajax requests.
|
650 |
+
*/
|
651 |
+
ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
|
652 |
+
|
653 |
+
ajaxSettings: JQueryAjaxSettings;
|
654 |
+
|
655 |
+
/**
|
656 |
+
* Set default values for future Ajax requests. Its use is not recommended.
|
657 |
+
*
|
658 |
+
* @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
|
659 |
+
*/
|
660 |
+
ajaxSetup(options: JQueryAjaxSettings): void;
|
661 |
+
|
662 |
+
/**
|
663 |
+
* Load data from the server using a HTTP GET request.
|
664 |
+
*
|
665 |
+
* @param url A string containing the URL to which the request is sent.
|
666 |
+
* @param success A callback function that is executed if the request succeeds.
|
667 |
+
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
|
668 |
+
*/
|
669 |
+
get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
670 |
+
/**
|
671 |
+
* Load data from the server using a HTTP GET request.
|
672 |
+
*
|
673 |
+
* @param url A string containing the URL to which the request is sent.
|
674 |
+
* @param data A plain object or string that is sent to the server with the request.
|
675 |
+
* @param success A callback function that is executed if the request succeeds.
|
676 |
+
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
|
677 |
+
*/
|
678 |
+
get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
679 |
+
/**
|
680 |
+
* Load JSON-encoded data from the server using a GET HTTP request.
|
681 |
+
*
|
682 |
+
* @param url A string containing the URL to which the request is sent.
|
683 |
+
* @param success A callback function that is executed if the request succeeds.
|
684 |
+
*/
|
685 |
+
getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
|
686 |
+
/**
|
687 |
+
* Load JSON-encoded data from the server using a GET HTTP request.
|
688 |
+
*
|
689 |
+
* @param url A string containing the URL to which the request is sent.
|
690 |
+
* @param data A plain object or string that is sent to the server with the request.
|
691 |
+
* @param success A callback function that is executed if the request succeeds.
|
692 |
+
*/
|
693 |
+
getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
|
694 |
+
/**
|
695 |
+
* Load a JavaScript file from the server using a GET HTTP request, then execute it.
|
696 |
+
*
|
697 |
+
* @param url A string containing the URL to which the request is sent.
|
698 |
+
* @param success A callback function that is executed if the request succeeds.
|
699 |
+
*/
|
700 |
+
getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
|
701 |
+
|
702 |
+
/**
|
703 |
+
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
|
704 |
+
*/
|
705 |
+
param: JQueryParam;
|
706 |
+
|
707 |
+
/**
|
708 |
+
* Load data from the server using a HTTP POST request.
|
709 |
+
*
|
710 |
+
* @param url A string containing the URL to which the request is sent.
|
711 |
+
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
|
712 |
+
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
|
713 |
+
*/
|
714 |
+
post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
715 |
+
/**
|
716 |
+
* Load data from the server using a HTTP POST request.
|
717 |
+
*
|
718 |
+
* @param url A string containing the URL to which the request is sent.
|
719 |
+
* @param data A plain object or string that is sent to the server with the request.
|
720 |
+
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
|
721 |
+
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
|
722 |
+
*/
|
723 |
+
post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
|
724 |
+
|
725 |
+
/**
|
726 |
+
* A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
|
727 |
+
*
|
728 |
+
* @param flags An optional list of space-separated flags that change how the callback list behaves.
|
729 |
+
*/
|
730 |
+
Callbacks(flags?: string): JQueryCallback;
|
731 |
+
|
732 |
+
/**
|
733 |
+
* Holds or releases the execution of jQuery's ready event.
|
734 |
+
*
|
735 |
+
* @param hold Indicates whether the ready hold is being requested or released
|
736 |
+
*/
|
737 |
+
holdReady(hold: boolean): void;
|
738 |
+
|
739 |
+
/**
|
740 |
+
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
741 |
+
*
|
742 |
+
* @param selector A string containing a selector expression
|
743 |
+
* @param context A DOM Element, Document, or jQuery to use as context
|
744 |
+
*/
|
745 |
+
(selector: string, context?: Element|JQuery): JQuery;
|
746 |
+
|
747 |
+
/**
|
748 |
+
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
749 |
+
*
|
750 |
+
* @param element A DOM element to wrap in a jQuery object.
|
751 |
+
*/
|
752 |
+
(element: Element): JQuery;
|
753 |
+
|
754 |
+
/**
|
755 |
+
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
756 |
+
*
|
757 |
+
* @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
|
758 |
+
*/
|
759 |
+
(elementArray: Element[]): JQuery;
|
760 |
+
|
761 |
+
/**
|
762 |
+
* Binds a function to be executed when the DOM has finished loading.
|
763 |
+
*
|
764 |
+
* @param callback A function to execute after the DOM is ready.
|
765 |
+
*/
|
766 |
+
(callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
770 |
+
*
|
771 |
+
* @param object A plain object to wrap in a jQuery object.
|
772 |
+
*/
|
773 |
+
(object: {}): JQuery;
|
774 |
+
|
775 |
+
/**
|
776 |
+
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
777 |
+
*
|
778 |
+
* @param object An existing jQuery object to clone.
|
779 |
+
*/
|
780 |
+
(object: JQuery): JQuery;
|
781 |
+
|
782 |
+
/**
|
783 |
+
* Specify a function to execute when the DOM is fully loaded.
|
784 |
+
*/
|
785 |
+
(): JQuery;
|
786 |
+
|
787 |
+
/**
|
788 |
+
* Creates DOM elements on the fly from the provided string of raw HTML.
|
789 |
+
*
|
790 |
+
* @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
|
791 |
+
* @param ownerDocument A document in which the new elements will be created.
|
792 |
+
*/
|
793 |
+
(html: string, ownerDocument?: Document): JQuery;
|
794 |
+
|
795 |
+
/**
|
796 |
+
* Creates DOM elements on the fly from the provided string of raw HTML.
|
797 |
+
*
|
798 |
+
* @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
|
799 |
+
* @param attributes An object of attributes, events, and methods to call on the newly-created element.
|
800 |
+
*/
|
801 |
+
(html: string, attributes: Object): JQuery;
|
802 |
+
|
803 |
+
/**
|
804 |
+
* Relinquish jQuery's control of the $ variable.
|
805 |
+
*
|
806 |
+
* @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
|
807 |
+
*/
|
808 |
+
noConflict(removeAll?: boolean): Object;
|
809 |
+
|
810 |
+
/**
|
811 |
+
* Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
|
812 |
+
*
|
813 |
+
* @param deferreds One or more Deferred objects, or plain JavaScript objects.
|
814 |
+
*/
|
815 |
+
when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
|
816 |
+
|
817 |
+
/**
|
818 |
+
* Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
|
819 |
+
*/
|
820 |
+
cssHooks: { [key: string]: any; };
|
821 |
+
cssNumber: any;
|
822 |
+
|
823 |
+
/**
|
824 |
+
* Store arbitrary data associated with the specified element. Returns the value that was set.
|
825 |
+
*
|
826 |
+
* @param element The DOM element to associate with the data.
|
827 |
+
* @param key A string naming the piece of data to set.
|
828 |
+
* @param value The new data value.
|
829 |
+
*/
|
830 |
+
data<T>(element: Element, key: string, value: T): T;
|
831 |
+
/**
|
832 |
+
* Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
|
833 |
+
*
|
834 |
+
* @param element The DOM element to associate with the data.
|
835 |
+
* @param key A string naming the piece of data to set.
|
836 |
+
*/
|
837 |
+
data(element: Element, key: string): any;
|
838 |
+
/**
|
839 |
+
* Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
|
840 |
+
*
|
841 |
+
* @param element The DOM element to associate with the data.
|
842 |
+
*/
|
843 |
+
data(element: Element): any;
|
844 |
+
|
845 |
+
/**
|
846 |
+
* Execute the next function on the queue for the matched element.
|
847 |
+
*
|
848 |
+
* @param element A DOM element from which to remove and execute a queued function.
|
849 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
850 |
+
*/
|
851 |
+
dequeue(element: Element, queueName?: string): void;
|
852 |
+
|
853 |
+
/**
|
854 |
+
* Determine whether an element has any jQuery data associated with it.
|
855 |
+
*
|
856 |
+
* @param element A DOM element to be checked for data.
|
857 |
+
*/
|
858 |
+
hasData(element: Element): boolean;
|
859 |
+
|
860 |
+
/**
|
861 |
+
* Show the queue of functions to be executed on the matched element.
|
862 |
+
*
|
863 |
+
* @param element A DOM element to inspect for an attached queue.
|
864 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
865 |
+
*/
|
866 |
+
queue(element: Element, queueName?: string): any[];
|
867 |
+
/**
|
868 |
+
* Manipulate the queue of functions to be executed on the matched element.
|
869 |
+
*
|
870 |
+
* @param element A DOM element where the array of queued functions is attached.
|
871 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
872 |
+
* @param newQueue An array of functions to replace the current queue contents.
|
873 |
+
*/
|
874 |
+
queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
|
875 |
+
/**
|
876 |
+
* Manipulate the queue of functions to be executed on the matched element.
|
877 |
+
*
|
878 |
+
* @param element A DOM element on which to add a queued function.
|
879 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
880 |
+
* @param callback The new function to add to the queue.
|
881 |
+
*/
|
882 |
+
queue(element: Element, queueName: string, callback: Function): JQuery;
|
883 |
+
|
884 |
+
/**
|
885 |
+
* Remove a previously-stored piece of data.
|
886 |
+
*
|
887 |
+
* @param element A DOM element from which to remove data.
|
888 |
+
* @param name A string naming the piece of data to remove.
|
889 |
+
*/
|
890 |
+
removeData(element: Element, name?: string): JQuery;
|
891 |
+
|
892 |
+
/**
|
893 |
+
* A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
|
894 |
+
*
|
895 |
+
* @param beforeStart A function that is called just before the constructor returns.
|
896 |
+
*/
|
897 |
+
Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
|
898 |
+
|
899 |
+
/**
|
900 |
+
* Effects
|
901 |
+
*/
|
902 |
+
|
903 |
+
easing: JQueryEasingFunctions;
|
904 |
+
|
905 |
+
fx: {
|
906 |
+
tick: () => void;
|
907 |
+
/**
|
908 |
+
* The rate (in milliseconds) at which animations fire.
|
909 |
+
*/
|
910 |
+
interval: number;
|
911 |
+
stop: () => void;
|
912 |
+
speeds: { slow: number; fast: number; };
|
913 |
+
/**
|
914 |
+
* Globally disable all animations.
|
915 |
+
*/
|
916 |
+
off: boolean;
|
917 |
+
step: any;
|
918 |
+
};
|
919 |
+
|
920 |
+
/**
|
921 |
+
* Takes a function and returns a new one that will always have a particular context.
|
922 |
+
*
|
923 |
+
* @param fnction The function whose context will be changed.
|
924 |
+
* @param context The object to which the context (this) of the function should be set.
|
925 |
+
* @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
|
926 |
+
*/
|
927 |
+
proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
|
928 |
+
/**
|
929 |
+
* Takes a function and returns a new one that will always have a particular context.
|
930 |
+
*
|
931 |
+
* @param context The object to which the context (this) of the function should be set.
|
932 |
+
* @param name The name of the function whose context will be changed (should be a property of the context object).
|
933 |
+
* @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
|
934 |
+
*/
|
935 |
+
proxy(context: Object, name: string, ...additionalArguments: any[]): any;
|
936 |
+
|
937 |
+
Event: JQueryEventConstructor;
|
938 |
+
|
939 |
+
/**
|
940 |
+
* Takes a string and throws an exception containing it.
|
941 |
+
*
|
942 |
+
* @param message The message to send out.
|
943 |
+
*/
|
944 |
+
error(message: any): JQuery;
|
945 |
+
|
946 |
+
expr: any;
|
947 |
+
fn: any; //TODO: Decide how we want to type this
|
948 |
+
|
949 |
+
isReady: boolean;
|
950 |
+
|
951 |
+
// Properties
|
952 |
+
support: JQuerySupport;
|
953 |
+
|
954 |
+
/**
|
955 |
+
* Check to see if a DOM element is a descendant of another DOM element.
|
956 |
+
*
|
957 |
+
* @param container The DOM element that may contain the other element.
|
958 |
+
* @param contained The DOM element that may be contained by (a descendant of) the other element.
|
959 |
+
*/
|
960 |
+
contains(container: Element, contained: Element): boolean;
|
961 |
+
|
962 |
+
/**
|
963 |
+
* A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
|
964 |
+
*
|
965 |
+
* @param collection The object or array to iterate over.
|
966 |
+
* @param callback The function that will be executed on every object.
|
967 |
+
*/
|
968 |
+
each<T>(
|
969 |
+
collection: T[],
|
970 |
+
callback: (indexInArray: number, valueOfElement: T) => any
|
971 |
+
): any;
|
972 |
+
|
973 |
+
/**
|
974 |
+
* A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
|
975 |
+
*
|
976 |
+
* @param collection The object or array to iterate over.
|
977 |
+
* @param callback The function that will be executed on every object.
|
978 |
+
*/
|
979 |
+
each(
|
980 |
+
collection: any,
|
981 |
+
callback: (indexInArray: any, valueOfElement: any) => any
|
982 |
+
): any;
|
983 |
+
|
984 |
+
/**
|
985 |
+
* Merge the contents of two or more objects together into the first object.
|
986 |
+
*
|
987 |
+
* @param target An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.
|
988 |
+
* @param object1 An object containing additional properties to merge in.
|
989 |
+
* @param objectN Additional objects containing properties to merge in.
|
990 |
+
*/
|
991 |
+
extend(target: any, object1?: any, ...objectN: any[]): any;
|
992 |
+
/**
|
993 |
+
* Merge the contents of two or more objects together into the first object.
|
994 |
+
*
|
995 |
+
* @param deep If true, the merge becomes recursive (aka. deep copy).
|
996 |
+
* @param target The object to extend. It will receive the new properties.
|
997 |
+
* @param object1 An object containing additional properties to merge in.
|
998 |
+
* @param objectN Additional objects containing properties to merge in.
|
999 |
+
*/
|
1000 |
+
extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
|
1001 |
+
|
1002 |
+
/**
|
1003 |
+
* Execute some JavaScript code globally.
|
1004 |
+
*
|
1005 |
+
* @param code The JavaScript code to execute.
|
1006 |
+
*/
|
1007 |
+
globalEval(code: string): any;
|
1008 |
+
|
1009 |
+
/**
|
1010 |
+
* Finds the elements of an array which satisfy a filter function. The original array is not affected.
|
1011 |
+
*
|
1012 |
+
* @param array The array to search through.
|
1013 |
+
* @param func The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
|
1014 |
+
* @param invert If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
|
1015 |
+
*/
|
1016 |
+
grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
|
1017 |
+
|
1018 |
+
/**
|
1019 |
+
* Search for a specified value within an array and return its index (or -1 if not found).
|
1020 |
+
*
|
1021 |
+
* @param value The value to search for.
|
1022 |
+
* @param array An array through which to search.
|
1023 |
+
* @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
|
1024 |
+
*/
|
1025 |
+
inArray<T>(value: T, array: T[], fromIndex?: number): number;
|
1026 |
+
|
1027 |
+
/**
|
1028 |
+
* Determine whether the argument is an array.
|
1029 |
+
*
|
1030 |
+
* @param obj Object to test whether or not it is an array.
|
1031 |
+
*/
|
1032 |
+
isArray(obj: any): boolean;
|
1033 |
+
/**
|
1034 |
+
* Check to see if an object is empty (contains no enumerable properties).
|
1035 |
+
*
|
1036 |
+
* @param obj The object that will be checked to see if it's empty.
|
1037 |
+
*/
|
1038 |
+
isEmptyObject(obj: any): boolean;
|
1039 |
+
/**
|
1040 |
+
* Determine if the argument passed is a Javascript function object.
|
1041 |
+
*
|
1042 |
+
* @param obj Object to test whether or not it is a function.
|
1043 |
+
*/
|
1044 |
+
isFunction(obj: any): boolean;
|
1045 |
+
/**
|
1046 |
+
* Determines whether its argument is a number.
|
1047 |
+
*
|
1048 |
+
* @param obj The value to be tested.
|
1049 |
+
*/
|
1050 |
+
isNumeric(value: any): boolean;
|
1051 |
+
/**
|
1052 |
+
* Check to see if an object is a plain object (created using "{}" or "new Object").
|
1053 |
+
*
|
1054 |
+
* @param obj The object that will be checked to see if it's a plain object.
|
1055 |
+
*/
|
1056 |
+
isPlainObject(obj: any): boolean;
|
1057 |
+
/**
|
1058 |
+
* Determine whether the argument is a window.
|
1059 |
+
*
|
1060 |
+
* @param obj Object to test whether or not it is a window.
|
1061 |
+
*/
|
1062 |
+
isWindow(obj: any): boolean;
|
1063 |
+
/**
|
1064 |
+
* Check to see if a DOM node is within an XML document (or is an XML document).
|
1065 |
+
*
|
1066 |
+
* @param node he DOM node that will be checked to see if it's in an XML document.
|
1067 |
+
*/
|
1068 |
+
isXMLDoc(node: Node): boolean;
|
1069 |
+
|
1070 |
+
/**
|
1071 |
+
* Convert an array-like object into a true JavaScript array.
|
1072 |
+
*
|
1073 |
+
* @param obj Any object to turn into a native Array.
|
1074 |
+
*/
|
1075 |
+
makeArray(obj: any): any[];
|
1076 |
+
|
1077 |
+
/**
|
1078 |
+
* Translate all items in an array or object to new array of items.
|
1079 |
+
*
|
1080 |
+
* @param array The Array to translate.
|
1081 |
+
* @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
|
1082 |
+
*/
|
1083 |
+
map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
|
1084 |
+
/**
|
1085 |
+
* Translate all items in an array or object to new array of items.
|
1086 |
+
*
|
1087 |
+
* @param arrayOrObject The Array or Object to translate.
|
1088 |
+
* @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.
|
1089 |
+
*/
|
1090 |
+
map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
|
1091 |
+
|
1092 |
+
/**
|
1093 |
+
* Merge the contents of two arrays together into the first array.
|
1094 |
+
*
|
1095 |
+
* @param first The first array to merge, the elements of second added.
|
1096 |
+
* @param second The second array to merge into the first, unaltered.
|
1097 |
+
*/
|
1098 |
+
merge<T>(first: T[], second: T[]): T[];
|
1099 |
+
|
1100 |
+
/**
|
1101 |
+
* An empty function.
|
1102 |
+
*/
|
1103 |
+
noop(): any;
|
1104 |
+
|
1105 |
+
/**
|
1106 |
+
* Return a number representing the current time.
|
1107 |
+
*/
|
1108 |
+
now(): number;
|
1109 |
+
|
1110 |
+
/**
|
1111 |
+
* Takes a well-formed JSON string and returns the resulting JavaScript object.
|
1112 |
+
*
|
1113 |
+
* @param json The JSON string to parse.
|
1114 |
+
*/
|
1115 |
+
parseJSON(json: string): any;
|
1116 |
+
|
1117 |
+
/**
|
1118 |
+
* Parses a string into an XML document.
|
1119 |
+
*
|
1120 |
+
* @param data a well-formed XML string to be parsed
|
1121 |
+
*/
|
1122 |
+
parseXML(data: string): XMLDocument;
|
1123 |
+
|
1124 |
+
/**
|
1125 |
+
* Remove the whitespace from the beginning and end of a string.
|
1126 |
+
*
|
1127 |
+
* @param str Remove the whitespace from the beginning and end of a string.
|
1128 |
+
*/
|
1129 |
+
trim(str: string): string;
|
1130 |
+
|
1131 |
+
/**
|
1132 |
+
* Determine the internal JavaScript [[Class]] of an object.
|
1133 |
+
*
|
1134 |
+
* @param obj Object to get the internal JavaScript [[Class]] of.
|
1135 |
+
*/
|
1136 |
+
type(obj: any): string;
|
1137 |
+
|
1138 |
+
/**
|
1139 |
+
* Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
|
1140 |
+
*
|
1141 |
+
* @param array The Array of DOM elements.
|
1142 |
+
*/
|
1143 |
+
unique(array: Element[]): Element[];
|
1144 |
+
|
1145 |
+
/**
|
1146 |
+
* Parses a string into an array of DOM nodes.
|
1147 |
+
*
|
1148 |
+
* @param data HTML string to be parsed
|
1149 |
+
* @param context DOM element to serve as the context in which the HTML fragment will be created
|
1150 |
+
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
|
1151 |
+
*/
|
1152 |
+
parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
|
1153 |
+
|
1154 |
+
/**
|
1155 |
+
* Parses a string into an array of DOM nodes.
|
1156 |
+
*
|
1157 |
+
* @param data HTML string to be parsed
|
1158 |
+
* @param context DOM element to serve as the context in which the HTML fragment will be created
|
1159 |
+
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
|
1160 |
+
*/
|
1161 |
+
parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
/**
|
1165 |
+
* The jQuery instance members
|
1166 |
+
*/
|
1167 |
+
interface JQuery {
|
1168 |
+
/**
|
1169 |
+
* Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
|
1170 |
+
*
|
1171 |
+
* @param handler The function to be invoked.
|
1172 |
+
*/
|
1173 |
+
ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
|
1174 |
+
/**
|
1175 |
+
* Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
|
1176 |
+
*
|
1177 |
+
* @param handler The function to be invoked.
|
1178 |
+
*/
|
1179 |
+
ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
|
1180 |
+
/**
|
1181 |
+
* Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
|
1182 |
+
*
|
1183 |
+
* @param handler The function to be invoked.
|
1184 |
+
*/
|
1185 |
+
ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
|
1186 |
+
/**
|
1187 |
+
* Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
|
1188 |
+
*
|
1189 |
+
* @param handler The function to be invoked.
|
1190 |
+
*/
|
1191 |
+
ajaxStart(handler: () => any): JQuery;
|
1192 |
+
/**
|
1193 |
+
* Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
|
1194 |
+
*
|
1195 |
+
* @param handler The function to be invoked.
|
1196 |
+
*/
|
1197 |
+
ajaxStop(handler: () => any): JQuery;
|
1198 |
+
/**
|
1199 |
+
* Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
|
1200 |
+
*
|
1201 |
+
* @param handler The function to be invoked.
|
1202 |
+
*/
|
1203 |
+
ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
|
1204 |
+
|
1205 |
+
/**
|
1206 |
+
* Load data from the server and place the returned HTML into the matched element.
|
1207 |
+
*
|
1208 |
+
* @param url A string containing the URL to which the request is sent.
|
1209 |
+
* @param data A plain object or string that is sent to the server with the request.
|
1210 |
+
* @param complete A callback function that is executed when the request completes.
|
1211 |
+
*/
|
1212 |
+
load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
|
1213 |
+
|
1214 |
+
/**
|
1215 |
+
* Encode a set of form elements as a string for submission.
|
1216 |
+
*/
|
1217 |
+
serialize(): string;
|
1218 |
+
/**
|
1219 |
+
* Encode a set of form elements as an array of names and values.
|
1220 |
+
*/
|
1221 |
+
serializeArray(): JQuerySerializeArrayElement[];
|
1222 |
+
|
1223 |
+
/**
|
1224 |
+
* Adds the specified class(es) to each of the set of matched elements.
|
1225 |
+
*
|
1226 |
+
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
|
1227 |
+
*/
|
1228 |
+
addClass(className: string): JQuery;
|
1229 |
+
/**
|
1230 |
+
* Adds the specified class(es) to each of the set of matched elements.
|
1231 |
+
*
|
1232 |
+
* @param function A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.
|
1233 |
+
*/
|
1234 |
+
addClass(func: (index: number, className: string) => string): JQuery;
|
1235 |
+
|
1236 |
+
/**
|
1237 |
+
* Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
|
1238 |
+
*/
|
1239 |
+
addBack(selector?: string): JQuery;
|
1240 |
+
|
1241 |
+
/**
|
1242 |
+
* Get the value of an attribute for the first element in the set of matched elements.
|
1243 |
+
*
|
1244 |
+
* @param attributeName The name of the attribute to get.
|
1245 |
+
*/
|
1246 |
+
attr(attributeName: string): string;
|
1247 |
+
/**
|
1248 |
+
* Set one or more attributes for the set of matched elements.
|
1249 |
+
*
|
1250 |
+
* @param attributeName The name of the attribute to set.
|
1251 |
+
* @param value A value to set for the attribute.
|
1252 |
+
*/
|
1253 |
+
attr(attributeName: string, value: string|number): JQuery;
|
1254 |
+
/**
|
1255 |
+
* Set one or more attributes for the set of matched elements.
|
1256 |
+
*
|
1257 |
+
* @param attributeName The name of the attribute to set.
|
1258 |
+
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.
|
1259 |
+
*/
|
1260 |
+
attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
|
1261 |
+
/**
|
1262 |
+
* Set one or more attributes for the set of matched elements.
|
1263 |
+
*
|
1264 |
+
* @param attributes An object of attribute-value pairs to set.
|
1265 |
+
*/
|
1266 |
+
attr(attributes: Object): JQuery;
|
1267 |
+
|
1268 |
+
/**
|
1269 |
+
* Determine whether any of the matched elements are assigned the given class.
|
1270 |
+
*
|
1271 |
+
* @param className The class name to search for.
|
1272 |
+
*/
|
1273 |
+
hasClass(className: string): boolean;
|
1274 |
+
|
1275 |
+
/**
|
1276 |
+
* Get the HTML contents of the first element in the set of matched elements.
|
1277 |
+
*/
|
1278 |
+
html(): string;
|
1279 |
+
/**
|
1280 |
+
* Set the HTML contents of each element in the set of matched elements.
|
1281 |
+
*
|
1282 |
+
* @param htmlString A string of HTML to set as the content of each matched element.
|
1283 |
+
*/
|
1284 |
+
html(htmlString: string): JQuery;
|
1285 |
+
/**
|
1286 |
+
* Set the HTML contents of each element in the set of matched elements.
|
1287 |
+
*
|
1288 |
+
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
|
1289 |
+
*/
|
1290 |
+
html(func: (index: number, oldhtml: string) => string): JQuery;
|
1291 |
+
/**
|
1292 |
+
* Set the HTML contents of each element in the set of matched elements.
|
1293 |
+
*
|
1294 |
+
* @param func A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.
|
1295 |
+
*/
|
1296 |
+
|
1297 |
+
/**
|
1298 |
+
* Get the value of a property for the first element in the set of matched elements.
|
1299 |
+
*
|
1300 |
+
* @param propertyName The name of the property to get.
|
1301 |
+
*/
|
1302 |
+
prop(propertyName: string): any;
|
1303 |
+
/**
|
1304 |
+
* Set one or more properties for the set of matched elements.
|
1305 |
+
*
|
1306 |
+
* @param propertyName The name of the property to set.
|
1307 |
+
* @param value A value to set for the property.
|
1308 |
+
*/
|
1309 |
+
prop(propertyName: string, value: string|number|boolean): JQuery;
|
1310 |
+
/**
|
1311 |
+
* Set one or more properties for the set of matched elements.
|
1312 |
+
*
|
1313 |
+
* @param properties An object of property-value pairs to set.
|
1314 |
+
*/
|
1315 |
+
prop(properties: Object): JQuery;
|
1316 |
+
/**
|
1317 |
+
* Set one or more properties for the set of matched elements.
|
1318 |
+
*
|
1319 |
+
* @param propertyName The name of the property to set.
|
1320 |
+
* @param func A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.
|
1321 |
+
*/
|
1322 |
+
prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
|
1323 |
+
|
1324 |
+
/**
|
1325 |
+
* Remove an attribute from each element in the set of matched elements.
|
1326 |
+
*
|
1327 |
+
* @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
|
1328 |
+
*/
|
1329 |
+
removeAttr(attributeName: string): JQuery;
|
1330 |
+
|
1331 |
+
/**
|
1332 |
+
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
1333 |
+
*
|
1334 |
+
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
|
1335 |
+
*/
|
1336 |
+
removeClass(className?: string): JQuery;
|
1337 |
+
/**
|
1338 |
+
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
|
1339 |
+
*
|
1340 |
+
* @param function A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.
|
1341 |
+
*/
|
1342 |
+
removeClass(func: (index: number, className: string) => string): JQuery;
|
1343 |
+
|
1344 |
+
/**
|
1345 |
+
* Remove a property for the set of matched elements.
|
1346 |
+
*
|
1347 |
+
* @param propertyName The name of the property to remove.
|
1348 |
+
*/
|
1349 |
+
removeProp(propertyName: string): JQuery;
|
1350 |
+
|
1351 |
+
/**
|
1352 |
+
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
1353 |
+
*
|
1354 |
+
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
|
1355 |
+
* @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
|
1356 |
+
*/
|
1357 |
+
toggleClass(className: string, swtch?: boolean): JQuery;
|
1358 |
+
/**
|
1359 |
+
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
1360 |
+
*
|
1361 |
+
* @param swtch A boolean value to determine whether the class should be added or removed.
|
1362 |
+
*/
|
1363 |
+
toggleClass(swtch?: boolean): JQuery;
|
1364 |
+
/**
|
1365 |
+
* Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
|
1366 |
+
*
|
1367 |
+
* @param func A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.
|
1368 |
+
* @param swtch A boolean value to determine whether the class should be added or removed.
|
1369 |
+
*/
|
1370 |
+
toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
|
1371 |
+
|
1372 |
+
/**
|
1373 |
+
* Get the current value of the first element in the set of matched elements.
|
1374 |
+
*/
|
1375 |
+
val(): any;
|
1376 |
+
/**
|
1377 |
+
* Set the value of each element in the set of matched elements.
|
1378 |
+
*
|
1379 |
+
* @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
|
1380 |
+
*/
|
1381 |
+
val(value: string|string[]|number): JQuery;
|
1382 |
+
/**
|
1383 |
+
* Set the value of each element in the set of matched elements.
|
1384 |
+
*
|
1385 |
+
* @param func A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
1386 |
+
*/
|
1387 |
+
val(func: (index: number, value: string) => string): JQuery;
|
1388 |
+
|
1389 |
+
|
1390 |
+
/**
|
1391 |
+
* Get the value of style properties for the first element in the set of matched elements.
|
1392 |
+
*
|
1393 |
+
* @param propertyName A CSS property.
|
1394 |
+
*/
|
1395 |
+
css(propertyName: string): string;
|
1396 |
+
/**
|
1397 |
+
* Set one or more CSS properties for the set of matched elements.
|
1398 |
+
*
|
1399 |
+
* @param propertyName A CSS property name.
|
1400 |
+
* @param value A value to set for the property.
|
1401 |
+
*/
|
1402 |
+
css(propertyName: string, value: string|number): JQuery;
|
1403 |
+
/**
|
1404 |
+
* Set one or more CSS properties for the set of matched elements.
|
1405 |
+
*
|
1406 |
+
* @param propertyName A CSS property name.
|
1407 |
+
* @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.
|
1408 |
+
*/
|
1409 |
+
css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
|
1410 |
+
/**
|
1411 |
+
* Set one or more CSS properties for the set of matched elements.
|
1412 |
+
*
|
1413 |
+
* @param properties An object of property-value pairs to set.
|
1414 |
+
*/
|
1415 |
+
css(properties: Object): JQuery;
|
1416 |
+
|
1417 |
+
/**
|
1418 |
+
* Get the current computed height for the first element in the set of matched elements.
|
1419 |
+
*/
|
1420 |
+
height(): number;
|
1421 |
+
/**
|
1422 |
+
* Set the CSS height of every matched element.
|
1423 |
+
*
|
1424 |
+
* @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
|
1425 |
+
*/
|
1426 |
+
height(value: number|string): JQuery;
|
1427 |
+
/**
|
1428 |
+
* Set the CSS height of every matched element.
|
1429 |
+
*
|
1430 |
+
* @param func A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.
|
1431 |
+
*/
|
1432 |
+
height(func: (index: number, height: number) => number|string): JQuery;
|
1433 |
+
|
1434 |
+
/**
|
1435 |
+
* Get the current computed height for the first element in the set of matched elements, including padding but not border.
|
1436 |
+
*/
|
1437 |
+
innerHeight(): number;
|
1438 |
+
|
1439 |
+
/**
|
1440 |
+
* Sets the inner height on elements in the set of matched elements, including padding but not border.
|
1441 |
+
*
|
1442 |
+
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
1443 |
+
*/
|
1444 |
+
innerHeight(height: number|string): JQuery;
|
1445 |
+
|
1446 |
+
/**
|
1447 |
+
* Get the current computed width for the first element in the set of matched elements, including padding but not border.
|
1448 |
+
*/
|
1449 |
+
innerWidth(): number;
|
1450 |
+
|
1451 |
+
/**
|
1452 |
+
* Sets the inner width on elements in the set of matched elements, including padding but not border.
|
1453 |
+
*
|
1454 |
+
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
1455 |
+
*/
|
1456 |
+
innerWidth(width: number|string): JQuery;
|
1457 |
+
|
1458 |
+
/**
|
1459 |
+
* Get the current coordinates of the first element in the set of matched elements, relative to the document.
|
1460 |
+
*/
|
1461 |
+
offset(): JQueryCoordinates;
|
1462 |
+
/**
|
1463 |
+
* An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
1464 |
+
*
|
1465 |
+
* @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
1466 |
+
*/
|
1467 |
+
offset(coordinates: JQueryCoordinates): JQuery;
|
1468 |
+
/**
|
1469 |
+
* An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
|
1470 |
+
*
|
1471 |
+
* @param func A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.
|
1472 |
+
*/
|
1473 |
+
offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
|
1474 |
+
|
1475 |
+
/**
|
1476 |
+
* Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
|
1477 |
+
*
|
1478 |
+
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
|
1479 |
+
*/
|
1480 |
+
outerHeight(includeMargin?: boolean): number;
|
1481 |
+
|
1482 |
+
/**
|
1483 |
+
* Sets the outer height on elements in the set of matched elements, including padding and border.
|
1484 |
+
*
|
1485 |
+
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
1486 |
+
*/
|
1487 |
+
outerHeight(height: number|string): JQuery;
|
1488 |
+
|
1489 |
+
/**
|
1490 |
+
* Get the current computed width for the first element in the set of matched elements, including padding and border.
|
1491 |
+
*
|
1492 |
+
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
|
1493 |
+
*/
|
1494 |
+
outerWidth(includeMargin?: boolean): number;
|
1495 |
+
|
1496 |
+
/**
|
1497 |
+
* Sets the outer width on elements in the set of matched elements, including padding and border.
|
1498 |
+
*
|
1499 |
+
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
1500 |
+
*/
|
1501 |
+
outerWidth(width: number|string): JQuery;
|
1502 |
+
|
1503 |
+
/**
|
1504 |
+
* Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
|
1505 |
+
*/
|
1506 |
+
position(): JQueryCoordinates;
|
1507 |
+
|
1508 |
+
/**
|
1509 |
+
* Get the current horizontal position of the scroll bar for the first element in the set of matched elements or set the horizontal position of the scroll bar for every matched element.
|
1510 |
+
*/
|
1511 |
+
scrollLeft(): number;
|
1512 |
+
/**
|
1513 |
+
* Set the current horizontal position of the scroll bar for each of the set of matched elements.
|
1514 |
+
*
|
1515 |
+
* @param value An integer indicating the new position to set the scroll bar to.
|
1516 |
+
*/
|
1517 |
+
scrollLeft(value: number): JQuery;
|
1518 |
+
|
1519 |
+
/**
|
1520 |
+
* Get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element.
|
1521 |
+
*/
|
1522 |
+
scrollTop(): number;
|
1523 |
+
/**
|
1524 |
+
* Set the current vertical position of the scroll bar for each of the set of matched elements.
|
1525 |
+
*
|
1526 |
+
* @param value An integer indicating the new position to set the scroll bar to.
|
1527 |
+
*/
|
1528 |
+
scrollTop(value: number): JQuery;
|
1529 |
+
|
1530 |
+
/**
|
1531 |
+
* Get the current computed width for the first element in the set of matched elements.
|
1532 |
+
*/
|
1533 |
+
width(): number;
|
1534 |
+
/**
|
1535 |
+
* Set the CSS width of each element in the set of matched elements.
|
1536 |
+
*
|
1537 |
+
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
|
1538 |
+
*/
|
1539 |
+
width(value: number|string): JQuery;
|
1540 |
+
/**
|
1541 |
+
* Set the CSS width of each element in the set of matched elements.
|
1542 |
+
*
|
1543 |
+
* @param func A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.
|
1544 |
+
*/
|
1545 |
+
width(func: (index: number, width: number) => number|string): JQuery;
|
1546 |
+
|
1547 |
+
/**
|
1548 |
+
* Remove from the queue all items that have not yet been run.
|
1549 |
+
*
|
1550 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
1551 |
+
*/
|
1552 |
+
clearQueue(queueName?: string): JQuery;
|
1553 |
+
|
1554 |
+
/**
|
1555 |
+
* Store arbitrary data associated with the matched elements.
|
1556 |
+
*
|
1557 |
+
* @param key A string naming the piece of data to set.
|
1558 |
+
* @param value The new data value; it can be any Javascript type including Array or Object.
|
1559 |
+
*/
|
1560 |
+
data(key: string, value: any): JQuery;
|
1561 |
+
/**
|
1562 |
+
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
1563 |
+
*
|
1564 |
+
* @param key Name of the data stored.
|
1565 |
+
*/
|
1566 |
+
data(key: string): any;
|
1567 |
+
/**
|
1568 |
+
* Store arbitrary data associated with the matched elements.
|
1569 |
+
*
|
1570 |
+
* @param obj An object of key-value pairs of data to update.
|
1571 |
+
*/
|
1572 |
+
data(obj: { [key: string]: any; }): JQuery;
|
1573 |
+
/**
|
1574 |
+
* Return the value at the named data store for the first element in the jQuery collection, as set by data(name, value) or by an HTML5 data-* attribute.
|
1575 |
+
*/
|
1576 |
+
data(): any;
|
1577 |
+
|
1578 |
+
/**
|
1579 |
+
* Execute the next function on the queue for the matched elements.
|
1580 |
+
*
|
1581 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
1582 |
+
*/
|
1583 |
+
dequeue(queueName?: string): JQuery;
|
1584 |
+
|
1585 |
+
/**
|
1586 |
+
* Remove a previously-stored piece of data.
|
1587 |
+
*
|
1588 |
+
* @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
|
1589 |
+
*/
|
1590 |
+
removeData(name: string): JQuery;
|
1591 |
+
/**
|
1592 |
+
* Remove a previously-stored piece of data.
|
1593 |
+
*
|
1594 |
+
* @param list An array of strings naming the pieces of data to delete.
|
1595 |
+
*/
|
1596 |
+
removeData(list: string[]): JQuery;
|
1597 |
+
/**
|
1598 |
+
* Remove all previously-stored piece of data.
|
1599 |
+
*/
|
1600 |
+
removeData(): JQuery;
|
1601 |
+
|
1602 |
+
/**
|
1603 |
+
* Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
|
1604 |
+
*
|
1605 |
+
* @param type The type of queue that needs to be observed. (default: fx)
|
1606 |
+
* @param target Object onto which the promise methods have to be attached
|
1607 |
+
*/
|
1608 |
+
promise(type?: string, target?: Object): JQueryPromise<any>;
|
1609 |
+
|
1610 |
+
/**
|
1611 |
+
* Perform a custom animation of a set of CSS properties.
|
1612 |
+
*
|
1613 |
+
* @param properties An object of CSS properties and values that the animation will move toward.
|
1614 |
+
* @param duration A string or number determining how long the animation will run.
|
1615 |
+
* @param complete A function to call once the animation is complete.
|
1616 |
+
*/
|
1617 |
+
animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
|
1618 |
+
/**
|
1619 |
+
* Perform a custom animation of a set of CSS properties.
|
1620 |
+
*
|
1621 |
+
* @param properties An object of CSS properties and values that the animation will move toward.
|
1622 |
+
* @param duration A string or number determining how long the animation will run.
|
1623 |
+
* @param easing A string indicating which easing function to use for the transition. (default: swing)
|
1624 |
+
* @param complete A function to call once the animation is complete.
|
1625 |
+
*/
|
1626 |
+
animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
|
1627 |
+
/**
|
1628 |
+
* Perform a custom animation of a set of CSS properties.
|
1629 |
+
*
|
1630 |
+
* @param properties An object of CSS properties and values that the animation will move toward.
|
1631 |
+
* @param options A map of additional options to pass to the method.
|
1632 |
+
*/
|
1633 |
+
animate(properties: Object, options: JQueryAnimationOptions): JQuery;
|
1634 |
+
|
1635 |
+
/**
|
1636 |
+
* Set a timer to delay execution of subsequent items in the queue.
|
1637 |
+
*
|
1638 |
+
* @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
|
1639 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
1640 |
+
*/
|
1641 |
+
delay(duration: number, queueName?: string): JQuery;
|
1642 |
+
|
1643 |
+
/**
|
1644 |
+
* Display the matched elements by fading them to opaque.
|
1645 |
+
*
|
1646 |
+
* @param duration A string or number determining how long the animation will run.
|
1647 |
+
* @param complete A function to call once the animation is complete.
|
1648 |
+
*/
|
1649 |
+
fadeIn(duration?: number|string, complete?: Function): JQuery;
|
1650 |
+
/**
|
1651 |
+
* Display the matched elements by fading them to opaque.
|
1652 |
+
*
|
1653 |
+
* @param duration A string or number determining how long the animation will run.
|
1654 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1655 |
+
* @param complete A function to call once the animation is complete.
|
1656 |
+
*/
|
1657 |
+
fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1658 |
+
/**
|
1659 |
+
* Display the matched elements by fading them to opaque.
|
1660 |
+
*
|
1661 |
+
* @param options A map of additional options to pass to the method.
|
1662 |
+
*/
|
1663 |
+
fadeIn(options: JQueryAnimationOptions): JQuery;
|
1664 |
+
|
1665 |
+
/**
|
1666 |
+
* Hide the matched elements by fading them to transparent.
|
1667 |
+
*
|
1668 |
+
* @param duration A string or number determining how long the animation will run.
|
1669 |
+
* @param complete A function to call once the animation is complete.
|
1670 |
+
*/
|
1671 |
+
fadeOut(duration?: number|string, complete?: Function): JQuery;
|
1672 |
+
/**
|
1673 |
+
* Hide the matched elements by fading them to transparent.
|
1674 |
+
*
|
1675 |
+
* @param duration A string or number determining how long the animation will run.
|
1676 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1677 |
+
* @param complete A function to call once the animation is complete.
|
1678 |
+
*/
|
1679 |
+
fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1680 |
+
/**
|
1681 |
+
* Hide the matched elements by fading them to transparent.
|
1682 |
+
*
|
1683 |
+
* @param options A map of additional options to pass to the method.
|
1684 |
+
*/
|
1685 |
+
fadeOut(options: JQueryAnimationOptions): JQuery;
|
1686 |
+
|
1687 |
+
/**
|
1688 |
+
* Adjust the opacity of the matched elements.
|
1689 |
+
*
|
1690 |
+
* @param duration A string or number determining how long the animation will run.
|
1691 |
+
* @param opacity A number between 0 and 1 denoting the target opacity.
|
1692 |
+
* @param complete A function to call once the animation is complete.
|
1693 |
+
*/
|
1694 |
+
fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
|
1695 |
+
/**
|
1696 |
+
* Adjust the opacity of the matched elements.
|
1697 |
+
*
|
1698 |
+
* @param duration A string or number determining how long the animation will run.
|
1699 |
+
* @param opacity A number between 0 and 1 denoting the target opacity.
|
1700 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1701 |
+
* @param complete A function to call once the animation is complete.
|
1702 |
+
*/
|
1703 |
+
fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
|
1704 |
+
|
1705 |
+
/**
|
1706 |
+
* Display or hide the matched elements by animating their opacity.
|
1707 |
+
*
|
1708 |
+
* @param duration A string or number determining how long the animation will run.
|
1709 |
+
* @param complete A function to call once the animation is complete.
|
1710 |
+
*/
|
1711 |
+
fadeToggle(duration?: number|string, complete?: Function): JQuery;
|
1712 |
+
/**
|
1713 |
+
* Display or hide the matched elements by animating their opacity.
|
1714 |
+
*
|
1715 |
+
* @param duration A string or number determining how long the animation will run.
|
1716 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1717 |
+
* @param complete A function to call once the animation is complete.
|
1718 |
+
*/
|
1719 |
+
fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1720 |
+
/**
|
1721 |
+
* Display or hide the matched elements by animating their opacity.
|
1722 |
+
*
|
1723 |
+
* @param options A map of additional options to pass to the method.
|
1724 |
+
*/
|
1725 |
+
fadeToggle(options: JQueryAnimationOptions): JQuery;
|
1726 |
+
|
1727 |
+
/**
|
1728 |
+
* Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
|
1729 |
+
*
|
1730 |
+
* @param queue The name of the queue in which to stop animations.
|
1731 |
+
*/
|
1732 |
+
finish(queue?: string): JQuery;
|
1733 |
+
|
1734 |
+
/**
|
1735 |
+
* Hide the matched elements.
|
1736 |
+
*
|
1737 |
+
* @param duration A string or number determining how long the animation will run.
|
1738 |
+
* @param complete A function to call once the animation is complete.
|
1739 |
+
*/
|
1740 |
+
hide(duration?: number|string, complete?: Function): JQuery;
|
1741 |
+
/**
|
1742 |
+
* Hide the matched elements.
|
1743 |
+
*
|
1744 |
+
* @param duration A string or number determining how long the animation will run.
|
1745 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1746 |
+
* @param complete A function to call once the animation is complete.
|
1747 |
+
*/
|
1748 |
+
hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1749 |
+
/**
|
1750 |
+
* Hide the matched elements.
|
1751 |
+
*
|
1752 |
+
* @param options A map of additional options to pass to the method.
|
1753 |
+
*/
|
1754 |
+
hide(options: JQueryAnimationOptions): JQuery;
|
1755 |
+
|
1756 |
+
/**
|
1757 |
+
* Display the matched elements.
|
1758 |
+
*
|
1759 |
+
* @param duration A string or number determining how long the animation will run.
|
1760 |
+
* @param complete A function to call once the animation is complete.
|
1761 |
+
*/
|
1762 |
+
show(duration?: number|string, complete?: Function): JQuery;
|
1763 |
+
/**
|
1764 |
+
* Display the matched elements.
|
1765 |
+
*
|
1766 |
+
* @param duration A string or number determining how long the animation will run.
|
1767 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1768 |
+
* @param complete A function to call once the animation is complete.
|
1769 |
+
*/
|
1770 |
+
show(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1771 |
+
/**
|
1772 |
+
* Display the matched elements.
|
1773 |
+
*
|
1774 |
+
* @param options A map of additional options to pass to the method.
|
1775 |
+
*/
|
1776 |
+
show(options: JQueryAnimationOptions): JQuery;
|
1777 |
+
|
1778 |
+
/**
|
1779 |
+
* Display the matched elements with a sliding motion.
|
1780 |
+
*
|
1781 |
+
* @param duration A string or number determining how long the animation will run.
|
1782 |
+
* @param complete A function to call once the animation is complete.
|
1783 |
+
*/
|
1784 |
+
slideDown(duration?: number|string, complete?: Function): JQuery;
|
1785 |
+
/**
|
1786 |
+
* Display the matched elements with a sliding motion.
|
1787 |
+
*
|
1788 |
+
* @param duration A string or number determining how long the animation will run.
|
1789 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1790 |
+
* @param complete A function to call once the animation is complete.
|
1791 |
+
*/
|
1792 |
+
slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1793 |
+
/**
|
1794 |
+
* Display the matched elements with a sliding motion.
|
1795 |
+
*
|
1796 |
+
* @param options A map of additional options to pass to the method.
|
1797 |
+
*/
|
1798 |
+
slideDown(options: JQueryAnimationOptions): JQuery;
|
1799 |
+
|
1800 |
+
/**
|
1801 |
+
* Display or hide the matched elements with a sliding motion.
|
1802 |
+
*
|
1803 |
+
* @param duration A string or number determining how long the animation will run.
|
1804 |
+
* @param complete A function to call once the animation is complete.
|
1805 |
+
*/
|
1806 |
+
slideToggle(duration?: number|string, complete?: Function): JQuery;
|
1807 |
+
/**
|
1808 |
+
* Display or hide the matched elements with a sliding motion.
|
1809 |
+
*
|
1810 |
+
* @param duration A string or number determining how long the animation will run.
|
1811 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1812 |
+
* @param complete A function to call once the animation is complete.
|
1813 |
+
*/
|
1814 |
+
slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1815 |
+
/**
|
1816 |
+
* Display or hide the matched elements with a sliding motion.
|
1817 |
+
*
|
1818 |
+
* @param options A map of additional options to pass to the method.
|
1819 |
+
*/
|
1820 |
+
slideToggle(options: JQueryAnimationOptions): JQuery;
|
1821 |
+
|
1822 |
+
/**
|
1823 |
+
* Hide the matched elements with a sliding motion.
|
1824 |
+
*
|
1825 |
+
* @param duration A string or number determining how long the animation will run.
|
1826 |
+
* @param complete A function to call once the animation is complete.
|
1827 |
+
*/
|
1828 |
+
slideUp(duration?: number|string, complete?: Function): JQuery;
|
1829 |
+
/**
|
1830 |
+
* Hide the matched elements with a sliding motion.
|
1831 |
+
*
|
1832 |
+
* @param duration A string or number determining how long the animation will run.
|
1833 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1834 |
+
* @param complete A function to call once the animation is complete.
|
1835 |
+
*/
|
1836 |
+
slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1837 |
+
/**
|
1838 |
+
* Hide the matched elements with a sliding motion.
|
1839 |
+
*
|
1840 |
+
* @param options A map of additional options to pass to the method.
|
1841 |
+
*/
|
1842 |
+
slideUp(options: JQueryAnimationOptions): JQuery;
|
1843 |
+
|
1844 |
+
/**
|
1845 |
+
* Stop the currently-running animation on the matched elements.
|
1846 |
+
*
|
1847 |
+
* @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
|
1848 |
+
* @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
|
1849 |
+
*/
|
1850 |
+
stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
|
1851 |
+
/**
|
1852 |
+
* Stop the currently-running animation on the matched elements.
|
1853 |
+
*
|
1854 |
+
* @param queue The name of the queue in which to stop animations.
|
1855 |
+
* @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
|
1856 |
+
* @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
|
1857 |
+
*/
|
1858 |
+
stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
|
1859 |
+
|
1860 |
+
/**
|
1861 |
+
* Display or hide the matched elements.
|
1862 |
+
*
|
1863 |
+
* @param duration A string or number determining how long the animation will run.
|
1864 |
+
* @param complete A function to call once the animation is complete.
|
1865 |
+
*/
|
1866 |
+
toggle(duration?: number|string, complete?: Function): JQuery;
|
1867 |
+
/**
|
1868 |
+
* Display or hide the matched elements.
|
1869 |
+
*
|
1870 |
+
* @param duration A string or number determining how long the animation will run.
|
1871 |
+
* @param easing A string indicating which easing function to use for the transition.
|
1872 |
+
* @param complete A function to call once the animation is complete.
|
1873 |
+
*/
|
1874 |
+
toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
|
1875 |
+
/**
|
1876 |
+
* Display or hide the matched elements.
|
1877 |
+
*
|
1878 |
+
* @param options A map of additional options to pass to the method.
|
1879 |
+
*/
|
1880 |
+
toggle(options: JQueryAnimationOptions): JQuery;
|
1881 |
+
/**
|
1882 |
+
* Display or hide the matched elements.
|
1883 |
+
*
|
1884 |
+
* @param showOrHide A Boolean indicating whether to show or hide the elements.
|
1885 |
+
*/
|
1886 |
+
toggle(showOrHide: boolean): JQuery;
|
1887 |
+
|
1888 |
+
/**
|
1889 |
+
* Attach a handler to an event for the elements.
|
1890 |
+
*
|
1891 |
+
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
1892 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1893 |
+
* @param handler A function to execute each time the event is triggered.
|
1894 |
+
*/
|
1895 |
+
bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1896 |
+
/**
|
1897 |
+
* Attach a handler to an event for the elements.
|
1898 |
+
*
|
1899 |
+
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
1900 |
+
* @param handler A function to execute each time the event is triggered.
|
1901 |
+
*/
|
1902 |
+
bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1903 |
+
/**
|
1904 |
+
* Attach a handler to an event for the elements.
|
1905 |
+
*
|
1906 |
+
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
1907 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1908 |
+
* @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
|
1909 |
+
*/
|
1910 |
+
bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
|
1911 |
+
/**
|
1912 |
+
* Attach a handler to an event for the elements.
|
1913 |
+
*
|
1914 |
+
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
1915 |
+
* @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.
|
1916 |
+
*/
|
1917 |
+
bind(eventType: string, preventBubble: boolean): JQuery;
|
1918 |
+
/**
|
1919 |
+
* Attach a handler to an event for the elements.
|
1920 |
+
*
|
1921 |
+
* @param events An object containing one or more DOM event types and functions to execute for them.
|
1922 |
+
*/
|
1923 |
+
bind(events: any): JQuery;
|
1924 |
+
|
1925 |
+
/**
|
1926 |
+
* Trigger the "blur" event on an element
|
1927 |
+
*/
|
1928 |
+
blur(): JQuery;
|
1929 |
+
/**
|
1930 |
+
* Bind an event handler to the "blur" JavaScript event
|
1931 |
+
*
|
1932 |
+
* @param handler A function to execute each time the event is triggered.
|
1933 |
+
*/
|
1934 |
+
blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1935 |
+
/**
|
1936 |
+
* Bind an event handler to the "blur" JavaScript event
|
1937 |
+
*
|
1938 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1939 |
+
* @param handler A function to execute each time the event is triggered.
|
1940 |
+
*/
|
1941 |
+
blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
1942 |
+
|
1943 |
+
/**
|
1944 |
+
* Trigger the "change" event on an element.
|
1945 |
+
*/
|
1946 |
+
change(): JQuery;
|
1947 |
+
/**
|
1948 |
+
* Bind an event handler to the "change" JavaScript event
|
1949 |
+
*
|
1950 |
+
* @param handler A function to execute each time the event is triggered.
|
1951 |
+
*/
|
1952 |
+
change(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1953 |
+
/**
|
1954 |
+
* Bind an event handler to the "change" JavaScript event
|
1955 |
+
*
|
1956 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1957 |
+
* @param handler A function to execute each time the event is triggered.
|
1958 |
+
*/
|
1959 |
+
change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
1960 |
+
|
1961 |
+
/**
|
1962 |
+
* Trigger the "click" event on an element.
|
1963 |
+
*/
|
1964 |
+
click(): JQuery;
|
1965 |
+
/**
|
1966 |
+
* Bind an event handler to the "click" JavaScript event
|
1967 |
+
*
|
1968 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1969 |
+
*/
|
1970 |
+
click(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1971 |
+
/**
|
1972 |
+
* Bind an event handler to the "click" JavaScript event
|
1973 |
+
*
|
1974 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1975 |
+
* @param handler A function to execute each time the event is triggered.
|
1976 |
+
*/
|
1977 |
+
click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
1978 |
+
|
1979 |
+
/**
|
1980 |
+
* Trigger the "dblclick" event on an element.
|
1981 |
+
*/
|
1982 |
+
dblclick(): JQuery;
|
1983 |
+
/**
|
1984 |
+
* Bind an event handler to the "dblclick" JavaScript event
|
1985 |
+
*
|
1986 |
+
* @param handler A function to execute each time the event is triggered.
|
1987 |
+
*/
|
1988 |
+
dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1989 |
+
/**
|
1990 |
+
* Bind an event handler to the "dblclick" JavaScript event
|
1991 |
+
*
|
1992 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
1993 |
+
* @param handler A function to execute each time the event is triggered.
|
1994 |
+
*/
|
1995 |
+
dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
1996 |
+
|
1997 |
+
delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1998 |
+
delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
1999 |
+
|
2000 |
+
/**
|
2001 |
+
* Trigger the "focus" event on an element.
|
2002 |
+
*/
|
2003 |
+
focus(): JQuery;
|
2004 |
+
/**
|
2005 |
+
* Bind an event handler to the "focus" JavaScript event
|
2006 |
+
*
|
2007 |
+
* @param handler A function to execute each time the event is triggered.
|
2008 |
+
*/
|
2009 |
+
focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2010 |
+
/**
|
2011 |
+
* Bind an event handler to the "focus" JavaScript event
|
2012 |
+
*
|
2013 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2014 |
+
* @param handler A function to execute each time the event is triggered.
|
2015 |
+
*/
|
2016 |
+
focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2017 |
+
|
2018 |
+
/**
|
2019 |
+
* Trigger the "focusin" event on an element.
|
2020 |
+
*/
|
2021 |
+
focusin(): JQuery;
|
2022 |
+
/**
|
2023 |
+
* Bind an event handler to the "focusin" JavaScript event
|
2024 |
+
*
|
2025 |
+
* @param handler A function to execute each time the event is triggered.
|
2026 |
+
*/
|
2027 |
+
focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2028 |
+
/**
|
2029 |
+
* Bind an event handler to the "focusin" JavaScript event
|
2030 |
+
*
|
2031 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2032 |
+
* @param handler A function to execute each time the event is triggered.
|
2033 |
+
*/
|
2034 |
+
focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2035 |
+
|
2036 |
+
/**
|
2037 |
+
* Trigger the "focusout" event on an element.
|
2038 |
+
*/
|
2039 |
+
focusout(): JQuery;
|
2040 |
+
/**
|
2041 |
+
* Bind an event handler to the "focusout" JavaScript event
|
2042 |
+
*
|
2043 |
+
* @param handler A function to execute each time the event is triggered.
|
2044 |
+
*/
|
2045 |
+
focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2046 |
+
/**
|
2047 |
+
* Bind an event handler to the "focusout" JavaScript event
|
2048 |
+
*
|
2049 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2050 |
+
* @param handler A function to execute each time the event is triggered.
|
2051 |
+
*/
|
2052 |
+
focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2053 |
+
|
2054 |
+
/**
|
2055 |
+
* Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
|
2056 |
+
*
|
2057 |
+
* @param handlerIn A function to execute when the mouse pointer enters the element.
|
2058 |
+
* @param handlerOut A function to execute when the mouse pointer leaves the element.
|
2059 |
+
*/
|
2060 |
+
hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
|
2061 |
+
/**
|
2062 |
+
* Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
|
2063 |
+
*
|
2064 |
+
* @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
|
2065 |
+
*/
|
2066 |
+
hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
|
2067 |
+
|
2068 |
+
/**
|
2069 |
+
* Trigger the "keydown" event on an element.
|
2070 |
+
*/
|
2071 |
+
keydown(): JQuery;
|
2072 |
+
/**
|
2073 |
+
* Bind an event handler to the "keydown" JavaScript event
|
2074 |
+
*
|
2075 |
+
* @param handler A function to execute each time the event is triggered.
|
2076 |
+
*/
|
2077 |
+
keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2078 |
+
/**
|
2079 |
+
* Bind an event handler to the "keydown" JavaScript event
|
2080 |
+
*
|
2081 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2082 |
+
* @param handler A function to execute each time the event is triggered.
|
2083 |
+
*/
|
2084 |
+
keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2085 |
+
|
2086 |
+
/**
|
2087 |
+
* Trigger the "keypress" event on an element.
|
2088 |
+
*/
|
2089 |
+
keypress(): JQuery;
|
2090 |
+
/**
|
2091 |
+
* Bind an event handler to the "keypress" JavaScript event
|
2092 |
+
*
|
2093 |
+
* @param handler A function to execute each time the event is triggered.
|
2094 |
+
*/
|
2095 |
+
keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2096 |
+
/**
|
2097 |
+
* Bind an event handler to the "keypress" JavaScript event
|
2098 |
+
*
|
2099 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2100 |
+
* @param handler A function to execute each time the event is triggered.
|
2101 |
+
*/
|
2102 |
+
keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2103 |
+
|
2104 |
+
/**
|
2105 |
+
* Trigger the "keyup" event on an element.
|
2106 |
+
*/
|
2107 |
+
keyup(): JQuery;
|
2108 |
+
/**
|
2109 |
+
* Bind an event handler to the "keyup" JavaScript event
|
2110 |
+
*
|
2111 |
+
* @param handler A function to execute each time the event is triggered.
|
2112 |
+
*/
|
2113 |
+
keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2114 |
+
/**
|
2115 |
+
* Bind an event handler to the "keyup" JavaScript event
|
2116 |
+
*
|
2117 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2118 |
+
* @param handler A function to execute each time the event is triggered.
|
2119 |
+
*/
|
2120 |
+
keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
|
2121 |
+
|
2122 |
+
/**
|
2123 |
+
* Bind an event handler to the "load" JavaScript event.
|
2124 |
+
*
|
2125 |
+
* @param handler A function to execute when the event is triggered.
|
2126 |
+
*/
|
2127 |
+
load(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2128 |
+
/**
|
2129 |
+
* Bind an event handler to the "load" JavaScript event.
|
2130 |
+
*
|
2131 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2132 |
+
* @param handler A function to execute when the event is triggered.
|
2133 |
+
*/
|
2134 |
+
load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2135 |
+
|
2136 |
+
/**
|
2137 |
+
* Trigger the "mousedown" event on an element.
|
2138 |
+
*/
|
2139 |
+
mousedown(): JQuery;
|
2140 |
+
/**
|
2141 |
+
* Bind an event handler to the "mousedown" JavaScript event.
|
2142 |
+
*
|
2143 |
+
* @param handler A function to execute when the event is triggered.
|
2144 |
+
*/
|
2145 |
+
mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2146 |
+
/**
|
2147 |
+
* Bind an event handler to the "mousedown" JavaScript event.
|
2148 |
+
*
|
2149 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2150 |
+
* @param handler A function to execute when the event is triggered.
|
2151 |
+
*/
|
2152 |
+
mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2153 |
+
|
2154 |
+
/**
|
2155 |
+
* Trigger the "mouseenter" event on an element.
|
2156 |
+
*/
|
2157 |
+
mouseenter(): JQuery;
|
2158 |
+
/**
|
2159 |
+
* Bind an event handler to be fired when the mouse enters an element.
|
2160 |
+
*
|
2161 |
+
* @param handler A function to execute when the event is triggered.
|
2162 |
+
*/
|
2163 |
+
mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2164 |
+
/**
|
2165 |
+
* Bind an event handler to be fired when the mouse enters an element.
|
2166 |
+
*
|
2167 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2168 |
+
* @param handler A function to execute when the event is triggered.
|
2169 |
+
*/
|
2170 |
+
mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2171 |
+
|
2172 |
+
/**
|
2173 |
+
* Trigger the "mouseleave" event on an element.
|
2174 |
+
*/
|
2175 |
+
mouseleave(): JQuery;
|
2176 |
+
/**
|
2177 |
+
* Bind an event handler to be fired when the mouse leaves an element.
|
2178 |
+
*
|
2179 |
+
* @param handler A function to execute when the event is triggered.
|
2180 |
+
*/
|
2181 |
+
mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2182 |
+
/**
|
2183 |
+
* Bind an event handler to be fired when the mouse leaves an element.
|
2184 |
+
*
|
2185 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2186 |
+
* @param handler A function to execute when the event is triggered.
|
2187 |
+
*/
|
2188 |
+
mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2189 |
+
|
2190 |
+
/**
|
2191 |
+
* Trigger the "mousemove" event on an element.
|
2192 |
+
*/
|
2193 |
+
mousemove(): JQuery;
|
2194 |
+
/**
|
2195 |
+
* Bind an event handler to the "mousemove" JavaScript event.
|
2196 |
+
*
|
2197 |
+
* @param handler A function to execute when the event is triggered.
|
2198 |
+
*/
|
2199 |
+
mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2200 |
+
/**
|
2201 |
+
* Bind an event handler to the "mousemove" JavaScript event.
|
2202 |
+
*
|
2203 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2204 |
+
* @param handler A function to execute when the event is triggered.
|
2205 |
+
*/
|
2206 |
+
mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2207 |
+
|
2208 |
+
/**
|
2209 |
+
* Trigger the "mouseout" event on an element.
|
2210 |
+
*/
|
2211 |
+
mouseout(): JQuery;
|
2212 |
+
/**
|
2213 |
+
* Bind an event handler to the "mouseout" JavaScript event.
|
2214 |
+
*
|
2215 |
+
* @param handler A function to execute when the event is triggered.
|
2216 |
+
*/
|
2217 |
+
mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2218 |
+
/**
|
2219 |
+
* Bind an event handler to the "mouseout" JavaScript event.
|
2220 |
+
*
|
2221 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2222 |
+
* @param handler A function to execute when the event is triggered.
|
2223 |
+
*/
|
2224 |
+
mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2225 |
+
|
2226 |
+
/**
|
2227 |
+
* Trigger the "mouseover" event on an element.
|
2228 |
+
*/
|
2229 |
+
mouseover(): JQuery;
|
2230 |
+
/**
|
2231 |
+
* Bind an event handler to the "mouseover" JavaScript event.
|
2232 |
+
*
|
2233 |
+
* @param handler A function to execute when the event is triggered.
|
2234 |
+
*/
|
2235 |
+
mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2236 |
+
/**
|
2237 |
+
* Bind an event handler to the "mouseover" JavaScript event.
|
2238 |
+
*
|
2239 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2240 |
+
* @param handler A function to execute when the event is triggered.
|
2241 |
+
*/
|
2242 |
+
mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2243 |
+
|
2244 |
+
/**
|
2245 |
+
* Trigger the "mouseup" event on an element.
|
2246 |
+
*/
|
2247 |
+
mouseup(): JQuery;
|
2248 |
+
/**
|
2249 |
+
* Bind an event handler to the "mouseup" JavaScript event.
|
2250 |
+
*
|
2251 |
+
* @param handler A function to execute when the event is triggered.
|
2252 |
+
*/
|
2253 |
+
mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2254 |
+
/**
|
2255 |
+
* Bind an event handler to the "mouseup" JavaScript event.
|
2256 |
+
*
|
2257 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2258 |
+
* @param handler A function to execute when the event is triggered.
|
2259 |
+
*/
|
2260 |
+
mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
|
2261 |
+
|
2262 |
+
/**
|
2263 |
+
* Remove an event handler.
|
2264 |
+
*/
|
2265 |
+
off(): JQuery;
|
2266 |
+
/**
|
2267 |
+
* Remove an event handler.
|
2268 |
+
*
|
2269 |
+
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
2270 |
+
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
2271 |
+
* @param handler A handler function previously attached for the event(s), or the special value false.
|
2272 |
+
*/
|
2273 |
+
off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2274 |
+
/**
|
2275 |
+
* Remove an event handler.
|
2276 |
+
*
|
2277 |
+
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
|
2278 |
+
* @param handler A handler function previously attached for the event(s), or the special value false.
|
2279 |
+
*/
|
2280 |
+
off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2281 |
+
/**
|
2282 |
+
* Remove an event handler.
|
2283 |
+
*
|
2284 |
+
* @param events An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).
|
2285 |
+
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
|
2286 |
+
*/
|
2287 |
+
off(events: { [key: string]: any; }, selector?: string): JQuery;
|
2288 |
+
|
2289 |
+
/**
|
2290 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2291 |
+
*
|
2292 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2293 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax).
|
2294 |
+
*/
|
2295 |
+
on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
|
2296 |
+
/**
|
2297 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2298 |
+
*
|
2299 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2300 |
+
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
2301 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
2302 |
+
*/
|
2303 |
+
on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
|
2304 |
+
/**
|
2305 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2306 |
+
*
|
2307 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2308 |
+
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
2309 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
2310 |
+
*/
|
2311 |
+
on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
|
2312 |
+
/**
|
2313 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2314 |
+
*
|
2315 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2316 |
+
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
2317 |
+
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
2318 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
2319 |
+
*/
|
2320 |
+
on(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery;
|
2321 |
+
/**
|
2322 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2323 |
+
*
|
2324 |
+
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
2325 |
+
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
2326 |
+
* @param data Data to be passed to the handler in event.data when an event occurs.
|
2327 |
+
*/
|
2328 |
+
on(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
|
2329 |
+
/**
|
2330 |
+
* Attach an event handler function for one or more events to the selected elements.
|
2331 |
+
*
|
2332 |
+
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
2333 |
+
* @param data Data to be passed to the handler in event.data when an event occurs.
|
2334 |
+
*/
|
2335 |
+
on(events: { [key: string]: any; }, data?: any): JQuery;
|
2336 |
+
|
2337 |
+
/**
|
2338 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2339 |
+
*
|
2340 |
+
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
2341 |
+
* @param handler A function to execute at the time the event is triggered.
|
2342 |
+
*/
|
2343 |
+
one(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2344 |
+
/**
|
2345 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2346 |
+
*
|
2347 |
+
* @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.
|
2348 |
+
* @param data An object containing data that will be passed to the event handler.
|
2349 |
+
* @param handler A function to execute at the time the event is triggered.
|
2350 |
+
*/
|
2351 |
+
one(events: string, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2352 |
+
|
2353 |
+
/**
|
2354 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2355 |
+
*
|
2356 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2357 |
+
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
2358 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
2359 |
+
*/
|
2360 |
+
one(events: string, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2361 |
+
/**
|
2362 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2363 |
+
*
|
2364 |
+
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
|
2365 |
+
* @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
|
2366 |
+
* @param data Data to be passed to the handler in event.data when an event is triggered.
|
2367 |
+
* @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
|
2368 |
+
*/
|
2369 |
+
one(events: string, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2370 |
+
|
2371 |
+
/**
|
2372 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2373 |
+
*
|
2374 |
+
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
2375 |
+
* @param selector A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.
|
2376 |
+
* @param data Data to be passed to the handler in event.data when an event occurs.
|
2377 |
+
*/
|
2378 |
+
one(events: { [key: string]: any; }, selector?: string, data?: any): JQuery;
|
2379 |
+
|
2380 |
+
/**
|
2381 |
+
* Attach a handler to an event for the elements. The handler is executed at most once per element per event type.
|
2382 |
+
*
|
2383 |
+
* @param events An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).
|
2384 |
+
* @param data Data to be passed to the handler in event.data when an event occurs.
|
2385 |
+
*/
|
2386 |
+
one(events: { [key: string]: any; }, data?: any): JQuery;
|
2387 |
+
|
2388 |
+
|
2389 |
+
/**
|
2390 |
+
* Specify a function to execute when the DOM is fully loaded.
|
2391 |
+
*
|
2392 |
+
* @param handler A function to execute after the DOM is ready.
|
2393 |
+
*/
|
2394 |
+
ready(handler: (jQueryAlias?: JQueryStatic) => any): JQuery;
|
2395 |
+
|
2396 |
+
/**
|
2397 |
+
* Trigger the "resize" event on an element.
|
2398 |
+
*/
|
2399 |
+
resize(): JQuery;
|
2400 |
+
/**
|
2401 |
+
* Bind an event handler to the "resize" JavaScript event.
|
2402 |
+
*
|
2403 |
+
* @param handler A function to execute each time the event is triggered.
|
2404 |
+
*/
|
2405 |
+
resize(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2406 |
+
/**
|
2407 |
+
* Bind an event handler to the "resize" JavaScript event.
|
2408 |
+
*
|
2409 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2410 |
+
* @param handler A function to execute each time the event is triggered.
|
2411 |
+
*/
|
2412 |
+
resize(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2413 |
+
|
2414 |
+
/**
|
2415 |
+
* Trigger the "scroll" event on an element.
|
2416 |
+
*/
|
2417 |
+
scroll(): JQuery;
|
2418 |
+
/**
|
2419 |
+
* Bind an event handler to the "scroll" JavaScript event.
|
2420 |
+
*
|
2421 |
+
* @param handler A function to execute each time the event is triggered.
|
2422 |
+
*/
|
2423 |
+
scroll(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2424 |
+
/**
|
2425 |
+
* Bind an event handler to the "scroll" JavaScript event.
|
2426 |
+
*
|
2427 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2428 |
+
* @param handler A function to execute each time the event is triggered.
|
2429 |
+
*/
|
2430 |
+
scroll(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2431 |
+
|
2432 |
+
/**
|
2433 |
+
* Trigger the "select" event on an element.
|
2434 |
+
*/
|
2435 |
+
select(): JQuery;
|
2436 |
+
/**
|
2437 |
+
* Bind an event handler to the "select" JavaScript event.
|
2438 |
+
*
|
2439 |
+
* @param handler A function to execute each time the event is triggered.
|
2440 |
+
*/
|
2441 |
+
select(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2442 |
+
/**
|
2443 |
+
* Bind an event handler to the "select" JavaScript event.
|
2444 |
+
*
|
2445 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2446 |
+
* @param handler A function to execute each time the event is triggered.
|
2447 |
+
*/
|
2448 |
+
select(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2449 |
+
|
2450 |
+
/**
|
2451 |
+
* Trigger the "submit" event on an element.
|
2452 |
+
*/
|
2453 |
+
submit(): JQuery;
|
2454 |
+
/**
|
2455 |
+
* Bind an event handler to the "submit" JavaScript event
|
2456 |
+
*
|
2457 |
+
* @param handler A function to execute each time the event is triggered.
|
2458 |
+
*/
|
2459 |
+
submit(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2460 |
+
/**
|
2461 |
+
* Bind an event handler to the "submit" JavaScript event
|
2462 |
+
*
|
2463 |
+
* @param eventData An object containing data that will be passed to the event handler.
|
2464 |
+
* @param handler A function to execute each time the event is triggered.
|
2465 |
+
*/
|
2466 |
+
submit(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2467 |
+
|
2468 |
+
/**
|
2469 |
+
* Execute all handlers and behaviors attached to the matched elements for the given event type.
|
2470 |
+
*
|
2471 |
+
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
2472 |
+
* @param extraParameters Additional parameters to pass along to the event handler.
|
2473 |
+
*/
|
2474 |
+
trigger(eventType: string, extraParameters?: any[]|Object): JQuery;
|
2475 |
+
/**
|
2476 |
+
* Execute all handlers and behaviors attached to the matched elements for the given event type.
|
2477 |
+
*
|
2478 |
+
* @param event A jQuery.Event object.
|
2479 |
+
* @param extraParameters Additional parameters to pass along to the event handler.
|
2480 |
+
*/
|
2481 |
+
trigger(event: JQueryEventObject, extraParameters?: any[]|Object): JQuery;
|
2482 |
+
|
2483 |
+
/**
|
2484 |
+
* Execute all handlers attached to an element for an event.
|
2485 |
+
*
|
2486 |
+
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
2487 |
+
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
2488 |
+
*/
|
2489 |
+
triggerHandler(eventType: string, ...extraParameters: any[]): Object;
|
2490 |
+
|
2491 |
+
/**
|
2492 |
+
* Execute all handlers attached to an element for an event.
|
2493 |
+
*
|
2494 |
+
* @param event A jQuery.Event object.
|
2495 |
+
* @param extraParameters An array of additional parameters to pass along to the event handler.
|
2496 |
+
*/
|
2497 |
+
triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object;
|
2498 |
+
|
2499 |
+
/**
|
2500 |
+
* Remove a previously-attached event handler from the elements.
|
2501 |
+
*
|
2502 |
+
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
2503 |
+
* @param handler The function that is to be no longer executed.
|
2504 |
+
*/
|
2505 |
+
unbind(eventType?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2506 |
+
/**
|
2507 |
+
* Remove a previously-attached event handler from the elements.
|
2508 |
+
*
|
2509 |
+
* @param eventType A string containing a JavaScript event type, such as click or submit.
|
2510 |
+
* @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).
|
2511 |
+
*/
|
2512 |
+
unbind(eventType: string, fls: boolean): JQuery;
|
2513 |
+
/**
|
2514 |
+
* Remove a previously-attached event handler from the elements.
|
2515 |
+
*
|
2516 |
+
* @param evt A JavaScript event object as passed to an event handler.
|
2517 |
+
*/
|
2518 |
+
unbind(evt: any): JQuery;
|
2519 |
+
|
2520 |
+
/**
|
2521 |
+
* Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
|
2522 |
+
*/
|
2523 |
+
undelegate(): JQuery;
|
2524 |
+
/**
|
2525 |
+
* Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
|
2526 |
+
*
|
2527 |
+
* @param selector A selector which will be used to filter the event results.
|
2528 |
+
* @param eventType A string containing a JavaScript event type, such as "click" or "keydown"
|
2529 |
+
* @param handler A function to execute at the time the event is triggered.
|
2530 |
+
*/
|
2531 |
+
undelegate(selector: string, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2532 |
+
/**
|
2533 |
+
* Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
|
2534 |
+
*
|
2535 |
+
* @param selector A selector which will be used to filter the event results.
|
2536 |
+
* @param events An object of one or more event types and previously bound functions to unbind from them.
|
2537 |
+
*/
|
2538 |
+
undelegate(selector: string, events: Object): JQuery;
|
2539 |
+
/**
|
2540 |
+
* Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
|
2541 |
+
*
|
2542 |
+
* @param namespace A string containing a namespace to unbind all events from.
|
2543 |
+
*/
|
2544 |
+
undelegate(namespace: string): JQuery;
|
2545 |
+
|
2546 |
+
/**
|
2547 |
+
* Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
|
2548 |
+
*
|
2549 |
+
* @param handler A function to execute when the event is triggered.
|
2550 |
+
*/
|
2551 |
+
unload(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2552 |
+
/**
|
2553 |
+
* Bind an event handler to the "unload" JavaScript event. (DEPRECATED from v1.8)
|
2554 |
+
*
|
2555 |
+
* @param eventData A plain object of data that will be passed to the event handler.
|
2556 |
+
* @param handler A function to execute when the event is triggered.
|
2557 |
+
*/
|
2558 |
+
unload(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
|
2559 |
+
|
2560 |
+
/**
|
2561 |
+
* The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document. (DEPRECATED from v1.10)
|
2562 |
+
*/
|
2563 |
+
context: Element;
|
2564 |
+
|
2565 |
+
jquery: string;
|
2566 |
+
|
2567 |
+
/**
|
2568 |
+
* Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
|
2569 |
+
*
|
2570 |
+
* @param handler A function to execute when the event is triggered.
|
2571 |
+
*/
|
2572 |
+
error(handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2573 |
+
/**
|
2574 |
+
* Bind an event handler to the "error" JavaScript event. (DEPRECATED from v1.8)
|
2575 |
+
*
|
2576 |
+
* @param eventData A plain object of data that will be passed to the event handler.
|
2577 |
+
* @param handler A function to execute when the event is triggered.
|
2578 |
+
*/
|
2579 |
+
error(eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
|
2580 |
+
|
2581 |
+
/**
|
2582 |
+
* Add a collection of DOM elements onto the jQuery stack.
|
2583 |
+
*
|
2584 |
+
* @param elements An array of elements to push onto the stack and make into a new jQuery object.
|
2585 |
+
*/
|
2586 |
+
pushStack(elements: any[]): JQuery;
|
2587 |
+
/**
|
2588 |
+
* Add a collection of DOM elements onto the jQuery stack.
|
2589 |
+
*
|
2590 |
+
* @param elements An array of elements to push onto the stack and make into a new jQuery object.
|
2591 |
+
* @param name The name of a jQuery method that generated the array of elements.
|
2592 |
+
* @param arguments The arguments that were passed in to the jQuery method (for serialization).
|
2593 |
+
*/
|
2594 |
+
pushStack(elements: any[], name: string, arguments: any[]): JQuery;
|
2595 |
+
|
2596 |
+
/**
|
2597 |
+
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
2598 |
+
*
|
2599 |
+
* param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
|
2600 |
+
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
|
2601 |
+
*/
|
2602 |
+
after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
2603 |
+
/**
|
2604 |
+
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
2605 |
+
*
|
2606 |
+
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
2607 |
+
*/
|
2608 |
+
after(func: (index: number, html: string) => string|Element|JQuery): JQuery;
|
2609 |
+
|
2610 |
+
/**
|
2611 |
+
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
2612 |
+
*
|
2613 |
+
* param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
|
2614 |
+
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
|
2615 |
+
*/
|
2616 |
+
append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
2617 |
+
/**
|
2618 |
+
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
2619 |
+
*
|
2620 |
+
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
2621 |
+
*/
|
2622 |
+
append(func: (index: number, html: string) => string|Element|JQuery): JQuery;
|
2623 |
+
|
2624 |
+
/**
|
2625 |
+
* Insert every element in the set of matched elements to the end of the target.
|
2626 |
+
*
|
2627 |
+
* @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
|
2628 |
+
*/
|
2629 |
+
appendTo(target: JQuery|any[]|Element|string): JQuery;
|
2630 |
+
|
2631 |
+
/**
|
2632 |
+
* Insert content, specified by the parameter, before each element in the set of matched elements.
|
2633 |
+
*
|
2634 |
+
* param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
|
2635 |
+
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
|
2636 |
+
*/
|
2637 |
+
before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
2638 |
+
/**
|
2639 |
+
* Insert content, specified by the parameter, before each element in the set of matched elements.
|
2640 |
+
*
|
2641 |
+
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
2642 |
+
*/
|
2643 |
+
before(func: (index: number, html: string) => string|Element|JQuery): JQuery;
|
2644 |
+
|
2645 |
+
/**
|
2646 |
+
* Create a deep copy of the set of matched elements.
|
2647 |
+
*
|
2648 |
+
* param withDataAndEvents A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false.
|
2649 |
+
* param deepWithDataAndEvents A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
|
2650 |
+
*/
|
2651 |
+
clone(withDataAndEvents?: boolean, deepWithDataAndEvents?: boolean): JQuery;
|
2652 |
+
|
2653 |
+
/**
|
2654 |
+
* Remove the set of matched elements from the DOM.
|
2655 |
+
*
|
2656 |
+
* param selector A selector expression that filters the set of matched elements to be removed.
|
2657 |
+
*/
|
2658 |
+
detach(selector?: string): JQuery;
|
2659 |
+
|
2660 |
+
/**
|
2661 |
+
* Remove all child nodes of the set of matched elements from the DOM.
|
2662 |
+
*/
|
2663 |
+
empty(): JQuery;
|
2664 |
+
|
2665 |
+
/**
|
2666 |
+
* Insert every element in the set of matched elements after the target.
|
2667 |
+
*
|
2668 |
+
* param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
|
2669 |
+
*/
|
2670 |
+
insertAfter(target: JQuery|any[]|Element|Text|string): JQuery;
|
2671 |
+
|
2672 |
+
/**
|
2673 |
+
* Insert every element in the set of matched elements before the target.
|
2674 |
+
*
|
2675 |
+
* param target A selector, element, array of elements, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
|
2676 |
+
*/
|
2677 |
+
insertBefore(target: JQuery|any[]|Element|Text|string): JQuery;
|
2678 |
+
|
2679 |
+
/**
|
2680 |
+
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
2681 |
+
*
|
2682 |
+
* param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
|
2683 |
+
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
|
2684 |
+
*/
|
2685 |
+
prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
2686 |
+
/**
|
2687 |
+
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
2688 |
+
*
|
2689 |
+
* param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.
|
2690 |
+
*/
|
2691 |
+
prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery;
|
2692 |
+
|
2693 |
+
/**
|
2694 |
+
* Insert every element in the set of matched elements to the beginning of the target.
|
2695 |
+
*
|
2696 |
+
* @param target A selector, element, HTML string, array of elements, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
|
2697 |
+
*/
|
2698 |
+
prependTo(target: JQuery|any[]|Element|string): JQuery;
|
2699 |
+
|
2700 |
+
/**
|
2701 |
+
* Remove the set of matched elements from the DOM.
|
2702 |
+
*
|
2703 |
+
* @param selector A selector expression that filters the set of matched elements to be removed.
|
2704 |
+
*/
|
2705 |
+
remove(selector?: string): JQuery;
|
2706 |
+
|
2707 |
+
/**
|
2708 |
+
* Replace each target element with the set of matched elements.
|
2709 |
+
*
|
2710 |
+
* @param target A selector string, jQuery object, DOM element, or array of elements indicating which element(s) to replace.
|
2711 |
+
*/
|
2712 |
+
replaceAll(target: JQuery|any[]|Element|string): JQuery;
|
2713 |
+
|
2714 |
+
/**
|
2715 |
+
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
2716 |
+
*
|
2717 |
+
* param newContent The content to insert. May be an HTML string, DOM element, array of DOM elements, or jQuery object.
|
2718 |
+
*/
|
2719 |
+
replaceWith(newContent: JQuery|any[]|Element|Text|string): JQuery;
|
2720 |
+
/**
|
2721 |
+
* Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.
|
2722 |
+
*
|
2723 |
+
* param func A function that returns content with which to replace the set of matched elements.
|
2724 |
+
*/
|
2725 |
+
replaceWith(func: () => Element|JQuery): JQuery;
|
2726 |
+
|
2727 |
+
/**
|
2728 |
+
* Get the combined text contents of each element in the set of matched elements, including their descendants.
|
2729 |
+
*/
|
2730 |
+
text(): string;
|
2731 |
+
/**
|
2732 |
+
* Set the content of each element in the set of matched elements to the specified text.
|
2733 |
+
*
|
2734 |
+
* @param text The text to set as the content of each matched element. When Number or Boolean is supplied, it will be converted to a String representation.
|
2735 |
+
*/
|
2736 |
+
text(text: string|number|boolean): JQuery;
|
2737 |
+
/**
|
2738 |
+
* Set the content of each element in the set of matched elements to the specified text.
|
2739 |
+
*
|
2740 |
+
* @param func A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.
|
2741 |
+
*/
|
2742 |
+
text(func: (index: number, text: string) => string): JQuery;
|
2743 |
+
|
2744 |
+
/**
|
2745 |
+
* Retrieve all the elements contained in the jQuery set, as an array.
|
2746 |
+
*/
|
2747 |
+
toArray(): any[];
|
2748 |
+
|
2749 |
+
/**
|
2750 |
+
* Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
|
2751 |
+
*/
|
2752 |
+
unwrap(): JQuery;
|
2753 |
+
|
2754 |
+
/**
|
2755 |
+
* Wrap an HTML structure around each element in the set of matched elements.
|
2756 |
+
*
|
2757 |
+
* @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
|
2758 |
+
*/
|
2759 |
+
wrap(wrappingElement: JQuery|Element|string): JQuery;
|
2760 |
+
/**
|
2761 |
+
* Wrap an HTML structure around each element in the set of matched elements.
|
2762 |
+
*
|
2763 |
+
* @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
2764 |
+
*/
|
2765 |
+
wrap(func: (index: number) => string|JQuery): JQuery;
|
2766 |
+
|
2767 |
+
/**
|
2768 |
+
* Wrap an HTML structure around all elements in the set of matched elements.
|
2769 |
+
*
|
2770 |
+
* @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements.
|
2771 |
+
*/
|
2772 |
+
wrapAll(wrappingElement: JQuery|Element|string): JQuery;
|
2773 |
+
wrapAll(func: (index: number) => string): JQuery;
|
2774 |
+
|
2775 |
+
/**
|
2776 |
+
* Wrap an HTML structure around the content of each element in the set of matched elements.
|
2777 |
+
*
|
2778 |
+
* @param wrappingElement An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
|
2779 |
+
*/
|
2780 |
+
wrapInner(wrappingElement: JQuery|Element|string): JQuery;
|
2781 |
+
/**
|
2782 |
+
* Wrap an HTML structure around the content of each element in the set of matched elements.
|
2783 |
+
*
|
2784 |
+
* @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.
|
2785 |
+
*/
|
2786 |
+
wrapInner(func: (index: number) => string): JQuery;
|
2787 |
+
|
2788 |
+
/**
|
2789 |
+
* Iterate over a jQuery object, executing a function for each matched element.
|
2790 |
+
*
|
2791 |
+
* @param func A function to execute for each matched element.
|
2792 |
+
*/
|
2793 |
+
each(func: (index: number, elem: Element) => any): JQuery;
|
2794 |
+
|
2795 |
+
/**
|
2796 |
+
* Retrieve one of the elements matched by the jQuery object.
|
2797 |
+
*
|
2798 |
+
* @param index A zero-based integer indicating which element to retrieve.
|
2799 |
+
*/
|
2800 |
+
get(index: number): HTMLElement;
|
2801 |
+
/**
|
2802 |
+
* Retrieve the elements matched by the jQuery object.
|
2803 |
+
*/
|
2804 |
+
get(): any[];
|
2805 |
+
|
2806 |
+
/**
|
2807 |
+
* Search for a given element from among the matched elements.
|
2808 |
+
*/
|
2809 |
+
index(): number;
|
2810 |
+
/**
|
2811 |
+
* Search for a given element from among the matched elements.
|
2812 |
+
*
|
2813 |
+
* @param selector A selector representing a jQuery collection in which to look for an element.
|
2814 |
+
*/
|
2815 |
+
index(selector: string|JQuery|Element): number;
|
2816 |
+
|
2817 |
+
/**
|
2818 |
+
* The number of elements in the jQuery object.
|
2819 |
+
*/
|
2820 |
+
length: number;
|
2821 |
+
/**
|
2822 |
+
* A selector representing selector passed to jQuery(), if any, when creating the original set.
|
2823 |
+
* version deprecated: 1.7, removed: 1.9
|
2824 |
+
*/
|
2825 |
+
selector: string;
|
2826 |
+
[index: string]: any;
|
2827 |
+
[index: number]: HTMLElement;
|
2828 |
+
|
2829 |
+
/**
|
2830 |
+
* Add elements to the set of matched elements.
|
2831 |
+
*
|
2832 |
+
* @param selector A string representing a selector expression to find additional elements to add to the set of matched elements.
|
2833 |
+
* @param context The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
|
2834 |
+
*/
|
2835 |
+
add(selector: string, context?: Element): JQuery;
|
2836 |
+
/**
|
2837 |
+
* Add elements to the set of matched elements.
|
2838 |
+
*
|
2839 |
+
* @param elements One or more elements to add to the set of matched elements.
|
2840 |
+
*/
|
2841 |
+
add(...elements: Element[]): JQuery;
|
2842 |
+
/**
|
2843 |
+
* Add elements to the set of matched elements.
|
2844 |
+
*
|
2845 |
+
* @param html An HTML fragment to add to the set of matched elements.
|
2846 |
+
*/
|
2847 |
+
add(html: string): JQuery;
|
2848 |
+
/**
|
2849 |
+
* Add elements to the set of matched elements.
|
2850 |
+
*
|
2851 |
+
* @param obj An existing jQuery object to add to the set of matched elements.
|
2852 |
+
*/
|
2853 |
+
add(obj: JQuery): JQuery;
|
2854 |
+
|
2855 |
+
/**
|
2856 |
+
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
|
2857 |
+
*
|
2858 |
+
* @param selector A string containing a selector expression to match elements against.
|
2859 |
+
*/
|
2860 |
+
children(selector?: string): JQuery;
|
2861 |
+
|
2862 |
+
/**
|
2863 |
+
* 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.
|
2864 |
+
*
|
2865 |
+
* @param selector A string containing a selector expression to match elements against.
|
2866 |
+
*/
|
2867 |
+
closest(selector: string): JQuery;
|
2868 |
+
/**
|
2869 |
+
* 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.
|
2870 |
+
*
|
2871 |
+
* @param selector A string containing a selector expression to match elements against.
|
2872 |
+
* @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
|
2873 |
+
*/
|
2874 |
+
closest(selector: string, context?: Element): JQuery;
|
2875 |
+
/**
|
2876 |
+
* 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.
|
2877 |
+
*
|
2878 |
+
* @param obj A jQuery object to match elements against.
|
2879 |
+
*/
|
2880 |
+
closest(obj: JQuery): JQuery;
|
2881 |
+
/**
|
2882 |
+
* 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.
|
2883 |
+
*
|
2884 |
+
* @param element An element to match elements against.
|
2885 |
+
*/
|
2886 |
+
closest(element: Element): JQuery;
|
2887 |
+
|
2888 |
+
/**
|
2889 |
+
* Get an array of all the elements and selectors matched against the current element up through the DOM tree.
|
2890 |
+
*
|
2891 |
+
* @param selectors An array or string containing a selector expression to match elements against (can also be a jQuery object).
|
2892 |
+
* @param context A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
|
2893 |
+
*/
|
2894 |
+
closest(selectors: any, context?: Element): any[];
|
2895 |
+
|
2896 |
+
/**
|
2897 |
+
* Get the children of each element in the set of matched elements, including text and comment nodes.
|
2898 |
+
*/
|
2899 |
+
contents(): JQuery;
|
2900 |
+
|
2901 |
+
/**
|
2902 |
+
* End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
|
2903 |
+
*/
|
2904 |
+
end(): JQuery;
|
2905 |
+
|
2906 |
+
/**
|
2907 |
+
* Reduce the set of matched elements to the one at the specified index.
|
2908 |
+
*
|
2909 |
+
* @param index An integer indicating the 0-based position of the element. OR An integer indicating the position of the element, counting backwards from the last element in the set.
|
2910 |
+
*
|
2911 |
+
*/
|
2912 |
+
eq(index: number): JQuery;
|
2913 |
+
|
2914 |
+
/**
|
2915 |
+
* Reduce the set of matched elements to those that match the selector or pass the function's test.
|
2916 |
+
*
|
2917 |
+
* @param selector A string containing a selector expression to match the current set of elements against.
|
2918 |
+
*/
|
2919 |
+
filter(selector: string): JQuery;
|
2920 |
+
/**
|
2921 |
+
* Reduce the set of matched elements to those that match the selector or pass the function's test.
|
2922 |
+
*
|
2923 |
+
* @param func A function used as a test for each element in the set. this is the current DOM element.
|
2924 |
+
*/
|
2925 |
+
filter(func: (index: number, element: Element) => any): JQuery;
|
2926 |
+
/**
|
2927 |
+
* Reduce the set of matched elements to those that match the selector or pass the function's test.
|
2928 |
+
*
|
2929 |
+
* @param element An element to match the current set of elements against.
|
2930 |
+
*/
|
2931 |
+
filter(element: Element): JQuery;
|
2932 |
+
/**
|
2933 |
+
* Reduce the set of matched elements to those that match the selector or pass the function's test.
|
2934 |
+
*
|
2935 |
+
* @param obj An existing jQuery object to match the current set of elements against.
|
2936 |
+
*/
|
2937 |
+
filter(obj: JQuery): JQuery;
|
2938 |
+
|
2939 |
+
/**
|
2940 |
+
* Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
|
2941 |
+
*
|
2942 |
+
* @param selector A string containing a selector expression to match elements against.
|
2943 |
+
*/
|
2944 |
+
find(selector: string): JQuery;
|
2945 |
+
/**
|
2946 |
+
* Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
|
2947 |
+
*
|
2948 |
+
* @param element An element to match elements against.
|
2949 |
+
*/
|
2950 |
+
find(element: Element): JQuery;
|
2951 |
+
/**
|
2952 |
+
* Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
|
2953 |
+
*
|
2954 |
+
* @param obj A jQuery object to match elements against.
|
2955 |
+
*/
|
2956 |
+
find(obj: JQuery): JQuery;
|
2957 |
+
|
2958 |
+
/**
|
2959 |
+
* Reduce the set of matched elements to the first in the set.
|
2960 |
+
*/
|
2961 |
+
first(): JQuery;
|
2962 |
+
|
2963 |
+
/**
|
2964 |
+
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
|
2965 |
+
*
|
2966 |
+
* @param selector A string containing a selector expression to match elements against.
|
2967 |
+
*/
|
2968 |
+
has(selector: string): JQuery;
|
2969 |
+
/**
|
2970 |
+
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
|
2971 |
+
*
|
2972 |
+
* @param contained A DOM element to match elements against.
|
2973 |
+
*/
|
2974 |
+
has(contained: Element): JQuery;
|
2975 |
+
|
2976 |
+
/**
|
2977 |
+
* Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
|
2978 |
+
*
|
2979 |
+
* @param selector A string containing a selector expression to match elements against.
|
2980 |
+
*/
|
2981 |
+
is(selector: string): boolean;
|
2982 |
+
/**
|
2983 |
+
* Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
|
2984 |
+
*
|
2985 |
+
* @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.
|
2986 |
+
*/
|
2987 |
+
is(func: (index: number, element: Element) => boolean): boolean;
|
2988 |
+
/**
|
2989 |
+
* Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
|
2990 |
+
*
|
2991 |
+
* @param obj An existing jQuery object to match the current set of elements against.
|
2992 |
+
*/
|
2993 |
+
is(obj: JQuery): boolean;
|
2994 |
+
/**
|
2995 |
+
* Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
|
2996 |
+
*
|
2997 |
+
* @param elements One or more elements to match the current set of elements against.
|
2998 |
+
*/
|
2999 |
+
is(elements: any): boolean;
|
3000 |
+
|
3001 |
+
/**
|
3002 |
+
* Reduce the set of matched elements to the final one in the set.
|
3003 |
+
*/
|
3004 |
+
last(): JQuery;
|
3005 |
+
|
3006 |
+
/**
|
3007 |
+
* Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
|
3008 |
+
*
|
3009 |
+
* @param callback A function object that will be invoked for each element in the current set.
|
3010 |
+
*/
|
3011 |
+
map(callback: (index: number, domElement: Element) => any): JQuery;
|
3012 |
+
|
3013 |
+
/**
|
3014 |
+
* Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
|
3015 |
+
*
|
3016 |
+
* @param selector A string containing a selector expression to match elements against.
|
3017 |
+
*/
|
3018 |
+
next(selector?: string): JQuery;
|
3019 |
+
|
3020 |
+
/**
|
3021 |
+
* Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
|
3022 |
+
*
|
3023 |
+
* @param selector A string containing a selector expression to match elements against.
|
3024 |
+
*/
|
3025 |
+
nextAll(selector?: string): JQuery;
|
3026 |
+
|
3027 |
+
/**
|
3028 |
+
* Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
|
3029 |
+
*
|
3030 |
+
* @param selector A string containing a selector expression to indicate where to stop matching following sibling elements.
|
3031 |
+
* @param filter A string containing a selector expression to match elements against.
|
3032 |
+
*/
|
3033 |
+
nextUntil(selector?: string, filter?: string): JQuery;
|
3034 |
+
/**
|
3035 |
+
* Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
|
3036 |
+
*
|
3037 |
+
* @param element A DOM node or jQuery object indicating where to stop matching following sibling elements.
|
3038 |
+
* @param filter A string containing a selector expression to match elements against.
|
3039 |
+
*/
|
3040 |
+
nextUntil(element?: Element, filter?: string): JQuery;
|
3041 |
+
/**
|
3042 |
+
* Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
|
3043 |
+
*
|
3044 |
+
* @param obj A DOM node or jQuery object indicating where to stop matching following sibling elements.
|
3045 |
+
* @param filter A string containing a selector expression to match elements against.
|
3046 |
+
*/
|
3047 |
+
nextUntil(obj?: JQuery, filter?: string): JQuery;
|
3048 |
+
|
3049 |
+
/**
|
3050 |
+
* Remove elements from the set of matched elements.
|
3051 |
+
*
|
3052 |
+
* @param selector A string containing a selector expression to match elements against.
|
3053 |
+
*/
|
3054 |
+
not(selector: string): JQuery;
|
3055 |
+
/**
|
3056 |
+
* Remove elements from the set of matched elements.
|
3057 |
+
*
|
3058 |
+
* @param func A function used as a test for each element in the set. this is the current DOM element.
|
3059 |
+
*/
|
3060 |
+
not(func: (index: number, element: Element) => boolean): JQuery;
|
3061 |
+
/**
|
3062 |
+
* Remove elements from the set of matched elements.
|
3063 |
+
*
|
3064 |
+
* @param elements One or more DOM elements to remove from the matched set.
|
3065 |
+
*/
|
3066 |
+
not(elements: Element|Element[]): JQuery;
|
3067 |
+
/**
|
3068 |
+
* Remove elements from the set of matched elements.
|
3069 |
+
*
|
3070 |
+
* @param obj An existing jQuery object to match the current set of elements against.
|
3071 |
+
*/
|
3072 |
+
not(obj: JQuery): JQuery;
|
3073 |
+
|
3074 |
+
/**
|
3075 |
+
* Get the closest ancestor element that is positioned.
|
3076 |
+
*/
|
3077 |
+
offsetParent(): JQuery;
|
3078 |
+
|
3079 |
+
/**
|
3080 |
+
* Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
|
3081 |
+
*
|
3082 |
+
* @param selector A string containing a selector expression to match elements against.
|
3083 |
+
*/
|
3084 |
+
parent(selector?: string): JQuery;
|
3085 |
+
|
3086 |
+
/**
|
3087 |
+
* Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
|
3088 |
+
*
|
3089 |
+
* @param selector A string containing a selector expression to match elements against.
|
3090 |
+
*/
|
3091 |
+
parents(selector?: string): JQuery;
|
3092 |
+
|
3093 |
+
/**
|
3094 |
+
* Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3095 |
+
*
|
3096 |
+
* @param selector A string containing a selector expression to indicate where to stop matching ancestor elements.
|
3097 |
+
* @param filter A string containing a selector expression to match elements against.
|
3098 |
+
*/
|
3099 |
+
parentsUntil(selector?: string, filter?: string): JQuery;
|
3100 |
+
/**
|
3101 |
+
* Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3102 |
+
*
|
3103 |
+
* @param element A DOM node or jQuery object indicating where to stop matching ancestor elements.
|
3104 |
+
* @param filter A string containing a selector expression to match elements against.
|
3105 |
+
*/
|
3106 |
+
parentsUntil(element?: Element, filter?: string): JQuery;
|
3107 |
+
/**
|
3108 |
+
* Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3109 |
+
*
|
3110 |
+
* @param obj A DOM node or jQuery object indicating where to stop matching ancestor elements.
|
3111 |
+
* @param filter A string containing a selector expression to match elements against.
|
3112 |
+
*/
|
3113 |
+
parentsUntil(obj?: JQuery, filter?: string): JQuery;
|
3114 |
+
|
3115 |
+
/**
|
3116 |
+
* Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
|
3117 |
+
*
|
3118 |
+
* @param selector A string containing a selector expression to match elements against.
|
3119 |
+
*/
|
3120 |
+
prev(selector?: string): JQuery;
|
3121 |
+
|
3122 |
+
/**
|
3123 |
+
* Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
|
3124 |
+
*
|
3125 |
+
* @param selector A string containing a selector expression to match elements against.
|
3126 |
+
*/
|
3127 |
+
prevAll(selector?: string): JQuery;
|
3128 |
+
|
3129 |
+
/**
|
3130 |
+
* Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3131 |
+
*
|
3132 |
+
* @param selector A string containing a selector expression to indicate where to stop matching preceding sibling elements.
|
3133 |
+
* @param filter A string containing a selector expression to match elements against.
|
3134 |
+
*/
|
3135 |
+
prevUntil(selector?: string, filter?: string): JQuery;
|
3136 |
+
/**
|
3137 |
+
* Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3138 |
+
*
|
3139 |
+
* @param element A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
|
3140 |
+
* @param filter A string containing a selector expression to match elements against.
|
3141 |
+
*/
|
3142 |
+
prevUntil(element?: Element, filter?: string): JQuery;
|
3143 |
+
/**
|
3144 |
+
* Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
|
3145 |
+
*
|
3146 |
+
* @param obj A DOM node or jQuery object indicating where to stop matching preceding sibling elements.
|
3147 |
+
* @param filter A string containing a selector expression to match elements against.
|
3148 |
+
*/
|
3149 |
+
prevUntil(obj?: JQuery, filter?: string): JQuery;
|
3150 |
+
|
3151 |
+
/**
|
3152 |
+
* Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
|
3153 |
+
*
|
3154 |
+
* @param selector A string containing a selector expression to match elements against.
|
3155 |
+
*/
|
3156 |
+
siblings(selector?: string): JQuery;
|
3157 |
+
|
3158 |
+
/**
|
3159 |
+
* Reduce the set of matched elements to a subset specified by a range of indices.
|
3160 |
+
*
|
3161 |
+
* @param start An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
|
3162 |
+
* @param end An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
|
3163 |
+
*/
|
3164 |
+
slice(start: number, end?: number): JQuery;
|
3165 |
+
|
3166 |
+
/**
|
3167 |
+
* Show the queue of functions to be executed on the matched elements.
|
3168 |
+
*
|
3169 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
3170 |
+
*/
|
3171 |
+
queue(queueName?: string): any[];
|
3172 |
+
/**
|
3173 |
+
* Manipulate the queue of functions to be executed, once for each matched element.
|
3174 |
+
*
|
3175 |
+
* @param newQueue An array of functions to replace the current queue contents.
|
3176 |
+
*/
|
3177 |
+
queue(newQueue: Function[]): JQuery;
|
3178 |
+
/**
|
3179 |
+
* Manipulate the queue of functions to be executed, once for each matched element.
|
3180 |
+
*
|
3181 |
+
* @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
|
3182 |
+
*/
|
3183 |
+
queue(callback: Function): JQuery;
|
3184 |
+
/**
|
3185 |
+
* Manipulate the queue of functions to be executed, once for each matched element.
|
3186 |
+
*
|
3187 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
3188 |
+
* @param newQueue An array of functions to replace the current queue contents.
|
3189 |
+
*/
|
3190 |
+
queue(queueName: string, newQueue: Function[]): JQuery;
|
3191 |
+
/**
|
3192 |
+
* Manipulate the queue of functions to be executed, once for each matched element.
|
3193 |
+
*
|
3194 |
+
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
|
3195 |
+
* @param callback The new function to add to the queue, with a function to call that will dequeue the next item.
|
3196 |
+
*/
|
3197 |
+
queue(queueName: string, callback: Function): JQuery;
|
3198 |
+
}
|
3199 |
+
declare module "jquery" {
|
3200 |
+
export = $;
|
3201 |
+
}
|
3202 |
+
declare var jQuery: JQueryStatic;
|
3203 |
+
declare var $: JQueryStatic;
|
js/jquery.json.js
CHANGED
@@ -1,156 +1,200 @@
|
|
1 |
-
|
2 |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'\t': '\\t',
|
37 |
-
'\n': '\\n',
|
38 |
-
'\f': '\\f',
|
39 |
-
'\r': '\\r',
|
40 |
-
'"' : '\\"',
|
41 |
-
'\\': '\\\\'
|
42 |
-
};
|
43 |
-
|
44 |
-
$.quoteString = function(string)
|
45 |
-
// Places quotes around a string, inteligently.
|
46 |
-
// If the string contains no control characters, no quote characters, and no
|
47 |
-
// backslash characters, then we can safely slap some quotes around it.
|
48 |
-
// Otherwise we must also replace the offending characters with safe escape
|
49 |
-
// sequences.
|
50 |
-
{
|
51 |
-
if (escapeable.test(string))
|
52 |
-
{
|
53 |
-
return '"' + string.replace(escapeable, function (a)
|
54 |
-
{
|
55 |
-
var c = meta[a];
|
56 |
-
if (typeof c === 'string') {
|
57 |
-
return c;
|
58 |
-
}
|
59 |
-
c = a.charCodeAt();
|
60 |
-
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
|
61 |
-
}) + '"';
|
62 |
-
}
|
63 |
-
return '"' + string + '"';
|
64 |
-
};
|
65 |
-
|
66 |
-
$.toJSON = function(o, compact)
|
67 |
-
{
|
68 |
-
var type = typeof(o);
|
69 |
-
|
70 |
-
if (type == "undefined")
|
71 |
-
return "undefined";
|
72 |
-
else if (type == "number" || type == "boolean")
|
73 |
-
return o + "";
|
74 |
-
else if (o === null)
|
75 |
-
return "null";
|
76 |
-
|
77 |
-
// Is it a string?
|
78 |
-
if (type == "string")
|
79 |
-
{
|
80 |
-
return $.quoteString(o);
|
81 |
-
}
|
82 |
-
|
83 |
-
// Does it have a .toJSON function?
|
84 |
-
if (type == "object" && typeof o.toJSON == "function")
|
85 |
-
return o.toJSON(compact);
|
86 |
-
|
87 |
-
// Is it an array?
|
88 |
-
if (type != "function" && typeof(o.length) == "number")
|
89 |
-
{
|
90 |
-
var ret = [];
|
91 |
-
for (var i = 0; i < o.length; i++) {
|
92 |
-
ret.push( $.toJSON(o[i], compact) );
|
93 |
-
}
|
94 |
-
if (compact)
|
95 |
-
return "[" + ret.join(",") + "]";
|
96 |
-
else
|
97 |
-
return "[" + ret.join(", ") + "]";
|
98 |
-
}
|
99 |
-
|
100 |
-
// If it's a function, we have to warn somebody!
|
101 |
-
if (type == "function") {
|
102 |
-
throw new TypeError("Unable to convert object of type 'function' to json.");
|
103 |
-
}
|
104 |
-
|
105 |
-
// It's probably an object, then.
|
106 |
-
var ret = [];
|
107 |
-
for (var k in o) {
|
108 |
-
var name;
|
109 |
-
type = typeof(k);
|
110 |
-
|
111 |
-
if (type == "number")
|
112 |
-
name = '"' + k + '"';
|
113 |
-
else if (type == "string")
|
114 |
-
name = $.quoteString(k);
|
115 |
-
else
|
116 |
-
continue; //skip non-string or number keys
|
117 |
-
|
118 |
-
var val = $.toJSON(o[k], compact);
|
119 |
-
if (typeof(val) != "string") {
|
120 |
-
// skip non-serializable values
|
121 |
-
continue;
|
122 |
-
}
|
123 |
-
|
124 |
-
if (compact)
|
125 |
-
ret.push(name + ":" + val);
|
126 |
-
else
|
127 |
-
ret.push(name + ": " + val);
|
128 |
-
}
|
129 |
-
return "{" + ret.join(", ") + "}";
|
130 |
-
};
|
131 |
-
|
132 |
-
$.compactJSON = function(o)
|
133 |
-
{
|
134 |
-
return $.toJSON(o, true);
|
135 |
-
};
|
136 |
-
|
137 |
-
$.evalJSON = function(src)
|
138 |
-
// Evals JSON that we know to be safe.
|
139 |
-
{
|
140 |
-
return eval("(" + src + ")");
|
141 |
-
};
|
142 |
-
|
143 |
-
$.secureEvalJSON = function(src)
|
144 |
-
// Evals JSON in a way that is *more* secure.
|
145 |
-
{
|
146 |
-
var filtered = src;
|
147 |
-
filtered = filtered.replace(/\\["\\\/bfnrtu]/g, '@');
|
148 |
-
filtered = filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
|
149 |
-
filtered = filtered.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
|
150 |
-
|
151 |
-
if (/^[\],:{}\s]*$/.test(filtered))
|
152 |
-
return eval("(" + src + ")");
|
153 |
-
else
|
154 |
-
throw new SyntaxError("Error parsing JSON, source is not valid.");
|
155 |
-
};
|
156 |
-
})(jQuery);
|
1 |
+
/**
|
2 |
+
* jQuery JSON plugin v2.5.1
|
3 |
+
* https://github.com/Krinkle/jquery-json
|
4 |
*
|
5 |
+
* @author Brantley Harris, 2009-2011
|
6 |
+
* @author Timo Tijhof, 2011-2014
|
7 |
+
* @source This plugin is heavily influenced by MochiKit's serializeJSON, which is
|
8 |
+
* copyrighted 2005 by Bob Ippolito.
|
9 |
+
* @source Brantley Harris wrote this plugin. It is based somewhat on the JSON.org
|
10 |
+
* website's http://www.json.org/json2.js, which proclaims:
|
11 |
+
* "NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.", a sentiment that
|
12 |
+
* I uphold.
|
13 |
+
* @license MIT License <http://opensource.org/licenses/MIT>
|
|
|
14 |
*/
|
15 |
+
(function ($) {
|
16 |
+
'use strict';
|
17 |
+
|
18 |
+
var escape = /["\\\x00-\x1f\x7f-\x9f]/g,
|
19 |
+
meta = {
|
20 |
+
'\b': '\\b',
|
21 |
+
'\t': '\\t',
|
22 |
+
'\n': '\\n',
|
23 |
+
'\f': '\\f',
|
24 |
+
'\r': '\\r',
|
25 |
+
'"': '\\"',
|
26 |
+
'\\': '\\\\'
|
27 |
+
},
|
28 |
+
hasOwn = Object.prototype.hasOwnProperty;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* jQuery.toJSON
|
32 |
+
* Converts the given argument into a JSON representation.
|
33 |
+
*
|
34 |
+
* @param o {Mixed} The json-serializable *thing* to be converted
|
35 |
+
*
|
36 |
+
* If an object has a toJSON prototype, that will be used to get the representation.
|
37 |
+
* Non-integer/string keys are skipped in the object, as are keys that point to a
|
38 |
+
* function.
|
39 |
+
*
|
40 |
+
*/
|
41 |
+
$.toJSON = typeof JSON === 'object' && JSON.stringify ? JSON.stringify : function (o) {
|
42 |
+
if (o === null) {
|
43 |
+
return 'null';
|
44 |
+
}
|
45 |
+
|
46 |
+
var pairs, k, name, val,
|
47 |
+
type = $.type(o);
|
48 |
+
|
49 |
+
if (type === 'undefined') {
|
50 |
+
return undefined;
|
51 |
+
}
|
52 |
+
|
53 |
+
// Also covers instantiated Number and Boolean objects,
|
54 |
+
// which are typeof 'object' but thanks to $.type, we
|
55 |
+
// catch them here. I don't know whether it is right
|
56 |
+
// or wrong that instantiated primitives are not
|
57 |
+
// exported to JSON as an {"object":..}.
|
58 |
+
// We choose this path because that's what the browsers did.
|
59 |
+
if (type === 'number' || type === 'boolean') {
|
60 |
+
return String(o);
|
61 |
+
}
|
62 |
+
if (type === 'string') {
|
63 |
+
return $.quoteString(o);
|
64 |
+
}
|
65 |
+
if (typeof o.toJSON === 'function') {
|
66 |
+
return $.toJSON(o.toJSON());
|
67 |
+
}
|
68 |
+
if (type === 'date') {
|
69 |
+
var month = o.getUTCMonth() + 1,
|
70 |
+
day = o.getUTCDate(),
|
71 |
+
year = o.getUTCFullYear(),
|
72 |
+
hours = o.getUTCHours(),
|
73 |
+
minutes = o.getUTCMinutes(),
|
74 |
+
seconds = o.getUTCSeconds(),
|
75 |
+
milli = o.getUTCMilliseconds();
|
76 |
+
|
77 |
+
if (month < 10) {
|
78 |
+
month = '0' + month;
|
79 |
+
}
|
80 |
+
if (day < 10) {
|
81 |
+
day = '0' + day;
|
82 |
+
}
|
83 |
+
if (hours < 10) {
|
84 |
+
hours = '0' + hours;
|
85 |
+
}
|
86 |
+
if (minutes < 10) {
|
87 |
+
minutes = '0' + minutes;
|
88 |
+
}
|
89 |
+
if (seconds < 10) {
|
90 |
+
seconds = '0' + seconds;
|
91 |
+
}
|
92 |
+
if (milli < 100) {
|
93 |
+
milli = '0' + milli;
|
94 |
+
}
|
95 |
+
if (milli < 10) {
|
96 |
+
milli = '0' + milli;
|
97 |
+
}
|
98 |
+
return '"' + year + '-' + month + '-' + day + 'T' +
|
99 |
+
hours + ':' + minutes + ':' + seconds +
|
100 |
+
'.' + milli + 'Z"';
|
101 |
+
}
|
102 |
+
|
103 |
+
pairs = [];
|
104 |
+
|
105 |
+
if ($.isArray(o)) {
|
106 |
+
for (k = 0; k < o.length; k++) {
|
107 |
+
pairs.push($.toJSON(o[k]) || 'null');
|
108 |
+
}
|
109 |
+
return '[' + pairs.join(',') + ']';
|
110 |
+
}
|
111 |
+
|
112 |
+
// Any other object (plain object, RegExp, ..)
|
113 |
+
// Need to do typeof instead of $.type, because we also
|
114 |
+
// want to catch non-plain objects.
|
115 |
+
if (typeof o === 'object') {
|
116 |
+
for (k in o) {
|
117 |
+
// Only include own properties,
|
118 |
+
// Filter out inherited prototypes
|
119 |
+
if (hasOwn.call(o, k)) {
|
120 |
+
// Keys must be numerical or string. Skip others
|
121 |
+
type = typeof k;
|
122 |
+
if (type === 'number') {
|
123 |
+
name = '"' + k + '"';
|
124 |
+
} else if (type === 'string') {
|
125 |
+
name = $.quoteString(k);
|
126 |
+
} else {
|
127 |
+
continue;
|
128 |
+
}
|
129 |
+
type = typeof o[k];
|
130 |
+
|
131 |
+
// Invalid values like these return undefined
|
132 |
+
// from toJSON, however those object members
|
133 |
+
// shouldn't be included in the JSON string at all.
|
134 |
+
if (type !== 'function' && type !== 'undefined') {
|
135 |
+
val = $.toJSON(o[k]);
|
136 |
+
pairs.push(name + ':' + val);
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
return '{' + pairs.join(',') + '}';
|
141 |
+
}
|
142 |
+
};
|
143 |
+
|
144 |
+
/**
|
145 |
+
* jQuery.evalJSON
|
146 |
+
* Evaluates a given json string.
|
147 |
+
*
|
148 |
+
* @param str {String}
|
149 |
+
*/
|
150 |
+
$.evalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
|
151 |
+
/*jshint evil: true */
|
152 |
+
return eval('(' + str + ')');
|
153 |
+
};
|
154 |
+
|
155 |
+
/**
|
156 |
+
* jQuery.secureEvalJSON
|
157 |
+
* Evals JSON in a way that is *more* secure.
|
158 |
+
*
|
159 |
+
* @param str {String}
|
160 |
+
*/
|
161 |
+
$.secureEvalJSON = typeof JSON === 'object' && JSON.parse ? JSON.parse : function (str) {
|
162 |
+
var filtered =
|
163 |
+
str
|
164 |
+
.replace(/\\["\\\/bfnrtu]/g, '@')
|
165 |
+
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
|
166 |
+
.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
|
167 |
+
|
168 |
+
if (/^[\],:{}\s]*$/.test(filtered)) {
|
169 |
+
/*jshint evil: true */
|
170 |
+
return eval('(' + str + ')');
|
171 |
+
}
|
172 |
+
throw new SyntaxError('Error parsing JSON, source is not valid.');
|
173 |
+
};
|
174 |
|
175 |
+
/**
|
176 |
+
* jQuery.quoteString
|
177 |
+
* Returns a string-repr of a string, escaping quotes intelligently.
|
178 |
+
* Mostly a support function for toJSON.
|
179 |
+
* Examples:
|
180 |
+
* >>> jQuery.quoteString('apple')
|
181 |
+
* "apple"
|
182 |
+
*
|
183 |
+
* >>> jQuery.quoteString('"Where are we going?", she asked.')
|
184 |
+
* "\"Where are we going?\", she asked."
|
185 |
+
*/
|
186 |
+
$.quoteString = function (str) {
|
187 |
+
if (str.match(escape)) {
|
188 |
+
return '"' + str.replace(escape, function (a) {
|
189 |
+
var c = meta[a];
|
190 |
+
if (typeof c === 'string') {
|
191 |
+
return c;
|
192 |
+
}
|
193 |
+
c = a.charCodeAt();
|
194 |
+
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
|
195 |
+
}) + '"';
|
196 |
+
}
|
197 |
+
return '"' + str + '"';
|
198 |
+
};
|
199 |
|
200 |
+
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Type definitions for Knockout v3.2.0
|
2 |
+
// Project: http://knockoutjs.com
|
3 |
+
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Igor Oleinikov <https://github.com/Igorbek/>, Clément Bourgeois <https://github.com/moonpyk/>
|
4 |
+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
5 |
+
|
6 |
+
|
7 |
+
interface KnockoutSubscribableFunctions<T> {
|
8 |
+
[key: string]: KnockoutBindingHandler;
|
9 |
+
|
10 |
+
notifySubscribers(valueToWrite?: T, event?: string): void;
|
11 |
+
}
|
12 |
+
|
13 |
+
interface KnockoutComputedFunctions<T> {
|
14 |
+
[key: string]: KnockoutBindingHandler;
|
15 |
+
}
|
16 |
+
|
17 |
+
interface KnockoutObservableFunctions<T> {
|
18 |
+
[key: string]: KnockoutBindingHandler;
|
19 |
+
|
20 |
+
equalityComparer(a: any, b: any): boolean;
|
21 |
+
}
|
22 |
+
|
23 |
+
interface KnockoutObservableArrayFunctions<T> {
|
24 |
+
// General Array functions
|
25 |
+
indexOf(searchElement: T, fromIndex?: number): number;
|
26 |
+
slice(start: number, end?: number): T[];
|
27 |
+
splice(start: number): T[];
|
28 |
+
splice(start: number, deleteCount: number, ...items: T[]): T[];
|
29 |
+
pop(): T;
|
30 |
+
push(...items: T[]): void;
|
31 |
+
shift(): T;
|
32 |
+
unshift(...items: T[]): number;
|
33 |
+
reverse(): KnockoutObservableArray<T>;
|
34 |
+
sort(): KnockoutObservableArray<T>;
|
35 |
+
sort(compareFunction: (left: T, right: T) => number): KnockoutObservableArray<T>;
|
36 |
+
|
37 |
+
// Ko specific
|
38 |
+
[key: string]: KnockoutBindingHandler;
|
39 |
+
|
40 |
+
replace(oldItem: T, newItem: T): void;
|
41 |
+
|
42 |
+
remove(item: T): T[];
|
43 |
+
remove(removeFunction: (item: T) => boolean): T[];
|
44 |
+
removeAll(items: T[]): T[];
|
45 |
+
removeAll(): T[];
|
46 |
+
|
47 |
+
destroy(item: T): void;
|
48 |
+
destroy(destroyFunction: (item: T) => boolean): void;
|
49 |
+
destroyAll(items: T[]): void;
|
50 |
+
destroyAll(): void;
|
51 |
+
}
|
52 |
+
|
53 |
+
interface KnockoutSubscribableStatic {
|
54 |
+
fn: KnockoutSubscribableFunctions<any>;
|
55 |
+
|
56 |
+
new <T>(): KnockoutSubscribable<T>;
|
57 |
+
}
|
58 |
+
|
59 |
+
interface KnockoutSubscription {
|
60 |
+
dispose(): void;
|
61 |
+
}
|
62 |
+
|
63 |
+
interface KnockoutSubscribable<T> extends KnockoutSubscribableFunctions<T> {
|
64 |
+
subscribe(callback: (newValue: T) => void, target?: any, event?: string): KnockoutSubscription;
|
65 |
+
subscribe<TEvent>(callback: (newValue: TEvent) => void, target: any, event: string): KnockoutSubscription;
|
66 |
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutSubscribable<T>;
|
67 |
+
getSubscriptionsCount(): number;
|
68 |
+
}
|
69 |
+
|
70 |
+
interface KnockoutComputedStatic {
|
71 |
+
fn: KnockoutComputedFunctions<any>;
|
72 |
+
|
73 |
+
<T>(): KnockoutComputed<T>;
|
74 |
+
<T>(func: () => T, context?: any, options?: any): KnockoutComputed<T>;
|
75 |
+
<T>(def: KnockoutComputedDefine<T>, context?: any): KnockoutComputed<T>;
|
76 |
+
}
|
77 |
+
|
78 |
+
interface KnockoutComputed<T> extends KnockoutObservable<T>, KnockoutComputedFunctions<T> {
|
79 |
+
fn: KnockoutComputedFunctions<any>;
|
80 |
+
|
81 |
+
dispose(): void;
|
82 |
+
isActive(): boolean;
|
83 |
+
getDependenciesCount(): number;
|
84 |
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutComputed<T>;
|
85 |
+
}
|
86 |
+
|
87 |
+
interface KnockoutObservableArrayStatic {
|
88 |
+
fn: KnockoutObservableArrayFunctions<any>;
|
89 |
+
|
90 |
+
<T>(value?: T[]): KnockoutObservableArray<T>;
|
91 |
+
}
|
92 |
+
|
93 |
+
interface KnockoutObservableArray<T> extends KnockoutObservable<T[]>, KnockoutObservableArrayFunctions<T> {
|
94 |
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutObservableArray<T>;
|
95 |
+
}
|
96 |
+
|
97 |
+
interface KnockoutObservableStatic {
|
98 |
+
fn: KnockoutObservableFunctions<any>;
|
99 |
+
|
100 |
+
<T>(value?: T): KnockoutObservable<T>;
|
101 |
+
}
|
102 |
+
|
103 |
+
interface KnockoutObservable<T> extends KnockoutSubscribable<T>, KnockoutObservableFunctions<T> {
|
104 |
+
(): T;
|
105 |
+
(value: T): void;
|
106 |
+
|
107 |
+
peek(): T;
|
108 |
+
valueHasMutated?:{(): void;};
|
109 |
+
valueWillMutate?:{(): void;};
|
110 |
+
extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable<T>;
|
111 |
+
}
|
112 |
+
|
113 |
+
interface KnockoutComputedDefine<T> {
|
114 |
+
read(): T;
|
115 |
+
write? (value: T): void;
|
116 |
+
disposeWhenNodeIsRemoved?: Node;
|
117 |
+
disposeWhen? (): boolean;
|
118 |
+
owner?: any;
|
119 |
+
deferEvaluation?: boolean;
|
120 |
+
pure?: boolean;
|
121 |
+
}
|
122 |
+
|
123 |
+
interface KnockoutBindingContext {
|
124 |
+
$parent: any;
|
125 |
+
$parents: any[];
|
126 |
+
$root: any;
|
127 |
+
$data: any;
|
128 |
+
$rawData: any | KnockoutObservable<any>;
|
129 |
+
$index?: KnockoutObservable<number>;
|
130 |
+
$parentContext?: KnockoutBindingContext;
|
131 |
+
$component: any;
|
132 |
+
$componentTemplateNodes: Node[];
|
133 |
+
|
134 |
+
extend(properties: any): any;
|
135 |
+
createChildContext(dataItemOrAccessor: any, dataItemAlias?: any, extendCallback?: Function): any;
|
136 |
+
}
|
137 |
+
|
138 |
+
interface KnockoutAllBindingsAccessor {
|
139 |
+
(): any;
|
140 |
+
get(name: string): any;
|
141 |
+
has(name: string): boolean;
|
142 |
+
}
|
143 |
+
|
144 |
+
interface KnockoutBindingHandler {
|
145 |
+
after?: Array<string>;
|
146 |
+
init?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void | { controlsDescendantBindings: boolean; };
|
147 |
+
update?: (element: any, valueAccessor: () => any, allBindingsAccessor?: KnockoutAllBindingsAccessor, viewModel?: any, bindingContext?: KnockoutBindingContext) => void;
|
148 |
+
options?: any;
|
149 |
+
preprocess?: (value: string, name: string, addBindingCallback?: (name: string, value: string) => void) => string;
|
150 |
+
}
|
151 |
+
|
152 |
+
interface KnockoutBindingHandlers {
|
153 |
+
[bindingHandler: string]: KnockoutBindingHandler;
|
154 |
+
|
155 |
+
// Controlling text and appearance
|
156 |
+
visible: KnockoutBindingHandler;
|
157 |
+
text: KnockoutBindingHandler;
|
158 |
+
html: KnockoutBindingHandler;
|
159 |
+
css: KnockoutBindingHandler;
|
160 |
+
style: KnockoutBindingHandler;
|
161 |
+
attr: KnockoutBindingHandler;
|
162 |
+
|
163 |
+
// Control Flow
|
164 |
+
foreach: KnockoutBindingHandler;
|
165 |
+
if: KnockoutBindingHandler;
|
166 |
+
ifnot: KnockoutBindingHandler;
|
167 |
+
with: KnockoutBindingHandler;
|
168 |
+
|
169 |
+
// Working with form fields
|
170 |
+
click: KnockoutBindingHandler;
|
171 |
+
event: KnockoutBindingHandler;
|
172 |
+
submit: KnockoutBindingHandler;
|
173 |
+
enable: KnockoutBindingHandler;
|
174 |
+
disable: KnockoutBindingHandler;
|
175 |
+
value: KnockoutBindingHandler;
|
176 |
+
textInput: KnockoutBindingHandler;
|
177 |
+
hasfocus: KnockoutBindingHandler;
|
178 |
+
checked: KnockoutBindingHandler;
|
179 |
+
options: KnockoutBindingHandler;
|
180 |
+
selectedOptions: KnockoutBindingHandler;
|
181 |
+
uniqueName: KnockoutBindingHandler;
|
182 |
+
|
183 |
+
// Rendering templates
|
184 |
+
template: KnockoutBindingHandler;
|
185 |
+
|
186 |
+
// Components (new for v3.2)
|
187 |
+
component: KnockoutBindingHandler;
|
188 |
+
}
|
189 |
+
|
190 |
+
interface KnockoutMemoization {
|
191 |
+
memoize(callback: () => string): string;
|
192 |
+
unmemoize(memoId: string, callbackParams: any[]): boolean;
|
193 |
+
unmemoizeDomNodeAndDescendants(domNode: any, extraCallbackParamsArray: any[]): boolean;
|
194 |
+
parseMemoText(memoText: string): string;
|
195 |
+
}
|
196 |
+
|
197 |
+
interface KnockoutVirtualElement {}
|
198 |
+
|
199 |
+
interface KnockoutVirtualElements {
|
200 |
+
allowedBindings: { [bindingName: string]: boolean; };
|
201 |
+
emptyNode(node: KnockoutVirtualElement ): void;
|
202 |
+
firstChild(node: KnockoutVirtualElement ): KnockoutVirtualElement;
|
203 |
+
insertAfter( container: KnockoutVirtualElement, nodeToInsert: Node, insertAfter: Node ): void;
|
204 |
+
nextSibling(node: KnockoutVirtualElement): Node;
|
205 |
+
prepend(node: KnockoutVirtualElement, toInsert: Node ): void;
|
206 |
+
setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number;[index: number]: Node; } ): void;
|
207 |
+
childNodes(node: KnockoutVirtualElement ): Node[];
|
208 |
+
}
|
209 |
+
|
210 |
+
interface KnockoutExtenders {
|
211 |
+
throttle(target: any, timeout: number): KnockoutComputed<any>;
|
212 |
+
notify(target: any, notifyWhen: string): any;
|
213 |
+
|
214 |
+
rateLimit(target: any, timeout: number): any;
|
215 |
+
rateLimit(target: any, options: { timeout: number; method?: string; }): any;
|
216 |
+
|
217 |
+
trackArrayChanges(target: any): any;
|
218 |
+
}
|
219 |
+
|
220 |
+
//
|
221 |
+
// NOTE TO MAINTAINERS AND CONTRIBUTORS : pay attention to only include symbols that are
|
222 |
+
// publicly exported in the minified version of ko, without that you can give the false
|
223 |
+
// impression that some functions will be available in production builds.
|
224 |
+
//
|
225 |
+
interface KnockoutUtils {
|
226 |
+
//////////////////////////////////
|
227 |
+
// utils.domData.js
|
228 |
+
//////////////////////////////////
|
229 |
+
|
230 |
+
domData: {
|
231 |
+
get (node: Element, key: string): any;
|
232 |
+
|
233 |
+
set (node: Element, key: string, value: any): void;
|
234 |
+
|
235 |
+
getAll(node: Element, createIfNotFound: boolean): any;
|
236 |
+
|
237 |
+
clear(node: Element): boolean;
|
238 |
+
};
|
239 |
+
|
240 |
+
//////////////////////////////////
|
241 |
+
// utils.domNodeDisposal.js
|
242 |
+
//////////////////////////////////
|
243 |
+
|
244 |
+
domNodeDisposal: {
|
245 |
+
addDisposeCallback(node: Element, callback: Function): void;
|
246 |
+
|
247 |
+
removeDisposeCallback(node: Element, callback: Function): void;
|
248 |
+
|
249 |
+
cleanNode(node: Node): Element;
|
250 |
+
|
251 |
+
removeNode(node: Node): void;
|
252 |
+
};
|
253 |
+
|
254 |
+
addOrRemoveItem<T>(array: T[] | KnockoutObservable<T>, value: T, included: T): void;
|
255 |
+
|
256 |
+
arrayFilter<T>(array: T[], predicate: (item: T) => boolean): T[];
|
257 |
+
|
258 |
+
arrayFirst<T>(array: T[], predicate: (item: T) => boolean, predicateOwner?: any): T;
|
259 |
+
|
260 |
+
arrayForEach<T>(array: T[], action: (item: T, index: number) => void): void;
|
261 |
+
|
262 |
+
arrayGetDistinctValues<T>(array: T[]): T[];
|
263 |
+
|
264 |
+
arrayIndexOf<T>(array: T[], item: T): number;
|
265 |
+
|
266 |
+
arrayMap<T, U>(array: T[], mapping: (item: T) => U): U[];
|
267 |
+
|
268 |
+
arrayPushAll<T>(array: T[] | KnockoutObservableArray<T>, valuesToPush: T[]): T[];
|
269 |
+
|
270 |
+
arrayRemoveItem(array: any[], itemToRemove: any): void;
|
271 |
+
|
272 |
+
compareArrays<T>(a: T[], b: T[]): Array<KnockoutArrayChange<T>>;
|
273 |
+
|
274 |
+
extend(target: Object, source: Object): Object;
|
275 |
+
|
276 |
+
fieldsIncludedWithJsonPost: any[];
|
277 |
+
|
278 |
+
getFormFields(form: any, fieldName: string): any[];
|
279 |
+
|
280 |
+
objectForEach(obj: any, action: (key: any, value: any) => void): void;
|
281 |
+
|
282 |
+
parseHtmlFragment(html: string): any[];
|
283 |
+
|
284 |
+
parseJson(jsonString: string): any;
|
285 |
+
|
286 |
+
postJson(urlOrForm: any, data: any, options: any): void;
|
287 |
+
|
288 |
+
peekObservable<T>(value: KnockoutObservable<T>): T;
|
289 |
+
|
290 |
+
range(min: any, max: any): any;
|
291 |
+
|
292 |
+
registerEventHandler(element: any, eventType: any, handler: Function): void;
|
293 |
+
|
294 |
+
setHtml(node: Element, html: () => string): void;
|
295 |
+
|
296 |
+
setHtml(node: Element, html: string): void;
|
297 |
+
|
298 |
+
setTextContent(element: any, textContent: string | KnockoutObservable<string>): void;
|
299 |
+
|
300 |
+
stringifyJson(data: any, replacer?: Function, space?: string): string;
|
301 |
+
|
302 |
+
toggleDomNodeCssClass(node: any, className: string, shouldHaveClass: boolean): void;
|
303 |
+
|
304 |
+
triggerEvent(element: any, eventType: any): void;
|
305 |
+
|
306 |
+
unwrapObservable<T>(value: KnockoutObservable<T> | T): T;
|
307 |
+
|
308 |
+
// NOT PART OF THE MINIFIED API SURFACE (ONLY IN knockout-{version}.debug.js) https://github.com/SteveSanderson/knockout/issues/670
|
309 |
+
// forceRefresh(node: any): void;
|
310 |
+
// ieVersion: number;
|
311 |
+
// isIe6: boolean;
|
312 |
+
// isIe7: boolean;
|
313 |
+
// jQueryHtmlParse(html: string): any[];
|
314 |
+
// makeArray(arrayLikeObject: any): any[];
|
315 |
+
// moveCleanedNodesToContainerElement(nodes: any[]): HTMLElement;
|
316 |
+
// replaceDomNodes(nodeToReplaceOrNodeArray: any, newNodesArray: any[]): void;
|
317 |
+
// setDomNodeChildren(domNode: any, childNodes: any[]): void;
|
318 |
+
// setElementName(element: any, name: string): void;
|
319 |
+
// setOptionNodeSelectionState(optionNode: any, isSelected: boolean): void;
|
320 |
+
// simpleHtmlParse(html: string): any[];
|
321 |
+
// stringStartsWith(str: string, startsWith: string): boolean;
|
322 |
+
// stringTokenize(str: string, delimiter: string): string[];
|
323 |
+
// stringTrim(str: string): string;
|
324 |
+
// tagNameLower(element: any): string;
|
325 |
+
}
|
326 |
+
|
327 |
+
interface KnockoutArrayChange<T> {
|
328 |
+
status: string;
|
329 |
+
value: T;
|
330 |
+
index: number;
|
331 |
+
moved?: number;
|
332 |
+
}
|
333 |
+
|
334 |
+
//////////////////////////////////
|
335 |
+
// templateSources.js
|
336 |
+
//////////////////////////////////
|
337 |
+
|
338 |
+
interface KnockoutTemplateSourcesDomElement {
|
339 |
+
text(): any;
|
340 |
+
text(value: any): void;
|
341 |
+
|
342 |
+
data(key: string): any;
|
343 |
+
data(key: string, value: any): any;
|
344 |
+
}
|
345 |
+
|
346 |
+
interface KnockoutTemplateAnonymous extends KnockoutTemplateSourcesDomElement {
|
347 |
+
nodes(): any;
|
348 |
+
nodes(value: any): void;
|
349 |
+
}
|
350 |
+
|
351 |
+
interface KnockoutTemplateSources {
|
352 |
+
|
353 |
+
domElement: {
|
354 |
+
prototype: KnockoutTemplateSourcesDomElement
|
355 |
+
new (element: Element): KnockoutTemplateSourcesDomElement
|
356 |
+
};
|
357 |
+
|
358 |
+
anonymousTemplate: {
|
359 |
+
prototype: KnockoutTemplateAnonymous;
|
360 |
+
new (element: Element): KnockoutTemplateAnonymous;
|
361 |
+
};
|
362 |
+
}
|
363 |
+
|
364 |
+
//////////////////////////////////
|
365 |
+
// nativeTemplateEngine.js
|
366 |
+
//////////////////////////////////
|
367 |
+
|
368 |
+
interface KnockoutNativeTemplateEngine {
|
369 |
+
|
370 |
+
renderTemplateSource(templateSource: Object, bindingContext?: KnockoutBindingContext, options?: Object): any[];
|
371 |
+
}
|
372 |
+
|
373 |
+
//////////////////////////////////
|
374 |
+
// templateEngine.js
|
375 |
+
//////////////////////////////////
|
376 |
+
|
377 |
+
interface KnockoutTemplateEngine extends KnockoutNativeTemplateEngine {
|
378 |
+
|
379 |
+
createJavaScriptEvaluatorBlock(script: string): string;
|
380 |
+
|
381 |
+
makeTemplateSource(template: any, templateDocument?: Document): any;
|
382 |
+
|
383 |
+
renderTemplate(template: any, bindingContext: KnockoutBindingContext, options: Object, templateDocument: Document): any;
|
384 |
+
|
385 |
+
isTemplateRewritten(template: any, templateDocument: Document): boolean;
|
386 |
+
|
387 |
+
rewriteTemplate(template: any, rewriterCallback: Function, templateDocument: Document): void;
|
388 |
+
}
|
389 |
+
|
390 |
+
/////////////////////////////////
|
391 |
+
|
392 |
+
interface KnockoutStatic {
|
393 |
+
utils: KnockoutUtils;
|
394 |
+
memoization: KnockoutMemoization;
|
395 |
+
|
396 |
+
bindingHandlers: KnockoutBindingHandlers;
|
397 |
+
getBindingHandler(handler: string): KnockoutBindingHandler;
|
398 |
+
|
399 |
+
virtualElements: KnockoutVirtualElements;
|
400 |
+
extenders: KnockoutExtenders;
|
401 |
+
|
402 |
+
applyBindings(viewModelOrBindingContext?: any, rootNode?: any): void;
|
403 |
+
applyBindingsToDescendants(viewModelOrBindingContext: any, rootNode: any): void;
|
404 |
+
applyBindingAccessorsToNode(node: Node, bindings: (bindingContext: KnockoutBindingContext, node: Node) => {}, bindingContext: KnockoutBindingContext): void;
|
405 |
+
applyBindingAccessorsToNode(node: Node, bindings: {}, bindingContext: KnockoutBindingContext): void;
|
406 |
+
applyBindingAccessorsToNode(node: Node, bindings: (bindingContext: KnockoutBindingContext, node: Node) => {}, viewModel: any): void;
|
407 |
+
applyBindingAccessorsToNode(node: Node, bindings: {}, viewModel: any): void;
|
408 |
+
applyBindingsToNode(node: Node, bindings: any, viewModelOrBindingContext?: any): any;
|
409 |
+
|
410 |
+
subscribable: KnockoutSubscribableStatic;
|
411 |
+
observable: KnockoutObservableStatic;
|
412 |
+
|
413 |
+
computed: KnockoutComputedStatic;
|
414 |
+
pureComputed<T>(evaluatorFunction: () => T, context?: any): KnockoutComputed<T>;
|
415 |
+
pureComputed<T>(options: KnockoutComputedDefine<T>, context?: any): KnockoutComputed<T>;
|
416 |
+
|
417 |
+
observableArray: KnockoutObservableArrayStatic;
|
418 |
+
|
419 |
+
contextFor(node: any): any;
|
420 |
+
isSubscribable(instance: any): boolean;
|
421 |
+
toJSON(viewModel: any, replacer?: Function, space?: any): string;
|
422 |
+
toJS(viewModel: any): any;
|
423 |
+
isObservable(instance: any): boolean;
|
424 |
+
isWriteableObservable(instance: any): boolean;
|
425 |
+
isComputed(instance: any): boolean;
|
426 |
+
dataFor(node: any): any;
|
427 |
+
removeNode(node: Element): void;
|
428 |
+
cleanNode(node: Element): Element;
|
429 |
+
renderTemplate(template: Function, viewModel: any, options?: any, target?: any, renderMode?: any): any;
|
430 |
+
renderTemplate(template: string, viewModel: any, options?: any, target?: any, renderMode?: any): any;
|
431 |
+
unwrap<T>(value: KnockoutObservable<T> | T): T;
|
432 |
+
|
433 |
+
computedContext: KnockoutComputedContext;
|
434 |
+
|
435 |
+
//////////////////////////////////
|
436 |
+
// templateSources.js
|
437 |
+
//////////////////////////////////
|
438 |
+
|
439 |
+
templateSources: KnockoutTemplateSources;
|
440 |
+
|
441 |
+
//////////////////////////////////
|
442 |
+
// templateEngine.js
|
443 |
+
//////////////////////////////////
|
444 |
+
|
445 |
+
templateEngine: {
|
446 |
+
|
447 |
+
prototype: KnockoutTemplateEngine;
|
448 |
+
|
449 |
+
new (): KnockoutTemplateEngine;
|
450 |
+
};
|
451 |
+
|
452 |
+
//////////////////////////////////
|
453 |
+
// templateRewriting.js
|
454 |
+
//////////////////////////////////
|
455 |
+
|
456 |
+
templateRewriting: {
|
457 |
+
|
458 |
+
ensureTemplateIsRewritten(template: Node, templateEngine: KnockoutTemplateEngine, templateDocument: Document): any;
|
459 |
+
ensureTemplateIsRewritten(template: string, templateEngine: KnockoutTemplateEngine, templateDocument: Document): any;
|
460 |
+
|
461 |
+
memoizeBindingAttributeSyntax(htmlString: string, templateEngine: KnockoutTemplateEngine): any;
|
462 |
+
|
463 |
+
applyMemoizedBindingsToNextSibling(bindings: any, nodeName: string): string;
|
464 |
+
};
|
465 |
+
|
466 |
+
//////////////////////////////////
|
467 |
+
// nativeTemplateEngine.js
|
468 |
+
//////////////////////////////////
|
469 |
+
|
470 |
+
nativeTemplateEngine: {
|
471 |
+
|
472 |
+
prototype: KnockoutNativeTemplateEngine;
|
473 |
+
|
474 |
+
new (): KnockoutNativeTemplateEngine;
|
475 |
+
|
476 |
+
instance: KnockoutNativeTemplateEngine;
|
477 |
+
};
|
478 |
+
|
479 |
+
//////////////////////////////////
|
480 |
+
// jqueryTmplTemplateEngine.js
|
481 |
+
//////////////////////////////////
|
482 |
+
|
483 |
+
jqueryTmplTemplateEngine: {
|
484 |
+
|
485 |
+
prototype: KnockoutTemplateEngine;
|
486 |
+
|
487 |
+
renderTemplateSource(templateSource: Object, bindingContext: KnockoutBindingContext, options: Object): Node[];
|
488 |
+
|
489 |
+
createJavaScriptEvaluatorBlock(script: string): string;
|
490 |
+
|
491 |
+
addTemplate(templateName: string, templateMarkup: string): void;
|
492 |
+
};
|
493 |
+
|
494 |
+
//////////////////////////////////
|
495 |
+
// templating.js
|
496 |
+
//////////////////////////////////
|
497 |
+
|
498 |
+
setTemplateEngine(templateEngine: KnockoutNativeTemplateEngine): void;
|
499 |
+
|
500 |
+
renderTemplate(template: Function, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any;
|
501 |
+
renderTemplate(template: any, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any;
|
502 |
+
renderTemplate(template: Function, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any;
|
503 |
+
renderTemplate(template: any, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node, renderMode: string): any;
|
504 |
+
renderTemplate(template: Function, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any;
|
505 |
+
renderTemplate(template: any, dataOrBindingContext: KnockoutBindingContext, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any;
|
506 |
+
renderTemplate(template: Function, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any;
|
507 |
+
renderTemplate(template: any, dataOrBindingContext: any, options: Object, targetNodeOrNodeArray: Node[], renderMode: string): any;
|
508 |
+
|
509 |
+
renderTemplateForEach(template: Function, arrayOrObservableArray: any[], options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any;
|
510 |
+
renderTemplateForEach(template: any, arrayOrObservableArray: any[], options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any;
|
511 |
+
renderTemplateForEach(template: Function, arrayOrObservableArray: KnockoutObservable<any>, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any;
|
512 |
+
renderTemplateForEach(template: any, arrayOrObservableArray: KnockoutObservable<any>, options: Object, targetNode: Node, parentBindingContext: KnockoutBindingContext): any;
|
513 |
+
|
514 |
+
expressionRewriting: {
|
515 |
+
bindingRewriteValidators: any;
|
516 |
+
parseObjectLiteral: { (objectLiteralString: string): any[] }
|
517 |
+
};
|
518 |
+
|
519 |
+
/////////////////////////////////
|
520 |
+
|
521 |
+
bindingProvider: {
|
522 |
+
instance: KnockoutBindingProvider;
|
523 |
+
new (): KnockoutBindingProvider;
|
524 |
+
}
|
525 |
+
|
526 |
+
/////////////////////////////////
|
527 |
+
// selectExtensions.js
|
528 |
+
/////////////////////////////////
|
529 |
+
|
530 |
+
selectExtensions: {
|
531 |
+
|
532 |
+
readValue(element: HTMLElement): any;
|
533 |
+
|
534 |
+
writeValue(element: HTMLElement, value: any): void;
|
535 |
+
};
|
536 |
+
|
537 |
+
components: KnockoutComponents;
|
538 |
+
}
|
539 |
+
|
540 |
+
interface KnockoutBindingProvider {
|
541 |
+
nodeHasBindings(node: Node): boolean;
|
542 |
+
getBindings(node: Node, bindingContext: KnockoutBindingContext): {};
|
543 |
+
getBindingAccessors?(node: Node, bindingContext: KnockoutBindingContext): { [key: string]: string; };
|
544 |
+
}
|
545 |
+
|
546 |
+
interface KnockoutComputedContext {
|
547 |
+
getDependenciesCount(): number;
|
548 |
+
isInitial: () => boolean;
|
549 |
+
isSleeping: boolean;
|
550 |
+
}
|
551 |
+
|
552 |
+
//
|
553 |
+
// refactored types into a namespace to reduce global pollution
|
554 |
+
// and used Union Types to simplify overloads (requires TypeScript 1.4)
|
555 |
+
//
|
556 |
+
declare module KnockoutComponentTypes {
|
557 |
+
|
558 |
+
interface Config {
|
559 |
+
viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule;
|
560 |
+
template: string | Node[]| DocumentFragment | TemplateElement | AMDModule;
|
561 |
+
synchronous?: boolean;
|
562 |
+
}
|
563 |
+
|
564 |
+
interface ComponentConfig {
|
565 |
+
viewModel?: ViewModelFunction | ViewModelSharedInstance | ViewModelFactoryFunction | AMDModule;
|
566 |
+
template: any;
|
567 |
+
createViewModel?: any;
|
568 |
+
}
|
569 |
+
|
570 |
+
interface EmptyConfig {
|
571 |
+
}
|
572 |
+
|
573 |
+
// common AMD type
|
574 |
+
interface AMDModule {
|
575 |
+
require: string;
|
576 |
+
}
|
577 |
+
|
578 |
+
// viewmodel types
|
579 |
+
interface ViewModelFunction {
|
580 |
+
(params?: any): any;
|
581 |
+
}
|
582 |
+
|
583 |
+
interface ViewModelSharedInstance {
|
584 |
+
instance: any;
|
585 |
+
}
|
586 |
+
|
587 |
+
interface ViewModelFactoryFunction {
|
588 |
+
createViewModel: (params?: any, componentInfo?: ComponentInfo) => any;
|
589 |
+
}
|
590 |
+
|
591 |
+
interface ComponentInfo {
|
592 |
+
element: Node;
|
593 |
+
templateNodes: Node[];
|
594 |
+
}
|
595 |
+
|
596 |
+
interface TemplateElement {
|
597 |
+
element: string | Node;
|
598 |
+
}
|
599 |
+
|
600 |
+
interface Loader {
|
601 |
+
getConfig? (componentName: string, callback: (result: ComponentConfig) => void): void;
|
602 |
+
loadComponent? (componentName: string, config: ComponentConfig, callback: (result: Definition) => void): void;
|
603 |
+
loadTemplate? (componentName: string, templateConfig: any, callback: (result: Node[]) => void): void;
|
604 |
+
loadViewModel? (componentName: string, viewModelConfig: any, callback: (result: any) => void): void;
|
605 |
+
suppressLoaderExceptions?: boolean;
|
606 |
+
}
|
607 |
+
|
608 |
+
interface Definition {
|
609 |
+
template: Node[];
|
610 |
+
createViewModel? (params: any, options: { element: Node; }): any;
|
611 |
+
}
|
612 |
+
}
|
613 |
+
|
614 |
+
interface KnockoutComponents {
|
615 |
+
// overloads for register method:
|
616 |
+
register(componentName: string, config: KnockoutComponentTypes.Config | KnockoutComponentTypes.EmptyConfig): void;
|
617 |
+
|
618 |
+
isRegistered(componentName: string): boolean;
|
619 |
+
unregister(componentName: string): void;
|
620 |
+
get(componentName: string, callback: (definition: KnockoutComponentTypes.Definition) => void): void;
|
621 |
+
clearCachedDefinition(componentName: string): void
|
622 |
+
defaultLoader: KnockoutComponentTypes.Loader;
|
623 |
+
loaders: KnockoutComponentTypes.Loader[];
|
624 |
+
getComponentNameForNode(node: Node): string;
|
625 |
+
}
|
626 |
+
|
627 |
+
declare var ko: KnockoutStatic;
|
628 |
+
|
629 |
+
declare module "knockout" {
|
630 |
+
export = ko;
|
631 |
+
}
|
js/knockout.js
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Knockout JavaScript library v3.4.0
|
3 |
+
* (c) Steven Sanderson - http://knockoutjs.com/
|
4 |
+
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5 |
+
*/
|
6 |
+
|
7 |
+
(function() {(function(n){var x=this||(0,eval)("this"),u=x.document,M=x.navigator,v=x.jQuery,F=x.JSON;(function(n){"function"===typeof define&&define.amd?define(["exports","require"],n):"object"===typeof exports&&"object"===typeof module?n(module.exports||exports):n(x.ko={})})(function(N,O){function J(a,c){return null===a||typeof a in T?a===c:!1}function U(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=n;b()},c))}}function V(b,c){var d;return function(){clearTimeout(d);d=a.a.setTimeout(b,c)}}function W(a,
|
8 |
+
c){c&&c!==I?"beforeChange"===c?this.Kb(a):this.Ha(a,c):this.Lb(a)}function X(a,c){null!==c&&c.k&&c.k()}function Y(a,c){var d=this.Hc,e=d[s];e.R||(this.lb&&this.Ma[c]?(d.Pb(c,a,this.Ma[c]),this.Ma[c]=null,--this.lb):e.r[c]||d.Pb(c,a,e.s?{ia:a}:d.uc(a)))}function K(b,c,d,e){a.d[b]={init:function(b,g,k,l,m){var h,r;a.m(function(){var q=a.a.c(g()),p=!d!==!q,A=!r;if(A||c||p!==h)A&&a.va.Aa()&&(r=a.a.ua(a.f.childNodes(b),!0)),p?(A||a.f.da(b,a.a.ua(r)),a.eb(e?e(m,q):m,b)):a.f.xa(b),h=p},null,{i:b});return{controlsDescendantBindings:!0}}};
|
9 |
+
a.h.ta[b]=!1;a.f.Z[b]=!0}var a="undefined"!==typeof N?N:{};a.b=function(b,c){for(var d=b.split("."),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.G=function(a,c,d){a[c]=d};a.version="3.4.0";a.b("version",a.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1};a.a=function(){function b(a,b){for(var c in a)a.hasOwnProperty(c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var h=b[c].match(r)||
|
10 |
+
[];a.a.q(d.match(r),function(b){a.a.pa(h,b,e)});b[c]=h.join(" ")}var f={__proto__:[]}instanceof Array,g="function"===typeof Symbol,k={},l={};k[M&&/Firefox\/2/i.test(M.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");b(k,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)l[b[c]]=a});var m={propertychange:!0},h=u&&function(){for(var a=3,b=u.createElement("div"),c=
|
11 |
+
b.getElementsByTagName("i");b.innerHTML="\x3c!--[if gt IE "+ ++a+"]><i></i><![endif]--\x3e",c[0];);return 4<a?a:n}(),r=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(a,b){for(var c=0,d=a.length;c<d;c++)b(a[c],c)},o:function(a,b){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(a,b);for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Sb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d))return a[d];
|
12 |
+
return null},La:function(b,c){var d=a.a.o(b,c);0<d?b.splice(d,1):0===d&&b.shift()},Tb:function(b){b=b||[];for(var c=[],d=0,e=b.length;d<e;d++)0>a.a.o(c,b[d])&&c.push(b[d]);return c},fb:function(a,b){a=a||[];for(var c=[],d=0,e=a.length;d<e;d++)c.push(b(a[d],d));return c},Ka:function(a,b){a=a||[];for(var c=[],d=0,e=a.length;d<e;d++)b(a[d],d)&&c.push(a[d]);return c},ra:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},pa:function(b,c,d){var e=
|
13 |
+
a.a.o(a.a.zb(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},ka:f,extend:c,Xa:d,Ya:f?d:c,D:b,Ca:function(a,b){if(!a)return a;var c={},d;for(d in a)a.hasOwnProperty(d)&&(c[d]=b(a[d],d,a));return c},ob:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},jc:function(b){b=a.a.V(b);for(var c=(b[0]&&b[0].ownerDocument||u).createElement("div"),d=0,e=b.length;d<e;d++)c.appendChild(a.$(b[d]));return c},ua:function(b,c){for(var d=0,e=b.length,h=[];d<e;d++){var m=b[d].cloneNode(!0);h.push(c?a.$(m):m)}return h},
|
14 |
+
da:function(b,c){a.a.ob(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},qc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],h=e.parentNode,m=0,l=c.length;m<l;m++)h.insertBefore(c[m],e);m=0;for(l=d.length;m<l;m++)a.removeNode(d[m])}},za:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),
|
15 |
+
c=c.nextSibling;a.push(d)}}return a},sc:function(a,b){7>h?a.setAttribute("selected",b):a.selected=b},$a:function(a){return null===a||a===n?"":a.trim?a.trim():a.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(a,b){a=a||"";return b.length>a.length?!1:a.substring(0,b.length)===b},Mc:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(3===a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=
|
16 |
+
b;)a=a.parentNode;return!!a},nb:function(b){return a.a.Mc(b,b.ownerDocument.documentElement)},Qb:function(b){return!!a.a.Sb(b,a.a.nb)},A:function(a){return a&&a.tagName&&a.tagName.toLowerCase()},Wb:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.Wb(b),c)},$b:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},p:function(b,c,d){var e=a.a.Wb(d);d=h&&m[c];if(a.options.useOnlyNativeEvents||
|
17 |
+
d||!v)if(d||"function"!=typeof b.addEventListener)if("undefined"!=typeof b.attachEvent){var l=function(a){e.call(b,a)},f="on"+c;b.attachEvent(f,l);a.a.F.oa(b,function(){b.detachEvent(f,l)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else b.addEventListener(c,e,!1);else v(b).bind(c,e)},Da:function(b,c){if(!b||!b.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var d;"input"===a.a.A(b)&&b.type&&"click"==c.toLowerCase()?(d=b.type,d="checkbox"==
|
18 |
+
d||"radio"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if("function"==typeof u.createEvent)if("function"==typeof b.dispatchEvent)d=u.createEvent(l[c]||"HTMLEvents"),d.initEvent(c,!0,!0,x,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error("The supplied element doesn't support dispatchEvent");else if(d&&b.click)b.click();else if("undefined"!=typeof b.fireEvent)b.fireEvent("on"+c);else throw Error("Browser doesn't support triggering events");else v(b).trigger(c)},c:function(b){return a.H(b)?
|
19 |
+
b():b},zb:function(b){return a.H(b)?b.t():b},bb:function(b,c,d){var h;c&&("object"===typeof b.classList?(h=b.classList[d?"add":"remove"],a.a.q(c.match(r),function(a){h.call(b.classList,a)})):"string"===typeof b.className.baseVal?e(b.className,"baseVal",c,d):e(b,"className",c,d))},Za:function(b,c){var d=a.a.c(c);if(null===d||d===n)d="";var e=a.f.firstChild(b);!e||3!=e.nodeType||a.f.nextSibling(e)?a.f.da(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.Rc(b)},rc:function(a,b){a.name=b;if(7>=h)try{a.mergeAttributes(u.createElement("<input name='"+
|
20 |
+
a.name+"'/>"),!1)}catch(c){}},Rc:function(a){9<=h&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},Nc:function(a){if(h){var b=a.style.width;a.style.width=0;a.style.width=b}},hd:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},V:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Yb:function(a){return g?Symbol(a):a},rd:6===h,sd:7===h,C:h,ec:function(b,c){for(var d=a.a.V(b.getElementsByTagName("input")).concat(a.a.V(b.getElementsByTagName("textarea"))),
|
21 |
+
e="string"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},h=[],m=d.length-1;0<=m;m--)e(d[m])&&h.push(d[m]);return h},ed:function(b){return"string"==typeof b&&(b=a.a.$a(b))?F&&F.parse?F.parse(b):(new Function("return "+b))():null},Eb:function(b,c,d){if(!F||!F.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
|
22 |
+
return F.stringify(a.a.c(b),c,d)},fd:function(c,d,e){e=e||{};var h=e.params||{},m=e.includeFields||this.cc,l=c;if("object"==typeof c&&"form"===a.a.A(c))for(var l=c.action,f=m.length-1;0<=f;f--)for(var g=a.a.ec(c,m[f]),k=g.length-1;0<=k;k--)h[g[k].name]=g[k].value;d=a.a.c(d);var r=u.createElement("form");r.style.display="none";r.action=l;r.method="post";for(var n in d)c=u.createElement("input"),c.type="hidden",c.name=n,c.value=a.a.Eb(a.a.c(d[n])),r.appendChild(c);b(h,function(a,b){var c=u.createElement("input");
|
23 |
+
c.type="hidden";c.name=a;c.value=b;r.appendChild(c)});u.body.appendChild(r);e.submitter?e.submitter(r):r.submit();setTimeout(function(){r.parentNode.removeChild(r)},0)}}}();a.b("utils",a.a);a.b("utils.arrayForEach",a.a.q);a.b("utils.arrayFirst",a.a.Sb);a.b("utils.arrayFilter",a.a.Ka);a.b("utils.arrayGetDistinctValues",a.a.Tb);a.b("utils.arrayIndexOf",a.a.o);a.b("utils.arrayMap",a.a.fb);a.b("utils.arrayPushAll",a.a.ra);a.b("utils.arrayRemoveItem",a.a.La);a.b("utils.extend",a.a.extend);a.b("utils.fieldsIncludedWithJsonPost",
|
24 |
+
a.a.cc);a.b("utils.getFormFields",a.a.ec);a.b("utils.peekObservable",a.a.zb);a.b("utils.postJson",a.a.fd);a.b("utils.parseJson",a.a.ed);a.b("utils.registerEventHandler",a.a.p);a.b("utils.stringifyJson",a.a.Eb);a.b("utils.range",a.a.hd);a.b("utils.toggleDomNodeCssClass",a.a.bb);a.b("utils.triggerEvent",a.a.Da);a.b("utils.unwrapObservable",a.a.c);a.b("utils.objectForEach",a.a.D);a.b("utils.addOrRemoveItem",a.a.pa);a.b("utils.setTextContent",a.a.Za);a.b("unwrap",a.a.c);Function.prototype.bind||(Function.prototype.bind=
|
25 |
+
function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.e=new function(){function a(b,g){var k=b[d];if(!k||"null"===k||!e[k]){if(!g)return n;k=b[d]="ko"+c++;e[k]={}}return e[k]}var c=0,d="__ko__"+(new Date).getTime(),e={};return{get:function(c,d){var e=a(c,!1);return e===n?n:e[d]},set:function(c,d,e){if(e!==n||a(c,!1)!==n)a(c,!0)[d]=
|
26 |
+
e},clear:function(a){var b=a[d];return b?(delete e[b],a[d]=null,!0):!1},I:function(){return c++ +d}}};a.b("utils.domData",a.a.e);a.b("utils.domData.clear",a.a.e.clear);a.a.F=new function(){function b(b,c){var e=a.a.e.get(b,d);e===n&&c&&(e=[],a.a.e.set(b,d,e));return e}function c(d){var e=b(d,!1);if(e)for(var e=e.slice(0),l=0;l<e.length;l++)e[l](d);a.a.e.clear(d);a.a.F.cleanExternalData(d);if(f[d.nodeType])for(e=d.firstChild;d=e;)e=d.nextSibling,8===d.nodeType&&c(d)}var d=a.a.e.I(),e={1:!0,8:!0,9:!0},
|
27 |
+
f={1:!0,9:!0};return{oa:function(a,c){if("function"!=typeof c)throw Error("Callback must be a function");b(a,!0).push(c)},pc:function(c,e){var l=b(c,!1);l&&(a.a.La(l,e),0==l.length&&a.a.e.set(c,d,n))},$:function(b){if(e[b.nodeType]&&(c(b),f[b.nodeType])){var d=[];a.a.ra(d,b.getElementsByTagName("*"));for(var l=0,m=d.length;l<m;l++)c(d[l])}return b},removeNode:function(b){a.$(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&"function"==typeof v.cleanData&&v.cleanData([a])}}};
|
28 |
+
a.$=a.a.F.$;a.removeNode=a.a.F.removeNode;a.b("cleanNode",a.$);a.b("removeNode",a.removeNode);a.b("utils.domNodeDisposal",a.a.F);a.b("utils.domNodeDisposal.addDisposeCallback",a.a.F.oa);a.b("utils.domNodeDisposal.removeDisposeCallback",a.a.F.pc);(function(){var b=[0,"",""],c=[1,"<table>","</table>"],d=[3,"<table><tbody><tr>","</tr></tbody></table>"],e=[1,"<select multiple='multiple'>","</select>"],f={thead:c,tbody:c,tfoot:c,tr:[2,"<table><tbody>","</tbody></table>"],td:d,th:d,option:e,optgroup:e},
|
29 |
+
g=8>=a.a.C;a.a.ma=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var h=e[0];h.parentNode&&11!==h.parentNode.nodeType;)h=h.parentNode;h.parentNode&&h.parentNode.removeChild(h)}}else{(e=d)||(e=u);var h=e.parentWindow||e.defaultView||x,r=a.a.$a(c).toLowerCase(),q=e.createElement("div"),p;p=(r=r.match(/^<([a-z]+)[ >]/))&&f[r[1]]||b;r=p[0];p="ignored<div>"+p[1]+c+p[2]+"</div>";"function"==typeof h.innerShiv?q.appendChild(h.innerShiv(p)):(g&&e.appendChild(q),
|
30 |
+
q.innerHTML=p,g&&q.parentNode.removeChild(q));for(;r--;)q=q.lastChild;e=a.a.V(q.lastChild.childNodes)}return e};a.a.Cb=function(b,c){a.a.ob(b);c=a.a.c(c);if(null!==c&&c!==n)if("string"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ma(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b("utils.parseHtmlFragment",a.a.ma);a.b("utils.setHtml",a.a.Cb);a.M=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.M.lc(c.nodeValue);null!=f&&e.push({Lc:c,cd:f})}else if(1==c.nodeType)for(var f=
|
31 |
+
0,g=c.childNodes,k=g.length;f<k;f++)b(g[f],e)}var c={};return{wb:function(a){if("function"!=typeof a)throw Error("You can only pass a function to ko.memoization.memoize()");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return"\x3c!--[ko_memo:"+b+"]--\x3e"},xc:function(a,b){var f=c[a];if(f===n)throw Error("Couldn't find any memo with ID "+a+". Perhaps it's already been unmemoized.");try{return f.apply(null,b||[]),
|
32 |
+
!0}finally{delete c[a]}},yc:function(c,e){var f=[];b(c,f);for(var g=0,k=f.length;g<k;g++){var l=f[g].Lc,m=[l];e&&a.a.ra(m,e);a.M.xc(f[g].cd,m);l.nodeValue="";l.parentNode&&l.parentNode.removeChild(l)}},lc:function(a){return(a=a.match(/^\[ko_memo\:(.*?)\]$/))?a[1]:null}}}();a.b("memoization",a.M);a.b("memoization.memoize",a.M.wb);a.b("memoization.unmemoize",a.M.xc);a.b("memoization.parseMemoText",a.M.lc);a.b("memoization.unmemoizeDomNodeAndDescendants",a.M.yc);a.Y=function(){function b(){if(e)for(var b=
|
33 |
+
e,c=0,m;g<e;)if(m=d[g++]){if(g>b){if(5E3<=++c){g=e;a.a.$b(Error("'Too much recursion' after processing "+c+" task groups."));break}b=e}try{m()}catch(h){a.a.$b(h)}}}function c(){b();g=e=d.length=0}var d=[],e=0,f=1,g=0;return{scheduler:x.MutationObserver?function(a){var b=u.createElement("div");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle("foo")}}(c):u&&"onreadystatechange"in u.createElement("script")?function(a){var b=u.createElement("script");b.onreadystatechange=
|
34 |
+
function(){b.onreadystatechange=null;u.documentElement.removeChild(b);b=null;a()};u.documentElement.appendChild(b)}:function(a){setTimeout(a,0)},Wa:function(b){e||a.Y.scheduler(c);d[e++]=b;return f++},cancel:function(a){a-=f-e;a>=g&&a<e&&(d[a]=null)},resetForTesting:function(){var a=e-g;g=e=d.length=0;return a},md:b}}();a.b("tasks",a.Y);a.b("tasks.schedule",a.Y.Wa);a.b("tasks.runEarly",a.Y.md);a.ya={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.B({read:b,write:function(e){clearTimeout(d);
|
35 |
+
d=a.a.setTimeout(function(){b(e)},c)}})},rateLimit:function(a,c){var d,e,f;"number"==typeof c?d=c:(d=c.timeout,e=c.method);a.cb=!1;f="notifyWhenChangesStop"==e?V:U;a.Ta(function(a){return f(a,d)})},deferred:function(b,c){if(!0!==c)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.cb||(b.cb=!0,b.Ta(function(c){var e;return function(){a.Y.cancel(e);e=a.Y.Wa(c);b.notifySubscribers(n,"dirty")}}))},notify:function(a,c){a.equalityComparer=
|
36 |
+
"always"==c?null:J}};var T={undefined:1,"boolean":1,number:1,string:1};a.b("extenders",a.ya);a.vc=function(b,c,d){this.ia=b;this.gb=c;this.Kc=d;this.R=!1;a.G(this,"dispose",this.k)};a.vc.prototype.k=function(){this.R=!0;this.Kc()};a.J=function(){a.a.Ya(this,D);D.rb(this)};var I="change",D={rb:function(a){a.K={};a.Nb=1},X:function(b,c,d){var e=this;d=d||I;var f=new a.vc(e,c?b.bind(c):b,function(){a.a.La(e.K[d],f);e.Ia&&e.Ia(d)});e.sa&&e.sa(d);e.K[d]||(e.K[d]=[]);e.K[d].push(f);return f},notifySubscribers:function(b,
|
37 |
+
c){c=c||I;c===I&&this.zc();if(this.Pa(c))try{a.l.Ub();for(var d=this.K[c].slice(0),e=0,f;f=d[e];++e)f.R||f.gb(b)}finally{a.l.end()}},Na:function(){return this.Nb},Uc:function(a){return this.Na()!==a},zc:function(){++this.Nb},Ta:function(b){var c=this,d=a.H(c),e,f,g;c.Ha||(c.Ha=c.notifySubscribers,c.notifySubscribers=W);var k=b(function(){c.Mb=!1;d&&g===c&&(g=c());e=!1;c.tb(f,g)&&c.Ha(f=g)});c.Lb=function(a){c.Mb=e=!0;g=a;k()};c.Kb=function(a){e||(f=a,c.Ha(a,"beforeChange"))}},Pa:function(a){return this.K[a]&&
|
38 |
+
this.K[a].length},Sc:function(b){if(b)return this.K[b]&&this.K[b].length||0;var c=0;a.a.D(this.K,function(a,b){"dirty"!==a&&(c+=b.length)});return c},tb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},extend:function(b){var c=this;b&&a.a.D(b,function(b,e){var f=a.ya[b];"function"==typeof f&&(c=f(c,e)||c)});return c}};a.G(D,"subscribe",D.X);a.G(D,"extend",D.extend);a.G(D,"getSubscriptionsCount",D.Sc);a.a.ka&&a.a.Xa(D,Function.prototype);a.J.fn=D;a.hc=function(a){return null!=
|
39 |
+
a&&"function"==typeof a.X&&"function"==typeof a.notifySubscribers};a.b("subscribable",a.J);a.b("isSubscribable",a.hc);a.va=a.l=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{Ub:b,end:c,oc:function(b){if(e){if(!a.hc(b))throw Error("Only subscribable things can act as dependencies");e.gb.call(e.Gc,b,b.Cc||(b.Cc=++f))}},w:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},Aa:function(){if(e)return e.m.Aa()},Sa:function(){if(e)return e.Sa}}}();a.b("computedContext",
|
40 |
+
a.va);a.b("computedContext.getDependenciesCount",a.va.Aa);a.b("computedContext.isInitial",a.va.Sa);a.b("ignoreDependencies",a.qd=a.l.w);var E=a.a.Yb("_latestValue");a.N=function(b){function c(){if(0<arguments.length)return c.tb(c[E],arguments[0])&&(c.ga(),c[E]=arguments[0],c.fa()),this;a.l.oc(c);return c[E]}c[E]=b;a.a.ka||a.a.extend(c,a.J.fn);a.J.fn.rb(c);a.a.Ya(c,B);a.options.deferUpdates&&a.ya.deferred(c,!0);return c};var B={equalityComparer:J,t:function(){return this[E]},fa:function(){this.notifySubscribers(this[E])},
|
41 |
+
ga:function(){this.notifySubscribers(this[E],"beforeChange")}};a.a.ka&&a.a.Xa(B,a.J.fn);var H=a.N.gd="__ko_proto__";B[H]=a.N;a.Oa=function(b,c){return null===b||b===n||b[H]===n?!1:b[H]===c?!0:a.Oa(b[H],c)};a.H=function(b){return a.Oa(b,a.N)};a.Ba=function(b){return"function"==typeof b&&b[H]===a.N||"function"==typeof b&&b[H]===a.B&&b.Vc?!0:!1};a.b("observable",a.N);a.b("isObservable",a.H);a.b("isWriteableObservable",a.Ba);a.b("isWritableObservable",a.Ba);a.b("observable.fn",B);a.G(B,"peek",B.t);a.G(B,
|
42 |
+
"valueHasMutated",B.fa);a.G(B,"valueWillMutate",B.ga);a.la=function(b){b=b||[];if("object"!=typeof b||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");b=a.N(b);a.a.Ya(b,a.la.fn);return b.extend({trackArrayChanges:!0})};a.la.fn={remove:function(b){for(var c=this.t(),d=[],e="function"!=typeof b||a.H(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];e(g)&&(0===d.length&&this.ga(),d.push(g),c.splice(f,1),f--)}d.length&&
|
43 |
+
this.fa();return d},removeAll:function(b){if(b===n){var c=this.t(),d=c.slice(0);this.ga();c.splice(0,c.length);this.fa();return d}return b?this.remove(function(c){return 0<=a.a.o(b,c)}):[]},destroy:function(b){var c=this.t(),d="function"!=typeof b||a.H(b)?function(a){return a===b}:b;this.ga();for(var e=c.length-1;0<=e;e--)d(c[e])&&(c[e]._destroy=!0);this.fa()},destroyAll:function(b){return b===n?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.o(b,c)}):[]},indexOf:function(b){var c=
|
44 |
+
this();return a.a.o(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.ga(),this.t()[d]=c,this.fa())}};a.a.ka&&a.a.Xa(a.la.fn,a.N.fn);a.a.q("pop push reverse shift sort splice unshift".split(" "),function(b){a.la.fn[b]=function(){var a=this.t();this.ga();this.Vb(a,b,arguments);var d=a[b].apply(a,arguments);this.fa();return d===a?this:d}});a.a.q(["slice"],function(b){a.la.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.b("observableArray",a.la);a.ya.trackArrayChanges=function(b,
|
45 |
+
c){function d(){if(!e){e=!0;var c=b.notifySubscribers;b.notifySubscribers=function(a,b){b&&b!==I||++k;return c.apply(this,arguments)};var d=[].concat(b.t()||[]);f=null;g=b.X(function(c){c=[].concat(c||[]);if(b.Pa("arrayChange")){var e;if(!f||1<k)f=a.a.ib(d,c,b.hb);e=f}d=c;f=null;k=0;e&&e.length&&b.notifySubscribers(e,"arrayChange")})}}b.hb={};c&&"object"==typeof c&&a.a.extend(b.hb,c);b.hb.sparse=!0;if(!b.Vb){var e=!1,f=null,g,k=0,l=b.sa,m=b.Ia;b.sa=function(a){l&&l.call(b,a);"arrayChange"===a&&d()};
|
46 |
+
b.Ia=function(a){m&&m.call(b,a);"arrayChange"!==a||b.Pa("arrayChange")||(g.k(),e=!1)};b.Vb=function(b,c,d){function m(a,b,c){return l[l.length]={status:a,value:b,index:c}}if(e&&!k){var l=[],g=b.length,t=d.length,G=0;switch(c){case "push":G=g;case "unshift":for(c=0;c<t;c++)m("added",d[c],G+c);break;case "pop":G=g-1;case "shift":g&&m("deleted",b[G],G);break;case "splice":c=Math.min(Math.max(0,0>d[0]?g+d[0]:d[0]),g);for(var g=1===t?g:Math.min(c+(d[1]||0),g),t=c+t-2,G=Math.max(g,t),P=[],n=[],Q=2;c<G;++c,
|
47 |
+
++Q)c<g&&n.push(m("deleted",b[c],c)),c<t&&P.push(m("added",d[Q],c));a.a.dc(n,P);break;default:return}f=l}}}};var s=a.a.Yb("_state");a.m=a.B=function(b,c,d){function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.pb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}a.l.oc(e);(g.S||g.s&&e.Qa())&&e.aa();return g.T}"object"===typeof b?d=b:(d=d||{},b&&(d.read=
|
48 |
+
b));if("function"!=typeof d.read)throw Error("Pass a function that returns the value of the ko.computed");var f=d.write,g={T:n,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:d.read,pb:c||d.owner,i:d.disposeWhenNodeIsRemoved||d.i||null,wa:d.disposeWhen||d.wa,mb:null,r:{},L:0,bc:null};e[s]=g;e.Vc="function"===typeof f;a.a.ka||a.a.extend(e,a.J.fn);a.J.fn.rb(e);a.a.Ya(e,z);d.pure?(g.Va=!0,g.s=!0,a.a.extend(e,$)):d.deferEvaluation&&a.a.extend(e,aa);a.options.deferUpdates&&a.ya.deferred(e,!0);g.i&&(g.Fb=!0,g.i.nodeType||
|
49 |
+
(g.i=null));g.s||d.deferEvaluation||e.aa();g.i&&e.ba()&&a.a.F.oa(g.i,g.mb=function(){e.k()});return e};var z={equalityComparer:J,Aa:function(){return this[s].L},Pb:function(a,c,d){if(this[s].Va&&c===this)throw Error("A 'pure' computed must not be called recursively");this[s].r[a]=d;d.Ga=this[s].L++;d.na=c.Na()},Qa:function(){var a,c,d=this[s].r;for(a in d)if(d.hasOwnProperty(a)&&(c=d[a],c.ia.Uc(c.na)))return!0},bd:function(){this.Fa&&!this[s].Ra&&this.Fa()},ba:function(){return this[s].S||0<this[s].L},
|
50 |
+
ld:function(){this.Mb||this.ac()},uc:function(a){if(a.cb&&!this[s].i){var c=a.X(this.bd,this,"dirty"),d=a.X(this.ld,this);return{ia:a,k:function(){c.k();d.k()}}}return a.X(this.ac,this)},ac:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[s].bc),this[s].bc=a.a.setTimeout(function(){b.aa(!0)},c)):b.Fa?b.Fa():b.aa(!0)},aa:function(b){var c=this[s],d=c.wa;if(!c.Ra&&!c.R){if(c.i&&!a.a.nb(c.i)||d&&d()){if(!c.Fb){this.k();return}}else c.Fb=!1;c.Ra=!0;try{this.Qc(b)}finally{c.Ra=!1}c.L||
|
51 |
+
this.k()}},Qc:function(b){var c=this[s],d=c.Va?n:!c.L,e={Hc:this,Ma:c.r,lb:c.L};a.l.Ub({Gc:e,gb:Y,m:this,Sa:d});c.r={};c.L=0;e=this.Pc(c,e);this.tb(c.T,e)&&(c.s||this.notifySubscribers(c.T,"beforeChange"),c.T=e,c.s?this.zc():b&&this.notifySubscribers(c.T));d&&this.notifySubscribers(c.T,"awake")},Pc:function(b,c){try{var d=b.jd;return b.pb?d.call(b.pb):d()}finally{a.l.end(),c.lb&&!b.s&&a.a.D(c.Ma,X),b.S=!1}},t:function(){var a=this[s];(a.S&&!a.L||a.s&&this.Qa())&&this.aa();return a.T},Ta:function(b){a.J.fn.Ta.call(this,
|
52 |
+
b);this.Fa=function(){this.Kb(this[s].T);this[s].S=!0;this.Lb(this)}},k:function(){var b=this[s];!b.s&&b.r&&a.a.D(b.r,function(a,b){b.k&&b.k()});b.i&&b.mb&&a.a.F.pc(b.i,b.mb);b.r=null;b.L=0;b.R=!0;b.S=!1;b.s=!1;b.i=null}},$={sa:function(b){var c=this,d=c[s];if(!d.R&&d.s&&"change"==b){d.s=!1;if(d.S||c.Qa())d.r=null,d.L=0,d.S=!0,c.aa();else{var e=[];a.a.D(d.r,function(a,b){e[b.Ga]=a});a.a.q(e,function(a,b){var e=d.r[a],l=c.uc(e.ia);l.Ga=b;l.na=e.na;d.r[a]=l})}d.R||c.notifySubscribers(d.T,"awake")}},
|
53 |
+
Ia:function(b){var c=this[s];c.R||"change"!=b||this.Pa("change")||(a.a.D(c.r,function(a,b){b.k&&(c.r[a]={ia:b.ia,Ga:b.Ga,na:b.na},b.k())}),c.s=!0,this.notifySubscribers(n,"asleep"))},Na:function(){var b=this[s];b.s&&(b.S||this.Qa())&&this.aa();return a.J.fn.Na.call(this)}},aa={sa:function(a){"change"!=a&&"beforeChange"!=a||this.t()}};a.a.ka&&a.a.Xa(z,a.J.fn);var R=a.N.gd;a.m[R]=a.N;z[R]=a.m;a.Xc=function(b){return a.Oa(b,a.m)};a.Yc=function(b){return a.Oa(b,a.m)&&b[s]&&b[s].Va};a.b("computed",a.m);
|
54 |
+
a.b("dependentObservable",a.m);a.b("isComputed",a.Xc);a.b("isPureComputed",a.Yc);a.b("computed.fn",z);a.G(z,"peek",z.t);a.G(z,"dispose",z.k);a.G(z,"isActive",z.ba);a.G(z,"getDependenciesCount",z.Aa);a.nc=function(b,c){if("function"===typeof b)return a.m(b,c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.m(b,c)};a.b("pureComputed",a.nc);(function(){function b(a,f,g){g=g||new d;a=f(a);if("object"!=typeof a||null===a||a===n||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof
|
55 |
+
Number||a instanceof Boolean)return a;var k=a instanceof Array?[]:{};g.save(a,k);c(a,function(c){var d=f(a[c]);switch(typeof d){case "boolean":case "number":case "string":case "function":k[c]=d;break;case "object":case "undefined":var h=g.get(d);k[c]=h!==n?h:b(d,f,g)}});return k}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"function"==typeof a.toJSON&&b("toJSON")}else for(c in a)b(c)}function d(){this.keys=[];this.Ib=[]}a.wc=function(c){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");
|
56 |
+
return b(c,function(b){for(var c=0;a.H(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.wc(b);return a.a.Eb(b,c,d)};d.prototype={save:function(b,c){var d=a.a.o(this.keys,b);0<=d?this.Ib[d]=c:(this.keys.push(b),this.Ib.push(c))},get:function(b){b=a.a.o(this.keys,b);return 0<=b?this.Ib[b]:n}}})();a.b("toJS",a.wc);a.b("toJSON",a.toJSON);(function(){a.j={u:function(b){switch(a.a.A(b)){case "option":return!0===b.__ko__hasDomDataOptionValue__?a.a.e.get(b,a.d.options.xb):7>=a.a.C?b.getAttributeNode("value")&&
|
57 |
+
b.getAttributeNode("value").specified?b.value:b.text:b.value;case "select":return 0<=b.selectedIndex?a.j.u(b.options[b.selectedIndex]):n;default:return b.value}},ha:function(b,c,d){switch(a.a.A(b)){case "option":switch(typeof c){case "string":a.a.e.set(b,a.d.options.xb,n);"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__;b.value=c;break;default:a.a.e.set(b,a.d.options.xb,c),b.__ko__hasDomDataOptionValue__=!0,b.value="number"===typeof c?c:""}break;case "select":if(""===c||
|
58 |
+
null===c)c=n;for(var e=-1,f=0,g=b.options.length,k;f<g;++f)if(k=a.j.u(b.options[f]),k==c||""==k&&c===n){e=f;break}if(d||0<=e||c===n&&1<b.size)b.selectedIndex=e;break;default:if(null===c||c===n)c="";b.value=c}}}})();a.b("selectExtensions",a.j);a.b("selectExtensions.readValue",a.j.u);a.b("selectExtensions.writeValue",a.j.ha);a.h=function(){function b(b){b=a.a.$a(b);123===b.charCodeAt(0)&&(b=b.slice(1,-1));var c=[],d=b.match(e),r,k=[],p=0;if(d){d.push(",");for(var A=0,y;y=d[A];++A){var t=y.charCodeAt(0);
|
59 |
+
if(44===t){if(0>=p){c.push(r&&k.length?{key:r,value:k.join("")}:{unknown:r||k.join("")});r=p=0;k=[];continue}}else if(58===t){if(!p&&!r&&1===k.length){r=k.pop();continue}}else 47===t&&A&&1<y.length?(t=d[A-1].match(f))&&!g[t[0]]&&(b=b.substr(b.indexOf(y)+1),d=b.match(e),d.push(","),A=-1,y="/"):40===t||123===t||91===t?++p:41===t||125===t||93===t?--p:r||k.length||34!==t&&39!==t||(y=y.slice(1,-1));k.push(y)}}return c}var c=["true","false","null","undefined"],d=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,
|
60 |
+
e=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),f=/[\])"'A-Za-z0-9_$]+$/,g={"in":1,"return":1,"typeof":1},k={};return{ta:[],ea:k,yb:b,Ua:function(e,m){function h(b,e){var m;if(!A){var l=a.getBindingHandler(b);if(l&&l.preprocess&&!(e=l.preprocess(e,b,h)))return;if(l=k[b])m=e,0<=a.a.o(c,m)?m=!1:(l=m.match(d),m=null===l?!1:l[1]?"Object("+l[1]+")"+l[2]:m),l=m;l&&g.push("'"+b+"':function(_z){"+m+"=_z}")}p&&(e=
|
61 |
+
"function(){return "+e+" }");f.push("'"+b+"':"+e)}m=m||{};var f=[],g=[],p=m.valueAccessors,A=m.bindingParams,y="string"===typeof e?b(e):e;a.a.q(y,function(a){h(a.key||a.unknown,a.value)});g.length&&h("_ko_property_writers","{"+g.join(",")+" }");return f.join(",")},ad:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},Ea:function(b,c,d,e,f){if(b&&a.H(b))!a.Ba(b)||f&&b.t()===e||b(e);else if((b=c.get("_ko_property_writers"))&&b[d])b[d](e)}}}();a.b("expressionRewriting",a.h);a.b("expressionRewriting.bindingRewriteValidators",
|
62 |
+
a.h.ta);a.b("expressionRewriting.parseObjectLiteral",a.h.yb);a.b("expressionRewriting.preProcessBindings",a.h.Ua);a.b("expressionRewriting._twoWayBindings",a.h.ea);a.b("jsonExpressionRewriting",a.h);a.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",a.h.Ua);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&k.test(f?a.text:a.nodeValue)}function d(a,d){for(var e=a,f=1,l=[];e=e.nextSibling;){if(c(e)&&(f--,0===f))return l;l.push(e);
|
63 |
+
b(e)&&f++}if(!d)throw Error("Cannot find closing comment tag to match: "+a.nodeValue);return null}function e(a,b){var c=d(a,b);return c?0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=u&&"\x3c!--test--\x3e"===u.createComment("test").text,g=f?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,k=f?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};a.f={Z:{},childNodes:function(a){return b(a)?d(a):a.childNodes},xa:function(c){if(b(c)){c=a.f.childNodes(c);for(var d=
|
64 |
+
0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.ob(c)},da:function(c,d){if(b(c)){a.f.xa(c);for(var e=c.nextSibling,f=0,l=d.length;f<l;f++)e.parentNode.insertBefore(d[f],e)}else a.a.da(c,d)},mc:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},gc:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):c.appendChild(d):a.f.mc(c,d)},firstChild:function(a){return b(a)?!a.nextSibling||
|
65 |
+
c(a.nextSibling)?null:a.nextSibling:a.firstChild},nextSibling:function(a){b(a)&&(a=e(a));return a.nextSibling&&c(a.nextSibling)?null:a.nextSibling},Tc:b,pd:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},kc:function(d){if(l[a.a.A(d)]){var h=d.firstChild;if(h){do if(1===h.nodeType){var f;f=h.firstChild;var g=null;if(f){do if(g)g.push(f);else if(b(f)){var k=e(f,!0);k?f=k:g=[f]}else c(f)&&(g=[f]);while(f=f.nextSibling)}if(f=g)for(g=h.nextSibling,k=0;k<f.length;k++)g?d.insertBefore(f[k],
|
66 |
+
g):d.appendChild(f[k])}while(h=h.nextSibling)}}}}})();a.b("virtualElements",a.f);a.b("virtualElements.allowedBindings",a.f.Z);a.b("virtualElements.emptyNode",a.f.xa);a.b("virtualElements.insertAfter",a.f.gc);a.b("virtualElements.prepend",a.f.mc);a.b("virtualElements.setDomNodeChildren",a.f.da);(function(){a.Q=function(){this.Fc={}};a.a.extend(a.Q.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=b.getAttribute("data-bind")||a.g.getComponentNameForNode(b);case 8:return a.f.Tc(b);
|
67 |
+
default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.g.Ob(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.g.Ob(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return a.f.pd(b);default:return null}},parseBindingsString:function(b,c,d,e){try{var f=this.Fc,g=b+(e&&e.valueAccessors||
|
68 |
+
""),k;if(!(k=f[g])){var l,m="with($context){with($data||{}){return{"+a.h.Ua(b,e)+"}}}";l=new Function("$context","$element",m);k=f[g]=l}return k(c,d)}catch(h){throw h.message="Unable to parse bindings.\nBindings value: "+b+"\nMessage: "+h.message,h;}}});a.Q.instance=new a.Q})();a.b("bindingProvider",a.Q);(function(){function b(a){return function(){return a}}function c(a){return a()}function d(b){return a.a.Ca(a.l.w(b),function(a,c){return function(){return b()[c]}})}function e(c,e,h){return"function"===
|
69 |
+
typeof c?d(c.bind(null,e,h)):a.a.Ca(c,b)}function f(a,b){return d(this.getBindings.bind(this,a,b))}function g(b,c,d){var e,h=a.f.firstChild(c),f=a.Q.instance,m=f.preprocessNode;if(m){for(;e=h;)h=a.f.nextSibling(e),m.call(f,e);h=a.f.firstChild(c)}for(;e=h;)h=a.f.nextSibling(e),k(b,e,d)}function k(b,c,d){var e=!0,h=1===c.nodeType;h&&a.f.kc(c);if(h&&d||a.Q.instance.nodeHasBindings(c))e=m(c,null,b,d).shouldBindDescendants;e&&!r[a.a.A(c)]&&g(b,c,!h)}function l(b){var c=[],d={},e=[];a.a.D(b,function Z(h){if(!d[h]){var f=
|
70 |
+
a.getBindingHandler(h);f&&(f.after&&(e.push(h),a.a.q(f.after,function(c){if(b[c]){if(-1!==a.a.o(e,c))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+e.join(", "));Z(c)}}),e.length--),c.push({key:h,fc:f}));d[h]=!0}});return c}function m(b,d,e,h){var m=a.a.e.get(b,q);if(!d){if(m)throw Error("You cannot apply bindings multiple times to the same element.");a.a.e.set(b,q,!0)}!m&&h&&a.tc(b,e);var g;if(d&&"function"!==typeof d)g=d;else{var k=a.Q.instance,r=k.getBindingAccessors||
|
71 |
+
f,p=a.B(function(){(g=d?d(e,b):r.call(k,b,e))&&e.P&&e.P();return g},null,{i:b});g&&p.ba()||(p=null)}var u;if(g){var v=p?function(a){return function(){return c(p()[a])}}:function(a){return g[a]},s=function(){return a.a.Ca(p?p():g,c)};s.get=function(a){return g[a]&&c(v(a))};s.has=function(a){return a in g};h=l(g);a.a.q(h,function(c){var d=c.fc.init,h=c.fc.update,f=c.key;if(8===b.nodeType&&!a.f.Z[f])throw Error("The binding '"+f+"' cannot be used with virtual elements");try{"function"==typeof d&&a.l.w(function(){var a=
|
72 |
+
d(b,v(f),s,e.$data,e);if(a&&a.controlsDescendantBindings){if(u!==n)throw Error("Multiple bindings ("+u+" and "+f+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");u=f}}),"function"==typeof h&&a.B(function(){h(b,v(f),s,e.$data,e)},null,{i:b})}catch(m){throw m.message='Unable to process binding "'+f+": "+g[f]+'"\nMessage: '+m.message,m;}})}return{shouldBindDescendants:u===n}}function h(b){return b&&b instanceof a.U?b:new a.U(b)}
|
73 |
+
a.d={};var r={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.d[b]};a.U=function(b,c,d,e){var h=this,f="function"==typeof b&&!a.H(b),m,g=a.B(function(){var m=f?b():b,l=a.a.c(m);c?(c.P&&c.P(),a.a.extend(h,c),g&&(h.P=g)):(h.$parents=[],h.$root=l,h.ko=a);h.$rawData=m;h.$data=l;d&&(h[d]=l);e&&e(h,c,l);return h.$data},null,{wa:function(){return m&&!a.a.Qb(m)},i:!0});g.ba()&&(h.P=g,g.equalityComparer=null,m=[],g.Ac=function(b){m.push(b);a.a.F.oa(b,function(b){a.a.La(m,b);m.length||
|
74 |
+
(g.k(),h.P=g=n)})})};a.U.prototype.createChildContext=function(b,c,d){return new a.U(b,this,c,function(a,b){a.$parentContext=b;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)})};a.U.prototype.extend=function(b){return new a.U(this.P||this.$data,this,null,function(c,d){c.$rawData=d.$rawData;a.a.extend(c,"function"==typeof b?b():b)})};var q=a.a.e.I(),p=a.a.e.I();a.tc=function(b,c){if(2==arguments.length)a.a.e.set(b,p,c),c.P&&c.P.Ac(b);else return a.a.e.get(b,
|
75 |
+
p)};a.Ja=function(b,c,d){1===b.nodeType&&a.f.kc(b);return m(b,c,h(d),!0)};a.Dc=function(b,c,d){d=h(d);return a.Ja(b,e(c,d,b),d)};a.eb=function(a,b){1!==b.nodeType&&8!==b.nodeType||g(h(a),b,!0)};a.Rb=function(a,b){!v&&x.jQuery&&(v=x.jQuery);if(b&&1!==b.nodeType&&8!==b.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");b=b||x.document.body;k(h(a),b,!0)};a.kb=function(b){switch(b.nodeType){case 1:case 8:var c=a.tc(b);if(c)return c;
|
76 |
+
if(b.parentNode)return a.kb(b.parentNode)}return n};a.Jc=function(b){return(b=a.kb(b))?b.$data:n};a.b("bindingHandlers",a.d);a.b("applyBindings",a.Rb);a.b("applyBindingsToDescendants",a.eb);a.b("applyBindingAccessorsToNode",a.Ja);a.b("applyBindingsToNode",a.Dc);a.b("contextFor",a.kb);a.b("dataFor",a.Jc)})();(function(b){function c(c,e){var m=f.hasOwnProperty(c)?f[c]:b,h;m?m.X(e):(m=f[c]=new a.J,m.X(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Zc:e};delete f[c];h||e?m.notifySubscribers(b):
|
77 |
+
a.Y.Wa(function(){m.notifySubscribers(b)})}),h=!0)}function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],function(a){b(a,c)}):b(null,null)})}function e(c,d,f,h){h||(h=a.g.loaders.slice(0));var g=h.shift();if(g){var q=g[c];if(q){var p=!1;if(q.apply(g,d.concat(function(a){p?f(null):null!==a?f(a):e(c,d,f,h)}))!==b&&(p=!0,!g.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");}else e(c,d,f,h)}else f(null)}
|
78 |
+
var f={},g={};a.g={get:function(d,e){var f=g.hasOwnProperty(d)?g[d]:b;f?f.Zc?a.l.w(function(){e(f.definition)}):a.Y.Wa(function(){e(f.definition)}):c(d,e)},Xb:function(a){delete g[a]},Jb:e};a.g.loaders=[];a.b("components",a.g);a.b("components.get",a.g.get);a.b("components.clearCachedDefinition",a.g.Xb)})();(function(){function b(b,c,d,e){function g(){0===--y&&e(k)}var k={},y=2,t=d.template;d=d.viewModel;t?f(c,t,function(c){a.g.Jb("loadTemplate",[b,c],function(a){k.template=a;g()})}):g();d?f(c,d,function(c){a.g.Jb("loadViewModel",
|
79 |
+
[b,c],function(a){k[l]=a;g()})}):g()}function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});else if("function"===typeof b[l])d(b[l]);else if("instance"in b){var e=b.instance;d(function(){return e})}else"viewModel"in b?c(a,b.viewModel,d):a("Unknown viewModel value: "+b)}function d(b){switch(a.a.A(b)){case "script":return a.a.ma(b.text);case "textarea":return a.a.ma(b.value);case "template":if(e(b.content))return a.a.ua(b.content.childNodes)}return a.a.ua(b.childNodes)}function e(a){return x.DocumentFragment?
|
80 |
+
a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){"string"===typeof b.require?O||x.require?(O||x.require)([b.require],c):a("Uses require, but no AMD loader is present"):c(b)}function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}var k={};a.g.register=function(b,c){if(!c)throw Error("Invalid configuration for "+b);if(a.g.ub(b))throw Error("Component "+b+" is already registered");k[b]=c};a.g.ub=function(a){return k.hasOwnProperty(a)};a.g.od=function(b){delete k[b];
|
81 |
+
a.g.Xb(b)};a.g.Zb={getConfig:function(a,b){b(k.hasOwnProperty(a)?k[a]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if("string"===typeof c)f(a.a.ma(c));else if(c instanceof Array)f(c);else if(e(c))f(a.a.V(c.childNodes));else if(c.element)if(c=c.element,x.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if("string"===typeof c){var l=u.getElementById(c);l?f(d(l)):b("Cannot find element with ID "+c)}else b("Unknown element type: "+
|
82 |
+
c);else b("Unknown template value: "+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var l="createViewModel";a.b("components.register",a.g.register);a.b("components.isRegistered",a.g.ub);a.b("components.unregister",a.g.od);a.b("components.defaultLoader",a.g.Zb);a.g.loaders.push(a.g.Zb);a.g.Bc=k})();(function(){function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ca(f,function(c){return a.m(c,null,{i:b})}),g=a.a.Ca(f,function(c){var e=
|
83 |
+
c.t();return c.ba()?a.m({read:function(){return a.a.c(c())},write:a.Ba(e)&&function(a){c()(a)},i:b}):e});g.hasOwnProperty("$raw")||(g.$raw=f);return g}return{$raw:{}}}a.g.getComponentNameForNode=function(b){var c=a.a.A(b);if(a.g.ub(c)&&(-1!=c.indexOf("-")||"[object HTMLUnknownElement]"==""+b||8>=a.a.C&&b.tagName===c))return c};a.g.Ob=function(c,e,f,g){if(1===e.nodeType){var k=a.g.getComponentNameForNode(e);if(k){c=c||{};if(c.component)throw Error('Cannot use the "component" binding on a custom element matching a component');
|
84 |
+
var l={name:k,params:b(e,f)};c.component=g?function(){return l}:l}}return c};var c=new a.Q;9>a.a.C&&(a.g.register=function(a){return function(b){u.createElement(b);return a.apply(this,arguments)}}(a.g.register),u.createDocumentFragment=function(b){return function(){var c=b(),f=a.g.Bc,g;for(g in f)f.hasOwnProperty(g)&&c.createElement(g);return c}}(u.createDocumentFragment))})();(function(b){function c(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has no template");b=a.a.ua(c);a.f.da(d,b)}
|
85 |
+
function d(a,b,c,d){var e=a.createViewModel;return e?e.call(a,d,{element:b,templateNodes:c}):d}var e=0;a.d.component={init:function(f,g,k,l,m){function h(){var a=r&&r.dispose;"function"===typeof a&&a.call(r);q=r=null}var r,q,p=a.a.V(a.f.childNodes(f));a.a.F.oa(f,h);a.m(function(){var l=a.a.c(g()),k,t;"string"===typeof l?k=l:(k=a.a.c(l.name),t=a.a.c(l.params));if(!k)throw Error("No component name specified");var n=q=++e;a.g.get(k,function(e){if(q===n){h();if(!e)throw Error("Unknown component '"+k+
|
86 |
+
"'");c(k,e,f);var g=d(e,f,p,t);e=m.createChildContext(g,b,function(a){a.$component=g;a.$componentTemplateNodes=p});r=g;a.eb(e,f)}})},null,{i:f});return{controlsDescendantBindings:!0}}};a.f.Z.component=!0})();var S={"class":"className","for":"htmlFor"};a.d.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.D(d,function(c,d){d=a.a.c(d);var g=!1===d||null===d||d===n;g&&b.removeAttribute(c);8>=a.a.C&&c in S?(c=S[c],g?b.removeAttribute(c):b[c]=d):g||b.setAttribute(c,d.toString());"name"===c&&a.a.rc(b,
|
87 |
+
g?"":d.toString())})}};(function(){a.d.checked={after:["value","attr"],init:function(b,c,d){function e(){var e=b.checked,f=p?g():e;if(!a.va.Sa()&&(!l||e)){var m=a.l.w(c);if(h){var k=r?m.t():m;q!==f?(e&&(a.a.pa(k,f,!0),a.a.pa(k,q,!1)),q=f):a.a.pa(k,f,e);r&&a.Ba(m)&&m(k)}else a.h.Ea(m,d,"checked",f,!0)}}function f(){var d=a.a.c(c());b.checked=h?0<=a.a.o(d,g()):k?d:g()===d}var g=a.nc(function(){return d.has("checkedValue")?a.a.c(d.get("checkedValue")):d.has("value")?a.a.c(d.get("value")):b.value}),k=
|
88 |
+
"checkbox"==b.type,l="radio"==b.type;if(k||l){var m=c(),h=k&&a.a.c(m)instanceof Array,r=!(h&&m.push&&m.splice),q=h?g():n,p=l||h;l&&!b.name&&a.d.uniqueName.init(b,function(){return!0});a.m(e,null,{i:b});a.a.p(b,"click",e);a.m(f,null,{i:b});m=n}}};a.h.ea.checked=!0;a.d.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.d.css={update:function(b,c){var d=a.a.c(c());null!==d&&"object"==typeof d?a.a.D(d,function(c,d){d=a.a.c(d);a.a.bb(b,c,d)}):(d=a.a.$a(String(d||"")),a.a.bb(b,b.__ko__cssValue,
|
89 |
+
!1),b.__ko__cssValue=d,a.a.bb(b,d,!0))}};a.d.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute("disabled"):d||b.disabled||(b.disabled=!0)}};a.d.disable={update:function(b,c){a.d.enable.update(b,function(){return!a.a.c(c())})}};a.d.event={init:function(b,c,d,e,f){var g=c()||{};a.a.D(g,function(g){"string"==typeof g&&a.a.p(b,g,function(b){var m,h=c()[g];if(h){try{var r=a.a.V(arguments);e=f.$data;r.unshift(e);m=h.apply(e,r)}finally{!0!==m&&(b.preventDefault?b.preventDefault():
|
90 |
+
b.returnValue=!1)}!1===d.get(g+"Bubble")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.d.foreach={ic:function(b){return function(){var c=b(),d=a.a.zb(c);if(!d||"number"==typeof d.length)return{foreach:c,templateEngine:a.W.sb};a.a.c(c);return{foreach:d.data,as:d.as,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,beforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.W.sb}}},init:function(b,c){return a.d.template.init(b,
|
91 |
+
a.d.foreach.ic(c))},update:function(b,c,d,e,f){return a.d.template.update(b,a.d.foreach.ic(c),d,e,f)}};a.h.ta.foreach=!1;a.f.Z.foreach=!0;a.d.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activeElement"in f){var g;try{g=f.activeElement}catch(h){g=f.body}e=g===b}f=c();a.h.Ea(f,d,"hasfocus",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.p(b,"focus",f);a.a.p(b,"focusin",f);a.a.p(b,"blur",g);a.a.p(b,
|
92 |
+
"focusout",g)},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.l.w(a.a.Da,null,[b,d?"focusin":"focusout"]))}};a.h.ea.hasfocus=!0;a.d.hasFocus=a.d.hasfocus;a.h.ea.hasFocus=!0;a.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Cb(b,c())}};K("if");K("ifnot",!1,!0);K("with",!0,!1,function(a,c){return a.createChildContext(c)});var L={};
|
93 |
+
a.d.options={init:function(b){if("select"!==a.a.A(b))throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.Ka(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[b]:c}function g(c,e){if(A&&h)a.j.ha(b,a.a.c(d.get("value")),!0);else if(p.length){var f=0<=a.a.o(p,a.j.u(e[0]));a.a.sc(e[0],f);A&&!f&&a.l.w(a.a.Da,null,[b,
|
94 |
+
"change"])}}var k=b.multiple,l=0!=b.length&&k?b.scrollTop:null,m=a.a.c(c()),h=d.get("valueAllowUnset")&&d.has("value"),r=d.get("optionsIncludeDestroyed");c={};var q,p=[];h||(k?p=a.a.fb(e(),a.j.u):0<=b.selectedIndex&&p.push(a.j.u(b.options[b.selectedIndex])));m&&("undefined"==typeof m.length&&(m=[m]),q=a.a.Ka(m,function(b){return r||b===n||null===b||!a.a.c(b._destroy)}),d.has("optionsCaption")&&(m=a.a.c(d.get("optionsCaption")),null!==m&&m!==n&&q.unshift(L)));var A=!1;c.beforeRemove=function(a){b.removeChild(a)};
|
95 |
+
m=g;d.has("optionsAfterRender")&&"function"==typeof d.get("optionsAfterRender")&&(m=function(b,c){g(0,c);a.l.w(d.get("optionsAfterRender"),null,[c[0],b!==L?b:n])});a.a.Bb(b,q,function(c,e,g){g.length&&(p=!h&&g[0].selected?[a.j.u(g[0])]:[],A=!0);e=b.ownerDocument.createElement("option");c===L?(a.a.Za(e,d.get("optionsCaption")),a.j.ha(e,n)):(g=f(c,d.get("optionsValue"),c),a.j.ha(e,a.a.c(g)),c=f(c,d.get("optionsText"),g),a.a.Za(e,c));return[e]},c,m);a.l.w(function(){h?a.j.ha(b,a.a.c(d.get("value")),
|
96 |
+
!0):(k?p.length&&e().length<p.length:p.length&&0<=b.selectedIndex?a.j.u(b.options[b.selectedIndex])!==p[0]:p.length||0<=b.selectedIndex)&&a.a.Da(b,"change")});a.a.Nc(b);l&&20<Math.abs(l-b.scrollTop)&&(b.scrollTop=l)}};a.d.options.xb=a.a.e.I();a.d.selectedOptions={after:["options","foreach"],init:function(b,c,d){a.a.p(b,"change",function(){var e=c(),f=[];a.a.q(b.getElementsByTagName("option"),function(b){b.selected&&f.push(a.j.u(b))});a.h.Ea(e,d,"selectedOptions",f)})},update:function(b,c){if("select"!=
|
97 |
+
a.a.A(b))throw Error("values binding applies only to SELECT elements");var d=a.a.c(c()),e=b.scrollTop;d&&"number"==typeof d.length&&a.a.q(b.getElementsByTagName("option"),function(b){var c=0<=a.a.o(d,a.j.u(b));b.selected!=c&&a.a.sc(b,c)});b.scrollTop=e}};a.h.ea.selectedOptions=!0;a.d.style={update:function(b,c){var d=a.a.c(c()||{});a.a.D(d,function(c,d){d=a.a.c(d);if(null===d||d===n||!1===d)d="";b.style[c]=d})}};a.d.submit={init:function(b,c,d,e,f){if("function"!=typeof c())throw Error("The value for a submit binding must be a function");
|
98 |
+
a.a.p(b,"submit",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Za(b,c())}};a.f.Z.text=!0;(function(){if(x&&x.navigator)var b=function(a){if(a)return parseFloat(a[1])},c=x.opera&&x.opera.version&&parseInt(x.opera.version()),d=x.navigator.userAgent,e=b(d.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),f=b(d.match(/Firefox\/([^ ]*)/));
|
99 |
+
if(10>a.a.C)var g=a.a.e.I(),k=a.a.e.I(),l=function(b){var c=this.activeElement;(c=c&&a.a.e.get(c,k))&&c(b)},m=function(b,c){var d=b.ownerDocument;a.a.e.get(d,g)||(a.a.e.set(d,g,!0),a.a.p(d,"selectionchange",l));a.a.e.set(b,k,c)};a.d.textInput={init:function(b,d,g){function l(c,d){a.a.p(b,c,d)}function k(){var c=a.a.c(d());if(null===c||c===n)c="";v!==n&&c===v?a.a.setTimeout(k,4):b.value!==c&&(u=c,b.value=c)}function y(){s||(v=b.value,s=a.a.setTimeout(t,4))}function t(){clearTimeout(s);v=s=n;var c=
|
100 |
+
b.value;u!==c&&(u=c,a.h.Ea(d(),g,"textInput",c))}var u=b.value,s,v,x=9==a.a.C?y:t;10>a.a.C?(l("propertychange",function(a){"value"===a.propertyName&&x(a)}),8==a.a.C&&(l("keyup",t),l("keydown",t)),8<=a.a.C&&(m(b,x),l("dragend",y))):(l("input",t),5>e&&"textarea"===a.a.A(b)?(l("keydown",y),l("paste",y),l("cut",y)):11>c?l("keydown",y):4>f&&(l("DOMAutoComplete",t),l("dragdrop",t),l("drop",t)));l("change",t);a.m(k,null,{i:b})}};a.h.ea.textInput=!0;a.d.textinput={preprocess:function(a,b,c){c("textInput",
|
101 |
+
a)}}})();a.d.uniqueName={init:function(b,c){if(c()){var d="ko_unique_"+ ++a.d.uniqueName.Ic;a.a.rc(b,d)}}};a.d.uniqueName.Ic=0;a.d.value={after:["options","foreach"],init:function(b,c,d){if("input"!=b.tagName.toLowerCase()||"checkbox"!=b.type&&"radio"!=b.type){var e=["change"],f=d.get("valueUpdate"),g=!1,k=null;f&&("string"==typeof f&&(f=[f]),a.a.ra(e,f),e=a.a.Tb(e));var l=function(){k=null;g=!1;var e=c(),f=a.j.u(b);a.h.Ea(e,d,"value",f)};!a.a.C||"input"!=b.tagName.toLowerCase()||"text"!=b.type||
|
102 |
+
"off"==b.autocomplete||b.form&&"off"==b.form.autocomplete||-1!=a.a.o(e,"propertychange")||(a.a.p(b,"propertychange",function(){g=!0}),a.a.p(b,"focus",function(){g=!1}),a.a.p(b,"blur",function(){g&&l()}));a.a.q(e,function(c){var d=l;a.a.nd(c,"after")&&(d=function(){k=a.j.u(b);a.a.setTimeout(l,0)},c=c.substring(5));a.a.p(b,c,d)});var m=function(){var e=a.a.c(c()),f=a.j.u(b);if(null!==k&&e===k)a.a.setTimeout(m,0);else if(e!==f)if("select"===a.a.A(b)){var g=d.get("valueAllowUnset"),f=function(){a.j.ha(b,
|
103 |
+
e,g)};f();g||e===a.j.u(b)?a.a.setTimeout(f,0):a.l.w(a.a.Da,null,[b,"change"])}else a.j.ha(b,e)};a.m(m,null,{i:b})}else a.Ja(b,{checkedValue:c})},update:function(){}};a.h.ea.value=!0;a.d.visible={update:function(b,c){var d=a.a.c(c()),e="none"!=b.style.display;d&&!e?b.style.display="":!d&&e&&(b.style.display="none")}};(function(b){a.d[b]={init:function(c,d,e,f,g){return a.d.event.init.call(this,c,function(){var a={};a[b]=d();return a},e,f,g)}}})("click");a.O=function(){};a.O.prototype.renderTemplateSource=
|
104 |
+
function(){throw Error("Override renderTemplateSource");};a.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};a.O.prototype.makeTemplateSource=function(b,c){if("string"==typeof b){c=c||u;var d=c.getElementById(b);if(!d)throw Error("Cannot find template with ID "+b);return new a.v.n(d)}if(1==b.nodeType||8==b.nodeType)return new a.v.qa(b);throw Error("Unknown template type: "+b);};a.O.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,
|
105 |
+
e);return this.renderTemplateSource(a,c,d,e)};a.O.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data("isRewritten")};a.O.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data("isRewritten",!0)};a.b("templateEngine",a.O);a.Gb=function(){function b(b,c,d,k){b=a.h.yb(b);for(var l=a.h.ta,m=0;m<b.length;m++){var h=b[m].key;if(l.hasOwnProperty(h)){var r=l[h];if("function"===typeof r){if(h=
|
106 |
+
r(b[m].value))throw Error(h);}else if(!r)throw Error("This template engine does not support the '"+h+"' binding within its templates");}}d="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+a.h.Ua(b,{valueAccessors:!0})+" } })()},'"+d.toLowerCase()+"')";return k.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,d=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(b,
|
107 |
+
c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.Gb.dd(b,c)},d)},dd:function(a,f){return a.replace(c,function(a,c,d,e,h){return b(h,c,d,f)}).replace(d,function(a,c){return b(c,"\x3c!-- ko --\x3e","#comment",f)})},Ec:function(b,c){return a.M.wb(function(d,k){var l=d.nextSibling;l&&l.nodeName.toLowerCase()===c&&a.Ja(l,b,k)})}}}();a.b("__tr_ambtns",a.Gb.Ec);(function(){a.v={};a.v.n=function(b){if(this.n=b){var c=a.a.A(b);this.ab="script"===c?1:"textarea"===c?2:"template"==c&&
|
108 |
+
b.content&&11===b.content.nodeType?3:4}};a.v.n.prototype.text=function(){var b=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[b];var c=arguments[0];"innerHTML"===b?a.a.Cb(this.n,c):this.n[b]=c};var b=a.a.e.I()+"_";a.v.n.prototype.data=function(c){if(1===arguments.length)return a.a.e.get(this.n,b+c);a.a.e.set(this.n,b+c,arguments[1])};var c=a.a.e.I();a.v.n.prototype.nodes=function(){var b=this.n;if(0==arguments.length)return(a.a.e.get(b,c)||{}).jb||(3===this.ab?
|
109 |
+
b.content:4===this.ab?b:n);a.a.e.set(b,c,{jb:arguments[0]})};a.v.qa=function(a){this.n=a};a.v.qa.prototype=new a.v.n;a.v.qa.prototype.text=function(){if(0==arguments.length){var b=a.a.e.get(this.n,c)||{};b.Hb===n&&b.jb&&(b.Hb=b.jb.innerHTML);return b.Hb}a.a.e.set(this.n,c,{Hb:arguments[0]})};a.b("templateSources",a.v);a.b("templateSources.domElement",a.v.n);a.b("templateSources.anonymousTemplate",a.v.qa)})();(function(){function b(b,c,d){var e;for(c=a.f.nextSibling(c);b&&(e=b)!==c;)b=a.f.nextSibling(e),
|
110 |
+
d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,k=a.Q.instance,n=k.preprocessNode;if(n){b(e,f,function(a,b){var c=a.previousSibling,d=n.call(k,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.za(c,g))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.Rb(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.M.yc(b,[d])});a.a.za(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,
|
111 |
+
e,f,k,q){q=q||{};var p=(b&&d(b)||f||{}).ownerDocument,n=q.templateEngine||g;a.Gb.Oc(f,n,p);f=n.renderTemplate(f,k,q,p);if("number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");p=!1;switch(e){case "replaceChildren":a.f.da(b,f);p=!0;break;case "replaceNode":a.a.qc(b,f);p=!0;break;case "ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+e);}p&&(c(f,k),q.afterRender&&a.l.w(q.afterRender,null,[f,k.$data]));
|
112 |
+
return f}function f(b,c,d){return a.H(b)?b():"function"===typeof b?b(c,d):b}var g;a.Db=function(b){if(b!=n&&!(b instanceof a.O))throw Error("templateEngine must inherit from ko.templateEngine");g=b};a.Ab=function(b,c,h,k,q){h=h||{};if((h.templateEngine||g)==n)throw Error("Set a template engine before calling renderTemplate");q=q||"replaceChildren";if(k){var p=d(k);return a.B(function(){var g=c&&c instanceof a.U?c:new a.U(a.a.c(c)),n=f(b,g.$data,g),g=e(k,q,n,g,h);"replaceNode"==q&&(k=g,p=d(k))},null,
|
113 |
+
{wa:function(){return!p||!a.a.nb(p)},i:p&&"replaceNode"==q?p.parentNode:p})}return a.M.wb(function(d){a.Ab(b,c,h,d,"replaceNode")})};a.kd=function(b,d,g,k,q){function p(a,b){c(b,s);g.afterRender&&g.afterRender(b,a);s=null}function u(a,c){s=q.createChildContext(a,g.as,function(a){a.$index=c});var d=f(b,a,s);return e(null,"ignoreTargetNode",d,s,g)}var s;return a.B(function(){var b=a.a.c(d)||[];"undefined"==typeof b.length&&(b=[b]);b=a.a.Ka(b,function(b){return g.includeDestroyed||b===n||null===b||!a.a.c(b._destroy)});
|
114 |
+
a.l.w(a.a.Bb,null,[k,b,u,g,p])},null,{i:k})};var k=a.a.e.I();a.d.template={init:function(b,c){var d=a.a.c(c());if("string"==typeof d||d.name)a.f.xa(b);else{if("nodes"in d){if(d=d.nodes||[],a.H(d))throw Error('The "nodes" option must be a plain, non-observable array.');}else d=a.f.childNodes(b);d=a.a.jc(d);(new a.v.qa(b)).nodes(d)}return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c(),s;c=a.a.c(g);d=!0;e=null;"string"==typeof c?c={}:(g=c.name,"if"in c&&(d=a.a.c(c["if"])),d&&"ifnot"in
|
115 |
+
c&&(d=!a.a.c(c.ifnot)),s=a.a.c(c.data));"foreach"in c?e=a.kd(g||b,d&&c.foreach||[],c,b,f):d?(f="data"in c?f.createChildContext(s,c.as):f,e=a.Ab(g||b,f,c,b)):a.f.xa(b);f=e;(s=a.a.e.get(b,k))&&"function"==typeof s.k&&s.k();a.a.e.set(b,k,f&&f.ba()?f:n)}};a.h.ta.template=function(b){b=a.h.yb(b);return 1==b.length&&b[0].unknown||a.h.ad(b,"name")?null:"This template engine does not support anonymous templates nested within its templates"};a.f.Z.template=!0})();a.b("setTemplateEngine",a.Db);a.b("renderTemplate",
|
116 |
+
a.Ab);a.a.dc=function(a,c,d){if(a.length&&c.length){var e,f,g,k,l;for(e=f=0;(!d||e<d)&&(k=a[f]);++f){for(g=0;l=c[g];++g)if(k.value===l.value){k.moved=l.index;l.moved=k.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.ib=function(){function b(b,d,e,f,g){var k=Math.min,l=Math.max,m=[],h,n=b.length,q,p=d.length,s=p-n||1,u=n+p+1,t,v,x;for(h=0;h<=n;h++)for(v=t,m.push(t=[]),x=k(p,h+s),q=l(0,h-1);q<=x;q++)t[q]=q?h?b[h-1]===d[q-1]?v[q-1]:k(v[q]||u,t[q-1]||u)+1:q+1:h+1;k=[];l=[];s=[];h=n;for(q=p;h||q;)p=m[h][q]-
|
117 |
+
1,q&&p===m[h][q-1]?l.push(k[k.length]={status:e,value:d[--q],index:q}):h&&p===m[h-1][q]?s.push(k[k.length]={status:f,value:b[--h],index:h}):(--q,--h,g.sparse||k.push({status:"retained",value:d[q]}));a.a.dc(s,l,!g.dontLimitMoves&&10*n);return k.reverse()}return function(a,d,e){e="boolean"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,"added","deleted",e):b(d,a,"deleted","added",e)}}();a.b("utils.compareArrays",a.a.ib);(function(){function b(b,c,d,k,l){var m=[],
|
118 |
+
h=a.B(function(){var h=c(d,l,a.a.za(m,b))||[];0<m.length&&(a.a.qc(m,h),k&&a.l.w(k,null,[d,h,l]));m.length=0;a.a.ra(m,h)},null,{i:b,wa:function(){return!a.a.Qb(m)}});return{ca:m,B:h.ba()?h:n}}var c=a.a.e.I(),d=a.a.e.I();a.a.Bb=function(e,f,g,k,l){function m(b,c){w=q[c];v!==c&&(D[b]=w);w.qb(v++);a.a.za(w.ca,e);u.push(w);z.push(w)}function h(b,c){if(b)for(var d=0,e=c.length;d<e;d++)c[d]&&a.a.q(c[d].ca,function(a){b(a,d,c[d].ja)})}f=f||[];k=k||{};var r=a.a.e.get(e,c)===n,q=a.a.e.get(e,c)||[],p=a.a.fb(q,
|
119 |
+
function(a){return a.ja}),s=a.a.ib(p,f,k.dontLimitMoves),u=[],t=0,v=0,x=[],z=[];f=[];for(var D=[],p=[],w,C=0,B,E;B=s[C];C++)switch(E=B.moved,B.status){case "deleted":E===n&&(w=q[t],w.B&&(w.B.k(),w.B=n),a.a.za(w.ca,e).length&&(k.beforeRemove&&(u.push(w),z.push(w),w.ja===d?w=null:f[C]=w),w&&x.push.apply(x,w.ca)));t++;break;case "retained":m(C,t++);break;case "added":E!==n?m(C,E):(w={ja:B.value,qb:a.N(v++)},u.push(w),z.push(w),r||(p[C]=w))}a.a.e.set(e,c,u);h(k.beforeMove,D);a.a.q(x,k.beforeRemove?a.$:
|
120 |
+
a.removeNode);for(var C=0,r=a.f.firstChild(e),F;w=z[C];C++){w.ca||a.a.extend(w,b(e,g,w.ja,l,w.qb));for(t=0;s=w.ca[t];r=s.nextSibling,F=s,t++)s!==r&&a.f.gc(e,s,F);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}h(k.beforeRemove,f);for(C=0;C<f.length;++C)f[C]&&(f[C].ja=d);h(k.afterMove,D);h(k.afterAdd,p)}})();a.b("utils.setDomNodeChildrenFromArrayMapping",a.a.Bb);a.W=function(){this.allowTemplateRewriting=!1};a.W.prototype=new a.O;a.W.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.C?0:b.nodes)?
|
121 |
+
b.nodes():null)return a.a.V(c.cloneNode(!0).childNodes);b=b.text();return a.a.ma(b,e)};a.W.sb=new a.W;a.Db(a.W.sb);a.b("nativeTemplateEngine",a.W);(function(){a.vb=function(){var a=this.$c=function(){if(!v||!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,f,g){g=g||u;f=f||{};if(2>a)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var k=b.data("precompiled");
|
122 |
+
k||(k=b.text()||"",k=v.template(null,"{{ko_with $item.koBindingContext}}"+k+"{{/ko_with}}"),b.data("precompiled",k));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(k,b,e);e.appendTo(g.createElement("div"));v.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return"{{ko_code ((function() { return "+a+" })()) }}"};this.addTemplate=function(a,b){u.write("<script type='text/html' id='"+a+"'>"+b+"\x3c/script>")};0<a&&(v.tmpl.tag.ko_code={open:"__.push($1 || '');"},
|
123 |
+
v.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};a.vb.prototype=new a.O;var b=new a.vb;0<b.$c&&a.Db(b);a.b("jqueryTmplTemplateEngine",a.vb)})()})})();})();
|
js/lodash-3.10.d.ts
ADDED
@@ -0,0 +1,15041 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Type definitions for Lo-Dash
|
2 |
+
// Project: http://lodash.com/
|
3 |
+
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>
|
4 |
+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
5 |
+
|
6 |
+
declare var _: _.LoDashStatic;
|
7 |
+
|
8 |
+
declare module _ {
|
9 |
+
interface LoDashStatic {
|
10 |
+
/**
|
11 |
+
* Creates a lodash object which wraps the given value to enable intuitive method chaining.
|
12 |
+
*
|
13 |
+
* In addition to Lo-Dash methods, wrappers also have the following Array methods:
|
14 |
+
* concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift
|
15 |
+
*
|
16 |
+
* Chaining is supported in custom builds as long as the value method is implicitly or
|
17 |
+
* explicitly included in the build.
|
18 |
+
*
|
19 |
+
* The chainable wrapper functions are:
|
20 |
+
* after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
|
21 |
+
* createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
|
22 |
+
* forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
|
23 |
+
* indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
|
24 |
+
* object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
|
25 |
+
* remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
|
26 |
+
* toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip
|
27 |
+
*
|
28 |
+
* The non-chainable wrapper functions are:
|
29 |
+
* clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast,
|
30 |
+
* findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean,
|
31 |
+
* isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber,
|
32 |
+
* isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin,
|
33 |
+
* noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some,
|
34 |
+
* sortedIndex, runInContext, template, unescape, uniqueId, and value
|
35 |
+
*
|
36 |
+
* The wrapper functions first and last return wrapped values when n is provided, otherwise
|
37 |
+
* they return unwrapped values.
|
38 |
+
*
|
39 |
+
* Explicit chaining can be enabled by using the _.chain method.
|
40 |
+
**/
|
41 |
+
(value: number): LoDashImplicitWrapper<number>;
|
42 |
+
(value: string): LoDashImplicitStringWrapper;
|
43 |
+
(value: boolean): LoDashImplicitWrapper<boolean>;
|
44 |
+
(value: Array<number>): LoDashImplicitNumberArrayWrapper;
|
45 |
+
<T>(value: Array<T>): LoDashImplicitArrayWrapper<T>;
|
46 |
+
<T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
|
47 |
+
(value: any): LoDashImplicitWrapper<any>;
|
48 |
+
|
49 |
+
/**
|
50 |
+
* The semantic version number.
|
51 |
+
**/
|
52 |
+
VERSION: string;
|
53 |
+
|
54 |
+
/**
|
55 |
+
* An object used to flag environments features.
|
56 |
+
**/
|
57 |
+
support: Support;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
|
61 |
+
* (ERB). Change the following template settings to use alternative delimiters.
|
62 |
+
**/
|
63 |
+
templateSettings: TemplateSettings;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
|
68 |
+
* (ERB). Change the following template settings to use alternative delimiters.
|
69 |
+
**/
|
70 |
+
interface TemplateSettings {
|
71 |
+
/**
|
72 |
+
* The "escape" delimiter.
|
73 |
+
**/
|
74 |
+
escape?: RegExp;
|
75 |
+
|
76 |
+
/**
|
77 |
+
* The "evaluate" delimiter.
|
78 |
+
**/
|
79 |
+
evaluate?: RegExp;
|
80 |
+
|
81 |
+
/**
|
82 |
+
* An object to import into the template as local variables.
|
83 |
+
**/
|
84 |
+
imports?: Dictionary<any>;
|
85 |
+
|
86 |
+
/**
|
87 |
+
* The "interpolate" delimiter.
|
88 |
+
**/
|
89 |
+
interpolate?: RegExp;
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Used to reference the data object in the template text.
|
93 |
+
**/
|
94 |
+
variable?: string;
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Creates a cache object to store key/value pairs.
|
99 |
+
*/
|
100 |
+
interface MapCache {
|
101 |
+
/**
|
102 |
+
* Removes `key` and its value from the cache.
|
103 |
+
* @param key The key of the value to remove.
|
104 |
+
* @return Returns `true` if the entry was removed successfully, else `false`.
|
105 |
+
*/
|
106 |
+
delete(key: string): boolean;
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Gets the cached value for `key`.
|
110 |
+
* @param key The key of the value to get.
|
111 |
+
* @return Returns the cached value.
|
112 |
+
*/
|
113 |
+
get(key: string): any;
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Checks if a cached value for `key` exists.
|
117 |
+
* @param key The key of the entry to check.
|
118 |
+
* @return Returns `true` if an entry for `key` exists, else `false`.
|
119 |
+
*/
|
120 |
+
has(key: string): boolean;
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Sets `value` to `key` of the cache.
|
124 |
+
* @param key The key of the value to cache.
|
125 |
+
* @param value The value to cache.
|
126 |
+
* @return Returns the cache object.
|
127 |
+
*/
|
128 |
+
set(key: string, value: any): _.Dictionary<any>;
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* An object used to flag environments features.
|
133 |
+
**/
|
134 |
+
interface Support {
|
135 |
+
/**
|
136 |
+
* Detect if an arguments object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
|
137 |
+
**/
|
138 |
+
argsClass: boolean;
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Detect if arguments objects are Object objects (all but Narwhal and Opera < 10.5).
|
142 |
+
**/
|
143 |
+
argsObject: boolean;
|
144 |
+
|
145 |
+
/**
|
146 |
+
* Detect if name or message properties of Error.prototype are enumerable by default.
|
147 |
+
* (IE < 9, Safari < 5.1)
|
148 |
+
**/
|
149 |
+
enumErrorProps: boolean;
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Detect if prototype properties are enumerable by default.
|
153 |
+
*
|
154 |
+
* Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 (if the prototype or a property on the
|
155 |
+
* prototype has been set) incorrectly set the [[Enumerable]] value of a function’s prototype property to true.
|
156 |
+
**/
|
157 |
+
enumPrototypes: boolean;
|
158 |
+
|
159 |
+
/**
|
160 |
+
* Detect if Function#bind exists and is inferred to be fast (all but V8).
|
161 |
+
**/
|
162 |
+
fastBind: boolean;
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Detect if functions can be decompiled by Function#toString (all but PS3 and older Opera
|
166 |
+
* mobile browsers & avoided in Windows 8 apps).
|
167 |
+
**/
|
168 |
+
funcDecomp: boolean;
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Detect if Function#name is supported (all but IE).
|
172 |
+
**/
|
173 |
+
funcNames: boolean;
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Detect if arguments object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS,
|
177 |
+
* Safari < 5.1).
|
178 |
+
**/
|
179 |
+
nonEnumArgs: boolean;
|
180 |
+
|
181 |
+
/**
|
182 |
+
* Detect if properties shadowing those on Object.prototype are non-enumerable.
|
183 |
+
*
|
184 |
+
* In IE < 9 an objects own properties, shadowing non-enumerable ones, are made
|
185 |
+
* non-enumerable as well (a.k.a the JScript [[DontEnum]] bug).
|
186 |
+
**/
|
187 |
+
nonEnumShadows: boolean;
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Detect if own properties are iterated after inherited properties (all but IE < 9).
|
191 |
+
**/
|
192 |
+
ownLast: boolean;
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Detect if Array#shift and Array#splice augment array-like objects correctly.
|
196 |
+
*
|
197 |
+
* Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array shift() and splice()
|
198 |
+
* functions that fail to remove the last element, value[0], of array-like objects even
|
199 |
+
* though the length property is set to 0. The shift() method is buggy in IE 8 compatibility
|
200 |
+
* mode, while splice() is buggy regardless of mode in IE < 9 and buggy in compatibility mode
|
201 |
+
* in IE 9.
|
202 |
+
**/
|
203 |
+
spliceObjects: boolean;
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Detect lack of support for accessing string characters by index.
|
207 |
+
*
|
208 |
+
* IE < 8 can't access characters by index and IE 8 can only access characters by index on
|
209 |
+
* string literals.
|
210 |
+
**/
|
211 |
+
unindexedChars: boolean;
|
212 |
+
}
|
213 |
+
|
214 |
+
interface LoDashWrapperBase<T, TWrapper> { }
|
215 |
+
|
216 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
|
217 |
+
|
218 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> extends LoDashWrapperBase<T, TWrapper> { }
|
219 |
+
|
220 |
+
interface LoDashImplicitWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitWrapper<T>> { }
|
221 |
+
|
222 |
+
interface LoDashExplicitWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitWrapper<T>> { }
|
223 |
+
|
224 |
+
interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper<string> { }
|
225 |
+
|
226 |
+
interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper<string> { }
|
227 |
+
|
228 |
+
interface LoDashImplicitObjectWrapper<T> extends LoDashImplicitWrapperBase<T, LoDashImplicitObjectWrapper<T>> { }
|
229 |
+
|
230 |
+
interface LoDashExplicitObjectWrapper<T> extends LoDashExplicitWrapperBase<T, LoDashExplicitObjectWrapper<T>> { }
|
231 |
+
|
232 |
+
interface LoDashImplicitArrayWrapper<T> extends LoDashImplicitWrapperBase<T[], LoDashImplicitArrayWrapper<T>> {
|
233 |
+
pop(): T;
|
234 |
+
push(...items: T[]): LoDashImplicitArrayWrapper<T>;
|
235 |
+
shift(): T;
|
236 |
+
sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper<T>;
|
237 |
+
splice(start: number): LoDashImplicitArrayWrapper<T>;
|
238 |
+
splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper<T>;
|
239 |
+
unshift(...items: T[]): LoDashImplicitArrayWrapper<T>;
|
240 |
+
}
|
241 |
+
|
242 |
+
interface LoDashExplicitArrayWrapper<T> extends LoDashExplicitWrapperBase<T[], LoDashExplicitArrayWrapper<T>> { }
|
243 |
+
|
244 |
+
interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper<number> { }
|
245 |
+
|
246 |
+
interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper<number> { }
|
247 |
+
|
248 |
+
// join (exists only in wrappers)
|
249 |
+
interface LoDashImplicitWrapper<T> {
|
250 |
+
/**
|
251 |
+
* @see _.join
|
252 |
+
*/
|
253 |
+
join(separator?: string): string;
|
254 |
+
}
|
255 |
+
|
256 |
+
interface LoDashImplicitArrayWrapper<T> {
|
257 |
+
/**
|
258 |
+
* @see _.join
|
259 |
+
*/
|
260 |
+
join(separator?: string): string;
|
261 |
+
}
|
262 |
+
|
263 |
+
interface LoDashImplicitObjectWrapper<T> {
|
264 |
+
/**
|
265 |
+
* @see _.join
|
266 |
+
*/
|
267 |
+
join(separator?: string): string;
|
268 |
+
}
|
269 |
+
|
270 |
+
interface LoDashExplicitWrapper<T> {
|
271 |
+
/**
|
272 |
+
* @see _.join
|
273 |
+
*/
|
274 |
+
join(separator?: string): LoDashExplicitWrapper<string>;
|
275 |
+
}
|
276 |
+
|
277 |
+
interface LoDashExplicitArrayWrapper<T> {
|
278 |
+
/**
|
279 |
+
* @see _.join
|
280 |
+
*/
|
281 |
+
join(separator?: string): LoDashExplicitWrapper<string>;
|
282 |
+
}
|
283 |
+
|
284 |
+
interface LoDashExplicitObjectWrapper<T> {
|
285 |
+
/**
|
286 |
+
* @see _.join
|
287 |
+
*/
|
288 |
+
join(separator?: string): LoDashExplicitWrapper<string>;
|
289 |
+
}
|
290 |
+
|
291 |
+
/*********
|
292 |
+
* Array *
|
293 |
+
*********/
|
294 |
+
|
295 |
+
//_.chunk
|
296 |
+
interface LoDashStatic {
|
297 |
+
/**
|
298 |
+
* Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
|
299 |
+
* final chunk will be the remaining elements.
|
300 |
+
*
|
301 |
+
* @param array The array to process.
|
302 |
+
* @param size The length of each chunk.
|
303 |
+
* @return Returns the new array containing chunks.
|
304 |
+
*/
|
305 |
+
chunk<T>(
|
306 |
+
array: List<T>,
|
307 |
+
size?: number
|
308 |
+
): T[][];
|
309 |
+
}
|
310 |
+
|
311 |
+
interface LoDashImplicitArrayWrapper<T> {
|
312 |
+
/**
|
313 |
+
* @see _.chunk
|
314 |
+
*/
|
315 |
+
chunk(size?: number): LoDashImplicitArrayWrapper<T[]>;
|
316 |
+
}
|
317 |
+
|
318 |
+
interface LoDashImplicitObjectWrapper<T> {
|
319 |
+
/**
|
320 |
+
* @see _.chunk
|
321 |
+
*/
|
322 |
+
chunk<TResult>(size?: number): LoDashImplicitArrayWrapper<TResult[]>;
|
323 |
+
}
|
324 |
+
|
325 |
+
interface LoDashExplicitArrayWrapper<T> {
|
326 |
+
/**
|
327 |
+
* @see _.chunk
|
328 |
+
*/
|
329 |
+
chunk(size?: number): LoDashExplicitArrayWrapper<T[]>;
|
330 |
+
}
|
331 |
+
|
332 |
+
interface LoDashExplicitObjectWrapper<T> {
|
333 |
+
/**
|
334 |
+
* @see _.chunk
|
335 |
+
*/
|
336 |
+
chunk<TResult>(size?: number): LoDashExplicitArrayWrapper<TResult[]>;
|
337 |
+
}
|
338 |
+
|
339 |
+
//_.compact
|
340 |
+
interface LoDashStatic {
|
341 |
+
/**
|
342 |
+
* Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
|
343 |
+
* falsey.
|
344 |
+
*
|
345 |
+
* @param array The array to compact.
|
346 |
+
* @return (Array) Returns the new array of filtered values.
|
347 |
+
*/
|
348 |
+
compact<T>(array?: List<T>): T[];
|
349 |
+
}
|
350 |
+
|
351 |
+
interface LoDashImplicitArrayWrapper<T> {
|
352 |
+
/**
|
353 |
+
* @see _.compact
|
354 |
+
*/
|
355 |
+
compact(): LoDashImplicitArrayWrapper<T>;
|
356 |
+
}
|
357 |
+
|
358 |
+
interface LoDashImplicitObjectWrapper<T> {
|
359 |
+
/**
|
360 |
+
* @see _.compact
|
361 |
+
*/
|
362 |
+
compact<TResult>(): LoDashImplicitArrayWrapper<TResult>;
|
363 |
+
}
|
364 |
+
|
365 |
+
interface LoDashExplicitArrayWrapper<T> {
|
366 |
+
/**
|
367 |
+
* @see _.compact
|
368 |
+
*/
|
369 |
+
compact(): LoDashExplicitArrayWrapper<T>;
|
370 |
+
}
|
371 |
+
|
372 |
+
interface LoDashExplicitObjectWrapper<T> {
|
373 |
+
/**
|
374 |
+
* @see _.compact
|
375 |
+
*/
|
376 |
+
compact<TResult>(): LoDashExplicitArrayWrapper<TResult>;
|
377 |
+
}
|
378 |
+
|
379 |
+
//_.difference
|
380 |
+
interface LoDashStatic {
|
381 |
+
/**
|
382 |
+
* Creates an array of unique array values not included in the other provided arrays using SameValueZero for
|
383 |
+
* equality comparisons.
|
384 |
+
*
|
385 |
+
* @param array The array to inspect.
|
386 |
+
* @param values The arrays of values to exclude.
|
387 |
+
* @return Returns the new array of filtered values.
|
388 |
+
*/
|
389 |
+
difference<T>(
|
390 |
+
array: T[]|List<T>,
|
391 |
+
...values: (T[]|List<T>)[]
|
392 |
+
): T[];
|
393 |
+
}
|
394 |
+
|
395 |
+
interface LoDashImplicitArrayWrapper<T> {
|
396 |
+
/**
|
397 |
+
* @see _.difference
|
398 |
+
*/
|
399 |
+
difference(...values: (T[]|List<T>)[]): LoDashImplicitArrayWrapper<T>;
|
400 |
+
}
|
401 |
+
|
402 |
+
interface LoDashImplicitObjectWrapper<T> {
|
403 |
+
/**
|
404 |
+
* @see _.difference
|
405 |
+
*/
|
406 |
+
difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashImplicitArrayWrapper<TValue>;
|
407 |
+
}
|
408 |
+
|
409 |
+
interface LoDashExplicitArrayWrapper<T> {
|
410 |
+
/**
|
411 |
+
* @see _.difference
|
412 |
+
*/
|
413 |
+
difference(...values: (T[]|List<T>)[]): LoDashExplicitArrayWrapper<T>;
|
414 |
+
}
|
415 |
+
|
416 |
+
interface LoDashExplicitObjectWrapper<T> {
|
417 |
+
/**
|
418 |
+
* @see _.difference
|
419 |
+
*/
|
420 |
+
difference<TValue>(...values: (TValue[]|List<TValue>)[]): LoDashExplicitArrayWrapper<TValue>;
|
421 |
+
}
|
422 |
+
|
423 |
+
//_.drop
|
424 |
+
interface LoDashStatic {
|
425 |
+
/**
|
426 |
+
* Creates a slice of array with n elements dropped from the beginning.
|
427 |
+
*
|
428 |
+
* @param array The array to query.
|
429 |
+
* @param n The number of elements to drop.
|
430 |
+
* @return Returns the slice of array.
|
431 |
+
*/
|
432 |
+
drop<T>(array: T[]|List<T>, n?: number): T[];
|
433 |
+
}
|
434 |
+
|
435 |
+
interface LoDashImplicitArrayWrapper<T> {
|
436 |
+
/**
|
437 |
+
* @see _.drop
|
438 |
+
*/
|
439 |
+
drop(n?: number): LoDashImplicitArrayWrapper<T>;
|
440 |
+
}
|
441 |
+
|
442 |
+
interface LoDashImplicitObjectWrapper<T> {
|
443 |
+
/**
|
444 |
+
* @see _.drop
|
445 |
+
*/
|
446 |
+
drop<T>(n?: number): LoDashImplicitArrayWrapper<T>;
|
447 |
+
}
|
448 |
+
|
449 |
+
interface LoDashExplicitArrayWrapper<T> {
|
450 |
+
/**
|
451 |
+
* @see _.drop
|
452 |
+
*/
|
453 |
+
drop(n?: number): LoDashExplicitArrayWrapper<T>;
|
454 |
+
}
|
455 |
+
|
456 |
+
interface LoDashExplicitObjectWrapper<T> {
|
457 |
+
/**
|
458 |
+
* @see _.drop
|
459 |
+
*/
|
460 |
+
drop<T>(n?: number): LoDashExplicitArrayWrapper<T>;
|
461 |
+
}
|
462 |
+
|
463 |
+
//_.dropRight
|
464 |
+
interface LoDashStatic {
|
465 |
+
/**
|
466 |
+
* Creates a slice of array with n elements dropped from the end.
|
467 |
+
*
|
468 |
+
* @param array The array to query.
|
469 |
+
* @param n The number of elements to drop.
|
470 |
+
* @return Returns the slice of array.
|
471 |
+
*/
|
472 |
+
dropRight<T>(
|
473 |
+
array: List<T>,
|
474 |
+
n?: number
|
475 |
+
): T[];
|
476 |
+
}
|
477 |
+
|
478 |
+
interface LoDashImplicitArrayWrapper<T> {
|
479 |
+
/**
|
480 |
+
* @see _.dropRight
|
481 |
+
*/
|
482 |
+
dropRight(n?: number): LoDashImplicitArrayWrapper<T>;
|
483 |
+
}
|
484 |
+
|
485 |
+
interface LoDashImplicitObjectWrapper<T> {
|
486 |
+
/**
|
487 |
+
* @see _.dropRight
|
488 |
+
*/
|
489 |
+
dropRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
|
490 |
+
}
|
491 |
+
|
492 |
+
interface LoDashExplicitArrayWrapper<T> {
|
493 |
+
/**
|
494 |
+
* @see _.dropRight
|
495 |
+
*/
|
496 |
+
dropRight(n?: number): LoDashExplicitArrayWrapper<T>;
|
497 |
+
}
|
498 |
+
|
499 |
+
interface LoDashExplicitObjectWrapper<T> {
|
500 |
+
/**
|
501 |
+
* @see _.dropRight
|
502 |
+
*/
|
503 |
+
dropRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
|
504 |
+
}
|
505 |
+
|
506 |
+
//_.dropRightWhile
|
507 |
+
interface LoDashStatic {
|
508 |
+
/**
|
509 |
+
* Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate
|
510 |
+
* returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
|
511 |
+
*
|
512 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
513 |
+
* value of the given element.
|
514 |
+
*
|
515 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
516 |
+
* elements that have a matching property value, else false.
|
517 |
+
*
|
518 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
519 |
+
* match the properties of the given object, else false.
|
520 |
+
*
|
521 |
+
* @param array The array to query.
|
522 |
+
* @param predicate The function invoked per iteration.
|
523 |
+
* @param thisArg The this binding of predicate.
|
524 |
+
* @return Returns the slice of array.
|
525 |
+
*/
|
526 |
+
dropRightWhile<TValue>(
|
527 |
+
array: List<TValue>,
|
528 |
+
predicate?: ListIterator<TValue, boolean>,
|
529 |
+
thisArg?: any
|
530 |
+
): TValue[];
|
531 |
+
|
532 |
+
/**
|
533 |
+
* @see _.dropRightWhile
|
534 |
+
*/
|
535 |
+
dropRightWhile<TValue>(
|
536 |
+
array: List<TValue>,
|
537 |
+
predicate?: string,
|
538 |
+
thisArg?: any
|
539 |
+
): TValue[];
|
540 |
+
|
541 |
+
/**
|
542 |
+
* @see _.dropRightWhile
|
543 |
+
*/
|
544 |
+
dropRightWhile<TWhere, TValue>(
|
545 |
+
array: List<TValue>,
|
546 |
+
predicate?: TWhere
|
547 |
+
): TValue[];
|
548 |
+
}
|
549 |
+
|
550 |
+
interface LoDashImplicitArrayWrapper<T> {
|
551 |
+
/**
|
552 |
+
* @see _.dropRightWhile
|
553 |
+
*/
|
554 |
+
dropRightWhile(
|
555 |
+
predicate?: ListIterator<T, boolean>,
|
556 |
+
thisArg?: any
|
557 |
+
): LoDashImplicitArrayWrapper<T>;
|
558 |
+
|
559 |
+
/**
|
560 |
+
* @see _.dropRightWhile
|
561 |
+
*/
|
562 |
+
dropRightWhile(
|
563 |
+
predicate?: string,
|
564 |
+
thisArg?: any
|
565 |
+
): LoDashImplicitArrayWrapper<T>;
|
566 |
+
|
567 |
+
/**
|
568 |
+
* @see _.dropRightWhile
|
569 |
+
*/
|
570 |
+
dropRightWhile<TWhere>(
|
571 |
+
predicate?: TWhere
|
572 |
+
): LoDashImplicitArrayWrapper<T>;
|
573 |
+
}
|
574 |
+
|
575 |
+
interface LoDashImplicitObjectWrapper<T> {
|
576 |
+
/**
|
577 |
+
* @see _.dropRightWhile
|
578 |
+
*/
|
579 |
+
dropRightWhile<TValue>(
|
580 |
+
predicate?: ListIterator<TValue, boolean>,
|
581 |
+
thisArg?: any
|
582 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
583 |
+
|
584 |
+
/**
|
585 |
+
* @see _.dropRightWhile
|
586 |
+
*/
|
587 |
+
dropRightWhile<TValue>(
|
588 |
+
predicate?: string,
|
589 |
+
thisArg?: any
|
590 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
591 |
+
|
592 |
+
/**
|
593 |
+
* @see _.dropRightWhile
|
594 |
+
*/
|
595 |
+
dropRightWhile<TWhere, TValue>(
|
596 |
+
predicate?: TWhere
|
597 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
598 |
+
}
|
599 |
+
|
600 |
+
interface LoDashExplicitArrayWrapper<T> {
|
601 |
+
/**
|
602 |
+
* @see _.dropRightWhile
|
603 |
+
*/
|
604 |
+
dropRightWhile(
|
605 |
+
predicate?: ListIterator<T, boolean>,
|
606 |
+
thisArg?: any
|
607 |
+
): LoDashExplicitArrayWrapper<T>;
|
608 |
+
|
609 |
+
/**
|
610 |
+
* @see _.dropRightWhile
|
611 |
+
*/
|
612 |
+
dropRightWhile(
|
613 |
+
predicate?: string,
|
614 |
+
thisArg?: any
|
615 |
+
): LoDashExplicitArrayWrapper<T>;
|
616 |
+
|
617 |
+
/**
|
618 |
+
* @see _.dropRightWhile
|
619 |
+
*/
|
620 |
+
dropRightWhile<TWhere>(
|
621 |
+
predicate?: TWhere
|
622 |
+
): LoDashExplicitArrayWrapper<T>;
|
623 |
+
}
|
624 |
+
|
625 |
+
interface LoDashExplicitObjectWrapper<T> {
|
626 |
+
/**
|
627 |
+
* @see _.dropRightWhile
|
628 |
+
*/
|
629 |
+
dropRightWhile<TValue>(
|
630 |
+
predicate?: ListIterator<TValue, boolean>,
|
631 |
+
thisArg?: any
|
632 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
633 |
+
|
634 |
+
/**
|
635 |
+
* @see _.dropRightWhile
|
636 |
+
*/
|
637 |
+
dropRightWhile<TValue>(
|
638 |
+
predicate?: string,
|
639 |
+
thisArg?: any
|
640 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
641 |
+
|
642 |
+
/**
|
643 |
+
* @see _.dropRightWhile
|
644 |
+
*/
|
645 |
+
dropRightWhile<TWhere, TValue>(
|
646 |
+
predicate?: TWhere
|
647 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
648 |
+
}
|
649 |
+
|
650 |
+
//_.dropWhile
|
651 |
+
interface LoDashStatic {
|
652 |
+
/**
|
653 |
+
* Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate
|
654 |
+
* returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
|
655 |
+
*
|
656 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
657 |
+
* value of the given element.
|
658 |
+
*
|
659 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
660 |
+
* elements that have a matching property value, else false.
|
661 |
+
*
|
662 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
663 |
+
* have the properties of the given object, else false.
|
664 |
+
*
|
665 |
+
* @param array The array to query.
|
666 |
+
* @param predicate The function invoked per iteration.
|
667 |
+
* @param thisArg The this binding of predicate.
|
668 |
+
* @return Returns the slice of array.
|
669 |
+
*/
|
670 |
+
dropWhile<TValue>(
|
671 |
+
array: List<TValue>,
|
672 |
+
predicate?: ListIterator<TValue, boolean>,
|
673 |
+
thisArg?: any
|
674 |
+
): TValue[];
|
675 |
+
|
676 |
+
/**
|
677 |
+
* @see _.dropWhile
|
678 |
+
*/
|
679 |
+
dropWhile<TValue>(
|
680 |
+
array: List<TValue>,
|
681 |
+
predicate?: string,
|
682 |
+
thisArg?: any
|
683 |
+
): TValue[];
|
684 |
+
|
685 |
+
/**
|
686 |
+
* @see _.dropWhile
|
687 |
+
*/
|
688 |
+
dropWhile<TWhere, TValue>(
|
689 |
+
array: List<TValue>,
|
690 |
+
predicate?: TWhere
|
691 |
+
): TValue[];
|
692 |
+
}
|
693 |
+
|
694 |
+
interface LoDashImplicitArrayWrapper<T> {
|
695 |
+
/**
|
696 |
+
* @see _.dropWhile
|
697 |
+
*/
|
698 |
+
dropWhile(
|
699 |
+
predicate?: ListIterator<T, boolean>,
|
700 |
+
thisArg?: any
|
701 |
+
): LoDashImplicitArrayWrapper<T>;
|
702 |
+
|
703 |
+
/**
|
704 |
+
* @see _.dropWhile
|
705 |
+
*/
|
706 |
+
dropWhile(
|
707 |
+
predicate?: string,
|
708 |
+
thisArg?: any
|
709 |
+
): LoDashImplicitArrayWrapper<T>;
|
710 |
+
|
711 |
+
/**
|
712 |
+
* @see _.dropWhile
|
713 |
+
*/
|
714 |
+
dropWhile<TWhere>(
|
715 |
+
predicate?: TWhere
|
716 |
+
): LoDashImplicitArrayWrapper<T>;
|
717 |
+
}
|
718 |
+
|
719 |
+
interface LoDashImplicitObjectWrapper<T> {
|
720 |
+
/**
|
721 |
+
* @see _.dropWhile
|
722 |
+
*/
|
723 |
+
dropWhile<TValue>(
|
724 |
+
predicate?: ListIterator<TValue, boolean>,
|
725 |
+
thisArg?: any
|
726 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
727 |
+
|
728 |
+
/**
|
729 |
+
* @see _.dropWhile
|
730 |
+
*/
|
731 |
+
dropWhile<TValue>(
|
732 |
+
predicate?: string,
|
733 |
+
thisArg?: any
|
734 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
735 |
+
|
736 |
+
/**
|
737 |
+
* @see _.dropWhile
|
738 |
+
*/
|
739 |
+
dropWhile<TWhere, TValue>(
|
740 |
+
predicate?: TWhere
|
741 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
742 |
+
}
|
743 |
+
|
744 |
+
interface LoDashExplicitArrayWrapper<T> {
|
745 |
+
/**
|
746 |
+
* @see _.dropWhile
|
747 |
+
*/
|
748 |
+
dropWhile(
|
749 |
+
predicate?: ListIterator<T, boolean>,
|
750 |
+
thisArg?: any
|
751 |
+
): LoDashExplicitArrayWrapper<T>;
|
752 |
+
|
753 |
+
/**
|
754 |
+
* @see _.dropWhile
|
755 |
+
*/
|
756 |
+
dropWhile(
|
757 |
+
predicate?: string,
|
758 |
+
thisArg?: any
|
759 |
+
): LoDashExplicitArrayWrapper<T>;
|
760 |
+
|
761 |
+
/**
|
762 |
+
* @see _.dropWhile
|
763 |
+
*/
|
764 |
+
dropWhile<TWhere>(
|
765 |
+
predicate?: TWhere
|
766 |
+
): LoDashExplicitArrayWrapper<T>;
|
767 |
+
}
|
768 |
+
|
769 |
+
interface LoDashExplicitObjectWrapper<T> {
|
770 |
+
/**
|
771 |
+
* @see _.dropWhile
|
772 |
+
*/
|
773 |
+
dropWhile<TValue>(
|
774 |
+
predicate?: ListIterator<TValue, boolean>,
|
775 |
+
thisArg?: any
|
776 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
777 |
+
|
778 |
+
/**
|
779 |
+
* @see _.dropWhile
|
780 |
+
*/
|
781 |
+
dropWhile<TValue>(
|
782 |
+
predicate?: string,
|
783 |
+
thisArg?: any
|
784 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
785 |
+
|
786 |
+
/**
|
787 |
+
* @see _.dropWhile
|
788 |
+
*/
|
789 |
+
dropWhile<TWhere, TValue>(
|
790 |
+
predicate?: TWhere
|
791 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
792 |
+
}
|
793 |
+
|
794 |
+
//_.fill
|
795 |
+
interface LoDashStatic {
|
796 |
+
/**
|
797 |
+
* Fills elements of array with value from start up to, but not including, end.
|
798 |
+
*
|
799 |
+
* Note: This method mutates array.
|
800 |
+
*
|
801 |
+
* @param array The array to fill.
|
802 |
+
* @param value The value to fill array with.
|
803 |
+
* @param start The start position.
|
804 |
+
* @param end The end position.
|
805 |
+
* @return Returns array.
|
806 |
+
*/
|
807 |
+
fill<T>(
|
808 |
+
array: any[],
|
809 |
+
value: T,
|
810 |
+
start?: number,
|
811 |
+
end?: number
|
812 |
+
): T[];
|
813 |
+
|
814 |
+
/**
|
815 |
+
* @see _.fill
|
816 |
+
*/
|
817 |
+
fill<T>(
|
818 |
+
array: List<any>,
|
819 |
+
value: T,
|
820 |
+
start?: number,
|
821 |
+
end?: number
|
822 |
+
): List<T>;
|
823 |
+
}
|
824 |
+
|
825 |
+
interface LoDashImplicitArrayWrapper<T> {
|
826 |
+
/**
|
827 |
+
* @see _.fill
|
828 |
+
*/
|
829 |
+
fill<T>(
|
830 |
+
value: T,
|
831 |
+
start?: number,
|
832 |
+
end?: number
|
833 |
+
): LoDashImplicitArrayWrapper<T>;
|
834 |
+
}
|
835 |
+
|
836 |
+
interface LoDashImplicitObjectWrapper<T> {
|
837 |
+
/**
|
838 |
+
* @see _.fill
|
839 |
+
*/
|
840 |
+
fill<T>(
|
841 |
+
value: T,
|
842 |
+
start?: number,
|
843 |
+
end?: number
|
844 |
+
): LoDashImplicitObjectWrapper<List<T>>;
|
845 |
+
}
|
846 |
+
|
847 |
+
interface LoDashExplicitArrayWrapper<T> {
|
848 |
+
/**
|
849 |
+
* @see _.fill
|
850 |
+
*/
|
851 |
+
fill<T>(
|
852 |
+
value: T,
|
853 |
+
start?: number,
|
854 |
+
end?: number
|
855 |
+
): LoDashExplicitArrayWrapper<T>;
|
856 |
+
}
|
857 |
+
|
858 |
+
interface LoDashExplicitObjectWrapper<T> {
|
859 |
+
/**
|
860 |
+
* @see _.fill
|
861 |
+
*/
|
862 |
+
fill<T>(
|
863 |
+
value: T,
|
864 |
+
start?: number,
|
865 |
+
end?: number
|
866 |
+
): LoDashExplicitObjectWrapper<List<T>>;
|
867 |
+
}
|
868 |
+
|
869 |
+
//_.findIndex
|
870 |
+
interface LoDashStatic {
|
871 |
+
/**
|
872 |
+
* This method is like _.find except that it returns the index of the first element predicate returns truthy
|
873 |
+
* for instead of the element itself.
|
874 |
+
*
|
875 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
876 |
+
* value of the given element.
|
877 |
+
*
|
878 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
879 |
+
* elements that have a matching property value, else false.
|
880 |
+
*
|
881 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
882 |
+
* have the properties of the given object, else false.
|
883 |
+
*
|
884 |
+
* @param array The array to search.
|
885 |
+
* @param predicate The function invoked per iteration.
|
886 |
+
* @param thisArg The this binding of predicate.
|
887 |
+
* @return Returns the index of the found element, else -1.
|
888 |
+
*/
|
889 |
+
findIndex<T>(
|
890 |
+
array: List<T>,
|
891 |
+
predicate?: ListIterator<T, boolean>,
|
892 |
+
thisArg?: any
|
893 |
+
): number;
|
894 |
+
|
895 |
+
/**
|
896 |
+
* @see _.findIndex
|
897 |
+
*/
|
898 |
+
findIndex<T>(
|
899 |
+
array: List<T>,
|
900 |
+
predicate?: string,
|
901 |
+
thisArg?: any
|
902 |
+
): number;
|
903 |
+
|
904 |
+
/**
|
905 |
+
* @see _.findIndex
|
906 |
+
*/
|
907 |
+
findIndex<W, T>(
|
908 |
+
array: List<T>,
|
909 |
+
predicate?: W
|
910 |
+
): number;
|
911 |
+
}
|
912 |
+
|
913 |
+
interface LoDashImplicitArrayWrapper<T> {
|
914 |
+
/**
|
915 |
+
* @see _.findIndex
|
916 |
+
*/
|
917 |
+
findIndex(
|
918 |
+
predicate?: ListIterator<T, boolean>,
|
919 |
+
thisArg?: any
|
920 |
+
): number;
|
921 |
+
|
922 |
+
/**
|
923 |
+
* @see _.findIndex
|
924 |
+
*/
|
925 |
+
findIndex(
|
926 |
+
predicate?: string,
|
927 |
+
thisArg?: any
|
928 |
+
): number;
|
929 |
+
|
930 |
+
/**
|
931 |
+
* @see _.findIndex
|
932 |
+
*/
|
933 |
+
findIndex<W>(
|
934 |
+
predicate?: W
|
935 |
+
): number;
|
936 |
+
}
|
937 |
+
|
938 |
+
interface LoDashImplicitObjectWrapper<T> {
|
939 |
+
/**
|
940 |
+
* @see _.findIndex
|
941 |
+
*/
|
942 |
+
findIndex<TResult>(
|
943 |
+
predicate?: ListIterator<TResult, boolean>,
|
944 |
+
thisArg?: any
|
945 |
+
): number;
|
946 |
+
|
947 |
+
/**
|
948 |
+
* @see _.findIndex
|
949 |
+
*/
|
950 |
+
findIndex(
|
951 |
+
predicate?: string,
|
952 |
+
thisArg?: any
|
953 |
+
): number;
|
954 |
+
|
955 |
+
/**
|
956 |
+
* @see _.findIndex
|
957 |
+
*/
|
958 |
+
findIndex<W>(
|
959 |
+
predicate?: W
|
960 |
+
): number;
|
961 |
+
}
|
962 |
+
|
963 |
+
interface LoDashExplicitArrayWrapper<T> {
|
964 |
+
/**
|
965 |
+
* @see _.findIndex
|
966 |
+
*/
|
967 |
+
findIndex(
|
968 |
+
predicate?: ListIterator<T, boolean>,
|
969 |
+
thisArg?: any
|
970 |
+
): LoDashExplicitWrapper<number>;
|
971 |
+
|
972 |
+
/**
|
973 |
+
* @see _.findIndex
|
974 |
+
*/
|
975 |
+
findIndex(
|
976 |
+
predicate?: string,
|
977 |
+
thisArg?: any
|
978 |
+
): LoDashExplicitWrapper<number>;
|
979 |
+
|
980 |
+
/**
|
981 |
+
* @see _.findIndex
|
982 |
+
*/
|
983 |
+
findIndex<W>(
|
984 |
+
predicate?: W
|
985 |
+
): LoDashExplicitWrapper<number>;
|
986 |
+
}
|
987 |
+
|
988 |
+
interface LoDashExplicitObjectWrapper<T> {
|
989 |
+
/**
|
990 |
+
* @see _.findIndex
|
991 |
+
*/
|
992 |
+
findIndex<TResult>(
|
993 |
+
predicate?: ListIterator<TResult, boolean>,
|
994 |
+
thisArg?: any
|
995 |
+
): LoDashExplicitWrapper<number>;
|
996 |
+
|
997 |
+
/**
|
998 |
+
* @see _.findIndex
|
999 |
+
*/
|
1000 |
+
findIndex(
|
1001 |
+
predicate?: string,
|
1002 |
+
thisArg?: any
|
1003 |
+
): LoDashExplicitWrapper<number>;
|
1004 |
+
|
1005 |
+
/**
|
1006 |
+
* @see _.findIndex
|
1007 |
+
*/
|
1008 |
+
findIndex<W>(
|
1009 |
+
predicate?: W
|
1010 |
+
): LoDashExplicitWrapper<number>;
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
//_.findLastIndex
|
1014 |
+
interface LoDashStatic {
|
1015 |
+
/**
|
1016 |
+
* This method is like _.findIndex except that it iterates over elements of collection from right to left.
|
1017 |
+
*
|
1018 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
1019 |
+
* value of the given element.
|
1020 |
+
*
|
1021 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
1022 |
+
* elements that have a matching property value, else false.
|
1023 |
+
*
|
1024 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
1025 |
+
* have the properties of the given object, else false.
|
1026 |
+
*
|
1027 |
+
* @param array The array to search.
|
1028 |
+
* @param predicate The function invoked per iteration.
|
1029 |
+
* @param thisArg The function invoked per iteration.
|
1030 |
+
* @return Returns the index of the found element, else -1.
|
1031 |
+
*/
|
1032 |
+
findLastIndex<T>(
|
1033 |
+
array: List<T>,
|
1034 |
+
predicate?: ListIterator<T, boolean>,
|
1035 |
+
thisArg?: any
|
1036 |
+
): number;
|
1037 |
+
|
1038 |
+
/**
|
1039 |
+
* @see _.findLastIndex
|
1040 |
+
*/
|
1041 |
+
findLastIndex<T>(
|
1042 |
+
array: List<T>,
|
1043 |
+
predicate?: string,
|
1044 |
+
thisArg?: any
|
1045 |
+
): number;
|
1046 |
+
|
1047 |
+
/**
|
1048 |
+
* @see _.findLastIndex
|
1049 |
+
*/
|
1050 |
+
findLastIndex<W, T>(
|
1051 |
+
array: List<T>,
|
1052 |
+
predicate?: W
|
1053 |
+
): number;
|
1054 |
+
}
|
1055 |
+
|
1056 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1057 |
+
/**
|
1058 |
+
* @see _.findLastIndex
|
1059 |
+
*/
|
1060 |
+
findLastIndex(
|
1061 |
+
predicate?: ListIterator<T, boolean>,
|
1062 |
+
thisArg?: any
|
1063 |
+
): number;
|
1064 |
+
|
1065 |
+
/**
|
1066 |
+
* @see _.findLastIndex
|
1067 |
+
*/
|
1068 |
+
findLastIndex(
|
1069 |
+
predicate?: string,
|
1070 |
+
thisArg?: any
|
1071 |
+
): number;
|
1072 |
+
|
1073 |
+
/**
|
1074 |
+
* @see _.findLastIndex
|
1075 |
+
*/
|
1076 |
+
findLastIndex<W>(
|
1077 |
+
predicate?: W
|
1078 |
+
): number;
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1082 |
+
/**
|
1083 |
+
* @see _.findLastIndex
|
1084 |
+
*/
|
1085 |
+
findLastIndex<TResult>(
|
1086 |
+
predicate?: ListIterator<TResult, boolean>,
|
1087 |
+
thisArg?: any
|
1088 |
+
): number;
|
1089 |
+
|
1090 |
+
/**
|
1091 |
+
* @see _.findLastIndex
|
1092 |
+
*/
|
1093 |
+
findLastIndex(
|
1094 |
+
predicate?: string,
|
1095 |
+
thisArg?: any
|
1096 |
+
): number;
|
1097 |
+
|
1098 |
+
/**
|
1099 |
+
* @see _.findLastIndex
|
1100 |
+
*/
|
1101 |
+
findLastIndex<W>(
|
1102 |
+
predicate?: W
|
1103 |
+
): number;
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1107 |
+
/**
|
1108 |
+
* @see _.findLastIndex
|
1109 |
+
*/
|
1110 |
+
findLastIndex(
|
1111 |
+
predicate?: ListIterator<T, boolean>,
|
1112 |
+
thisArg?: any
|
1113 |
+
): LoDashExplicitWrapper<number>;
|
1114 |
+
|
1115 |
+
/**
|
1116 |
+
* @see _.findLastIndex
|
1117 |
+
*/
|
1118 |
+
findLastIndex(
|
1119 |
+
predicate?: string,
|
1120 |
+
thisArg?: any
|
1121 |
+
): LoDashExplicitWrapper<number>;
|
1122 |
+
|
1123 |
+
/**
|
1124 |
+
* @see _.findLastIndex
|
1125 |
+
*/
|
1126 |
+
findLastIndex<W>(
|
1127 |
+
predicate?: W
|
1128 |
+
): LoDashExplicitWrapper<number>;
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1132 |
+
/**
|
1133 |
+
* @see _.findLastIndex
|
1134 |
+
*/
|
1135 |
+
findLastIndex<TResult>(
|
1136 |
+
predicate?: ListIterator<TResult, boolean>,
|
1137 |
+
thisArg?: any
|
1138 |
+
): LoDashExplicitWrapper<number>;
|
1139 |
+
|
1140 |
+
/**
|
1141 |
+
* @see _.findLastIndex
|
1142 |
+
*/
|
1143 |
+
findLastIndex(
|
1144 |
+
predicate?: string,
|
1145 |
+
thisArg?: any
|
1146 |
+
): LoDashExplicitWrapper<number>;
|
1147 |
+
|
1148 |
+
/**
|
1149 |
+
* @see _.findLastIndex
|
1150 |
+
*/
|
1151 |
+
findLastIndex<W>(
|
1152 |
+
predicate?: W
|
1153 |
+
): LoDashExplicitWrapper<number>;
|
1154 |
+
}
|
1155 |
+
|
1156 |
+
//_.first
|
1157 |
+
interface LoDashStatic {
|
1158 |
+
/**
|
1159 |
+
* Gets the first element of array.
|
1160 |
+
*
|
1161 |
+
* @alias _.head
|
1162 |
+
*
|
1163 |
+
* @param array The array to query.
|
1164 |
+
* @return Returns the first element of array.
|
1165 |
+
*/
|
1166 |
+
first<T>(array: List<T>): T;
|
1167 |
+
}
|
1168 |
+
|
1169 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1170 |
+
/**
|
1171 |
+
* @see _.first
|
1172 |
+
*/
|
1173 |
+
first(): T;
|
1174 |
+
}
|
1175 |
+
|
1176 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1177 |
+
/**
|
1178 |
+
* @see _.first
|
1179 |
+
*/
|
1180 |
+
first<TResult>(): TResult;
|
1181 |
+
}
|
1182 |
+
|
1183 |
+
interface RecursiveArray<T> extends Array<T|RecursiveArray<T>> {}
|
1184 |
+
interface ListOfRecursiveArraysOrValues<T> extends List<T|RecursiveArray<T>> {}
|
1185 |
+
|
1186 |
+
//_.flatten
|
1187 |
+
interface LoDashStatic {
|
1188 |
+
/**
|
1189 |
+
* Flattens a nested array. If isDeep is true the array is recursively flattened, otherwise it’s only
|
1190 |
+
* flattened a single level.
|
1191 |
+
*
|
1192 |
+
* @param array The array to flatten.
|
1193 |
+
* @param isDeep Specify a deep flatten.
|
1194 |
+
* @return Returns the new flattened array.
|
1195 |
+
*/
|
1196 |
+
flatten<T>(array: ListOfRecursiveArraysOrValues<T>, isDeep: boolean): T[];
|
1197 |
+
|
1198 |
+
/**
|
1199 |
+
* @see _.flatten
|
1200 |
+
*/
|
1201 |
+
flatten<T>(array: List<T|T[]>): T[];
|
1202 |
+
|
1203 |
+
/**
|
1204 |
+
* @see _.flatten
|
1205 |
+
*/
|
1206 |
+
flatten<T>(array: ListOfRecursiveArraysOrValues<T>): RecursiveArray<T>;
|
1207 |
+
}
|
1208 |
+
|
1209 |
+
interface LoDashImplicitWrapper<T> {
|
1210 |
+
/**
|
1211 |
+
* @see _.flatten
|
1212 |
+
*/
|
1213 |
+
flatten(): LoDashImplicitArrayWrapper<string>;
|
1214 |
+
}
|
1215 |
+
|
1216 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1217 |
+
/**
|
1218 |
+
* @see _.flatten
|
1219 |
+
*/
|
1220 |
+
flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>;
|
1221 |
+
}
|
1222 |
+
|
1223 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1224 |
+
/**
|
1225 |
+
* @see _.flatten
|
1226 |
+
*/
|
1227 |
+
flatten<TResult>(isDeep?: boolean): LoDashImplicitArrayWrapper<TResult>;
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
interface LoDashExplicitWrapper<T> {
|
1231 |
+
/**
|
1232 |
+
* @see _.flatten
|
1233 |
+
*/
|
1234 |
+
flatten(): LoDashExplicitArrayWrapper<string>;
|
1235 |
+
}
|
1236 |
+
|
1237 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1238 |
+
/**
|
1239 |
+
* @see _.flatten
|
1240 |
+
*/
|
1241 |
+
flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>;
|
1242 |
+
}
|
1243 |
+
|
1244 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1245 |
+
/**
|
1246 |
+
* @see _.flatten
|
1247 |
+
*/
|
1248 |
+
flatten<TResult>(isDeep?: boolean): LoDashExplicitArrayWrapper<TResult>;
|
1249 |
+
}
|
1250 |
+
|
1251 |
+
//_.flattenDeep
|
1252 |
+
interface LoDashStatic {
|
1253 |
+
/**
|
1254 |
+
* Recursively flattens a nested array.
|
1255 |
+
*
|
1256 |
+
* @param array The array to recursively flatten.
|
1257 |
+
* @return Returns the new flattened array.
|
1258 |
+
*/
|
1259 |
+
flattenDeep<T>(array: ListOfRecursiveArraysOrValues<T>): T[];
|
1260 |
+
}
|
1261 |
+
|
1262 |
+
interface LoDashImplicitWrapper<T> {
|
1263 |
+
/**
|
1264 |
+
* @see _.flattenDeep
|
1265 |
+
*/
|
1266 |
+
flattenDeep(): LoDashImplicitArrayWrapper<string>;
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1270 |
+
/**
|
1271 |
+
* @see _.flattenDeep
|
1272 |
+
*/
|
1273 |
+
flattenDeep<T>(): LoDashImplicitArrayWrapper<T>;
|
1274 |
+
}
|
1275 |
+
|
1276 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1277 |
+
/**
|
1278 |
+
* @see _.flattenDeep
|
1279 |
+
*/
|
1280 |
+
flattenDeep<T>(): LoDashImplicitArrayWrapper<T>;
|
1281 |
+
}
|
1282 |
+
|
1283 |
+
interface LoDashExplicitWrapper<T> {
|
1284 |
+
/**
|
1285 |
+
* @see _.flattenDeep
|
1286 |
+
*/
|
1287 |
+
flattenDeep(): LoDashExplicitArrayWrapper<string>;
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1291 |
+
/**
|
1292 |
+
* @see _.flattenDeep
|
1293 |
+
*/
|
1294 |
+
flattenDeep<T>(): LoDashExplicitArrayWrapper<T>;
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1298 |
+
/**
|
1299 |
+
* @see _.flattenDeep
|
1300 |
+
*/
|
1301 |
+
flattenDeep<T>(): LoDashExplicitArrayWrapper<T>;
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
//_.head
|
1305 |
+
interface LoDashStatic {
|
1306 |
+
/**
|
1307 |
+
* @see _.first
|
1308 |
+
*/
|
1309 |
+
head<T>(array: List<T>): T;
|
1310 |
+
}
|
1311 |
+
|
1312 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1313 |
+
/**
|
1314 |
+
* @see _.first
|
1315 |
+
*/
|
1316 |
+
head(): T;
|
1317 |
+
}
|
1318 |
+
|
1319 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1320 |
+
/**
|
1321 |
+
* @see _.first
|
1322 |
+
*/
|
1323 |
+
head<TResult>(): TResult;
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
//_.indexOf
|
1327 |
+
interface LoDashStatic {
|
1328 |
+
/**
|
1329 |
+
* Gets the index at which the first occurrence of value is found in array using SameValueZero for equality
|
1330 |
+
* comparisons. If fromIndex is negative, it’s used as the offset from the end of array. If array is sorted
|
1331 |
+
* providing true for fromIndex performs a faster binary search.
|
1332 |
+
*
|
1333 |
+
* @param array The array to search.
|
1334 |
+
* @param value The value to search for.
|
1335 |
+
* @param fromIndex The index to search from or true to perform a binary search on a sorted array.
|
1336 |
+
* @return The index to search from or true to perform a binary search on a sorted array.
|
1337 |
+
*/
|
1338 |
+
indexOf<T>(
|
1339 |
+
array: List<T>,
|
1340 |
+
value: T,
|
1341 |
+
fromIndex?: boolean|number
|
1342 |
+
): number;
|
1343 |
+
}
|
1344 |
+
|
1345 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1346 |
+
/**
|
1347 |
+
* @see _.indexOf
|
1348 |
+
*/
|
1349 |
+
indexOf(
|
1350 |
+
value: T,
|
1351 |
+
fromIndex?: boolean|number
|
1352 |
+
): number;
|
1353 |
+
}
|
1354 |
+
|
1355 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1356 |
+
/**
|
1357 |
+
* @see _.indexOf
|
1358 |
+
*/
|
1359 |
+
indexOf<TValue>(
|
1360 |
+
value: TValue,
|
1361 |
+
fromIndex?: boolean|number
|
1362 |
+
): number;
|
1363 |
+
}
|
1364 |
+
|
1365 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1366 |
+
/**
|
1367 |
+
* @see _.indexOf
|
1368 |
+
*/
|
1369 |
+
indexOf(
|
1370 |
+
value: T,
|
1371 |
+
fromIndex?: boolean|number
|
1372 |
+
): LoDashExplicitWrapper<number>;
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1376 |
+
/**
|
1377 |
+
* @see _.indexOf
|
1378 |
+
*/
|
1379 |
+
indexOf<TValue>(
|
1380 |
+
value: TValue,
|
1381 |
+
fromIndex?: boolean|number
|
1382 |
+
): LoDashExplicitWrapper<number>;
|
1383 |
+
}
|
1384 |
+
|
1385 |
+
//_.initial
|
1386 |
+
interface LoDashStatic {
|
1387 |
+
/**
|
1388 |
+
* Gets all but the last element of array.
|
1389 |
+
*
|
1390 |
+
* @param array The array to query.
|
1391 |
+
* @return Returns the slice of array.
|
1392 |
+
*/
|
1393 |
+
initial<T>(array: List<T>): T[];
|
1394 |
+
}
|
1395 |
+
|
1396 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1397 |
+
/**
|
1398 |
+
* @see _.initial
|
1399 |
+
*/
|
1400 |
+
initial(): LoDashImplicitArrayWrapper<T>;
|
1401 |
+
}
|
1402 |
+
|
1403 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1404 |
+
/**
|
1405 |
+
* @see _.initial
|
1406 |
+
*/
|
1407 |
+
initial<T>(): LoDashImplicitArrayWrapper<T>;
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1411 |
+
/**
|
1412 |
+
* @see _.initial
|
1413 |
+
*/
|
1414 |
+
initial(): LoDashExplicitArrayWrapper<T>;
|
1415 |
+
}
|
1416 |
+
|
1417 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1418 |
+
/**
|
1419 |
+
* @see _.initial
|
1420 |
+
*/
|
1421 |
+
initial<T>(): LoDashExplicitArrayWrapper<T>;
|
1422 |
+
}
|
1423 |
+
|
1424 |
+
//_.intersection
|
1425 |
+
interface LoDashStatic {
|
1426 |
+
/**
|
1427 |
+
* Creates an array of unique values that are included in all of the provided arrays using SameValueZero for
|
1428 |
+
* equality comparisons.
|
1429 |
+
*
|
1430 |
+
* @param arrays The arrays to inspect.
|
1431 |
+
* @return Returns the new array of shared values.
|
1432 |
+
*/
|
1433 |
+
intersection<T>(...arrays: (T[]|List<T>)[]): T[];
|
1434 |
+
}
|
1435 |
+
|
1436 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1437 |
+
/**
|
1438 |
+
* @see _.intersection
|
1439 |
+
*/
|
1440 |
+
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
|
1441 |
+
}
|
1442 |
+
|
1443 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1444 |
+
/**
|
1445 |
+
* @see _.intersection
|
1446 |
+
*/
|
1447 |
+
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1451 |
+
/**
|
1452 |
+
* @see _.intersection
|
1453 |
+
*/
|
1454 |
+
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
|
1455 |
+
}
|
1456 |
+
|
1457 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1458 |
+
/**
|
1459 |
+
* @see _.intersection
|
1460 |
+
*/
|
1461 |
+
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
|
1462 |
+
}
|
1463 |
+
|
1464 |
+
//_.last
|
1465 |
+
interface LoDashStatic {
|
1466 |
+
/**
|
1467 |
+
* Gets the last element of array.
|
1468 |
+
*
|
1469 |
+
* @param array The array to query.
|
1470 |
+
* @return Returns the last element of array.
|
1471 |
+
*/
|
1472 |
+
last<T>(array: List<T>): T;
|
1473 |
+
}
|
1474 |
+
|
1475 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1476 |
+
/**
|
1477 |
+
* @see _.last
|
1478 |
+
*/
|
1479 |
+
last(): T;
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1483 |
+
/**
|
1484 |
+
* @see _.last
|
1485 |
+
*/
|
1486 |
+
last<T>(): T;
|
1487 |
+
}
|
1488 |
+
|
1489 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1490 |
+
/**
|
1491 |
+
* @see _.last
|
1492 |
+
*/
|
1493 |
+
last(): LoDashExplicitArrayWrapper<T>;
|
1494 |
+
}
|
1495 |
+
|
1496 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1497 |
+
/**
|
1498 |
+
* @see _.last
|
1499 |
+
*/
|
1500 |
+
last<T>(): LoDashExplicitObjectWrapper<T>;
|
1501 |
+
}
|
1502 |
+
|
1503 |
+
//_.lastIndexOf
|
1504 |
+
interface LoDashStatic {
|
1505 |
+
/**
|
1506 |
+
* This method is like _.indexOf except that it iterates over elements of array from right to left.
|
1507 |
+
*
|
1508 |
+
* @param array The array to search.
|
1509 |
+
* @param value The value to search for.
|
1510 |
+
* @param fromIndex The index to search from or true to perform a binary search on a sorted array.
|
1511 |
+
* @return Returns the index of the matched value, else -1.
|
1512 |
+
*/
|
1513 |
+
lastIndexOf<T>(
|
1514 |
+
array: List<T>,
|
1515 |
+
value: T,
|
1516 |
+
fromIndex?: boolean|number
|
1517 |
+
): number;
|
1518 |
+
}
|
1519 |
+
|
1520 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1521 |
+
/**
|
1522 |
+
* @see _.lastIndexOf
|
1523 |
+
*/
|
1524 |
+
lastIndexOf(
|
1525 |
+
value: T,
|
1526 |
+
fromIndex?: boolean|number
|
1527 |
+
): number;
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1531 |
+
/**
|
1532 |
+
* @see _.lastIndexOf
|
1533 |
+
*/
|
1534 |
+
lastIndexOf<TResult>(
|
1535 |
+
value: TResult,
|
1536 |
+
fromIndex?: boolean|number
|
1537 |
+
): number;
|
1538 |
+
}
|
1539 |
+
|
1540 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1541 |
+
/**
|
1542 |
+
* @see _.lastIndexOf
|
1543 |
+
*/
|
1544 |
+
lastIndexOf(
|
1545 |
+
value: T,
|
1546 |
+
fromIndex?: boolean|number
|
1547 |
+
): LoDashExplicitWrapper<number>;
|
1548 |
+
}
|
1549 |
+
|
1550 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1551 |
+
/**
|
1552 |
+
* @see _.lastIndexOf
|
1553 |
+
*/
|
1554 |
+
lastIndexOf<TResult>(
|
1555 |
+
value: TResult,
|
1556 |
+
fromIndex?: boolean|number
|
1557 |
+
): LoDashExplicitWrapper<number>;
|
1558 |
+
}
|
1559 |
+
|
1560 |
+
//_.object
|
1561 |
+
interface LoDashStatic {
|
1562 |
+
/**
|
1563 |
+
* @see _.zipObject
|
1564 |
+
*/
|
1565 |
+
object<TValues, TResult extends {}>(
|
1566 |
+
props: List<StringRepresentable>|List<List<any>>,
|
1567 |
+
values?: List<TValues>
|
1568 |
+
): TResult;
|
1569 |
+
|
1570 |
+
/**
|
1571 |
+
* @see _.zipObject
|
1572 |
+
*/
|
1573 |
+
object<TResult extends {}>(
|
1574 |
+
props: List<StringRepresentable>|List<List<any>>,
|
1575 |
+
values?: List<any>
|
1576 |
+
): TResult;
|
1577 |
+
|
1578 |
+
/**
|
1579 |
+
* @see _.zipObject
|
1580 |
+
*/
|
1581 |
+
object(
|
1582 |
+
props: List<StringRepresentable>|List<List<any>>,
|
1583 |
+
values?: List<any>
|
1584 |
+
): _.Dictionary<any>;
|
1585 |
+
}
|
1586 |
+
|
1587 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1588 |
+
/**
|
1589 |
+
* @see _.zipObject
|
1590 |
+
*/
|
1591 |
+
object<TValues, TResult extends {}>(
|
1592 |
+
values?: List<TValues>
|
1593 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
1594 |
+
|
1595 |
+
/**
|
1596 |
+
* @see _.zipObject
|
1597 |
+
*/
|
1598 |
+
object<TResult extends {}>(
|
1599 |
+
values?: List<any>
|
1600 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
1601 |
+
|
1602 |
+
/**
|
1603 |
+
* @see _.zipObject
|
1604 |
+
*/
|
1605 |
+
object(
|
1606 |
+
values?: List<any>
|
1607 |
+
): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
|
1608 |
+
}
|
1609 |
+
|
1610 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1611 |
+
/**
|
1612 |
+
* @see _.zipObject
|
1613 |
+
*/
|
1614 |
+
object<TValues, TResult extends {}>(
|
1615 |
+
values?: List<TValues>
|
1616 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
1617 |
+
|
1618 |
+
/**
|
1619 |
+
* @see _.zipObject
|
1620 |
+
*/
|
1621 |
+
object<TResult extends {}>(
|
1622 |
+
values?: List<any>
|
1623 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
1624 |
+
|
1625 |
+
/**
|
1626 |
+
* @see _.zipObject
|
1627 |
+
*/
|
1628 |
+
object(
|
1629 |
+
values?: List<any>
|
1630 |
+
): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
|
1631 |
+
}
|
1632 |
+
|
1633 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1634 |
+
/**
|
1635 |
+
* @see _.zipObject
|
1636 |
+
*/
|
1637 |
+
object<TValues, TResult extends {}>(
|
1638 |
+
values?: List<TValues>
|
1639 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
1640 |
+
|
1641 |
+
/**
|
1642 |
+
* @see _.zipObject
|
1643 |
+
*/
|
1644 |
+
object<TResult extends {}>(
|
1645 |
+
values?: List<any>
|
1646 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
1647 |
+
|
1648 |
+
/**
|
1649 |
+
* @see _.zipObject
|
1650 |
+
*/
|
1651 |
+
object(
|
1652 |
+
values?: List<any>
|
1653 |
+
): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
|
1654 |
+
}
|
1655 |
+
|
1656 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1657 |
+
/**
|
1658 |
+
* @see _.zipObject
|
1659 |
+
*/
|
1660 |
+
object<TValues, TResult extends {}>(
|
1661 |
+
values?: List<TValues>
|
1662 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
1663 |
+
|
1664 |
+
/**
|
1665 |
+
* @see _.zipObject
|
1666 |
+
*/
|
1667 |
+
object<TResult extends {}>(
|
1668 |
+
values?: List<any>
|
1669 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
1670 |
+
|
1671 |
+
/**
|
1672 |
+
* @see _.zipObject
|
1673 |
+
*/
|
1674 |
+
object(
|
1675 |
+
values?: List<any>
|
1676 |
+
): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
|
1677 |
+
}
|
1678 |
+
|
1679 |
+
//_.pull
|
1680 |
+
interface LoDashStatic {
|
1681 |
+
/**
|
1682 |
+
* Removes all provided values from array using SameValueZero for equality comparisons.
|
1683 |
+
*
|
1684 |
+
* Note: Unlike _.without, this method mutates array.
|
1685 |
+
*
|
1686 |
+
* @param array The array to modify.
|
1687 |
+
* @param values The values to remove.
|
1688 |
+
* @return Returns array.
|
1689 |
+
*/
|
1690 |
+
pull<T>(
|
1691 |
+
array: T[],
|
1692 |
+
...values: T[]
|
1693 |
+
): T[];
|
1694 |
+
|
1695 |
+
/**
|
1696 |
+
* @see _.pull
|
1697 |
+
*/
|
1698 |
+
pull<T>(
|
1699 |
+
array: List<T>,
|
1700 |
+
...values: T[]
|
1701 |
+
): List<T>;
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1705 |
+
/**
|
1706 |
+
* @see _.pull
|
1707 |
+
*/
|
1708 |
+
pull(...values: T[]): LoDashImplicitArrayWrapper<T>;
|
1709 |
+
}
|
1710 |
+
|
1711 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1712 |
+
/**
|
1713 |
+
* @see _.pull
|
1714 |
+
*/
|
1715 |
+
pull<TValue>(...values: TValue[]): LoDashImplicitObjectWrapper<List<TValue>>;
|
1716 |
+
}
|
1717 |
+
|
1718 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1719 |
+
/**
|
1720 |
+
* @see _.pull
|
1721 |
+
*/
|
1722 |
+
pull(...values: T[]): LoDashExplicitArrayWrapper<T>;
|
1723 |
+
}
|
1724 |
+
|
1725 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1726 |
+
/**
|
1727 |
+
* @see _.pull
|
1728 |
+
*/
|
1729 |
+
pull<TValue>(...values: TValue[]): LoDashExplicitObjectWrapper<List<TValue>>;
|
1730 |
+
}
|
1731 |
+
|
1732 |
+
//_.pullAt
|
1733 |
+
interface LoDashStatic {
|
1734 |
+
/**
|
1735 |
+
* Removes elements from array corresponding to the given indexes and returns an array of the removed elements.
|
1736 |
+
* Indexes may be specified as an array of indexes or as individual arguments.
|
1737 |
+
*
|
1738 |
+
* Note: Unlike _.at, this method mutates array.
|
1739 |
+
*
|
1740 |
+
* @param array The array to modify.
|
1741 |
+
* @param indexes The indexes of elements to remove, specified as individual indexes or arrays of indexes.
|
1742 |
+
* @return Returns the new array of removed elements.
|
1743 |
+
*/
|
1744 |
+
pullAt<T>(
|
1745 |
+
array: List<T>,
|
1746 |
+
...indexes: (number|number[])[]
|
1747 |
+
): T[];
|
1748 |
+
}
|
1749 |
+
|
1750 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1751 |
+
/**
|
1752 |
+
* @see _.pullAt
|
1753 |
+
*/
|
1754 |
+
pullAt(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
|
1755 |
+
}
|
1756 |
+
|
1757 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1758 |
+
/**
|
1759 |
+
* @see _.pullAt
|
1760 |
+
*/
|
1761 |
+
pullAt<T>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1765 |
+
/**
|
1766 |
+
* @see _.pullAt
|
1767 |
+
*/
|
1768 |
+
pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
|
1769 |
+
}
|
1770 |
+
|
1771 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1772 |
+
/**
|
1773 |
+
* @see _.pullAt
|
1774 |
+
*/
|
1775 |
+
pullAt<T>(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
|
1776 |
+
}
|
1777 |
+
|
1778 |
+
//_.remove
|
1779 |
+
interface LoDashStatic {
|
1780 |
+
/**
|
1781 |
+
* Removes all elements from array that predicate returns truthy for and returns an array of the removed
|
1782 |
+
* elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
|
1783 |
+
*
|
1784 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
1785 |
+
* value of the given element.
|
1786 |
+
*
|
1787 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
1788 |
+
* elements that have a matching property value, else false.
|
1789 |
+
*
|
1790 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
1791 |
+
* have the properties of the given object, else false.
|
1792 |
+
*
|
1793 |
+
* Note: Unlike _.filter, this method mutates array.
|
1794 |
+
*
|
1795 |
+
* @param array The array to modify.
|
1796 |
+
* @param predicate The function invoked per iteration.
|
1797 |
+
* @param thisArg The this binding of predicate.
|
1798 |
+
* @return Returns the new array of removed elements.
|
1799 |
+
*/
|
1800 |
+
remove<T>(
|
1801 |
+
array: List<T>,
|
1802 |
+
predicate?: ListIterator<T, boolean>,
|
1803 |
+
thisArg?: any
|
1804 |
+
): T[];
|
1805 |
+
|
1806 |
+
/**
|
1807 |
+
* @see _.remove
|
1808 |
+
*/
|
1809 |
+
remove<T>(
|
1810 |
+
array: List<T>,
|
1811 |
+
predicate?: string,
|
1812 |
+
thisArg?: any
|
1813 |
+
): T[];
|
1814 |
+
|
1815 |
+
/**
|
1816 |
+
* @see _.remove
|
1817 |
+
*/
|
1818 |
+
remove<W, T>(
|
1819 |
+
array: List<T>,
|
1820 |
+
predicate?: W
|
1821 |
+
): T[];
|
1822 |
+
}
|
1823 |
+
|
1824 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1825 |
+
/**
|
1826 |
+
* @see _.remove
|
1827 |
+
*/
|
1828 |
+
remove(
|
1829 |
+
predicate?: ListIterator<T, boolean>,
|
1830 |
+
thisArg?: any
|
1831 |
+
): LoDashImplicitArrayWrapper<T>;
|
1832 |
+
|
1833 |
+
/**
|
1834 |
+
* @see _.remove
|
1835 |
+
*/
|
1836 |
+
remove(
|
1837 |
+
predicate?: string,
|
1838 |
+
thisArg?: any
|
1839 |
+
): LoDashImplicitArrayWrapper<T>;
|
1840 |
+
|
1841 |
+
/**
|
1842 |
+
* @see _.remove
|
1843 |
+
*/
|
1844 |
+
remove<W>(
|
1845 |
+
predicate?: W
|
1846 |
+
): LoDashImplicitArrayWrapper<T>;
|
1847 |
+
}
|
1848 |
+
|
1849 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1850 |
+
/**
|
1851 |
+
* @see _.remove
|
1852 |
+
*/
|
1853 |
+
remove<TResult>(
|
1854 |
+
predicate?: ListIterator<TResult, boolean>,
|
1855 |
+
thisArg?: any
|
1856 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
1857 |
+
|
1858 |
+
/**
|
1859 |
+
* @see _.remove
|
1860 |
+
*/
|
1861 |
+
remove<TResult>(
|
1862 |
+
predicate?: string,
|
1863 |
+
thisArg?: any
|
1864 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
1865 |
+
|
1866 |
+
/**
|
1867 |
+
* @see _.remove
|
1868 |
+
*/
|
1869 |
+
remove<W, TResult>(
|
1870 |
+
predicate?: W
|
1871 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
1872 |
+
}
|
1873 |
+
|
1874 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1875 |
+
/**
|
1876 |
+
* @see _.remove
|
1877 |
+
*/
|
1878 |
+
remove(
|
1879 |
+
predicate?: ListIterator<T, boolean>,
|
1880 |
+
thisArg?: any
|
1881 |
+
): LoDashExplicitArrayWrapper<T>;
|
1882 |
+
|
1883 |
+
/**
|
1884 |
+
* @see _.remove
|
1885 |
+
*/
|
1886 |
+
remove(
|
1887 |
+
predicate?: string,
|
1888 |
+
thisArg?: any
|
1889 |
+
): LoDashExplicitArrayWrapper<T>;
|
1890 |
+
|
1891 |
+
/**
|
1892 |
+
* @see _.remove
|
1893 |
+
*/
|
1894 |
+
remove<W>(
|
1895 |
+
predicate?: W
|
1896 |
+
): LoDashExplicitArrayWrapper<T>;
|
1897 |
+
}
|
1898 |
+
|
1899 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1900 |
+
/**
|
1901 |
+
* @see _.remove
|
1902 |
+
*/
|
1903 |
+
remove<TResult>(
|
1904 |
+
predicate?: ListIterator<TResult, boolean>,
|
1905 |
+
thisArg?: any
|
1906 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
1907 |
+
|
1908 |
+
/**
|
1909 |
+
* @see _.remove
|
1910 |
+
*/
|
1911 |
+
remove<TResult>(
|
1912 |
+
predicate?: string,
|
1913 |
+
thisArg?: any
|
1914 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
1915 |
+
|
1916 |
+
/**
|
1917 |
+
* @see _.remove
|
1918 |
+
*/
|
1919 |
+
remove<W, TResult>(
|
1920 |
+
predicate?: W
|
1921 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
1922 |
+
}
|
1923 |
+
|
1924 |
+
//_.rest
|
1925 |
+
interface LoDashStatic {
|
1926 |
+
/**
|
1927 |
+
* Gets all but the first element of array.
|
1928 |
+
*
|
1929 |
+
* @alias _.tail
|
1930 |
+
*
|
1931 |
+
* @param array The array to query.
|
1932 |
+
* @return Returns the slice of array.
|
1933 |
+
*/
|
1934 |
+
rest<T>(array: List<T>): T[];
|
1935 |
+
}
|
1936 |
+
|
1937 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1938 |
+
/**
|
1939 |
+
* @see _.rest
|
1940 |
+
*/
|
1941 |
+
rest(): LoDashImplicitArrayWrapper<T>;
|
1942 |
+
}
|
1943 |
+
|
1944 |
+
interface LoDashImplicitObjectWrapper<T> {
|
1945 |
+
/**
|
1946 |
+
* @see _.rest
|
1947 |
+
*/
|
1948 |
+
rest<T>(): LoDashImplicitArrayWrapper<T>;
|
1949 |
+
}
|
1950 |
+
|
1951 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1952 |
+
/**
|
1953 |
+
* @see _.rest
|
1954 |
+
*/
|
1955 |
+
rest(): LoDashExplicitArrayWrapper<T>;
|
1956 |
+
}
|
1957 |
+
|
1958 |
+
interface LoDashExplicitObjectWrapper<T> {
|
1959 |
+
/**
|
1960 |
+
* @see _.rest
|
1961 |
+
*/
|
1962 |
+
rest<T>(): LoDashExplicitArrayWrapper<T>;
|
1963 |
+
}
|
1964 |
+
|
1965 |
+
//_.slice
|
1966 |
+
interface LoDashStatic {
|
1967 |
+
/**
|
1968 |
+
* Creates a slice of array from start up to, but not including, end.
|
1969 |
+
*
|
1970 |
+
* @param array The array to slice.
|
1971 |
+
* @param start The start position.
|
1972 |
+
* @param end The end position.
|
1973 |
+
* @return Returns the slice of array.
|
1974 |
+
*/
|
1975 |
+
slice<T>(
|
1976 |
+
array: T[],
|
1977 |
+
start?: number,
|
1978 |
+
end?: number
|
1979 |
+
): T[];
|
1980 |
+
}
|
1981 |
+
|
1982 |
+
interface LoDashImplicitArrayWrapper<T> {
|
1983 |
+
/**
|
1984 |
+
* @see _.slice
|
1985 |
+
*/
|
1986 |
+
slice(
|
1987 |
+
start?: number,
|
1988 |
+
end?: number
|
1989 |
+
): LoDashImplicitArrayWrapper<T>;
|
1990 |
+
}
|
1991 |
+
|
1992 |
+
interface LoDashExplicitArrayWrapper<T> {
|
1993 |
+
/**
|
1994 |
+
* @see _.slice
|
1995 |
+
*/
|
1996 |
+
slice(
|
1997 |
+
start?: number,
|
1998 |
+
end?: number
|
1999 |
+
): LoDashExplicitArrayWrapper<T>;
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
//_.sortedIndex
|
2003 |
+
interface LoDashStatic {
|
2004 |
+
/**
|
2005 |
+
* Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order. If an iteratee function is provided it’s invoked for value and each element of array to compute their sort ranking. The iteratee is bound to thisArg and invoked with one argument; (value).
|
2006 |
+
*
|
2007 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property value of the given element.
|
2008 |
+
*
|
2009 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for elements that have a matching property value, else false.
|
2010 |
+
*
|
2011 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that have the properties of the given object, else false.
|
2012 |
+
*
|
2013 |
+
* @param array The sorted array to inspect.
|
2014 |
+
* @param value The value to evaluate.
|
2015 |
+
* @param iteratee The function invoked per iteration.
|
2016 |
+
* @return The this binding of iteratee.
|
2017 |
+
*/
|
2018 |
+
sortedIndex<T, TSort>(
|
2019 |
+
array: List<T>,
|
2020 |
+
value: T,
|
2021 |
+
iteratee?: (x: T) => TSort,
|
2022 |
+
thisArg?: any
|
2023 |
+
): number;
|
2024 |
+
|
2025 |
+
/**
|
2026 |
+
* @see _.sortedIndex
|
2027 |
+
*/
|
2028 |
+
sortedIndex<T>(
|
2029 |
+
array: List<T>,
|
2030 |
+
value: T,
|
2031 |
+
iteratee?: (x: T) => any,
|
2032 |
+
thisArg?: any
|
2033 |
+
): number;
|
2034 |
+
|
2035 |
+
/**
|
2036 |
+
* @see _.sortedIndex
|
2037 |
+
*/
|
2038 |
+
sortedIndex<T>(
|
2039 |
+
array: List<T>,
|
2040 |
+
value: T,
|
2041 |
+
iteratee: string
|
2042 |
+
): number;
|
2043 |
+
|
2044 |
+
/**
|
2045 |
+
* @see _.sortedIndex
|
2046 |
+
*/
|
2047 |
+
sortedIndex<W, T>(
|
2048 |
+
array: List<T>,
|
2049 |
+
value: T,
|
2050 |
+
iteratee: W
|
2051 |
+
): number;
|
2052 |
+
|
2053 |
+
/**
|
2054 |
+
* @see _.sortedIndex
|
2055 |
+
*/
|
2056 |
+
sortedIndex<T>(
|
2057 |
+
array: List<T>,
|
2058 |
+
value: T,
|
2059 |
+
iteratee: Object
|
2060 |
+
): number;
|
2061 |
+
}
|
2062 |
+
|
2063 |
+
interface LoDashImplicitWrapper<T> {
|
2064 |
+
/**
|
2065 |
+
* @see _.sortedIndex
|
2066 |
+
*/
|
2067 |
+
sortedIndex<TSort>(
|
2068 |
+
value: string,
|
2069 |
+
iteratee?: (x: string) => TSort,
|
2070 |
+
thisArg?: any
|
2071 |
+
): number;
|
2072 |
+
}
|
2073 |
+
|
2074 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2075 |
+
/**
|
2076 |
+
* @see _.sortedIndex
|
2077 |
+
*/
|
2078 |
+
sortedIndex<TSort>(
|
2079 |
+
value: T,
|
2080 |
+
iteratee?: (x: T) => TSort,
|
2081 |
+
thisArg?: any
|
2082 |
+
): number;
|
2083 |
+
|
2084 |
+
/**
|
2085 |
+
* @see _.sortedIndex
|
2086 |
+
*/
|
2087 |
+
sortedIndex(
|
2088 |
+
value: T,
|
2089 |
+
iteratee: string
|
2090 |
+
): number;
|
2091 |
+
|
2092 |
+
/**
|
2093 |
+
* @see _.sortedIndex
|
2094 |
+
*/
|
2095 |
+
sortedIndex<W>(
|
2096 |
+
value: T,
|
2097 |
+
iteratee: W
|
2098 |
+
): number;
|
2099 |
+
}
|
2100 |
+
|
2101 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2102 |
+
/**
|
2103 |
+
* @see _.sortedIndex
|
2104 |
+
*/
|
2105 |
+
sortedIndex<T, TSort>(
|
2106 |
+
value: T,
|
2107 |
+
iteratee?: (x: T) => TSort,
|
2108 |
+
thisArg?: any
|
2109 |
+
): number;
|
2110 |
+
|
2111 |
+
/**
|
2112 |
+
* @see _.sortedIndex
|
2113 |
+
*/
|
2114 |
+
sortedIndex<T>(
|
2115 |
+
value: T,
|
2116 |
+
iteratee?: (x: T) => any,
|
2117 |
+
thisArg?: any
|
2118 |
+
): number;
|
2119 |
+
|
2120 |
+
/**
|
2121 |
+
* @see _.sortedIndex
|
2122 |
+
*/
|
2123 |
+
sortedIndex<T>(
|
2124 |
+
value: T,
|
2125 |
+
iteratee: string
|
2126 |
+
): number;
|
2127 |
+
|
2128 |
+
/**
|
2129 |
+
* @see _.sortedIndex
|
2130 |
+
*/
|
2131 |
+
sortedIndex<W, T>(
|
2132 |
+
value: T,
|
2133 |
+
iteratee: W
|
2134 |
+
): number;
|
2135 |
+
|
2136 |
+
/**
|
2137 |
+
* @see _.sortedIndex
|
2138 |
+
*/
|
2139 |
+
sortedIndex<T>(
|
2140 |
+
value: T,
|
2141 |
+
iteratee: Object
|
2142 |
+
): number;
|
2143 |
+
}
|
2144 |
+
|
2145 |
+
interface LoDashExplicitWrapper<T> {
|
2146 |
+
/**
|
2147 |
+
* @see _.sortedIndex
|
2148 |
+
*/
|
2149 |
+
sortedIndex<TSort>(
|
2150 |
+
value: string,
|
2151 |
+
iteratee?: (x: string) => TSort,
|
2152 |
+
thisArg?: any
|
2153 |
+
): LoDashExplicitWrapper<number>;
|
2154 |
+
}
|
2155 |
+
|
2156 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2157 |
+
/**
|
2158 |
+
* @see _.sortedIndex
|
2159 |
+
*/
|
2160 |
+
sortedIndex<TSort>(
|
2161 |
+
value: T,
|
2162 |
+
iteratee?: (x: T) => TSort,
|
2163 |
+
thisArg?: any
|
2164 |
+
): LoDashExplicitWrapper<number>;
|
2165 |
+
|
2166 |
+
/**
|
2167 |
+
* @see _.sortedIndex
|
2168 |
+
*/
|
2169 |
+
sortedIndex(
|
2170 |
+
value: T,
|
2171 |
+
iteratee: string
|
2172 |
+
): LoDashExplicitWrapper<number>;
|
2173 |
+
|
2174 |
+
/**
|
2175 |
+
* @see _.sortedIndex
|
2176 |
+
*/
|
2177 |
+
sortedIndex<W>(
|
2178 |
+
value: T,
|
2179 |
+
iteratee: W
|
2180 |
+
): LoDashExplicitWrapper<number>;
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2184 |
+
/**
|
2185 |
+
* @see _.sortedIndex
|
2186 |
+
*/
|
2187 |
+
sortedIndex<T, TSort>(
|
2188 |
+
value: T,
|
2189 |
+
iteratee?: (x: T) => TSort,
|
2190 |
+
thisArg?: any
|
2191 |
+
): LoDashExplicitWrapper<number>;
|
2192 |
+
|
2193 |
+
/**
|
2194 |
+
* @see _.sortedIndex
|
2195 |
+
*/
|
2196 |
+
sortedIndex<T>(
|
2197 |
+
value: T,
|
2198 |
+
iteratee?: (x: T) => any,
|
2199 |
+
thisArg?: any
|
2200 |
+
): LoDashExplicitWrapper<number>;
|
2201 |
+
|
2202 |
+
/**
|
2203 |
+
* @see _.sortedIndex
|
2204 |
+
*/
|
2205 |
+
sortedIndex<T>(
|
2206 |
+
value: T,
|
2207 |
+
iteratee: string
|
2208 |
+
): LoDashExplicitWrapper<number>;
|
2209 |
+
|
2210 |
+
/**
|
2211 |
+
* @see _.sortedIndex
|
2212 |
+
*/
|
2213 |
+
sortedIndex<W, T>(
|
2214 |
+
value: T,
|
2215 |
+
iteratee: W
|
2216 |
+
): LoDashExplicitWrapper<number>;
|
2217 |
+
|
2218 |
+
/**
|
2219 |
+
* @see _.sortedIndex
|
2220 |
+
*/
|
2221 |
+
sortedIndex<T>(
|
2222 |
+
value: T,
|
2223 |
+
iteratee: Object
|
2224 |
+
): LoDashExplicitWrapper<number>;
|
2225 |
+
}
|
2226 |
+
|
2227 |
+
//_.sortedLastIndex
|
2228 |
+
interface LoDashStatic {
|
2229 |
+
/**
|
2230 |
+
* This method is like _.sortedIndex except that it returns the highest index at which value should be
|
2231 |
+
* inserted into array in order to maintain its sort order.
|
2232 |
+
*
|
2233 |
+
* @param array The sorted array to inspect.
|
2234 |
+
* @param value The value to evaluate.
|
2235 |
+
* @param iteratee The function invoked per iteration.
|
2236 |
+
* @param thisArg The this binding of iteratee.
|
2237 |
+
* @return Returns the index at which value should be inserted into array.
|
2238 |
+
*/
|
2239 |
+
sortedLastIndex<T, TSort>(
|
2240 |
+
array: List<T>,
|
2241 |
+
value: T,
|
2242 |
+
iteratee?: (x: T) => TSort,
|
2243 |
+
thisArg?: any
|
2244 |
+
): number;
|
2245 |
+
|
2246 |
+
/**
|
2247 |
+
* @see _.sortedLastIndex
|
2248 |
+
*/
|
2249 |
+
sortedLastIndex<T>(
|
2250 |
+
array: List<T>,
|
2251 |
+
value: T,
|
2252 |
+
iteratee?: (x: T) => any,
|
2253 |
+
thisArg?: any
|
2254 |
+
): number;
|
2255 |
+
|
2256 |
+
/**
|
2257 |
+
* @see _.sortedLastIndex
|
2258 |
+
*/
|
2259 |
+
sortedLastIndex<T>(
|
2260 |
+
array: List<T>,
|
2261 |
+
value: T,
|
2262 |
+
iteratee: string
|
2263 |
+
): number;
|
2264 |
+
|
2265 |
+
/**
|
2266 |
+
* @see _.sortedLastIndex
|
2267 |
+
*/
|
2268 |
+
sortedLastIndex<W, T>(
|
2269 |
+
array: List<T>,
|
2270 |
+
value: T,
|
2271 |
+
iteratee: W
|
2272 |
+
): number;
|
2273 |
+
|
2274 |
+
/**
|
2275 |
+
* @see _.sortedLastIndex
|
2276 |
+
*/
|
2277 |
+
sortedLastIndex<T>(
|
2278 |
+
array: List<T>,
|
2279 |
+
value: T,
|
2280 |
+
iteratee: Object
|
2281 |
+
): number;
|
2282 |
+
}
|
2283 |
+
|
2284 |
+
interface LoDashImplicitWrapper<T> {
|
2285 |
+
/**
|
2286 |
+
* @see _.sortedLastIndex
|
2287 |
+
*/
|
2288 |
+
sortedLastIndex<TSort>(
|
2289 |
+
value: string,
|
2290 |
+
iteratee?: (x: string) => TSort,
|
2291 |
+
thisArg?: any
|
2292 |
+
): number;
|
2293 |
+
}
|
2294 |
+
|
2295 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2296 |
+
/**
|
2297 |
+
* @see _.sortedLastIndex
|
2298 |
+
*/
|
2299 |
+
sortedLastIndex<TSort>(
|
2300 |
+
value: T,
|
2301 |
+
iteratee?: (x: T) => TSort,
|
2302 |
+
thisArg?: any
|
2303 |
+
): number;
|
2304 |
+
|
2305 |
+
/**
|
2306 |
+
* @see _.sortedLastIndex
|
2307 |
+
*/
|
2308 |
+
sortedLastIndex(
|
2309 |
+
value: T,
|
2310 |
+
iteratee: string
|
2311 |
+
): number;
|
2312 |
+
|
2313 |
+
/**
|
2314 |
+
* @see _.sortedLastIndex
|
2315 |
+
*/
|
2316 |
+
sortedLastIndex<W>(
|
2317 |
+
value: T,
|
2318 |
+
iteratee: W
|
2319 |
+
): number;
|
2320 |
+
}
|
2321 |
+
|
2322 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2323 |
+
/**
|
2324 |
+
* @see _.sortedLastIndex
|
2325 |
+
*/
|
2326 |
+
sortedLastIndex<T, TSort>(
|
2327 |
+
value: T,
|
2328 |
+
iteratee?: (x: T) => TSort,
|
2329 |
+
thisArg?: any
|
2330 |
+
): number;
|
2331 |
+
|
2332 |
+
/**
|
2333 |
+
* @see _.sortedLastIndex
|
2334 |
+
*/
|
2335 |
+
sortedLastIndex<T>(
|
2336 |
+
value: T,
|
2337 |
+
iteratee?: (x: T) => any,
|
2338 |
+
thisArg?: any
|
2339 |
+
): number;
|
2340 |
+
|
2341 |
+
/**
|
2342 |
+
* @see _.sortedLastIndex
|
2343 |
+
*/
|
2344 |
+
sortedLastIndex<T>(
|
2345 |
+
value: T,
|
2346 |
+
iteratee: string
|
2347 |
+
): number;
|
2348 |
+
|
2349 |
+
/**
|
2350 |
+
* @see _.sortedLastIndex
|
2351 |
+
*/
|
2352 |
+
sortedLastIndex<W, T>(
|
2353 |
+
value: T,
|
2354 |
+
iteratee: W
|
2355 |
+
): number;
|
2356 |
+
|
2357 |
+
/**
|
2358 |
+
* @see _.sortedLastIndex
|
2359 |
+
*/
|
2360 |
+
sortedLastIndex<T>(
|
2361 |
+
value: T,
|
2362 |
+
iteratee: Object
|
2363 |
+
): number;
|
2364 |
+
}
|
2365 |
+
|
2366 |
+
interface LoDashExplicitWrapper<T> {
|
2367 |
+
/**
|
2368 |
+
* @see _.sortedLastIndex
|
2369 |
+
*/
|
2370 |
+
sortedLastIndex<TSort>(
|
2371 |
+
value: string,
|
2372 |
+
iteratee?: (x: string) => TSort,
|
2373 |
+
thisArg?: any
|
2374 |
+
): LoDashExplicitWrapper<number>;
|
2375 |
+
}
|
2376 |
+
|
2377 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2378 |
+
/**
|
2379 |
+
* @see _.sortedLastIndex
|
2380 |
+
*/
|
2381 |
+
sortedLastIndex<TSort>(
|
2382 |
+
value: T,
|
2383 |
+
iteratee?: (x: T) => TSort,
|
2384 |
+
thisArg?: any
|
2385 |
+
): LoDashExplicitWrapper<number>;
|
2386 |
+
|
2387 |
+
/**
|
2388 |
+
* @see _.sortedLastIndex
|
2389 |
+
*/
|
2390 |
+
sortedLastIndex(
|
2391 |
+
value: T,
|
2392 |
+
iteratee: string
|
2393 |
+
): LoDashExplicitWrapper<number>;
|
2394 |
+
|
2395 |
+
/**
|
2396 |
+
* @see _.sortedLastIndex
|
2397 |
+
*/
|
2398 |
+
sortedLastIndex<W>(
|
2399 |
+
value: T,
|
2400 |
+
iteratee: W
|
2401 |
+
): LoDashExplicitWrapper<number>;
|
2402 |
+
}
|
2403 |
+
|
2404 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2405 |
+
/**
|
2406 |
+
* @see _.sortedLastIndex
|
2407 |
+
*/
|
2408 |
+
sortedLastIndex<T, TSort>(
|
2409 |
+
value: T,
|
2410 |
+
iteratee?: (x: T) => TSort,
|
2411 |
+
thisArg?: any
|
2412 |
+
): LoDashExplicitWrapper<number>;
|
2413 |
+
|
2414 |
+
/**
|
2415 |
+
* @see _.sortedLastIndex
|
2416 |
+
*/
|
2417 |
+
sortedLastIndex<T>(
|
2418 |
+
value: T,
|
2419 |
+
iteratee?: (x: T) => any,
|
2420 |
+
thisArg?: any
|
2421 |
+
): LoDashExplicitWrapper<number>;
|
2422 |
+
|
2423 |
+
/**
|
2424 |
+
* @see _.sortedLastIndex
|
2425 |
+
*/
|
2426 |
+
sortedLastIndex<T>(
|
2427 |
+
value: T,
|
2428 |
+
iteratee: string
|
2429 |
+
): LoDashExplicitWrapper<number>;
|
2430 |
+
|
2431 |
+
/**
|
2432 |
+
* @see _.sortedLastIndex
|
2433 |
+
*/
|
2434 |
+
sortedLastIndex<W, T>(
|
2435 |
+
value: T,
|
2436 |
+
iteratee: W
|
2437 |
+
): LoDashExplicitWrapper<number>;
|
2438 |
+
|
2439 |
+
/**
|
2440 |
+
* @see _.sortedLastIndex
|
2441 |
+
*/
|
2442 |
+
sortedLastIndex<T>(
|
2443 |
+
value: T,
|
2444 |
+
iteratee: Object
|
2445 |
+
): LoDashExplicitWrapper<number>;
|
2446 |
+
}
|
2447 |
+
|
2448 |
+
//_.tail
|
2449 |
+
interface LoDashStatic {
|
2450 |
+
/**
|
2451 |
+
* @see _.rest
|
2452 |
+
*/
|
2453 |
+
tail<T>(array: List<T>): T[];
|
2454 |
+
}
|
2455 |
+
|
2456 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2457 |
+
/**
|
2458 |
+
* @see _.rest
|
2459 |
+
*/
|
2460 |
+
tail(): LoDashImplicitArrayWrapper<T>;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2464 |
+
/**
|
2465 |
+
* @see _.rest
|
2466 |
+
*/
|
2467 |
+
tail<T>(): LoDashImplicitArrayWrapper<T>;
|
2468 |
+
}
|
2469 |
+
|
2470 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2471 |
+
/**
|
2472 |
+
* @see _.rest
|
2473 |
+
*/
|
2474 |
+
tail(): LoDashExplicitArrayWrapper<T>;
|
2475 |
+
}
|
2476 |
+
|
2477 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2478 |
+
/**
|
2479 |
+
* @see _.rest
|
2480 |
+
*/
|
2481 |
+
tail<T>(): LoDashExplicitArrayWrapper<T>;
|
2482 |
+
}
|
2483 |
+
|
2484 |
+
//_.take
|
2485 |
+
interface LoDashStatic {
|
2486 |
+
/**
|
2487 |
+
* Creates a slice of array with n elements taken from the beginning.
|
2488 |
+
*
|
2489 |
+
* @param array The array to query.
|
2490 |
+
* @param n The number of elements to take.
|
2491 |
+
* @return Returns the slice of array.
|
2492 |
+
*/
|
2493 |
+
take<T>(
|
2494 |
+
array: List<T>,
|
2495 |
+
n?: number
|
2496 |
+
): T[];
|
2497 |
+
}
|
2498 |
+
|
2499 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2500 |
+
/**
|
2501 |
+
* @see _.take
|
2502 |
+
*/
|
2503 |
+
take(n?: number): LoDashImplicitArrayWrapper<T>;
|
2504 |
+
}
|
2505 |
+
|
2506 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2507 |
+
/**
|
2508 |
+
* @see _.take
|
2509 |
+
*/
|
2510 |
+
take<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
|
2511 |
+
}
|
2512 |
+
|
2513 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2514 |
+
/**
|
2515 |
+
* @see _.take
|
2516 |
+
*/
|
2517 |
+
take(n?: number): LoDashExplicitArrayWrapper<T>;
|
2518 |
+
}
|
2519 |
+
|
2520 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2521 |
+
/**
|
2522 |
+
* @see _.take
|
2523 |
+
*/
|
2524 |
+
take<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
|
2525 |
+
}
|
2526 |
+
|
2527 |
+
//_.takeRight
|
2528 |
+
interface LoDashStatic {
|
2529 |
+
/**
|
2530 |
+
* Creates a slice of array with n elements taken from the end.
|
2531 |
+
*
|
2532 |
+
* @param array The array to query.
|
2533 |
+
* @param n The number of elements to take.
|
2534 |
+
* @return Returns the slice of array.
|
2535 |
+
*/
|
2536 |
+
takeRight<T>(
|
2537 |
+
array: List<T>,
|
2538 |
+
n?: number
|
2539 |
+
): T[];
|
2540 |
+
}
|
2541 |
+
|
2542 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2543 |
+
/**
|
2544 |
+
* @see _.takeRight
|
2545 |
+
*/
|
2546 |
+
takeRight(n?: number): LoDashImplicitArrayWrapper<T>;
|
2547 |
+
}
|
2548 |
+
|
2549 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2550 |
+
/**
|
2551 |
+
* @see _.takeRight
|
2552 |
+
*/
|
2553 |
+
takeRight<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
|
2554 |
+
}
|
2555 |
+
|
2556 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2557 |
+
/**
|
2558 |
+
* @see _.takeRight
|
2559 |
+
*/
|
2560 |
+
takeRight(n?: number): LoDashExplicitArrayWrapper<T>;
|
2561 |
+
}
|
2562 |
+
|
2563 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2564 |
+
/**
|
2565 |
+
* @see _.takeRight
|
2566 |
+
*/
|
2567 |
+
takeRight<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
|
2568 |
+
}
|
2569 |
+
|
2570 |
+
//_.takeRightWhile
|
2571 |
+
interface LoDashStatic {
|
2572 |
+
/**
|
2573 |
+
* Creates a slice of array with elements taken from the end. Elements are taken until predicate returns
|
2574 |
+
* falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
|
2575 |
+
*
|
2576 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
2577 |
+
* value of the given element.
|
2578 |
+
*
|
2579 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
2580 |
+
* elements that have a matching property value, else false.
|
2581 |
+
*
|
2582 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
2583 |
+
* have the properties of the given object, else false.
|
2584 |
+
*
|
2585 |
+
* @param array The array to query.
|
2586 |
+
* @param predicate The function invoked per iteration.
|
2587 |
+
* @param thisArg The this binding of predicate.
|
2588 |
+
* @return Returns the slice of array.
|
2589 |
+
*/
|
2590 |
+
takeRightWhile<TValue>(
|
2591 |
+
array: List<TValue>,
|
2592 |
+
predicate?: ListIterator<TValue, boolean>,
|
2593 |
+
thisArg?: any
|
2594 |
+
): TValue[];
|
2595 |
+
|
2596 |
+
/**
|
2597 |
+
* @see _.takeRightWhile
|
2598 |
+
*/
|
2599 |
+
takeRightWhile<TValue>(
|
2600 |
+
array: List<TValue>,
|
2601 |
+
predicate?: string,
|
2602 |
+
thisArg?: any
|
2603 |
+
): TValue[];
|
2604 |
+
|
2605 |
+
/**
|
2606 |
+
* @see _.takeRightWhile
|
2607 |
+
*/
|
2608 |
+
takeRightWhile<TWhere, TValue>(
|
2609 |
+
array: List<TValue>,
|
2610 |
+
predicate?: TWhere
|
2611 |
+
): TValue[];
|
2612 |
+
}
|
2613 |
+
|
2614 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2615 |
+
/**
|
2616 |
+
* @see _.takeRightWhile
|
2617 |
+
*/
|
2618 |
+
takeRightWhile(
|
2619 |
+
predicate?: ListIterator<T, boolean>,
|
2620 |
+
thisArg?: any
|
2621 |
+
): LoDashImplicitArrayWrapper<T>;
|
2622 |
+
|
2623 |
+
/**
|
2624 |
+
* @see _.takeRightWhile
|
2625 |
+
*/
|
2626 |
+
takeRightWhile(
|
2627 |
+
predicate?: string,
|
2628 |
+
thisArg?: any
|
2629 |
+
): LoDashImplicitArrayWrapper<T>;
|
2630 |
+
|
2631 |
+
/**
|
2632 |
+
* @see _.takeRightWhile
|
2633 |
+
*/
|
2634 |
+
takeRightWhile<TWhere>(
|
2635 |
+
predicate?: TWhere
|
2636 |
+
): LoDashImplicitArrayWrapper<T>;
|
2637 |
+
}
|
2638 |
+
|
2639 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2640 |
+
/**
|
2641 |
+
* @see _.takeRightWhile
|
2642 |
+
*/
|
2643 |
+
takeRightWhile<TValue>(
|
2644 |
+
predicate?: ListIterator<TValue, boolean>,
|
2645 |
+
thisArg?: any
|
2646 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2647 |
+
|
2648 |
+
/**
|
2649 |
+
* @see _.takeRightWhile
|
2650 |
+
*/
|
2651 |
+
takeRightWhile<TValue>(
|
2652 |
+
predicate?: string,
|
2653 |
+
thisArg?: any
|
2654 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2655 |
+
|
2656 |
+
/**
|
2657 |
+
* @see _.takeRightWhile
|
2658 |
+
*/
|
2659 |
+
takeRightWhile<TWhere, TValue>(
|
2660 |
+
predicate?: TWhere
|
2661 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2662 |
+
}
|
2663 |
+
|
2664 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2665 |
+
/**
|
2666 |
+
* @see _.takeRightWhile
|
2667 |
+
*/
|
2668 |
+
takeRightWhile(
|
2669 |
+
predicate?: ListIterator<T, boolean>,
|
2670 |
+
thisArg?: any
|
2671 |
+
): LoDashExplicitArrayWrapper<T>;
|
2672 |
+
|
2673 |
+
/**
|
2674 |
+
* @see _.takeRightWhile
|
2675 |
+
*/
|
2676 |
+
takeRightWhile(
|
2677 |
+
predicate?: string,
|
2678 |
+
thisArg?: any
|
2679 |
+
): LoDashExplicitArrayWrapper<T>;
|
2680 |
+
|
2681 |
+
/**
|
2682 |
+
* @see _.takeRightWhile
|
2683 |
+
*/
|
2684 |
+
takeRightWhile<TWhere>(
|
2685 |
+
predicate?: TWhere
|
2686 |
+
): LoDashExplicitArrayWrapper<T>;
|
2687 |
+
}
|
2688 |
+
|
2689 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2690 |
+
/**
|
2691 |
+
* @see _.takeRightWhile
|
2692 |
+
*/
|
2693 |
+
takeRightWhile<TValue>(
|
2694 |
+
predicate?: ListIterator<TValue, boolean>,
|
2695 |
+
thisArg?: any
|
2696 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2697 |
+
|
2698 |
+
/**
|
2699 |
+
* @see _.takeRightWhile
|
2700 |
+
*/
|
2701 |
+
takeRightWhile<TValue>(
|
2702 |
+
predicate?: string,
|
2703 |
+
thisArg?: any
|
2704 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2705 |
+
|
2706 |
+
/**
|
2707 |
+
* @see _.takeRightWhile
|
2708 |
+
*/
|
2709 |
+
takeRightWhile<TWhere, TValue>(
|
2710 |
+
predicate?: TWhere
|
2711 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2712 |
+
}
|
2713 |
+
|
2714 |
+
//_.takeWhile
|
2715 |
+
interface LoDashStatic {
|
2716 |
+
/**
|
2717 |
+
* Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns
|
2718 |
+
* falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array).
|
2719 |
+
*
|
2720 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
2721 |
+
* value of the given element.
|
2722 |
+
*
|
2723 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
2724 |
+
* elements that have a matching property value, else false.
|
2725 |
+
*
|
2726 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
2727 |
+
* have the properties of the given object, else false.
|
2728 |
+
*
|
2729 |
+
* @param array The array to query.
|
2730 |
+
* @param predicate The function invoked per iteration.
|
2731 |
+
* @param thisArg The this binding of predicate.
|
2732 |
+
* @return Returns the slice of array.
|
2733 |
+
*/
|
2734 |
+
takeWhile<TValue>(
|
2735 |
+
array: List<TValue>,
|
2736 |
+
predicate?: ListIterator<TValue, boolean>,
|
2737 |
+
thisArg?: any
|
2738 |
+
): TValue[];
|
2739 |
+
|
2740 |
+
/**
|
2741 |
+
* @see _.takeWhile
|
2742 |
+
*/
|
2743 |
+
takeWhile<TValue>(
|
2744 |
+
array: List<TValue>,
|
2745 |
+
predicate?: string,
|
2746 |
+
thisArg?: any
|
2747 |
+
): TValue[];
|
2748 |
+
|
2749 |
+
/**
|
2750 |
+
* @see _.takeWhile
|
2751 |
+
*/
|
2752 |
+
takeWhile<TWhere, TValue>(
|
2753 |
+
array: List<TValue>,
|
2754 |
+
predicate?: TWhere
|
2755 |
+
): TValue[];
|
2756 |
+
}
|
2757 |
+
|
2758 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2759 |
+
/**
|
2760 |
+
* @see _.takeWhile
|
2761 |
+
*/
|
2762 |
+
takeWhile(
|
2763 |
+
predicate?: ListIterator<T, boolean>,
|
2764 |
+
thisArg?: any
|
2765 |
+
): LoDashImplicitArrayWrapper<T>;
|
2766 |
+
|
2767 |
+
/**
|
2768 |
+
* @see _.takeWhile
|
2769 |
+
*/
|
2770 |
+
takeWhile(
|
2771 |
+
predicate?: string,
|
2772 |
+
thisArg?: any
|
2773 |
+
): LoDashImplicitArrayWrapper<T>;
|
2774 |
+
|
2775 |
+
/**
|
2776 |
+
* @see _.takeWhile
|
2777 |
+
*/
|
2778 |
+
takeWhile<TWhere>(
|
2779 |
+
predicate?: TWhere
|
2780 |
+
): LoDashImplicitArrayWrapper<T>;
|
2781 |
+
}
|
2782 |
+
|
2783 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2784 |
+
/**
|
2785 |
+
* @see _.takeWhile
|
2786 |
+
*/
|
2787 |
+
takeWhile<TValue>(
|
2788 |
+
predicate?: ListIterator<TValue, boolean>,
|
2789 |
+
thisArg?: any
|
2790 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2791 |
+
|
2792 |
+
/**
|
2793 |
+
* @see _.takeWhile
|
2794 |
+
*/
|
2795 |
+
takeWhile<TValue>(
|
2796 |
+
predicate?: string,
|
2797 |
+
thisArg?: any
|
2798 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2799 |
+
|
2800 |
+
/**
|
2801 |
+
* @see _.takeWhile
|
2802 |
+
*/
|
2803 |
+
takeWhile<TWhere, TValue>(
|
2804 |
+
predicate?: TWhere
|
2805 |
+
): LoDashImplicitArrayWrapper<TValue>;
|
2806 |
+
}
|
2807 |
+
|
2808 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2809 |
+
/**
|
2810 |
+
* @see _.takeWhile
|
2811 |
+
*/
|
2812 |
+
takeWhile(
|
2813 |
+
predicate?: ListIterator<T, boolean>,
|
2814 |
+
thisArg?: any
|
2815 |
+
): LoDashExplicitArrayWrapper<T>;
|
2816 |
+
|
2817 |
+
/**
|
2818 |
+
* @see _.takeWhile
|
2819 |
+
*/
|
2820 |
+
takeWhile(
|
2821 |
+
predicate?: string,
|
2822 |
+
thisArg?: any
|
2823 |
+
): LoDashExplicitArrayWrapper<T>;
|
2824 |
+
|
2825 |
+
/**
|
2826 |
+
* @see _.takeWhile
|
2827 |
+
*/
|
2828 |
+
takeWhile<TWhere>(
|
2829 |
+
predicate?: TWhere
|
2830 |
+
): LoDashExplicitArrayWrapper<T>;
|
2831 |
+
}
|
2832 |
+
|
2833 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2834 |
+
/**
|
2835 |
+
* @see _.takeWhile
|
2836 |
+
*/
|
2837 |
+
takeWhile<TValue>(
|
2838 |
+
predicate?: ListIterator<TValue, boolean>,
|
2839 |
+
thisArg?: any
|
2840 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2841 |
+
|
2842 |
+
/**
|
2843 |
+
* @see _.takeWhile
|
2844 |
+
*/
|
2845 |
+
takeWhile<TValue>(
|
2846 |
+
predicate?: string,
|
2847 |
+
thisArg?: any
|
2848 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2849 |
+
|
2850 |
+
/**
|
2851 |
+
* @see _.takeWhile
|
2852 |
+
*/
|
2853 |
+
takeWhile<TWhere, TValue>(
|
2854 |
+
predicate?: TWhere
|
2855 |
+
): LoDashExplicitArrayWrapper<TValue>;
|
2856 |
+
}
|
2857 |
+
|
2858 |
+
//_.union
|
2859 |
+
interface LoDashStatic {
|
2860 |
+
/**
|
2861 |
+
* Creates an array of unique values, in order, from all of the provided arrays using SameValueZero for
|
2862 |
+
* equality comparisons.
|
2863 |
+
*
|
2864 |
+
* @param arrays The arrays to inspect.
|
2865 |
+
* @return Returns the new array of combined values.
|
2866 |
+
*/
|
2867 |
+
union<T>(...arrays: List<T>[]): T[];
|
2868 |
+
}
|
2869 |
+
|
2870 |
+
interface LoDashImplicitArrayWrapper<T> {
|
2871 |
+
/**
|
2872 |
+
* @see _.union
|
2873 |
+
*/
|
2874 |
+
union(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
|
2875 |
+
|
2876 |
+
/**
|
2877 |
+
* @see _.union
|
2878 |
+
*/
|
2879 |
+
union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
|
2880 |
+
}
|
2881 |
+
|
2882 |
+
interface LoDashImplicitObjectWrapper<T> {
|
2883 |
+
/**
|
2884 |
+
* @see _.union
|
2885 |
+
*/
|
2886 |
+
union<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
|
2887 |
+
}
|
2888 |
+
|
2889 |
+
interface LoDashExplicitArrayWrapper<T> {
|
2890 |
+
/**
|
2891 |
+
* @see _.union
|
2892 |
+
*/
|
2893 |
+
union(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
2894 |
+
|
2895 |
+
/**
|
2896 |
+
* @see _.union
|
2897 |
+
*/
|
2898 |
+
union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
2899 |
+
}
|
2900 |
+
|
2901 |
+
interface LoDashExplicitObjectWrapper<T> {
|
2902 |
+
/**
|
2903 |
+
* @see _.union
|
2904 |
+
*/
|
2905 |
+
union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
2906 |
+
}
|
2907 |
+
|
2908 |
+
//_.uniq
|
2909 |
+
interface LoDashStatic {
|
2910 |
+
/**
|
2911 |
+
* Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only
|
2912 |
+
* the first occurrence of each element is kept. Providing true for isSorted performs a faster search
|
2913 |
+
* algorithm for sorted arrays. If an iteratee function is provided it’s invoked for each element in the
|
2914 |
+
* array to generate the criterion by which uniqueness is computed. The iteratee is bound to thisArg and
|
2915 |
+
* invoked with three arguments: (value, index, array).
|
2916 |
+
*
|
2917 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property
|
2918 |
+
* value of the given element.
|
2919 |
+
*
|
2920 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
2921 |
+
* elements that have a matching property value, else false.
|
2922 |
+
*
|
2923 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
2924 |
+
* have the properties of the given object, else false.
|
2925 |
+
*
|
2926 |
+
* @alias _.unique
|
2927 |
+
*
|
2928 |
+
* @param array The array to inspect.
|
2929 |
+
* @param isSorted Specify the array is sorted.
|
2930 |
+
* @param iteratee The function invoked per iteration.
|
2931 |
+
* @param thisArg iteratee
|
2932 |
+
* @return Returns the new duplicate-value-free array.
|
2933 |
+
*/
|
2934 |
+
uniq<T>(
|
2935 |
+
array: List<T>,
|
2936 |
+
isSorted?: boolean,
|
2937 |
+
iteratee?: ListIterator<T, any>,
|
2938 |
+
thisArg?: any
|
2939 |
+
): T[];
|
2940 |
+
|
2941 |
+
/**
|
2942 |
+
* @see _.uniq
|
2943 |
+
*/
|
2944 |
+
uniq<T, TSort>(
|
2945 |
+
array: List<T>,
|
2946 |
+
isSorted?: boolean,
|
2947 |
+
iteratee?: ListIterator<T, TSort>,
|
2948 |
+
thisArg?: any
|
2949 |
+
): T[];
|
2950 |
+
|
2951 |
+
/**
|
2952 |
+
* @see _.uniq
|
2953 |
+
*/
|
2954 |
+
uniq<T>(
|
2955 |
+
array: List<T>,
|
2956 |
+
iteratee?: ListIterator<T, any>,
|
2957 |
+
thisArg?: any
|
2958 |
+
): T[];
|
2959 |
+
|
2960 |
+
/**
|
2961 |
+
* @see _.uniq
|
2962 |
+
*/
|
2963 |
+
uniq<T, TSort>(
|
2964 |
+
array: List<T>,
|
2965 |
+
iteratee?: ListIterator<T, TSort>,
|
2966 |
+
thisArg?: any
|
2967 |
+
): T[];
|
2968 |
+
|
2969 |
+
/**
|
2970 |
+
* @see _.uniq
|
2971 |
+
*/
|
2972 |
+
uniq<T>(
|
2973 |
+
array: List<T>,
|
2974 |
+
isSorted?: boolean,
|
2975 |
+
iteratee?: string,
|
2976 |
+
thisArg?: any
|
2977 |
+
): T[];
|
2978 |
+
|
2979 |
+
/**
|
2980 |
+
* @see _.uniq
|
2981 |
+
*/
|
2982 |
+
uniq<T>(
|
2983 |
+
array: List<T>,
|
2984 |
+
iteratee?: string,
|
2985 |
+
thisArg?: any
|
2986 |
+
): T[];
|
2987 |
+
|
2988 |
+
/**
|
2989 |
+
* @see _.uniq
|
2990 |
+
*/
|
2991 |
+
uniq<T>(
|
2992 |
+
array: List<T>,
|
2993 |
+
isSorted?: boolean,
|
2994 |
+
iteratee?: Object
|
2995 |
+
): T[];
|
2996 |
+
|
2997 |
+
/**
|
2998 |
+
* @see _.uniq
|
2999 |
+
*/
|
3000 |
+
uniq<TWhere extends {}, T>(
|
3001 |
+
array: List<T>,
|
3002 |
+
isSorted?: boolean,
|
3003 |
+
iteratee?: TWhere
|
3004 |
+
): T[];
|
3005 |
+
|
3006 |
+
/**
|
3007 |
+
* @see _.uniq
|
3008 |
+
*/
|
3009 |
+
uniq<T>(
|
3010 |
+
array: List<T>,
|
3011 |
+
iteratee?: Object
|
3012 |
+
): T[];
|
3013 |
+
|
3014 |
+
/**
|
3015 |
+
* @see _.uniq
|
3016 |
+
*/
|
3017 |
+
uniq<TWhere extends {}, T>(
|
3018 |
+
array: List<T>,
|
3019 |
+
iteratee?: TWhere
|
3020 |
+
): T[];
|
3021 |
+
}
|
3022 |
+
|
3023 |
+
interface LoDashImplicitWrapper<T> {
|
3024 |
+
/**
|
3025 |
+
* @see _.uniq
|
3026 |
+
*/
|
3027 |
+
uniq<TSort>(
|
3028 |
+
isSorted?: boolean,
|
3029 |
+
iteratee?: ListIterator<T, TSort>,
|
3030 |
+
thisArg?: any
|
3031 |
+
): LoDashImplicitArrayWrapper<T>;
|
3032 |
+
|
3033 |
+
/**
|
3034 |
+
* @see _.uniq
|
3035 |
+
*/
|
3036 |
+
uniq<TSort>(
|
3037 |
+
iteratee?: ListIterator<T, TSort>,
|
3038 |
+
thisArg?: any
|
3039 |
+
): LoDashImplicitArrayWrapper<T>;
|
3040 |
+
}
|
3041 |
+
|
3042 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3043 |
+
/**
|
3044 |
+
* @see _.uniq
|
3045 |
+
*/
|
3046 |
+
uniq<TSort>(
|
3047 |
+
isSorted?: boolean,
|
3048 |
+
iteratee?: ListIterator<T, TSort>,
|
3049 |
+
thisArg?: any
|
3050 |
+
): LoDashImplicitArrayWrapper<T>;
|
3051 |
+
|
3052 |
+
/**
|
3053 |
+
* @see _.uniq
|
3054 |
+
*/
|
3055 |
+
uniq<TSort>(
|
3056 |
+
iteratee?: ListIterator<T, TSort>,
|
3057 |
+
thisArg?: any
|
3058 |
+
): LoDashImplicitArrayWrapper<T>;
|
3059 |
+
|
3060 |
+
/**
|
3061 |
+
* @see _.uniq
|
3062 |
+
*/
|
3063 |
+
uniq(
|
3064 |
+
isSorted?: boolean,
|
3065 |
+
iteratee?: string,
|
3066 |
+
thisArg?: any
|
3067 |
+
): LoDashImplicitArrayWrapper<T>;
|
3068 |
+
|
3069 |
+
/**
|
3070 |
+
* @see _.uniq
|
3071 |
+
*/
|
3072 |
+
uniq(
|
3073 |
+
iteratee?: string,
|
3074 |
+
thisArg?: any
|
3075 |
+
): LoDashImplicitArrayWrapper<T>;
|
3076 |
+
|
3077 |
+
/**
|
3078 |
+
* @see _.uniq
|
3079 |
+
*/
|
3080 |
+
uniq<TWhere extends {}>(
|
3081 |
+
isSorted?: boolean,
|
3082 |
+
iteratee?: TWhere
|
3083 |
+
): LoDashImplicitArrayWrapper<T>;
|
3084 |
+
|
3085 |
+
/**
|
3086 |
+
* @see _.uniq
|
3087 |
+
*/
|
3088 |
+
uniq<TWhere extends {}>(
|
3089 |
+
iteratee?: TWhere
|
3090 |
+
): LoDashImplicitArrayWrapper<T>;
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3094 |
+
uniq<T>(
|
3095 |
+
isSorted?: boolean,
|
3096 |
+
iteratee?: ListIterator<T, any>,
|
3097 |
+
thisArg?: any
|
3098 |
+
): LoDashImplicitArrayWrapper<T>;
|
3099 |
+
|
3100 |
+
/**
|
3101 |
+
* @see _.uniq
|
3102 |
+
*/
|
3103 |
+
uniq<T, TSort>(
|
3104 |
+
isSorted?: boolean,
|
3105 |
+
iteratee?: ListIterator<T, TSort>,
|
3106 |
+
thisArg?: any
|
3107 |
+
): LoDashImplicitArrayWrapper<T>;
|
3108 |
+
|
3109 |
+
/**
|
3110 |
+
* @see _.uniq
|
3111 |
+
*/
|
3112 |
+
uniq<T>(
|
3113 |
+
iteratee?: ListIterator<T, any>,
|
3114 |
+
thisArg?: any
|
3115 |
+
): LoDashImplicitArrayWrapper<T>;
|
3116 |
+
|
3117 |
+
/**
|
3118 |
+
* @see _.uniq
|
3119 |
+
*/
|
3120 |
+
uniq<T, TSort>(
|
3121 |
+
iteratee?: ListIterator<T, TSort>,
|
3122 |
+
thisArg?: any
|
3123 |
+
): LoDashImplicitArrayWrapper<T>;
|
3124 |
+
|
3125 |
+
/**
|
3126 |
+
* @see _.uniq
|
3127 |
+
*/
|
3128 |
+
uniq<T>(
|
3129 |
+
isSorted?: boolean,
|
3130 |
+
iteratee?: string,
|
3131 |
+
thisArg?: any
|
3132 |
+
): LoDashImplicitArrayWrapper<T>;
|
3133 |
+
|
3134 |
+
/**
|
3135 |
+
* @see _.uniq
|
3136 |
+
*/
|
3137 |
+
uniq<T>(
|
3138 |
+
iteratee?: string,
|
3139 |
+
thisArg?: any
|
3140 |
+
): LoDashImplicitArrayWrapper<T>;
|
3141 |
+
|
3142 |
+
/**
|
3143 |
+
* @see _.uniq
|
3144 |
+
*/
|
3145 |
+
uniq<T>(
|
3146 |
+
isSorted?: boolean,
|
3147 |
+
iteratee?: Object
|
3148 |
+
): LoDashImplicitArrayWrapper<T>;
|
3149 |
+
|
3150 |
+
/**
|
3151 |
+
* @see _.uniq
|
3152 |
+
*/
|
3153 |
+
uniq<TWhere extends {}, T>(
|
3154 |
+
isSorted?: boolean,
|
3155 |
+
iteratee?: TWhere
|
3156 |
+
): LoDashImplicitArrayWrapper<T>;
|
3157 |
+
|
3158 |
+
/**
|
3159 |
+
* @see _.uniq
|
3160 |
+
*/
|
3161 |
+
uniq<T>(
|
3162 |
+
iteratee?: Object
|
3163 |
+
): LoDashImplicitArrayWrapper<T>;
|
3164 |
+
|
3165 |
+
/**
|
3166 |
+
* @see _.uniq
|
3167 |
+
*/
|
3168 |
+
uniq<TWhere extends {}, T>(
|
3169 |
+
iteratee?: TWhere
|
3170 |
+
): LoDashImplicitArrayWrapper<T>;
|
3171 |
+
}
|
3172 |
+
|
3173 |
+
interface LoDashExplicitWrapper<T> {
|
3174 |
+
/**
|
3175 |
+
* @see _.uniq
|
3176 |
+
*/
|
3177 |
+
uniq<TSort>(
|
3178 |
+
isSorted?: boolean,
|
3179 |
+
iteratee?: ListIterator<T, TSort>,
|
3180 |
+
thisArg?: any
|
3181 |
+
): LoDashExplicitArrayWrapper<T>;
|
3182 |
+
|
3183 |
+
/**
|
3184 |
+
* @see _.uniq
|
3185 |
+
*/
|
3186 |
+
uniq<TSort>(
|
3187 |
+
iteratee?: ListIterator<T, TSort>,
|
3188 |
+
thisArg?: any
|
3189 |
+
): LoDashExplicitArrayWrapper<T>;
|
3190 |
+
}
|
3191 |
+
|
3192 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3193 |
+
/**
|
3194 |
+
* @see _.uniq
|
3195 |
+
*/
|
3196 |
+
uniq<TSort>(
|
3197 |
+
isSorted?: boolean,
|
3198 |
+
iteratee?: ListIterator<T, TSort>,
|
3199 |
+
thisArg?: any
|
3200 |
+
): LoDashExplicitArrayWrapper<T>;
|
3201 |
+
|
3202 |
+
/**
|
3203 |
+
* @see _.uniq
|
3204 |
+
*/
|
3205 |
+
uniq<TSort>(
|
3206 |
+
iteratee?: ListIterator<T, TSort>,
|
3207 |
+
thisArg?: any
|
3208 |
+
): LoDashExplicitArrayWrapper<T>;
|
3209 |
+
|
3210 |
+
/**
|
3211 |
+
* @see _.uniq
|
3212 |
+
*/
|
3213 |
+
uniq(
|
3214 |
+
isSorted?: boolean,
|
3215 |
+
iteratee?: string,
|
3216 |
+
thisArg?: any
|
3217 |
+
): LoDashExplicitArrayWrapper<T>;
|
3218 |
+
|
3219 |
+
/**
|
3220 |
+
* @see _.uniq
|
3221 |
+
*/
|
3222 |
+
uniq(
|
3223 |
+
iteratee?: string,
|
3224 |
+
thisArg?: any
|
3225 |
+
): LoDashExplicitArrayWrapper<T>;
|
3226 |
+
|
3227 |
+
/**
|
3228 |
+
* @see _.uniq
|
3229 |
+
*/
|
3230 |
+
uniq<TWhere extends {}>(
|
3231 |
+
isSorted?: boolean,
|
3232 |
+
iteratee?: TWhere
|
3233 |
+
): LoDashExplicitArrayWrapper<T>;
|
3234 |
+
|
3235 |
+
/**
|
3236 |
+
* @see _.uniq
|
3237 |
+
*/
|
3238 |
+
uniq<TWhere extends {}>(
|
3239 |
+
iteratee?: TWhere
|
3240 |
+
): LoDashExplicitArrayWrapper<T>;
|
3241 |
+
}
|
3242 |
+
|
3243 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3244 |
+
uniq<T>(
|
3245 |
+
isSorted?: boolean,
|
3246 |
+
iteratee?: ListIterator<T, any>,
|
3247 |
+
thisArg?: any
|
3248 |
+
): LoDashExplicitArrayWrapper<T>;
|
3249 |
+
|
3250 |
+
/**
|
3251 |
+
* @see _.uniq
|
3252 |
+
*/
|
3253 |
+
uniq<T, TSort>(
|
3254 |
+
isSorted?: boolean,
|
3255 |
+
iteratee?: ListIterator<T, TSort>,
|
3256 |
+
thisArg?: any
|
3257 |
+
): LoDashExplicitArrayWrapper<T>;
|
3258 |
+
|
3259 |
+
/**
|
3260 |
+
* @see _.uniq
|
3261 |
+
*/
|
3262 |
+
uniq<T>(
|
3263 |
+
iteratee?: ListIterator<T, any>,
|
3264 |
+
thisArg?: any
|
3265 |
+
): LoDashExplicitArrayWrapper<T>;
|
3266 |
+
|
3267 |
+
/**
|
3268 |
+
* @see _.uniq
|
3269 |
+
*/
|
3270 |
+
uniq<T, TSort>(
|
3271 |
+
iteratee?: ListIterator<T, TSort>,
|
3272 |
+
thisArg?: any
|
3273 |
+
): LoDashExplicitArrayWrapper<T>;
|
3274 |
+
|
3275 |
+
/**
|
3276 |
+
* @see _.uniq
|
3277 |
+
*/
|
3278 |
+
uniq<T>(
|
3279 |
+
isSorted?: boolean,
|
3280 |
+
iteratee?: string,
|
3281 |
+
thisArg?: any
|
3282 |
+
): LoDashExplicitArrayWrapper<T>;
|
3283 |
+
|
3284 |
+
/**
|
3285 |
+
* @see _.uniq
|
3286 |
+
*/
|
3287 |
+
uniq<T>(
|
3288 |
+
iteratee?: string,
|
3289 |
+
thisArg?: any
|
3290 |
+
): LoDashExplicitArrayWrapper<T>;
|
3291 |
+
|
3292 |
+
/**
|
3293 |
+
* @see _.uniq
|
3294 |
+
*/
|
3295 |
+
uniq<T>(
|
3296 |
+
isSorted?: boolean,
|
3297 |
+
iteratee?: Object
|
3298 |
+
): LoDashExplicitArrayWrapper<T>;
|
3299 |
+
|
3300 |
+
/**
|
3301 |
+
* @see _.uniq
|
3302 |
+
*/
|
3303 |
+
uniq<TWhere extends {}, T>(
|
3304 |
+
isSorted?: boolean,
|
3305 |
+
iteratee?: TWhere
|
3306 |
+
): LoDashExplicitArrayWrapper<T>;
|
3307 |
+
|
3308 |
+
/**
|
3309 |
+
* @see _.uniq
|
3310 |
+
*/
|
3311 |
+
uniq<T>(
|
3312 |
+
iteratee?: Object
|
3313 |
+
): LoDashExplicitArrayWrapper<T>;
|
3314 |
+
|
3315 |
+
/**
|
3316 |
+
* @see _.uniq
|
3317 |
+
*/
|
3318 |
+
uniq<TWhere extends {}, T>(
|
3319 |
+
iteratee?: TWhere
|
3320 |
+
): LoDashExplicitArrayWrapper<T>;
|
3321 |
+
}
|
3322 |
+
|
3323 |
+
//_.unique
|
3324 |
+
interface LoDashStatic {
|
3325 |
+
/**
|
3326 |
+
* @see _.uniq
|
3327 |
+
*/
|
3328 |
+
unique<T>(
|
3329 |
+
array: List<T>,
|
3330 |
+
isSorted?: boolean,
|
3331 |
+
iteratee?: ListIterator<T, any>,
|
3332 |
+
thisArg?: any
|
3333 |
+
): T[];
|
3334 |
+
|
3335 |
+
/**
|
3336 |
+
* @see _.uniq
|
3337 |
+
*/
|
3338 |
+
unique<T, TSort>(
|
3339 |
+
array: List<T>,
|
3340 |
+
isSorted?: boolean,
|
3341 |
+
iteratee?: ListIterator<T, TSort>,
|
3342 |
+
thisArg?: any
|
3343 |
+
): T[];
|
3344 |
+
|
3345 |
+
/**
|
3346 |
+
* @see _.uniq
|
3347 |
+
*/
|
3348 |
+
unique<T>(
|
3349 |
+
array: List<T>,
|
3350 |
+
iteratee?: ListIterator<T, any>,
|
3351 |
+
thisArg?: any
|
3352 |
+
): T[];
|
3353 |
+
|
3354 |
+
/**
|
3355 |
+
* @see _.uniq
|
3356 |
+
*/
|
3357 |
+
unique<T, TSort>(
|
3358 |
+
array: List<T>,
|
3359 |
+
iteratee?: ListIterator<T, TSort>,
|
3360 |
+
thisArg?: any
|
3361 |
+
): T[];
|
3362 |
+
|
3363 |
+
/**
|
3364 |
+
* @see _.uniq
|
3365 |
+
*/
|
3366 |
+
unique<T>(
|
3367 |
+
array: List<T>,
|
3368 |
+
isSorted?: boolean,
|
3369 |
+
iteratee?: string,
|
3370 |
+
thisArg?: any
|
3371 |
+
): T[];
|
3372 |
+
|
3373 |
+
/**
|
3374 |
+
* @see _.uniq
|
3375 |
+
*/
|
3376 |
+
unique<T>(
|
3377 |
+
array: List<T>,
|
3378 |
+
iteratee?: string,
|
3379 |
+
thisArg?: any
|
3380 |
+
): T[];
|
3381 |
+
|
3382 |
+
/**
|
3383 |
+
* @see _.uniq
|
3384 |
+
*/
|
3385 |
+
unique<T>(
|
3386 |
+
array: List<T>,
|
3387 |
+
isSorted?: boolean,
|
3388 |
+
iteratee?: Object
|
3389 |
+
): T[];
|
3390 |
+
|
3391 |
+
/**
|
3392 |
+
* @see _.uniq
|
3393 |
+
*/
|
3394 |
+
unique<TWhere extends {}, T>(
|
3395 |
+
array: List<T>,
|
3396 |
+
isSorted?: boolean,
|
3397 |
+
iteratee?: TWhere
|
3398 |
+
): T[];
|
3399 |
+
|
3400 |
+
/**
|
3401 |
+
* @see _.uniq
|
3402 |
+
*/
|
3403 |
+
unique<T>(
|
3404 |
+
array: List<T>,
|
3405 |
+
iteratee?: Object
|
3406 |
+
): T[];
|
3407 |
+
|
3408 |
+
/**
|
3409 |
+
* @see _.uniq
|
3410 |
+
*/
|
3411 |
+
unique<TWhere extends {}, T>(
|
3412 |
+
array: List<T>,
|
3413 |
+
iteratee?: TWhere
|
3414 |
+
): T[];
|
3415 |
+
}
|
3416 |
+
|
3417 |
+
interface LoDashImplicitWrapper<T> {
|
3418 |
+
/**
|
3419 |
+
* @see _.uniq
|
3420 |
+
*/
|
3421 |
+
unique<TSort>(
|
3422 |
+
isSorted?: boolean,
|
3423 |
+
iteratee?: ListIterator<T, TSort>,
|
3424 |
+
thisArg?: any
|
3425 |
+
): LoDashImplicitArrayWrapper<T>;
|
3426 |
+
|
3427 |
+
/**
|
3428 |
+
* @see _.uniq
|
3429 |
+
*/
|
3430 |
+
unique<TSort>(
|
3431 |
+
iteratee?: ListIterator<T, TSort>,
|
3432 |
+
thisArg?: any
|
3433 |
+
): LoDashImplicitArrayWrapper<T>;
|
3434 |
+
}
|
3435 |
+
|
3436 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3437 |
+
/**
|
3438 |
+
* @see _.uniq
|
3439 |
+
*/
|
3440 |
+
unique<TSort>(
|
3441 |
+
isSorted?: boolean,
|
3442 |
+
iteratee?: ListIterator<T, TSort>,
|
3443 |
+
thisArg?: any
|
3444 |
+
): LoDashImplicitArrayWrapper<T>;
|
3445 |
+
|
3446 |
+
/**
|
3447 |
+
* @see _.uniq
|
3448 |
+
*/
|
3449 |
+
unique<TSort>(
|
3450 |
+
iteratee?: ListIterator<T, TSort>,
|
3451 |
+
thisArg?: any
|
3452 |
+
): LoDashImplicitArrayWrapper<T>;
|
3453 |
+
|
3454 |
+
/**
|
3455 |
+
* @see _.uniq
|
3456 |
+
*/
|
3457 |
+
unique(
|
3458 |
+
isSorted?: boolean,
|
3459 |
+
iteratee?: string,
|
3460 |
+
thisArg?: any
|
3461 |
+
): LoDashImplicitArrayWrapper<T>;
|
3462 |
+
|
3463 |
+
/**
|
3464 |
+
* @see _.uniq
|
3465 |
+
*/
|
3466 |
+
unique(
|
3467 |
+
iteratee?: string,
|
3468 |
+
thisArg?: any
|
3469 |
+
): LoDashImplicitArrayWrapper<T>;
|
3470 |
+
|
3471 |
+
/**
|
3472 |
+
* @see _.uniq
|
3473 |
+
*/
|
3474 |
+
unique<TWhere extends {}>(
|
3475 |
+
isSorted?: boolean,
|
3476 |
+
iteratee?: TWhere
|
3477 |
+
): LoDashImplicitArrayWrapper<T>;
|
3478 |
+
|
3479 |
+
/**
|
3480 |
+
* @see _.uniq
|
3481 |
+
*/
|
3482 |
+
unique<TWhere extends {}>(
|
3483 |
+
iteratee?: TWhere
|
3484 |
+
): LoDashImplicitArrayWrapper<T>;
|
3485 |
+
}
|
3486 |
+
|
3487 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3488 |
+
unique<T>(
|
3489 |
+
isSorted?: boolean,
|
3490 |
+
iteratee?: ListIterator<T, any>,
|
3491 |
+
thisArg?: any
|
3492 |
+
): LoDashImplicitArrayWrapper<T>;
|
3493 |
+
|
3494 |
+
/**
|
3495 |
+
* @see _.uniq
|
3496 |
+
*/
|
3497 |
+
unique<T, TSort>(
|
3498 |
+
isSorted?: boolean,
|
3499 |
+
iteratee?: ListIterator<T, TSort>,
|
3500 |
+
thisArg?: any
|
3501 |
+
): LoDashImplicitArrayWrapper<T>;
|
3502 |
+
|
3503 |
+
/**
|
3504 |
+
* @see _.uniq
|
3505 |
+
*/
|
3506 |
+
unique<T>(
|
3507 |
+
iteratee?: ListIterator<T, any>,
|
3508 |
+
thisArg?: any
|
3509 |
+
): LoDashImplicitArrayWrapper<T>;
|
3510 |
+
|
3511 |
+
/**
|
3512 |
+
* @see _.uniq
|
3513 |
+
*/
|
3514 |
+
unique<T, TSort>(
|
3515 |
+
iteratee?: ListIterator<T, TSort>,
|
3516 |
+
thisArg?: any
|
3517 |
+
): LoDashImplicitArrayWrapper<T>;
|
3518 |
+
|
3519 |
+
/**
|
3520 |
+
* @see _.uniq
|
3521 |
+
*/
|
3522 |
+
unique<T>(
|
3523 |
+
isSorted?: boolean,
|
3524 |
+
iteratee?: string,
|
3525 |
+
thisArg?: any
|
3526 |
+
): LoDashImplicitArrayWrapper<T>;
|
3527 |
+
|
3528 |
+
/**
|
3529 |
+
* @see _.uniq
|
3530 |
+
*/
|
3531 |
+
unique<T>(
|
3532 |
+
iteratee?: string,
|
3533 |
+
thisArg?: any
|
3534 |
+
): LoDashImplicitArrayWrapper<T>;
|
3535 |
+
|
3536 |
+
/**
|
3537 |
+
* @see _.uniq
|
3538 |
+
*/
|
3539 |
+
unique<T>(
|
3540 |
+
isSorted?: boolean,
|
3541 |
+
iteratee?: Object
|
3542 |
+
): LoDashImplicitArrayWrapper<T>;
|
3543 |
+
|
3544 |
+
/**
|
3545 |
+
* @see _.uniq
|
3546 |
+
*/
|
3547 |
+
unique<TWhere extends {}, T>(
|
3548 |
+
isSorted?: boolean,
|
3549 |
+
iteratee?: TWhere
|
3550 |
+
): LoDashImplicitArrayWrapper<T>;
|
3551 |
+
|
3552 |
+
/**
|
3553 |
+
* @see _.uniq
|
3554 |
+
*/
|
3555 |
+
unique<T>(
|
3556 |
+
iteratee?: Object
|
3557 |
+
): LoDashImplicitArrayWrapper<T>;
|
3558 |
+
|
3559 |
+
/**
|
3560 |
+
* @see _.uniq
|
3561 |
+
*/
|
3562 |
+
unique<TWhere extends {}, T>(
|
3563 |
+
iteratee?: TWhere
|
3564 |
+
): LoDashImplicitArrayWrapper<T>;
|
3565 |
+
}
|
3566 |
+
|
3567 |
+
interface LoDashExplicitWrapper<T> {
|
3568 |
+
/**
|
3569 |
+
* @see _.uniq
|
3570 |
+
*/
|
3571 |
+
unique<TSort>(
|
3572 |
+
isSorted?: boolean,
|
3573 |
+
iteratee?: ListIterator<T, TSort>,
|
3574 |
+
thisArg?: any
|
3575 |
+
): LoDashExplicitArrayWrapper<T>;
|
3576 |
+
|
3577 |
+
/**
|
3578 |
+
* @see _.uniq
|
3579 |
+
*/
|
3580 |
+
unique<TSort>(
|
3581 |
+
iteratee?: ListIterator<T, TSort>,
|
3582 |
+
thisArg?: any
|
3583 |
+
): LoDashExplicitArrayWrapper<T>;
|
3584 |
+
}
|
3585 |
+
|
3586 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3587 |
+
/**
|
3588 |
+
* @see _.uniq
|
3589 |
+
*/
|
3590 |
+
unique<TSort>(
|
3591 |
+
isSorted?: boolean,
|
3592 |
+
iteratee?: ListIterator<T, TSort>,
|
3593 |
+
thisArg?: any
|
3594 |
+
): LoDashExplicitArrayWrapper<T>;
|
3595 |
+
|
3596 |
+
/**
|
3597 |
+
* @see _.uniq
|
3598 |
+
*/
|
3599 |
+
unique<TSort>(
|
3600 |
+
iteratee?: ListIterator<T, TSort>,
|
3601 |
+
thisArg?: any
|
3602 |
+
): LoDashExplicitArrayWrapper<T>;
|
3603 |
+
|
3604 |
+
/**
|
3605 |
+
* @see _.uniq
|
3606 |
+
*/
|
3607 |
+
unique(
|
3608 |
+
isSorted?: boolean,
|
3609 |
+
iteratee?: string,
|
3610 |
+
thisArg?: any
|
3611 |
+
): LoDashExplicitArrayWrapper<T>;
|
3612 |
+
|
3613 |
+
/**
|
3614 |
+
* @see _.uniq
|
3615 |
+
*/
|
3616 |
+
unique(
|
3617 |
+
iteratee?: string,
|
3618 |
+
thisArg?: any
|
3619 |
+
): LoDashExplicitArrayWrapper<T>;
|
3620 |
+
|
3621 |
+
/**
|
3622 |
+
* @see _.uniq
|
3623 |
+
*/
|
3624 |
+
unique<TWhere extends {}>(
|
3625 |
+
isSorted?: boolean,
|
3626 |
+
iteratee?: TWhere
|
3627 |
+
): LoDashExplicitArrayWrapper<T>;
|
3628 |
+
|
3629 |
+
/**
|
3630 |
+
* @see _.uniq
|
3631 |
+
*/
|
3632 |
+
unique<TWhere extends {}>(
|
3633 |
+
iteratee?: TWhere
|
3634 |
+
): LoDashExplicitArrayWrapper<T>;
|
3635 |
+
}
|
3636 |
+
|
3637 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3638 |
+
unique<T>(
|
3639 |
+
isSorted?: boolean,
|
3640 |
+
iteratee?: ListIterator<T, any>,
|
3641 |
+
thisArg?: any
|
3642 |
+
): LoDashExplicitArrayWrapper<T>;
|
3643 |
+
|
3644 |
+
/**
|
3645 |
+
* @see _.uniq
|
3646 |
+
*/
|
3647 |
+
unique<T, TSort>(
|
3648 |
+
isSorted?: boolean,
|
3649 |
+
iteratee?: ListIterator<T, TSort>,
|
3650 |
+
thisArg?: any
|
3651 |
+
): LoDashExplicitArrayWrapper<T>;
|
3652 |
+
|
3653 |
+
/**
|
3654 |
+
* @see _.uniq
|
3655 |
+
*/
|
3656 |
+
unique<T>(
|
3657 |
+
iteratee?: ListIterator<T, any>,
|
3658 |
+
thisArg?: any
|
3659 |
+
): LoDashExplicitArrayWrapper<T>;
|
3660 |
+
|
3661 |
+
/**
|
3662 |
+
* @see _.uniq
|
3663 |
+
*/
|
3664 |
+
unique<T, TSort>(
|
3665 |
+
iteratee?: ListIterator<T, TSort>,
|
3666 |
+
thisArg?: any
|
3667 |
+
): LoDashExplicitArrayWrapper<T>;
|
3668 |
+
|
3669 |
+
/**
|
3670 |
+
* @see _.uniq
|
3671 |
+
*/
|
3672 |
+
unique<T>(
|
3673 |
+
isSorted?: boolean,
|
3674 |
+
iteratee?: string,
|
3675 |
+
thisArg?: any
|
3676 |
+
): LoDashExplicitArrayWrapper<T>;
|
3677 |
+
|
3678 |
+
/**
|
3679 |
+
* @see _.uniq
|
3680 |
+
*/
|
3681 |
+
unique<T>(
|
3682 |
+
iteratee?: string,
|
3683 |
+
thisArg?: any
|
3684 |
+
): LoDashExplicitArrayWrapper<T>;
|
3685 |
+
|
3686 |
+
/**
|
3687 |
+
* @see _.uniq
|
3688 |
+
*/
|
3689 |
+
unique<T>(
|
3690 |
+
isSorted?: boolean,
|
3691 |
+
iteratee?: Object
|
3692 |
+
): LoDashExplicitArrayWrapper<T>;
|
3693 |
+
|
3694 |
+
/**
|
3695 |
+
* @see _.uniq
|
3696 |
+
*/
|
3697 |
+
unique<TWhere extends {}, T>(
|
3698 |
+
isSorted?: boolean,
|
3699 |
+
iteratee?: TWhere
|
3700 |
+
): LoDashExplicitArrayWrapper<T>;
|
3701 |
+
|
3702 |
+
/**
|
3703 |
+
* @see _.uniq
|
3704 |
+
*/
|
3705 |
+
unique<T>(
|
3706 |
+
iteratee?: Object
|
3707 |
+
): LoDashExplicitArrayWrapper<T>;
|
3708 |
+
|
3709 |
+
/**
|
3710 |
+
* @see _.uniq
|
3711 |
+
*/
|
3712 |
+
unique<TWhere extends {}, T>(
|
3713 |
+
iteratee?: TWhere
|
3714 |
+
): LoDashExplicitArrayWrapper<T>;
|
3715 |
+
}
|
3716 |
+
|
3717 |
+
//_.unzip
|
3718 |
+
interface LoDashStatic {
|
3719 |
+
/**
|
3720 |
+
* This method is like _.zip except that it accepts an array of grouped elements and creates an array
|
3721 |
+
* regrouping the elements to their pre-zip configuration.
|
3722 |
+
*
|
3723 |
+
* @param array The array of grouped elements to process.
|
3724 |
+
* @return Returns the new array of regrouped elements.
|
3725 |
+
*/
|
3726 |
+
unzip<T>(array: List<List<T>>): T[][];
|
3727 |
+
}
|
3728 |
+
|
3729 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3730 |
+
/**
|
3731 |
+
* @see _.unzip
|
3732 |
+
*/
|
3733 |
+
unzip<T>(): LoDashImplicitArrayWrapper<T[]>;
|
3734 |
+
}
|
3735 |
+
|
3736 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3737 |
+
/**
|
3738 |
+
* @see _.unzip
|
3739 |
+
*/
|
3740 |
+
unzip<T>(): LoDashImplicitArrayWrapper<T[]>;
|
3741 |
+
}
|
3742 |
+
|
3743 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3744 |
+
/**
|
3745 |
+
* @see _.unzip
|
3746 |
+
*/
|
3747 |
+
unzip<T>(): LoDashExplicitArrayWrapper<T[]>;
|
3748 |
+
}
|
3749 |
+
|
3750 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3751 |
+
/**
|
3752 |
+
* @see _.unzip
|
3753 |
+
*/
|
3754 |
+
unzip<T>(): LoDashExplicitArrayWrapper<T[]>;
|
3755 |
+
}
|
3756 |
+
|
3757 |
+
//_.unzipWith
|
3758 |
+
interface LoDashStatic {
|
3759 |
+
/**
|
3760 |
+
* This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be
|
3761 |
+
* combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
|
3762 |
+
* group).
|
3763 |
+
*
|
3764 |
+
* @param array The array of grouped elements to process.
|
3765 |
+
* @param iteratee The function to combine regrouped values.
|
3766 |
+
* @param thisArg The this binding of iteratee.
|
3767 |
+
* @return Returns the new array of regrouped elements.
|
3768 |
+
*/
|
3769 |
+
unzipWith<TArray, TResult>(
|
3770 |
+
array: List<List<TArray>>,
|
3771 |
+
iteratee?: MemoIterator<TArray, TResult>,
|
3772 |
+
thisArg?: any
|
3773 |
+
): TResult[];
|
3774 |
+
}
|
3775 |
+
|
3776 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3777 |
+
/**
|
3778 |
+
* @see _.unzipWith
|
3779 |
+
*/
|
3780 |
+
unzipWith<TArr, TResult>(
|
3781 |
+
iteratee?: MemoIterator<TArr, TResult>,
|
3782 |
+
thisArg?: any
|
3783 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
3784 |
+
}
|
3785 |
+
|
3786 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3787 |
+
/**
|
3788 |
+
* @see _.unzipWith
|
3789 |
+
*/
|
3790 |
+
unzipWith<TArr, TResult>(
|
3791 |
+
iteratee?: MemoIterator<TArr, TResult>,
|
3792 |
+
thisArg?: any
|
3793 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
3794 |
+
}
|
3795 |
+
|
3796 |
+
//_.without
|
3797 |
+
interface LoDashStatic {
|
3798 |
+
/**
|
3799 |
+
* Creates an array excluding all provided values using SameValueZero for equality comparisons.
|
3800 |
+
*
|
3801 |
+
* @param array The array to filter.
|
3802 |
+
* @param values The values to exclude.
|
3803 |
+
* @return Returns the new array of filtered values.
|
3804 |
+
*/
|
3805 |
+
without<T>(
|
3806 |
+
array: List<T>,
|
3807 |
+
...values: T[]
|
3808 |
+
): T[];
|
3809 |
+
}
|
3810 |
+
|
3811 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3812 |
+
/**
|
3813 |
+
* @see _.without
|
3814 |
+
*/
|
3815 |
+
without(...values: T[]): LoDashImplicitArrayWrapper<T>;
|
3816 |
+
}
|
3817 |
+
|
3818 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3819 |
+
/**
|
3820 |
+
* @see _.without
|
3821 |
+
*/
|
3822 |
+
without<T>(...values: T[]): LoDashImplicitArrayWrapper<T>;
|
3823 |
+
}
|
3824 |
+
|
3825 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3826 |
+
/**
|
3827 |
+
* @see _.without
|
3828 |
+
*/
|
3829 |
+
without(...values: T[]): LoDashExplicitArrayWrapper<T>;
|
3830 |
+
}
|
3831 |
+
|
3832 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3833 |
+
/**
|
3834 |
+
* @see _.without
|
3835 |
+
*/
|
3836 |
+
without<T>(...values: T[]): LoDashExplicitArrayWrapper<T>;
|
3837 |
+
}
|
3838 |
+
|
3839 |
+
//_.xor
|
3840 |
+
interface LoDashStatic {
|
3841 |
+
/**
|
3842 |
+
* Creates an array of unique values that is the symmetric difference of the provided arrays.
|
3843 |
+
*
|
3844 |
+
* @param arrays The arrays to inspect.
|
3845 |
+
* @return Returns the new array of values.
|
3846 |
+
*/
|
3847 |
+
xor<T>(...arrays: List<T>[]): T[];
|
3848 |
+
}
|
3849 |
+
|
3850 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3851 |
+
/**
|
3852 |
+
* @see _.xor
|
3853 |
+
*/
|
3854 |
+
xor(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
|
3855 |
+
}
|
3856 |
+
|
3857 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3858 |
+
/**
|
3859 |
+
* @see _.xor
|
3860 |
+
*/
|
3861 |
+
xor<T>(...arrays: List<T>[]): LoDashImplicitArrayWrapper<T>;
|
3862 |
+
}
|
3863 |
+
|
3864 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3865 |
+
/**
|
3866 |
+
* @see _.xor
|
3867 |
+
*/
|
3868 |
+
xor(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
3869 |
+
}
|
3870 |
+
|
3871 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3872 |
+
/**
|
3873 |
+
* @see _.xor
|
3874 |
+
*/
|
3875 |
+
xor<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
3876 |
+
}
|
3877 |
+
|
3878 |
+
//_.zip
|
3879 |
+
interface LoDashStatic {
|
3880 |
+
/**
|
3881 |
+
* Creates an array of grouped elements, the first of which contains the first elements of the given arrays,
|
3882 |
+
* the second of which contains the second elements of the given arrays, and so on.
|
3883 |
+
*
|
3884 |
+
* @param arrays The arrays to process.
|
3885 |
+
* @return Returns the new array of grouped elements.
|
3886 |
+
*/
|
3887 |
+
zip<T>(...arrays: List<T>[]): T[][];
|
3888 |
+
}
|
3889 |
+
|
3890 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3891 |
+
/**
|
3892 |
+
* @see _.zip
|
3893 |
+
*/
|
3894 |
+
zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
|
3895 |
+
}
|
3896 |
+
|
3897 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3898 |
+
/**
|
3899 |
+
* @see _.zip
|
3900 |
+
*/
|
3901 |
+
zip<T>(...arrays: List<T>[]): _.LoDashImplicitArrayWrapper<T[]>;
|
3902 |
+
}
|
3903 |
+
|
3904 |
+
interface LoDashExplicitArrayWrapper<T> {
|
3905 |
+
/**
|
3906 |
+
* @see _.zip
|
3907 |
+
*/
|
3908 |
+
zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
|
3909 |
+
}
|
3910 |
+
|
3911 |
+
interface LoDashExplicitObjectWrapper<T> {
|
3912 |
+
/**
|
3913 |
+
* @see _.zip
|
3914 |
+
*/
|
3915 |
+
zip<T>(...arrays: List<T>[]): _.LoDashExplicitArrayWrapper<T[]>;
|
3916 |
+
}
|
3917 |
+
|
3918 |
+
//_.zipObject
|
3919 |
+
interface LoDashStatic {
|
3920 |
+
/**
|
3921 |
+
* The inverse of _.pairs; this method returns an object composed from arrays of property names and values.
|
3922 |
+
* Provide either a single two dimensional array, e.g. [[key1, value1], [key2, value2]] or two arrays, one of
|
3923 |
+
* property names and one of corresponding values.
|
3924 |
+
*
|
3925 |
+
* @alias _.object
|
3926 |
+
*
|
3927 |
+
* @param props The property names.
|
3928 |
+
* @param values The property values.
|
3929 |
+
* @return Returns the new object.
|
3930 |
+
*/
|
3931 |
+
zipObject<TValues, TResult extends {}>(
|
3932 |
+
props: List<StringRepresentable>|List<List<any>>,
|
3933 |
+
values?: List<TValues>
|
3934 |
+
): TResult;
|
3935 |
+
|
3936 |
+
/**
|
3937 |
+
* @see _.zipObject
|
3938 |
+
*/
|
3939 |
+
zipObject<TResult extends {}>(
|
3940 |
+
props: List<StringRepresentable>|List<List<any>>,
|
3941 |
+
values?: List<any>
|
3942 |
+
): TResult;
|
3943 |
+
|
3944 |
+
/**
|
3945 |
+
* @see _.zipObject
|
3946 |
+
*/
|
3947 |
+
zipObject(
|
3948 |
+
props: List<StringRepresentable>|List<List<any>>,
|
3949 |
+
values?: List<any>
|
3950 |
+
): _.Dictionary<any>;
|
3951 |
+
}
|
3952 |
+
|
3953 |
+
interface LoDashImplicitArrayWrapper<T> {
|
3954 |
+
/**
|
3955 |
+
* @see _.zipObject
|
3956 |
+
*/
|
3957 |
+
zipObject<TValues, TResult extends {}>(
|
3958 |
+
values?: List<TValues>
|
3959 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
3960 |
+
|
3961 |
+
/**
|
3962 |
+
* @see _.zipObject
|
3963 |
+
*/
|
3964 |
+
zipObject<TResult extends {}>(
|
3965 |
+
values?: List<any>
|
3966 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
3967 |
+
|
3968 |
+
/**
|
3969 |
+
* @see _.zipObject
|
3970 |
+
*/
|
3971 |
+
zipObject(
|
3972 |
+
values?: List<any>
|
3973 |
+
): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
|
3974 |
+
}
|
3975 |
+
|
3976 |
+
interface LoDashImplicitObjectWrapper<T> {
|
3977 |
+
/**
|
3978 |
+
* @see _.zipObject
|
3979 |
+
*/
|
3980 |
+
zipObject<TValues, TResult extends {}>(
|
3981 |
+
values?: List<TValues>
|
3982 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
3983 |
+
|
3984 |
+
/**
|
3985 |
+
* @see _.zipObject
|
3986 |
+
*/
|
3987 |
+
zipObject<TResult extends {}>(
|
3988 |
+
values?: List<any>
|
3989 |
+
): _.LoDashImplicitObjectWrapper<TResult>;
|
3990 |
+
|
3991 |
+
/**
|
3992 |
+
* @see _.zipObject
|
3993 |
+
*/
|
3994 |
+
zipObject(
|
3995 |
+
values?: List<any>
|
3996 |
+
): _.LoDashImplicitObjectWrapper<_.Dictionary<any>>;
|
3997 |
+
}
|
3998 |
+
|
3999 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4000 |
+
/**
|
4001 |
+
* @see _.zipObject
|
4002 |
+
*/
|
4003 |
+
zipObject<TValues, TResult extends {}>(
|
4004 |
+
values?: List<TValues>
|
4005 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
4006 |
+
|
4007 |
+
/**
|
4008 |
+
* @see _.zipObject
|
4009 |
+
*/
|
4010 |
+
zipObject<TResult extends {}>(
|
4011 |
+
values?: List<any>
|
4012 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
4013 |
+
|
4014 |
+
/**
|
4015 |
+
* @see _.zipObject
|
4016 |
+
*/
|
4017 |
+
zipObject(
|
4018 |
+
values?: List<any>
|
4019 |
+
): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
|
4020 |
+
}
|
4021 |
+
|
4022 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4023 |
+
/**
|
4024 |
+
* @see _.zipObject
|
4025 |
+
*/
|
4026 |
+
zipObject<TValues, TResult extends {}>(
|
4027 |
+
values?: List<TValues>
|
4028 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
4029 |
+
|
4030 |
+
/**
|
4031 |
+
* @see _.zipObject
|
4032 |
+
*/
|
4033 |
+
zipObject<TResult extends {}>(
|
4034 |
+
values?: List<any>
|
4035 |
+
): _.LoDashExplicitObjectWrapper<TResult>;
|
4036 |
+
|
4037 |
+
/**
|
4038 |
+
* @see _.zipObject
|
4039 |
+
*/
|
4040 |
+
zipObject(
|
4041 |
+
values?: List<any>
|
4042 |
+
): _.LoDashExplicitObjectWrapper<_.Dictionary<any>>;
|
4043 |
+
}
|
4044 |
+
|
4045 |
+
//_.zipWith
|
4046 |
+
interface LoDashStatic {
|
4047 |
+
/**
|
4048 |
+
* This method is like _.zip except that it accepts an iteratee to specify how grouped values should be
|
4049 |
+
* combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index,
|
4050 |
+
* group).
|
4051 |
+
* @param {...Array} [arrays] The arrays to process.
|
4052 |
+
* @param {Function} [iteratee] The function to combine grouped values.
|
4053 |
+
* @param {*} [thisArg] The `this` binding of `iteratee`.
|
4054 |
+
* @return Returns the new array of grouped elements.
|
4055 |
+
*/
|
4056 |
+
zipWith<TResult>(...args: any[]): TResult[];
|
4057 |
+
}
|
4058 |
+
|
4059 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4060 |
+
/**
|
4061 |
+
* @see _.zipWith
|
4062 |
+
*/
|
4063 |
+
zipWith<TResult>(...args: any[]): LoDashImplicitArrayWrapper<TResult>;
|
4064 |
+
}
|
4065 |
+
|
4066 |
+
/*********
|
4067 |
+
* Chain *
|
4068 |
+
*********/
|
4069 |
+
|
4070 |
+
//_.chain
|
4071 |
+
interface LoDashStatic {
|
4072 |
+
/**
|
4073 |
+
* Creates a lodash object that wraps value with explicit method chaining enabled.
|
4074 |
+
*
|
4075 |
+
* @param value The value to wrap.
|
4076 |
+
* @return Returns the new lodash wrapper instance.
|
4077 |
+
*/
|
4078 |
+
chain(value: number): LoDashExplicitWrapper<number>;
|
4079 |
+
chain(value: string): LoDashExplicitWrapper<string>;
|
4080 |
+
chain(value: boolean): LoDashExplicitWrapper<boolean>;
|
4081 |
+
chain<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
|
4082 |
+
chain<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
|
4083 |
+
chain(value: any): LoDashExplicitWrapper<any>;
|
4084 |
+
}
|
4085 |
+
|
4086 |
+
interface LoDashImplicitWrapper<T> {
|
4087 |
+
/**
|
4088 |
+
* @see _.chain
|
4089 |
+
*/
|
4090 |
+
chain(): LoDashExplicitWrapper<T>;
|
4091 |
+
}
|
4092 |
+
|
4093 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4094 |
+
/**
|
4095 |
+
* @see _.chain
|
4096 |
+
*/
|
4097 |
+
chain(): LoDashExplicitArrayWrapper<T>;
|
4098 |
+
}
|
4099 |
+
|
4100 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4101 |
+
/**
|
4102 |
+
* @see _.chain
|
4103 |
+
*/
|
4104 |
+
chain(): LoDashExplicitObjectWrapper<T>;
|
4105 |
+
}
|
4106 |
+
|
4107 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4108 |
+
/**
|
4109 |
+
* @see _.chain
|
4110 |
+
*/
|
4111 |
+
chain(): TWrapper;
|
4112 |
+
}
|
4113 |
+
|
4114 |
+
//_.tap
|
4115 |
+
interface LoDashStatic {
|
4116 |
+
/**
|
4117 |
+
* This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one
|
4118 |
+
* argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations
|
4119 |
+
* on intermediate results within the chain.
|
4120 |
+
*
|
4121 |
+
* @param value The value to provide to interceptor.
|
4122 |
+
* @param interceptor The function to invoke.
|
4123 |
+
* @parem thisArg The this binding of interceptor.
|
4124 |
+
* @return Returns value.
|
4125 |
+
**/
|
4126 |
+
tap<T>(
|
4127 |
+
value: T,
|
4128 |
+
interceptor: (value: T) => void,
|
4129 |
+
thisArg?: any
|
4130 |
+
): T;
|
4131 |
+
}
|
4132 |
+
|
4133 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
4134 |
+
/**
|
4135 |
+
* @see _.tap
|
4136 |
+
*/
|
4137 |
+
tap(
|
4138 |
+
interceptor: (value: T) => void,
|
4139 |
+
thisArg?: any
|
4140 |
+
): TWrapper;
|
4141 |
+
}
|
4142 |
+
|
4143 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4144 |
+
/**
|
4145 |
+
* @see _.tap
|
4146 |
+
*/
|
4147 |
+
tap(
|
4148 |
+
interceptor: (value: T) => void,
|
4149 |
+
thisArg?: any
|
4150 |
+
): TWrapper;
|
4151 |
+
}
|
4152 |
+
|
4153 |
+
//_.thru
|
4154 |
+
interface LoDashStatic {
|
4155 |
+
/**
|
4156 |
+
* This method is like _.tap except that it returns the result of interceptor.
|
4157 |
+
*
|
4158 |
+
* @param value The value to provide to interceptor.
|
4159 |
+
* @param interceptor The function to invoke.
|
4160 |
+
* @param thisArg The this binding of interceptor.
|
4161 |
+
* @return Returns the result of interceptor.
|
4162 |
+
*/
|
4163 |
+
thru<T, TResult>(
|
4164 |
+
value: T,
|
4165 |
+
interceptor: (value: T) => TResult,
|
4166 |
+
thisArg?: any
|
4167 |
+
): TResult;
|
4168 |
+
}
|
4169 |
+
|
4170 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
4171 |
+
/**
|
4172 |
+
* @see _.thru
|
4173 |
+
*/
|
4174 |
+
thru<TResult extends number>(
|
4175 |
+
interceptor: (value: T) => TResult,
|
4176 |
+
thisArg?: any): LoDashImplicitWrapper<TResult>;
|
4177 |
+
|
4178 |
+
/**
|
4179 |
+
* @see _.thru
|
4180 |
+
*/
|
4181 |
+
thru<TResult extends string>(
|
4182 |
+
interceptor: (value: T) => TResult,
|
4183 |
+
thisArg?: any): LoDashImplicitWrapper<TResult>;
|
4184 |
+
|
4185 |
+
/**
|
4186 |
+
* @see _.thru
|
4187 |
+
*/
|
4188 |
+
thru<TResult extends boolean>(
|
4189 |
+
interceptor: (value: T) => TResult,
|
4190 |
+
thisArg?: any): LoDashImplicitWrapper<TResult>;
|
4191 |
+
|
4192 |
+
/**
|
4193 |
+
* @see _.thru
|
4194 |
+
*/
|
4195 |
+
thru<TResult extends {}>(
|
4196 |
+
interceptor: (value: T) => TResult,
|
4197 |
+
thisArg?: any): LoDashImplicitObjectWrapper<TResult>;
|
4198 |
+
|
4199 |
+
/**
|
4200 |
+
* @see _.thru
|
4201 |
+
*/
|
4202 |
+
thru<TResult>(
|
4203 |
+
interceptor: (value: T) => TResult[],
|
4204 |
+
thisArg?: any): LoDashImplicitArrayWrapper<TResult>;
|
4205 |
+
}
|
4206 |
+
|
4207 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4208 |
+
/**
|
4209 |
+
* @see _.thru
|
4210 |
+
*/
|
4211 |
+
thru<TResult extends number>(
|
4212 |
+
interceptor: (value: T) => TResult,
|
4213 |
+
thisArg?: any
|
4214 |
+
): LoDashExplicitWrapper<TResult>;
|
4215 |
+
|
4216 |
+
/**
|
4217 |
+
* @see _.thru
|
4218 |
+
*/
|
4219 |
+
thru<TResult extends string>(
|
4220 |
+
interceptor: (value: T) => TResult,
|
4221 |
+
thisArg?: any
|
4222 |
+
): LoDashExplicitWrapper<TResult>;
|
4223 |
+
|
4224 |
+
/**
|
4225 |
+
* @see _.thru
|
4226 |
+
*/
|
4227 |
+
thru<TResult extends boolean>(
|
4228 |
+
interceptor: (value: T) => TResult,
|
4229 |
+
thisArg?: any
|
4230 |
+
): LoDashExplicitWrapper<TResult>;
|
4231 |
+
|
4232 |
+
/**
|
4233 |
+
* @see _.thru
|
4234 |
+
*/
|
4235 |
+
thru<TResult extends {}>(
|
4236 |
+
interceptor: (value: T) => TResult,
|
4237 |
+
thisArg?: any
|
4238 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
4239 |
+
|
4240 |
+
/**
|
4241 |
+
* @see _.thru
|
4242 |
+
*/
|
4243 |
+
thru<TResult>(
|
4244 |
+
interceptor: (value: T) => TResult[],
|
4245 |
+
thisArg?: any
|
4246 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
4247 |
+
}
|
4248 |
+
|
4249 |
+
//_.prototype.commit
|
4250 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
4251 |
+
/**
|
4252 |
+
* Executes the chained sequence and returns the wrapped result.
|
4253 |
+
*
|
4254 |
+
* @return Returns the new lodash wrapper instance.
|
4255 |
+
*/
|
4256 |
+
commit(): TWrapper;
|
4257 |
+
}
|
4258 |
+
|
4259 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4260 |
+
/**
|
4261 |
+
* @see _.commit
|
4262 |
+
*/
|
4263 |
+
commit(): TWrapper;
|
4264 |
+
}
|
4265 |
+
|
4266 |
+
//_.prototype.concat
|
4267 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
4268 |
+
/**
|
4269 |
+
* Creates a new array joining a wrapped array with any additional arrays and/or values.
|
4270 |
+
*
|
4271 |
+
* @param items
|
4272 |
+
* @return Returns the new concatenated array.
|
4273 |
+
*/
|
4274 |
+
concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashImplicitArrayWrapper<TItem>;
|
4275 |
+
|
4276 |
+
/**
|
4277 |
+
* @see _.concat
|
4278 |
+
*/
|
4279 |
+
concat(...items: Array<T|Array<T>>): LoDashImplicitArrayWrapper<T>;
|
4280 |
+
}
|
4281 |
+
|
4282 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4283 |
+
/**
|
4284 |
+
* @see _.concat
|
4285 |
+
*/
|
4286 |
+
concat<TItem>(...items: Array<TItem|Array<TItem>>): LoDashExplicitArrayWrapper<TItem>;
|
4287 |
+
|
4288 |
+
/**
|
4289 |
+
* @see _.concat
|
4290 |
+
*/
|
4291 |
+
concat(...items: Array<T|Array<T>>): LoDashExplicitArrayWrapper<T>;
|
4292 |
+
}
|
4293 |
+
|
4294 |
+
//_.prototype.plant
|
4295 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
4296 |
+
/**
|
4297 |
+
* Creates a clone of the chained sequence planting value as the wrapped value.
|
4298 |
+
* @param value The value to plant as the wrapped value.
|
4299 |
+
* @return Returns the new lodash wrapper instance.
|
4300 |
+
*/
|
4301 |
+
plant(value: number): LoDashImplicitWrapper<number>;
|
4302 |
+
|
4303 |
+
/**
|
4304 |
+
* @see _.plant
|
4305 |
+
*/
|
4306 |
+
plant(value: string): LoDashImplicitStringWrapper;
|
4307 |
+
|
4308 |
+
/**
|
4309 |
+
* @see _.plant
|
4310 |
+
*/
|
4311 |
+
plant(value: boolean): LoDashImplicitWrapper<boolean>;
|
4312 |
+
|
4313 |
+
/**
|
4314 |
+
* @see _.plant
|
4315 |
+
*/
|
4316 |
+
plant(value: number[]): LoDashImplicitNumberArrayWrapper;
|
4317 |
+
|
4318 |
+
/**
|
4319 |
+
* @see _.plant
|
4320 |
+
*/
|
4321 |
+
plant<T>(value: T[]): LoDashImplicitArrayWrapper<T>;
|
4322 |
+
|
4323 |
+
/**
|
4324 |
+
* @see _.plant
|
4325 |
+
*/
|
4326 |
+
plant<T extends {}>(value: T): LoDashImplicitObjectWrapper<T>;
|
4327 |
+
|
4328 |
+
/**
|
4329 |
+
* @see _.plant
|
4330 |
+
*/
|
4331 |
+
plant(value: any): LoDashImplicitWrapper<any>;
|
4332 |
+
}
|
4333 |
+
|
4334 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
4335 |
+
/**
|
4336 |
+
* @see _.plant
|
4337 |
+
*/
|
4338 |
+
plant(value: number): LoDashExplicitWrapper<number>;
|
4339 |
+
|
4340 |
+
/**
|
4341 |
+
* @see _.plant
|
4342 |
+
*/
|
4343 |
+
plant(value: string): LoDashExplicitStringWrapper;
|
4344 |
+
|
4345 |
+
/**
|
4346 |
+
* @see _.plant
|
4347 |
+
*/
|
4348 |
+
plant(value: boolean): LoDashExplicitWrapper<boolean>;
|
4349 |
+
|
4350 |
+
/**
|
4351 |
+
* @see _.plant
|
4352 |
+
*/
|
4353 |
+
plant(value: number[]): LoDashExplicitNumberArrayWrapper;
|
4354 |
+
|
4355 |
+
/**
|
4356 |
+
* @see _.plant
|
4357 |
+
*/
|
4358 |
+
plant<T>(value: T[]): LoDashExplicitArrayWrapper<T>;
|
4359 |
+
|
4360 |
+
/**
|
4361 |
+
* @see _.plant
|
4362 |
+
*/
|
4363 |
+
plant<T extends {}>(value: T): LoDashExplicitObjectWrapper<T>;
|
4364 |
+
|
4365 |
+
/**
|
4366 |
+
* @see _.plant
|
4367 |
+
*/
|
4368 |
+
plant(value: any): LoDashExplicitWrapper<any>;
|
4369 |
+
}
|
4370 |
+
|
4371 |
+
//_.prototype.reverse
|
4372 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4373 |
+
/**
|
4374 |
+
* Reverses the wrapped array so the first element becomes the last, the second element becomes the second to
|
4375 |
+
* last, and so on.
|
4376 |
+
*
|
4377 |
+
* Note: This method mutates the wrapped array.
|
4378 |
+
*
|
4379 |
+
* @return Returns the new reversed lodash wrapper instance.
|
4380 |
+
*/
|
4381 |
+
reverse(): LoDashImplicitArrayWrapper<T>;
|
4382 |
+
}
|
4383 |
+
|
4384 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4385 |
+
/**
|
4386 |
+
* @see _.reverse
|
4387 |
+
*/
|
4388 |
+
reverse(): LoDashExplicitArrayWrapper<T>;
|
4389 |
+
}
|
4390 |
+
|
4391 |
+
//_.prototype.run
|
4392 |
+
interface LoDashWrapperBase<T, TWrapper> {
|
4393 |
+
/**
|
4394 |
+
* @see _.value
|
4395 |
+
*/
|
4396 |
+
run(): T;
|
4397 |
+
}
|
4398 |
+
|
4399 |
+
//_.prototype.toJSON
|
4400 |
+
interface LoDashWrapperBase<T, TWrapper> {
|
4401 |
+
/**
|
4402 |
+
* @see _.value
|
4403 |
+
*/
|
4404 |
+
toJSON(): T;
|
4405 |
+
}
|
4406 |
+
|
4407 |
+
//_.prototype.toString
|
4408 |
+
interface LoDashWrapperBase<T, TWrapper> {
|
4409 |
+
/**
|
4410 |
+
* Produces the result of coercing the unwrapped value to a string.
|
4411 |
+
*
|
4412 |
+
* @return Returns the coerced string value.
|
4413 |
+
*/
|
4414 |
+
toString(): string;
|
4415 |
+
}
|
4416 |
+
|
4417 |
+
//_.prototype.value
|
4418 |
+
interface LoDashWrapperBase<T, TWrapper> {
|
4419 |
+
/**
|
4420 |
+
* Executes the chained sequence to extract the unwrapped value.
|
4421 |
+
*
|
4422 |
+
* @alias _.run, _.toJSON, _.valueOf
|
4423 |
+
*
|
4424 |
+
* @return Returns the resolved unwrapped value.
|
4425 |
+
*/
|
4426 |
+
value(): T;
|
4427 |
+
}
|
4428 |
+
|
4429 |
+
//_.valueOf
|
4430 |
+
interface LoDashWrapperBase<T, TWrapper> {
|
4431 |
+
/**
|
4432 |
+
* @see _.value
|
4433 |
+
*/
|
4434 |
+
valueOf(): T;
|
4435 |
+
}
|
4436 |
+
|
4437 |
+
/**************
|
4438 |
+
* Collection *
|
4439 |
+
**************/
|
4440 |
+
|
4441 |
+
//_.all
|
4442 |
+
interface LoDashStatic {
|
4443 |
+
/**
|
4444 |
+
* @see _.every
|
4445 |
+
*/
|
4446 |
+
all<T>(
|
4447 |
+
collection: List<T>,
|
4448 |
+
predicate?: ListIterator<T, boolean>,
|
4449 |
+
thisArg?: any
|
4450 |
+
): boolean;
|
4451 |
+
|
4452 |
+
/**
|
4453 |
+
* @see _.every
|
4454 |
+
*/
|
4455 |
+
all<T>(
|
4456 |
+
collection: Dictionary<T>,
|
4457 |
+
predicate?: DictionaryIterator<T, boolean>,
|
4458 |
+
thisArg?: any
|
4459 |
+
): boolean;
|
4460 |
+
|
4461 |
+
/**
|
4462 |
+
* @see _.every
|
4463 |
+
*/
|
4464 |
+
all<T>(
|
4465 |
+
collection: List<T>|Dictionary<T>,
|
4466 |
+
predicate?: string,
|
4467 |
+
thisArg?: any
|
4468 |
+
): boolean;
|
4469 |
+
|
4470 |
+
/**
|
4471 |
+
* @see _.every
|
4472 |
+
*/
|
4473 |
+
all<TObject extends {}, T>(
|
4474 |
+
collection: List<T>|Dictionary<T>,
|
4475 |
+
predicate?: TObject
|
4476 |
+
): boolean;
|
4477 |
+
}
|
4478 |
+
|
4479 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4480 |
+
/**
|
4481 |
+
* @see _.every
|
4482 |
+
*/
|
4483 |
+
all(
|
4484 |
+
predicate?: ListIterator<T, boolean>,
|
4485 |
+
thisArg?: any
|
4486 |
+
): boolean;
|
4487 |
+
|
4488 |
+
/**
|
4489 |
+
* @see _.every
|
4490 |
+
*/
|
4491 |
+
all(
|
4492 |
+
predicate?: string,
|
4493 |
+
thisArg?: any
|
4494 |
+
): boolean;
|
4495 |
+
|
4496 |
+
/**
|
4497 |
+
* @see _.every
|
4498 |
+
*/
|
4499 |
+
all<TObject extends {}>(
|
4500 |
+
predicate?: TObject
|
4501 |
+
): boolean;
|
4502 |
+
}
|
4503 |
+
|
4504 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4505 |
+
/**
|
4506 |
+
* @see _.every
|
4507 |
+
*/
|
4508 |
+
all<TResult>(
|
4509 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
4510 |
+
thisArg?: any
|
4511 |
+
): boolean;
|
4512 |
+
|
4513 |
+
/**
|
4514 |
+
* @see _.every
|
4515 |
+
*/
|
4516 |
+
all(
|
4517 |
+
predicate?: string,
|
4518 |
+
thisArg?: any
|
4519 |
+
): boolean;
|
4520 |
+
|
4521 |
+
/**
|
4522 |
+
* @see _.every
|
4523 |
+
*/
|
4524 |
+
all<TObject extends {}>(
|
4525 |
+
predicate?: TObject
|
4526 |
+
): boolean;
|
4527 |
+
}
|
4528 |
+
|
4529 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4530 |
+
/**
|
4531 |
+
* @see _.every
|
4532 |
+
*/
|
4533 |
+
all(
|
4534 |
+
predicate?: ListIterator<T, boolean>,
|
4535 |
+
thisArg?: any
|
4536 |
+
): LoDashExplicitWrapper<boolean>;
|
4537 |
+
|
4538 |
+
/**
|
4539 |
+
* @see _.every
|
4540 |
+
*/
|
4541 |
+
all(
|
4542 |
+
predicate?: string,
|
4543 |
+
thisArg?: any
|
4544 |
+
): LoDashExplicitWrapper<boolean>;
|
4545 |
+
|
4546 |
+
/**
|
4547 |
+
* @see _.every
|
4548 |
+
*/
|
4549 |
+
all<TObject extends {}>(
|
4550 |
+
predicate?: TObject
|
4551 |
+
): LoDashExplicitWrapper<boolean>;
|
4552 |
+
}
|
4553 |
+
|
4554 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4555 |
+
/**
|
4556 |
+
* @see _.every
|
4557 |
+
*/
|
4558 |
+
all<TResult>(
|
4559 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
4560 |
+
thisArg?: any
|
4561 |
+
): LoDashExplicitWrapper<boolean>;
|
4562 |
+
|
4563 |
+
/**
|
4564 |
+
* @see _.every
|
4565 |
+
*/
|
4566 |
+
all(
|
4567 |
+
predicate?: string,
|
4568 |
+
thisArg?: any
|
4569 |
+
): LoDashExplicitWrapper<boolean>;
|
4570 |
+
|
4571 |
+
/**
|
4572 |
+
* @see _.every
|
4573 |
+
*/
|
4574 |
+
all<TObject extends {}>(
|
4575 |
+
predicate?: TObject
|
4576 |
+
): LoDashExplicitWrapper<boolean>;
|
4577 |
+
}
|
4578 |
+
|
4579 |
+
//_.any
|
4580 |
+
interface LoDashStatic {
|
4581 |
+
/**
|
4582 |
+
* @see _.some
|
4583 |
+
*/
|
4584 |
+
any<T>(
|
4585 |
+
collection: List<T>,
|
4586 |
+
predicate?: ListIterator<T, boolean>,
|
4587 |
+
thisArg?: any
|
4588 |
+
): boolean;
|
4589 |
+
|
4590 |
+
/**
|
4591 |
+
* @see _.some
|
4592 |
+
*/
|
4593 |
+
any<T>(
|
4594 |
+
collection: Dictionary<T>,
|
4595 |
+
predicate?: DictionaryIterator<T, boolean>,
|
4596 |
+
thisArg?: any
|
4597 |
+
): boolean;
|
4598 |
+
|
4599 |
+
/**
|
4600 |
+
* @see _.some
|
4601 |
+
*/
|
4602 |
+
any<T>(
|
4603 |
+
collection: NumericDictionary<T>,
|
4604 |
+
predicate?: NumericDictionaryIterator<T, boolean>,
|
4605 |
+
thisArg?: any
|
4606 |
+
): boolean;
|
4607 |
+
|
4608 |
+
/**
|
4609 |
+
* @see _.some
|
4610 |
+
*/
|
4611 |
+
any<T>(
|
4612 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
4613 |
+
predicate?: string,
|
4614 |
+
thisArg?: any
|
4615 |
+
): boolean;
|
4616 |
+
|
4617 |
+
/**
|
4618 |
+
* @see _.some
|
4619 |
+
*/
|
4620 |
+
any<TObject extends {}, T>(
|
4621 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
4622 |
+
predicate?: TObject
|
4623 |
+
): boolean;
|
4624 |
+
}
|
4625 |
+
|
4626 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4627 |
+
/**
|
4628 |
+
* @see _.some
|
4629 |
+
*/
|
4630 |
+
any(
|
4631 |
+
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
4632 |
+
thisArg?: any
|
4633 |
+
): boolean;
|
4634 |
+
|
4635 |
+
/**
|
4636 |
+
* @see _.some
|
4637 |
+
*/
|
4638 |
+
any(
|
4639 |
+
predicate?: string,
|
4640 |
+
thisArg?: any
|
4641 |
+
): boolean;
|
4642 |
+
|
4643 |
+
/**
|
4644 |
+
* @see _.some
|
4645 |
+
*/
|
4646 |
+
any<TObject extends {}>(
|
4647 |
+
predicate?: TObject
|
4648 |
+
): boolean;
|
4649 |
+
}
|
4650 |
+
|
4651 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4652 |
+
/**
|
4653 |
+
* @see _.some
|
4654 |
+
*/
|
4655 |
+
any<TResult>(
|
4656 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
4657 |
+
thisArg?: any
|
4658 |
+
): boolean;
|
4659 |
+
|
4660 |
+
/**
|
4661 |
+
* @see _.some
|
4662 |
+
*/
|
4663 |
+
any(
|
4664 |
+
predicate?: string,
|
4665 |
+
thisArg?: any
|
4666 |
+
): boolean;
|
4667 |
+
|
4668 |
+
/**
|
4669 |
+
* @see _.some
|
4670 |
+
*/
|
4671 |
+
any<TObject extends {}>(
|
4672 |
+
predicate?: TObject
|
4673 |
+
): boolean;
|
4674 |
+
}
|
4675 |
+
|
4676 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4677 |
+
/**
|
4678 |
+
* @see _.some
|
4679 |
+
*/
|
4680 |
+
any(
|
4681 |
+
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
4682 |
+
thisArg?: any
|
4683 |
+
): LoDashExplicitWrapper<boolean>;
|
4684 |
+
|
4685 |
+
/**
|
4686 |
+
* @see _.some
|
4687 |
+
*/
|
4688 |
+
any(
|
4689 |
+
predicate?: string,
|
4690 |
+
thisArg?: any
|
4691 |
+
): LoDashExplicitWrapper<boolean>;
|
4692 |
+
|
4693 |
+
/**
|
4694 |
+
* @see _.some
|
4695 |
+
*/
|
4696 |
+
any<TObject extends {}>(
|
4697 |
+
predicate?: TObject
|
4698 |
+
): LoDashExplicitWrapper<boolean>;
|
4699 |
+
}
|
4700 |
+
|
4701 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4702 |
+
/**
|
4703 |
+
* @see _.some
|
4704 |
+
*/
|
4705 |
+
any<TResult>(
|
4706 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
4707 |
+
thisArg?: any
|
4708 |
+
): LoDashExplicitWrapper<boolean>;
|
4709 |
+
|
4710 |
+
/**
|
4711 |
+
* @see _.some
|
4712 |
+
*/
|
4713 |
+
any(
|
4714 |
+
predicate?: string,
|
4715 |
+
thisArg?: any
|
4716 |
+
): LoDashExplicitWrapper<boolean>;
|
4717 |
+
|
4718 |
+
/**
|
4719 |
+
* @see _.some
|
4720 |
+
*/
|
4721 |
+
any<TObject extends {}>(
|
4722 |
+
predicate?: TObject
|
4723 |
+
): LoDashExplicitWrapper<boolean>;
|
4724 |
+
}
|
4725 |
+
|
4726 |
+
//_.at
|
4727 |
+
interface LoDashStatic {
|
4728 |
+
/**
|
4729 |
+
* Creates an array of elements corresponding to the given keys, or indexes, of collection. Keys may be
|
4730 |
+
* specified as individual arguments or as arrays of keys.
|
4731 |
+
*
|
4732 |
+
* @param collection The collection to iterate over.
|
4733 |
+
* @param props The property names or indexes of elements to pick, specified individually or in arrays.
|
4734 |
+
* @return Returns the new array of picked elements.
|
4735 |
+
*/
|
4736 |
+
at<T>(
|
4737 |
+
collection: List<T>|Dictionary<T>,
|
4738 |
+
...props: (number|string|(number|string)[])[]
|
4739 |
+
): T[];
|
4740 |
+
}
|
4741 |
+
|
4742 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4743 |
+
/**
|
4744 |
+
* @see _.at
|
4745 |
+
*/
|
4746 |
+
at(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
|
4747 |
+
}
|
4748 |
+
|
4749 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4750 |
+
/**
|
4751 |
+
* @see _.at
|
4752 |
+
*/
|
4753 |
+
at<T>(...props: (number|string|(number|string)[])[]): LoDashImplicitArrayWrapper<T>;
|
4754 |
+
}
|
4755 |
+
|
4756 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4757 |
+
/**
|
4758 |
+
* @see _.at
|
4759 |
+
*/
|
4760 |
+
at(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
|
4761 |
+
}
|
4762 |
+
|
4763 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4764 |
+
/**
|
4765 |
+
* @see _.at
|
4766 |
+
*/
|
4767 |
+
at<T>(...props: (number|string|(number|string)[])[]): LoDashExplicitArrayWrapper<T>;
|
4768 |
+
}
|
4769 |
+
|
4770 |
+
//_.collect
|
4771 |
+
interface LoDashStatic {
|
4772 |
+
/**
|
4773 |
+
* @see _.map
|
4774 |
+
*/
|
4775 |
+
collect<T, TResult>(
|
4776 |
+
collection: List<T>,
|
4777 |
+
iteratee?: ListIterator<T, TResult>,
|
4778 |
+
thisArg?: any
|
4779 |
+
): TResult[];
|
4780 |
+
|
4781 |
+
/**
|
4782 |
+
* @see _.map
|
4783 |
+
*/
|
4784 |
+
collect<T extends {}, TResult>(
|
4785 |
+
collection: Dictionary<T>,
|
4786 |
+
iteratee?: DictionaryIterator<T, TResult>,
|
4787 |
+
thisArg?: any
|
4788 |
+
): TResult[];
|
4789 |
+
|
4790 |
+
/**
|
4791 |
+
* @see _.map
|
4792 |
+
*/
|
4793 |
+
collect<T, TResult>(
|
4794 |
+
collection: List<T>|Dictionary<T>,
|
4795 |
+
iteratee?: string
|
4796 |
+
): TResult[];
|
4797 |
+
|
4798 |
+
/**
|
4799 |
+
* @see _.map
|
4800 |
+
*/
|
4801 |
+
collect<T, TObject extends {}>(
|
4802 |
+
collection: List<T>|Dictionary<T>,
|
4803 |
+
iteratee?: TObject
|
4804 |
+
): boolean[];
|
4805 |
+
}
|
4806 |
+
|
4807 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4808 |
+
/**
|
4809 |
+
* @see _.map
|
4810 |
+
*/
|
4811 |
+
collect<TResult>(
|
4812 |
+
iteratee?: ListIterator<T, TResult>,
|
4813 |
+
thisArg?: any
|
4814 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
4815 |
+
|
4816 |
+
/**
|
4817 |
+
* @see _.map
|
4818 |
+
*/
|
4819 |
+
collect<TResult>(
|
4820 |
+
iteratee?: string
|
4821 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
4822 |
+
|
4823 |
+
/**
|
4824 |
+
* @see _.map
|
4825 |
+
*/
|
4826 |
+
collect<TObject extends {}>(
|
4827 |
+
iteratee?: TObject
|
4828 |
+
): LoDashImplicitArrayWrapper<boolean>;
|
4829 |
+
}
|
4830 |
+
|
4831 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4832 |
+
/**
|
4833 |
+
* @see _.map
|
4834 |
+
*/
|
4835 |
+
collect<TValue, TResult>(
|
4836 |
+
iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
|
4837 |
+
thisArg?: any
|
4838 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
4839 |
+
|
4840 |
+
/**
|
4841 |
+
* @see _.map
|
4842 |
+
*/
|
4843 |
+
collect<TValue, TResult>(
|
4844 |
+
iteratee?: string
|
4845 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
4846 |
+
|
4847 |
+
/**
|
4848 |
+
* @see _.map
|
4849 |
+
*/
|
4850 |
+
collect<TObject extends {}>(
|
4851 |
+
iteratee?: TObject
|
4852 |
+
): LoDashImplicitArrayWrapper<boolean>;
|
4853 |
+
}
|
4854 |
+
|
4855 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4856 |
+
/**
|
4857 |
+
* @see _.map
|
4858 |
+
*/
|
4859 |
+
collect<TResult>(
|
4860 |
+
iteratee?: ListIterator<T, TResult>,
|
4861 |
+
thisArg?: any
|
4862 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
4863 |
+
|
4864 |
+
/**
|
4865 |
+
* @see _.map
|
4866 |
+
*/
|
4867 |
+
collect<TResult>(
|
4868 |
+
iteratee?: string
|
4869 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
4870 |
+
|
4871 |
+
/**
|
4872 |
+
* @see _.map
|
4873 |
+
*/
|
4874 |
+
collect<TObject extends {}>(
|
4875 |
+
iteratee?: TObject
|
4876 |
+
): LoDashExplicitArrayWrapper<boolean>;
|
4877 |
+
}
|
4878 |
+
|
4879 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4880 |
+
/**
|
4881 |
+
* @see _.map
|
4882 |
+
*/
|
4883 |
+
collect<TValue, TResult>(
|
4884 |
+
iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
|
4885 |
+
thisArg?: any
|
4886 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
4887 |
+
|
4888 |
+
/**
|
4889 |
+
* @see _.map
|
4890 |
+
*/
|
4891 |
+
collect<TValue, TResult>(
|
4892 |
+
iteratee?: string
|
4893 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
4894 |
+
|
4895 |
+
/**
|
4896 |
+
* @see _.map
|
4897 |
+
*/
|
4898 |
+
collect<TObject extends {}>(
|
4899 |
+
iteratee?: TObject
|
4900 |
+
): LoDashExplicitArrayWrapper<boolean>;
|
4901 |
+
}
|
4902 |
+
|
4903 |
+
//_.contains
|
4904 |
+
interface LoDashStatic {
|
4905 |
+
/**
|
4906 |
+
* @see _.includes
|
4907 |
+
*/
|
4908 |
+
contains<T>(
|
4909 |
+
collection: List<T>|Dictionary<T>,
|
4910 |
+
target: T,
|
4911 |
+
fromIndex?: number
|
4912 |
+
): boolean;
|
4913 |
+
|
4914 |
+
/**
|
4915 |
+
* @see _.includes
|
4916 |
+
*/
|
4917 |
+
contains(
|
4918 |
+
collection: string,
|
4919 |
+
target: string,
|
4920 |
+
fromIndex?: number
|
4921 |
+
): boolean;
|
4922 |
+
}
|
4923 |
+
|
4924 |
+
interface LoDashImplicitArrayWrapper<T> {
|
4925 |
+
/**
|
4926 |
+
* @see _.includes
|
4927 |
+
*/
|
4928 |
+
contains(
|
4929 |
+
target: T,
|
4930 |
+
fromIndex?: number
|
4931 |
+
): boolean;
|
4932 |
+
}
|
4933 |
+
|
4934 |
+
interface LoDashImplicitObjectWrapper<T> {
|
4935 |
+
/**
|
4936 |
+
* @see _.includes
|
4937 |
+
*/
|
4938 |
+
contains<TValue>(
|
4939 |
+
target: TValue,
|
4940 |
+
fromIndex?: number
|
4941 |
+
): boolean;
|
4942 |
+
}
|
4943 |
+
|
4944 |
+
interface LoDashImplicitWrapper<T> {
|
4945 |
+
/**
|
4946 |
+
* @see _.includes
|
4947 |
+
*/
|
4948 |
+
contains(
|
4949 |
+
target: string,
|
4950 |
+
fromIndex?: number
|
4951 |
+
): boolean;
|
4952 |
+
}
|
4953 |
+
|
4954 |
+
interface LoDashExplicitArrayWrapper<T> {
|
4955 |
+
/**
|
4956 |
+
* @see _.includes
|
4957 |
+
*/
|
4958 |
+
contains(
|
4959 |
+
target: T,
|
4960 |
+
fromIndex?: number
|
4961 |
+
): LoDashExplicitWrapper<boolean>;
|
4962 |
+
}
|
4963 |
+
|
4964 |
+
interface LoDashExplicitObjectWrapper<T> {
|
4965 |
+
/**
|
4966 |
+
* @see _.includes
|
4967 |
+
*/
|
4968 |
+
contains<TValue>(
|
4969 |
+
target: TValue,
|
4970 |
+
fromIndex?: number
|
4971 |
+
): LoDashExplicitWrapper<boolean>;
|
4972 |
+
}
|
4973 |
+
|
4974 |
+
interface LoDashExplicitWrapper<T> {
|
4975 |
+
/**
|
4976 |
+
* @see _.includes
|
4977 |
+
*/
|
4978 |
+
contains(
|
4979 |
+
target: string,
|
4980 |
+
fromIndex?: number
|
4981 |
+
): LoDashExplicitWrapper<boolean>;
|
4982 |
+
}
|
4983 |
+
|
4984 |
+
//_.countBy
|
4985 |
+
interface LoDashStatic {
|
4986 |
+
/**
|
4987 |
+
* Creates an object composed of keys generated from the results of running each element of collection through
|
4988 |
+
* iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The
|
4989 |
+
* iteratee is bound to thisArg and invoked with three arguments:
|
4990 |
+
* (value, index|key, collection).
|
4991 |
+
*
|
4992 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property
|
4993 |
+
* value of the given element.
|
4994 |
+
*
|
4995 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
4996 |
+
* elements that have a matching property value, else false.
|
4997 |
+
*
|
4998 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
4999 |
+
* have the properties of the given object, else false.
|
5000 |
+
*
|
5001 |
+
* @param collection The collection to iterate over.
|
5002 |
+
* @param iteratee The function invoked per iteration.
|
5003 |
+
* @param thisArg The this binding of iteratee.
|
5004 |
+
* @return Returns the composed aggregate object.
|
5005 |
+
*/
|
5006 |
+
countBy<T>(
|
5007 |
+
collection: List<T>,
|
5008 |
+
iteratee?: ListIterator<T, any>,
|
5009 |
+
thisArg?: any
|
5010 |
+
): Dictionary<number>;
|
5011 |
+
|
5012 |
+
/**
|
5013 |
+
* @see _.countBy
|
5014 |
+
*/
|
5015 |
+
countBy<T>(
|
5016 |
+
collection: Dictionary<T>,
|
5017 |
+
iteratee?: DictionaryIterator<T, any>,
|
5018 |
+
thisArg?: any
|
5019 |
+
): Dictionary<number>;
|
5020 |
+
|
5021 |
+
/**
|
5022 |
+
* @see _.countBy
|
5023 |
+
*/
|
5024 |
+
countBy<T>(
|
5025 |
+
collection: NumericDictionary<T>,
|
5026 |
+
iteratee?: NumericDictionaryIterator<T, any>,
|
5027 |
+
thisArg?: any
|
5028 |
+
): Dictionary<number>;
|
5029 |
+
|
5030 |
+
/**
|
5031 |
+
* @see _.countBy
|
5032 |
+
*/
|
5033 |
+
countBy<T>(
|
5034 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
5035 |
+
iteratee?: string,
|
5036 |
+
thisArg?: any
|
5037 |
+
): Dictionary<number>;
|
5038 |
+
|
5039 |
+
/**
|
5040 |
+
* @see _.countBy
|
5041 |
+
*/
|
5042 |
+
countBy<W, T>(
|
5043 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
5044 |
+
iteratee?: W
|
5045 |
+
): Dictionary<number>;
|
5046 |
+
|
5047 |
+
/**
|
5048 |
+
* @see _.countBy
|
5049 |
+
*/
|
5050 |
+
countBy<T>(
|
5051 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
5052 |
+
iteratee?: Object
|
5053 |
+
): Dictionary<number>;
|
5054 |
+
}
|
5055 |
+
|
5056 |
+
interface LoDashImplicitWrapper<T> {
|
5057 |
+
/**
|
5058 |
+
* @see _.countBy
|
5059 |
+
*/
|
5060 |
+
countBy(
|
5061 |
+
iteratee?: ListIterator<T, any>,
|
5062 |
+
thisArg?: any
|
5063 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5064 |
+
}
|
5065 |
+
|
5066 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5067 |
+
/**
|
5068 |
+
* @see _.countBy
|
5069 |
+
*/
|
5070 |
+
countBy(
|
5071 |
+
iteratee?: ListIterator<T, any>,
|
5072 |
+
thisArg?: any
|
5073 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5074 |
+
|
5075 |
+
/**
|
5076 |
+
* @see _.countBy
|
5077 |
+
*/
|
5078 |
+
countBy(
|
5079 |
+
iteratee?: string,
|
5080 |
+
thisArg?: any
|
5081 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5082 |
+
|
5083 |
+
/**
|
5084 |
+
* @see _.countBy
|
5085 |
+
*/
|
5086 |
+
countBy<W>(
|
5087 |
+
iteratee?: W
|
5088 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5089 |
+
}
|
5090 |
+
|
5091 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5092 |
+
/**
|
5093 |
+
* @see _.countBy
|
5094 |
+
*/
|
5095 |
+
countBy<T>(
|
5096 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>,
|
5097 |
+
thisArg?: any
|
5098 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5099 |
+
|
5100 |
+
/**
|
5101 |
+
* @see _.countBy
|
5102 |
+
*/
|
5103 |
+
countBy(
|
5104 |
+
iteratee?: string,
|
5105 |
+
thisArg?: any
|
5106 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5107 |
+
|
5108 |
+
/**
|
5109 |
+
* @see _.countBy
|
5110 |
+
*/
|
5111 |
+
countBy<W>(
|
5112 |
+
iteratee?: W
|
5113 |
+
): LoDashImplicitObjectWrapper<Dictionary<number>>;
|
5114 |
+
}
|
5115 |
+
|
5116 |
+
interface LoDashExplicitWrapper<T> {
|
5117 |
+
/**
|
5118 |
+
* @see _.countBy
|
5119 |
+
*/
|
5120 |
+
countBy(
|
5121 |
+
iteratee?: ListIterator<T, any>,
|
5122 |
+
thisArg?: any
|
5123 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5124 |
+
}
|
5125 |
+
|
5126 |
+
interface LoDashExplicitArrayWrapper<T> {
|
5127 |
+
/**
|
5128 |
+
* @see _.countBy
|
5129 |
+
*/
|
5130 |
+
countBy(
|
5131 |
+
iteratee?: ListIterator<T, any>,
|
5132 |
+
thisArg?: any
|
5133 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5134 |
+
|
5135 |
+
/**
|
5136 |
+
* @see _.countBy
|
5137 |
+
*/
|
5138 |
+
countBy(
|
5139 |
+
iteratee?: string,
|
5140 |
+
thisArg?: any
|
5141 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5142 |
+
|
5143 |
+
/**
|
5144 |
+
* @see _.countBy
|
5145 |
+
*/
|
5146 |
+
countBy<W>(
|
5147 |
+
iteratee?: W
|
5148 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5149 |
+
}
|
5150 |
+
|
5151 |
+
interface LoDashExplicitObjectWrapper<T> {
|
5152 |
+
/**
|
5153 |
+
* @see _.countBy
|
5154 |
+
*/
|
5155 |
+
countBy<T>(
|
5156 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>|NumericDictionaryIterator<T, any>,
|
5157 |
+
thisArg?: any
|
5158 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5159 |
+
|
5160 |
+
/**
|
5161 |
+
* @see _.countBy
|
5162 |
+
*/
|
5163 |
+
countBy(
|
5164 |
+
iteratee?: string,
|
5165 |
+
thisArg?: any
|
5166 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5167 |
+
|
5168 |
+
/**
|
5169 |
+
* @see _.countBy
|
5170 |
+
*/
|
5171 |
+
countBy<W>(
|
5172 |
+
iteratee?: W
|
5173 |
+
): LoDashExplicitObjectWrapper<Dictionary<number>>;
|
5174 |
+
}
|
5175 |
+
|
5176 |
+
//_.detect
|
5177 |
+
interface LoDashStatic {
|
5178 |
+
/**
|
5179 |
+
* @see _.find
|
5180 |
+
*/
|
5181 |
+
detect<T>(
|
5182 |
+
collection: List<T>,
|
5183 |
+
predicate?: ListIterator<T, boolean>,
|
5184 |
+
thisArg?: any
|
5185 |
+
): T;
|
5186 |
+
|
5187 |
+
/**
|
5188 |
+
* @see _.find
|
5189 |
+
*/
|
5190 |
+
detect<T>(
|
5191 |
+
collection: Dictionary<T>,
|
5192 |
+
predicate?: DictionaryIterator<T, boolean>,
|
5193 |
+
thisArg?: any
|
5194 |
+
): T;
|
5195 |
+
|
5196 |
+
/**
|
5197 |
+
* @see _.find
|
5198 |
+
*/
|
5199 |
+
detect<T>(
|
5200 |
+
collection: List<T>|Dictionary<T>,
|
5201 |
+
predicate?: string,
|
5202 |
+
thisArg?: any
|
5203 |
+
): T;
|
5204 |
+
|
5205 |
+
/**
|
5206 |
+
* @see _.find
|
5207 |
+
*/
|
5208 |
+
detect<TObject extends {}, T>(
|
5209 |
+
collection: List<T>|Dictionary<T>,
|
5210 |
+
predicate?: TObject
|
5211 |
+
): T;
|
5212 |
+
}
|
5213 |
+
|
5214 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5215 |
+
/**
|
5216 |
+
* @see _.find
|
5217 |
+
*/
|
5218 |
+
detect(
|
5219 |
+
predicate?: ListIterator<T, boolean>,
|
5220 |
+
thisArg?: any
|
5221 |
+
): T;
|
5222 |
+
|
5223 |
+
/**
|
5224 |
+
* @see _.find
|
5225 |
+
*/
|
5226 |
+
detect(
|
5227 |
+
predicate?: string,
|
5228 |
+
thisArg?: any
|
5229 |
+
): T;
|
5230 |
+
|
5231 |
+
/**
|
5232 |
+
* @see _.find
|
5233 |
+
*/
|
5234 |
+
detect<TObject extends {}>(
|
5235 |
+
predicate?: TObject
|
5236 |
+
): T;
|
5237 |
+
}
|
5238 |
+
|
5239 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5240 |
+
/**
|
5241 |
+
* @see _.find
|
5242 |
+
*/
|
5243 |
+
detect<TResult>(
|
5244 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
5245 |
+
thisArg?: any
|
5246 |
+
): TResult;
|
5247 |
+
|
5248 |
+
/**
|
5249 |
+
* @see _.find
|
5250 |
+
*/
|
5251 |
+
detect<TResult>(
|
5252 |
+
predicate?: string,
|
5253 |
+
thisArg?: any
|
5254 |
+
): TResult;
|
5255 |
+
|
5256 |
+
/**
|
5257 |
+
* @see _.find
|
5258 |
+
*/
|
5259 |
+
detect<TObject extends {}, TResult>(
|
5260 |
+
predicate?: TObject
|
5261 |
+
): TResult;
|
5262 |
+
}
|
5263 |
+
|
5264 |
+
//_.each
|
5265 |
+
interface LoDashStatic {
|
5266 |
+
/**
|
5267 |
+
* @see _.forEach
|
5268 |
+
*/
|
5269 |
+
each<T>(
|
5270 |
+
collection: T[],
|
5271 |
+
iteratee?: ListIterator<T, any>,
|
5272 |
+
thisArg?: any
|
5273 |
+
): T[];
|
5274 |
+
|
5275 |
+
/**
|
5276 |
+
* @see _.forEach
|
5277 |
+
*/
|
5278 |
+
each<T>(
|
5279 |
+
collection: List<T>,
|
5280 |
+
iteratee?: ListIterator<T, any>,
|
5281 |
+
thisArg?: any
|
5282 |
+
): List<T>;
|
5283 |
+
|
5284 |
+
/**
|
5285 |
+
* @see _.forEach
|
5286 |
+
*/
|
5287 |
+
each<T>(
|
5288 |
+
collection: Dictionary<T>,
|
5289 |
+
iteratee?: DictionaryIterator<T, any>,
|
5290 |
+
thisArg?: any
|
5291 |
+
): Dictionary<T>;
|
5292 |
+
|
5293 |
+
/**
|
5294 |
+
* @see _.forEach
|
5295 |
+
*/
|
5296 |
+
each<T extends {}>(
|
5297 |
+
collection: T,
|
5298 |
+
iteratee?: ObjectIterator<any, any>,
|
5299 |
+
thisArgs?: any
|
5300 |
+
): T;
|
5301 |
+
|
5302 |
+
/**
|
5303 |
+
* @see _.forEach
|
5304 |
+
*/
|
5305 |
+
each<T extends {}, TValue>(
|
5306 |
+
collection: T,
|
5307 |
+
iteratee?: ObjectIterator<TValue, any>,
|
5308 |
+
thisArgs?: any
|
5309 |
+
): T;
|
5310 |
+
}
|
5311 |
+
|
5312 |
+
interface LoDashImplicitWrapper<T> {
|
5313 |
+
/**
|
5314 |
+
* @see _.forEach
|
5315 |
+
*/
|
5316 |
+
each(
|
5317 |
+
iteratee: ListIterator<string, any>,
|
5318 |
+
thisArg?: any
|
5319 |
+
): LoDashImplicitWrapper<string>;
|
5320 |
+
}
|
5321 |
+
|
5322 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5323 |
+
/**
|
5324 |
+
* @see _.forEach
|
5325 |
+
*/
|
5326 |
+
each(
|
5327 |
+
iteratee: ListIterator<T, any>,
|
5328 |
+
thisArg?: any
|
5329 |
+
): LoDashImplicitArrayWrapper<T>;
|
5330 |
+
}
|
5331 |
+
|
5332 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5333 |
+
/**
|
5334 |
+
* @see _.forEach
|
5335 |
+
*/
|
5336 |
+
each<TValue>(
|
5337 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
5338 |
+
thisArg?: any
|
5339 |
+
): LoDashImplicitObjectWrapper<T>;
|
5340 |
+
}
|
5341 |
+
|
5342 |
+
interface LoDashExplicitWrapper<T> {
|
5343 |
+
/**
|
5344 |
+
* @see _.forEach
|
5345 |
+
*/
|
5346 |
+
each(
|
5347 |
+
iteratee: ListIterator<string, any>,
|
5348 |
+
thisArg?: any
|
5349 |
+
): LoDashExplicitWrapper<string>;
|
5350 |
+
}
|
5351 |
+
|
5352 |
+
interface LoDashExplicitArrayWrapper<T> {
|
5353 |
+
/**
|
5354 |
+
* @see _.forEach
|
5355 |
+
*/
|
5356 |
+
each(
|
5357 |
+
iteratee: ListIterator<T, any>,
|
5358 |
+
thisArg?: any
|
5359 |
+
): LoDashExplicitArrayWrapper<T>;
|
5360 |
+
}
|
5361 |
+
|
5362 |
+
interface LoDashExplicitObjectWrapper<T> {
|
5363 |
+
/**
|
5364 |
+
* @see _.forEach
|
5365 |
+
*/
|
5366 |
+
each<TValue>(
|
5367 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
5368 |
+
thisArg?: any
|
5369 |
+
): LoDashExplicitObjectWrapper<T>;
|
5370 |
+
}
|
5371 |
+
|
5372 |
+
//_.eachRight
|
5373 |
+
interface LoDashStatic {
|
5374 |
+
/**
|
5375 |
+
* @see _.forEachRight
|
5376 |
+
*/
|
5377 |
+
eachRight<T>(
|
5378 |
+
collection: T[],
|
5379 |
+
iteratee?: ListIterator<T, any>,
|
5380 |
+
thisArg?: any
|
5381 |
+
): T[];
|
5382 |
+
|
5383 |
+
/**
|
5384 |
+
* @see _.forEachRight
|
5385 |
+
*/
|
5386 |
+
eachRight<T>(
|
5387 |
+
collection: List<T>,
|
5388 |
+
iteratee?: ListIterator<T, any>,
|
5389 |
+
thisArg?: any
|
5390 |
+
): List<T>;
|
5391 |
+
|
5392 |
+
/**
|
5393 |
+
* @see _.forEachRight
|
5394 |
+
*/
|
5395 |
+
eachRight<T>(
|
5396 |
+
collection: Dictionary<T>,
|
5397 |
+
iteratee?: DictionaryIterator<T, any>,
|
5398 |
+
thisArg?: any
|
5399 |
+
): Dictionary<T>;
|
5400 |
+
|
5401 |
+
/**
|
5402 |
+
* @see _.forEachRight
|
5403 |
+
*/
|
5404 |
+
eachRight<T extends {}>(
|
5405 |
+
collection: T,
|
5406 |
+
iteratee?: ObjectIterator<any, any>,
|
5407 |
+
thisArgs?: any
|
5408 |
+
): T;
|
5409 |
+
|
5410 |
+
/**
|
5411 |
+
* @see _.forEachRight
|
5412 |
+
*/
|
5413 |
+
eachRight<T extends {}, TValue>(
|
5414 |
+
collection: T,
|
5415 |
+
iteratee?: ObjectIterator<TValue, any>,
|
5416 |
+
thisArgs?: any
|
5417 |
+
): T;
|
5418 |
+
}
|
5419 |
+
|
5420 |
+
interface LoDashImplicitWrapper<T> {
|
5421 |
+
/**
|
5422 |
+
* @see _.forEachRight
|
5423 |
+
*/
|
5424 |
+
eachRight(
|
5425 |
+
iteratee: ListIterator<string, any>,
|
5426 |
+
thisArg?: any
|
5427 |
+
): LoDashImplicitWrapper<string>;
|
5428 |
+
}
|
5429 |
+
|
5430 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5431 |
+
/**
|
5432 |
+
* @see _.forEachRight
|
5433 |
+
*/
|
5434 |
+
eachRight(
|
5435 |
+
iteratee: ListIterator<T, any>,
|
5436 |
+
thisArg?: any
|
5437 |
+
): LoDashImplicitArrayWrapper<T>;
|
5438 |
+
}
|
5439 |
+
|
5440 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5441 |
+
/**
|
5442 |
+
* @see _.forEachRight
|
5443 |
+
*/
|
5444 |
+
eachRight<TValue>(
|
5445 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
5446 |
+
thisArg?: any
|
5447 |
+
): LoDashImplicitObjectWrapper<T>;
|
5448 |
+
}
|
5449 |
+
|
5450 |
+
interface LoDashExplicitWrapper<T> {
|
5451 |
+
/**
|
5452 |
+
* @see _.forEachRight
|
5453 |
+
*/
|
5454 |
+
eachRight(
|
5455 |
+
iteratee: ListIterator<string, any>,
|
5456 |
+
thisArg?: any
|
5457 |
+
): LoDashExplicitWrapper<string>;
|
5458 |
+
}
|
5459 |
+
|
5460 |
+
interface LoDashExplicitArrayWrapper<T> {
|
5461 |
+
/**
|
5462 |
+
* @see _.forEachRight
|
5463 |
+
*/
|
5464 |
+
eachRight(
|
5465 |
+
iteratee: ListIterator<T, any>,
|
5466 |
+
thisArg?: any
|
5467 |
+
): LoDashExplicitArrayWrapper<T>;
|
5468 |
+
}
|
5469 |
+
|
5470 |
+
interface LoDashExplicitObjectWrapper<T> {
|
5471 |
+
/**
|
5472 |
+
* @see _.forEachRight
|
5473 |
+
*/
|
5474 |
+
eachRight<TValue>(
|
5475 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
5476 |
+
thisArg?: any
|
5477 |
+
): LoDashExplicitObjectWrapper<T>;
|
5478 |
+
}
|
5479 |
+
|
5480 |
+
//_.every
|
5481 |
+
interface LoDashStatic {
|
5482 |
+
/**
|
5483 |
+
* Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and
|
5484 |
+
* invoked with three arguments: (value, index|key, collection).
|
5485 |
+
*
|
5486 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
5487 |
+
* value of the given element.
|
5488 |
+
*
|
5489 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
5490 |
+
* elements that have a matching property value, else false.
|
5491 |
+
*
|
5492 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
5493 |
+
* have the properties of the given object, else false.
|
5494 |
+
*
|
5495 |
+
* @alias _.all
|
5496 |
+
*
|
5497 |
+
* @param collection The collection to iterate over.
|
5498 |
+
* @param predicate The function invoked per iteration.
|
5499 |
+
* @param thisArg The this binding of predicate.
|
5500 |
+
* @return Returns true if all elements pass the predicate check, else false.
|
5501 |
+
*/
|
5502 |
+
every<T>(
|
5503 |
+
collection: List<T>,
|
5504 |
+
predicate?: ListIterator<T, boolean>,
|
5505 |
+
thisArg?: any
|
5506 |
+
): boolean;
|
5507 |
+
|
5508 |
+
/**
|
5509 |
+
* @see _.every
|
5510 |
+
*/
|
5511 |
+
every<T>(
|
5512 |
+
collection: Dictionary<T>,
|
5513 |
+
predicate?: DictionaryIterator<T, boolean>,
|
5514 |
+
thisArg?: any
|
5515 |
+
): boolean;
|
5516 |
+
|
5517 |
+
/**
|
5518 |
+
* @see _.every
|
5519 |
+
*/
|
5520 |
+
every<T>(
|
5521 |
+
collection: List<T>|Dictionary<T>,
|
5522 |
+
predicate?: string,
|
5523 |
+
thisArg?: any
|
5524 |
+
): boolean;
|
5525 |
+
|
5526 |
+
/**
|
5527 |
+
* @see _.every
|
5528 |
+
*/
|
5529 |
+
every<TObject extends {}, T>(
|
5530 |
+
collection: List<T>|Dictionary<T>,
|
5531 |
+
predicate?: TObject
|
5532 |
+
): boolean;
|
5533 |
+
}
|
5534 |
+
|
5535 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5536 |
+
/**
|
5537 |
+
* @see _.every
|
5538 |
+
*/
|
5539 |
+
every(
|
5540 |
+
predicate?: ListIterator<T, boolean>,
|
5541 |
+
thisArg?: any
|
5542 |
+
): boolean;
|
5543 |
+
|
5544 |
+
/**
|
5545 |
+
* @see _.every
|
5546 |
+
*/
|
5547 |
+
every(
|
5548 |
+
predicate?: string,
|
5549 |
+
thisArg?: any
|
5550 |
+
): boolean;
|
5551 |
+
|
5552 |
+
/**
|
5553 |
+
* @see _.every
|
5554 |
+
*/
|
5555 |
+
every<TObject extends {}>(
|
5556 |
+
predicate?: TObject
|
5557 |
+
): boolean;
|
5558 |
+
}
|
5559 |
+
|
5560 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5561 |
+
/**
|
5562 |
+
* @see _.every
|
5563 |
+
*/
|
5564 |
+
every<TResult>(
|
5565 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
5566 |
+
thisArg?: any
|
5567 |
+
): boolean;
|
5568 |
+
|
5569 |
+
/**
|
5570 |
+
* @see _.every
|
5571 |
+
*/
|
5572 |
+
every(
|
5573 |
+
predicate?: string,
|
5574 |
+
thisArg?: any
|
5575 |
+
): boolean;
|
5576 |
+
|
5577 |
+
/**
|
5578 |
+
* @see _.every
|
5579 |
+
*/
|
5580 |
+
every<TObject extends {}>(
|
5581 |
+
predicate?: TObject
|
5582 |
+
): boolean;
|
5583 |
+
}
|
5584 |
+
|
5585 |
+
interface LoDashExplicitArrayWrapper<T> {
|
5586 |
+
/**
|
5587 |
+
* @see _.every
|
5588 |
+
*/
|
5589 |
+
every(
|
5590 |
+
predicate?: ListIterator<T, boolean>,
|
5591 |
+
thisArg?: any
|
5592 |
+
): LoDashExplicitWrapper<boolean>;
|
5593 |
+
|
5594 |
+
/**
|
5595 |
+
* @see _.every
|
5596 |
+
*/
|
5597 |
+
every(
|
5598 |
+
predicate?: string,
|
5599 |
+
thisArg?: any
|
5600 |
+
): LoDashExplicitWrapper<boolean>;
|
5601 |
+
|
5602 |
+
/**
|
5603 |
+
* @see _.every
|
5604 |
+
*/
|
5605 |
+
every<TObject extends {}>(
|
5606 |
+
predicate?: TObject
|
5607 |
+
): LoDashExplicitWrapper<boolean>;
|
5608 |
+
}
|
5609 |
+
|
5610 |
+
interface LoDashExplicitObjectWrapper<T> {
|
5611 |
+
/**
|
5612 |
+
* @see _.every
|
5613 |
+
*/
|
5614 |
+
every<TResult>(
|
5615 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
5616 |
+
thisArg?: any
|
5617 |
+
): LoDashExplicitWrapper<boolean>;
|
5618 |
+
|
5619 |
+
/**
|
5620 |
+
* @see _.every
|
5621 |
+
*/
|
5622 |
+
every(
|
5623 |
+
predicate?: string,
|
5624 |
+
thisArg?: any
|
5625 |
+
): LoDashExplicitWrapper<boolean>;
|
5626 |
+
|
5627 |
+
/**
|
5628 |
+
* @see _.every
|
5629 |
+
*/
|
5630 |
+
every<TObject extends {}>(
|
5631 |
+
predicate?: TObject
|
5632 |
+
): LoDashExplicitWrapper<boolean>;
|
5633 |
+
}
|
5634 |
+
|
5635 |
+
//_.filter
|
5636 |
+
interface LoDashStatic {
|
5637 |
+
/**
|
5638 |
+
* Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The
|
5639 |
+
* predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
|
5640 |
+
*
|
5641 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
5642 |
+
* value of the given element.
|
5643 |
+
*
|
5644 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
5645 |
+
* elements that have a matching property value, else false.
|
5646 |
+
*
|
5647 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
5648 |
+
* have the properties of the given object, else false.
|
5649 |
+
*
|
5650 |
+
* @alias _.select
|
5651 |
+
*
|
5652 |
+
* @param collection The collection to iterate over.
|
5653 |
+
* @param predicate The function invoked per iteration.
|
5654 |
+
* @param thisArg The this binding of predicate.
|
5655 |
+
* @return Returns the new filtered array.
|
5656 |
+
*/
|
5657 |
+
filter<T>(
|
5658 |
+
collection: List<T>,
|
5659 |
+
predicate?: ListIterator<T, boolean>,
|
5660 |
+
thisArg?: any
|
5661 |
+
): T[];
|
5662 |
+
|
5663 |
+
/**
|
5664 |
+
* @see _.filter
|
5665 |
+
*/
|
5666 |
+
filter<T>(
|
5667 |
+
collection: Dictionary<T>,
|
5668 |
+
predicate?: DictionaryIterator<T, boolean>,
|
5669 |
+
thisArg?: any
|
5670 |
+
): T[];
|
5671 |
+
|
5672 |
+
/**
|
5673 |
+
* @see _.filter
|
5674 |
+
*/
|
5675 |
+
filter(
|
5676 |
+
collection: string,
|
5677 |
+
predicate?: StringIterator<boolean>,
|
5678 |
+
thisArg?: any
|
5679 |
+
): string[];
|
5680 |
+
|
5681 |
+
/**
|
5682 |
+
* @see _.filter
|
5683 |
+
*/
|
5684 |
+
filter<T>(
|
5685 |
+
collection: List<T>|Dictionary<T>,
|
5686 |
+
predicate: string,
|
5687 |
+
thisArg?: any
|
5688 |
+
): T[];
|
5689 |
+
|
5690 |
+
/**
|
5691 |
+
* @see _.filter
|
5692 |
+
*/
|
5693 |
+
filter<W extends {}, T>(
|
5694 |
+
collection: List<T>|Dictionary<T>,
|
5695 |
+
predicate: W
|
5696 |
+
): T[];
|
5697 |
+
}
|
5698 |
+
|
5699 |
+
interface LoDashImplicitWrapper<T> {
|
5700 |
+
/**
|
5701 |
+
* @see _.filter
|
5702 |
+
*/
|
5703 |
+
filter(
|
5704 |
+
predicate?: StringIterator<boolean>,
|
5705 |
+
thisArg?: any
|
5706 |
+
): LoDashImplicitArrayWrapper<string>;
|
5707 |
+
}
|
5708 |
+
|
5709 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5710 |
+
/**
|
5711 |
+
* @see _.filter
|
5712 |
+
*/
|
5713 |
+
filter(
|
5714 |
+
predicate: ListIterator<T, boolean>,
|
5715 |
+
thisArg?: any
|
5716 |
+
): LoDashImplicitArrayWrapper<T>;
|
5717 |
+
|
5718 |
+
/**
|
5719 |
+
* @see _.filter
|
5720 |
+
*/
|
5721 |
+
filter(
|
5722 |
+
predicate: string,
|
5723 |
+
thisArg?: any
|
5724 |
+
): LoDashImplicitArrayWrapper<T>;
|
5725 |
+
|
5726 |
+
/**
|
5727 |
+
* @see _.filter
|
5728 |
+
*/
|
5729 |
+
filter<W>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
5730 |
+
}
|
5731 |
+
|
5732 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5733 |
+
/**
|
5734 |
+
* @see _.filter
|
5735 |
+
*/
|
5736 |
+
filter<T>(
|
5737 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
5738 |
+
thisArg?: any
|
5739 |
+
): LoDashImplicitArrayWrapper<T>;
|
5740 |
+
|
5741 |
+
/**
|
5742 |
+
* @see _.filter
|
5743 |
+
*/
|
5744 |
+
filter<T>(
|
5745 |
+
predicate: string,
|
5746 |
+
thisArg?: any
|
5747 |
+
): LoDashImplicitArrayWrapper<T>;
|
5748 |
+
|
5749 |
+
/**
|
5750 |
+
* @see _.filter
|
5751 |
+
*/
|
5752 |
+
filter<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
5753 |
+
}
|
5754 |
+
|
5755 |
+
interface LoDashExplicitWrapper<T> {
|
5756 |
+
/**
|
5757 |
+
* @see _.filter
|
5758 |
+
*/
|
5759 |
+
filter(
|
5760 |
+
predicate?: StringIterator<boolean>,
|
5761 |
+
thisArg?: any
|
5762 |
+
): LoDashExplicitArrayWrapper<string>;
|
5763 |
+
}
|
5764 |
+
|
5765 |
+
interface LoDashExplicitArrayWrapper<T> {
|
5766 |
+
/**
|
5767 |
+
* @see _.filter
|
5768 |
+
*/
|
5769 |
+
filter(
|
5770 |
+
predicate: ListIterator<T, boolean>,
|
5771 |
+
thisArg?: any
|
5772 |
+
): LoDashExplicitArrayWrapper<T>;
|
5773 |
+
|
5774 |
+
/**
|
5775 |
+
* @see _.filter
|
5776 |
+
*/
|
5777 |
+
filter(
|
5778 |
+
predicate: string,
|
5779 |
+
thisArg?: any
|
5780 |
+
): LoDashExplicitArrayWrapper<T>;
|
5781 |
+
|
5782 |
+
/**
|
5783 |
+
* @see _.filter
|
5784 |
+
*/
|
5785 |
+
filter<W>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
5786 |
+
}
|
5787 |
+
|
5788 |
+
interface LoDashExplicitObjectWrapper<T> {
|
5789 |
+
/**
|
5790 |
+
* @see _.filter
|
5791 |
+
*/
|
5792 |
+
filter<T>(
|
5793 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
5794 |
+
thisArg?: any
|
5795 |
+
): LoDashExplicitArrayWrapper<T>;
|
5796 |
+
|
5797 |
+
/**
|
5798 |
+
* @see _.filter
|
5799 |
+
*/
|
5800 |
+
filter<T>(
|
5801 |
+
predicate: string,
|
5802 |
+
thisArg?: any
|
5803 |
+
): LoDashExplicitArrayWrapper<T>;
|
5804 |
+
|
5805 |
+
/**
|
5806 |
+
* @see _.filter
|
5807 |
+
*/
|
5808 |
+
filter<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
5809 |
+
}
|
5810 |
+
|
5811 |
+
//_.find
|
5812 |
+
interface LoDashStatic {
|
5813 |
+
/**
|
5814 |
+
* Iterates over elements of collection, returning the first element predicate returns truthy for.
|
5815 |
+
* The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
|
5816 |
+
*
|
5817 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
5818 |
+
* value of the given element.
|
5819 |
+
*
|
5820 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
5821 |
+
* elements that have a matching property value, else false.
|
5822 |
+
*
|
5823 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
5824 |
+
* have the properties of the given object, else false.
|
5825 |
+
*
|
5826 |
+
* @alias _.detect
|
5827 |
+
*
|
5828 |
+
* @param collection The collection to search.
|
5829 |
+
* @param predicate The function invoked per iteration.
|
5830 |
+
* @param thisArg The this binding of predicate.
|
5831 |
+
* @return Returns the matched element, else undefined.
|
5832 |
+
*/
|
5833 |
+
find<T>(
|
5834 |
+
collection: List<T>,
|
5835 |
+
predicate?: ListIterator<T, boolean>,
|
5836 |
+
thisArg?: any
|
5837 |
+
): T;
|
5838 |
+
|
5839 |
+
/**
|
5840 |
+
* @see _.find
|
5841 |
+
*/
|
5842 |
+
find<T>(
|
5843 |
+
collection: Dictionary<T>,
|
5844 |
+
predicate?: DictionaryIterator<T, boolean>,
|
5845 |
+
thisArg?: any
|
5846 |
+
): T;
|
5847 |
+
|
5848 |
+
/**
|
5849 |
+
* @see _.find
|
5850 |
+
*/
|
5851 |
+
find<T>(
|
5852 |
+
collection: List<T>|Dictionary<T>,
|
5853 |
+
predicate?: string,
|
5854 |
+
thisArg?: any
|
5855 |
+
): T;
|
5856 |
+
|
5857 |
+
/**
|
5858 |
+
* @see _.find
|
5859 |
+
*/
|
5860 |
+
find<TObject extends {}, T>(
|
5861 |
+
collection: List<T>|Dictionary<T>,
|
5862 |
+
predicate?: TObject
|
5863 |
+
): T;
|
5864 |
+
}
|
5865 |
+
|
5866 |
+
interface LoDashImplicitArrayWrapper<T> {
|
5867 |
+
/**
|
5868 |
+
* @see _.find
|
5869 |
+
*/
|
5870 |
+
find(
|
5871 |
+
predicate?: ListIterator<T, boolean>,
|
5872 |
+
thisArg?: any
|
5873 |
+
): T;
|
5874 |
+
|
5875 |
+
/**
|
5876 |
+
* @see _.find
|
5877 |
+
*/
|
5878 |
+
find(
|
5879 |
+
predicate?: string,
|
5880 |
+
thisArg?: any
|
5881 |
+
): T;
|
5882 |
+
|
5883 |
+
/**
|
5884 |
+
* @see _.find
|
5885 |
+
*/
|
5886 |
+
find<TObject extends {}>(
|
5887 |
+
predicate?: TObject
|
5888 |
+
): T;
|
5889 |
+
}
|
5890 |
+
|
5891 |
+
interface LoDashImplicitObjectWrapper<T> {
|
5892 |
+
/**
|
5893 |
+
* @see _.find
|
5894 |
+
*/
|
5895 |
+
find<TResult>(
|
5896 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
5897 |
+
thisArg?: any
|
5898 |
+
): TResult;
|
5899 |
+
|
5900 |
+
/**
|
5901 |
+
* @see _.find
|
5902 |
+
*/
|
5903 |
+
find<TResult>(
|
5904 |
+
predicate?: string,
|
5905 |
+
thisArg?: any
|
5906 |
+
): TResult;
|
5907 |
+
|
5908 |
+
/**
|
5909 |
+
* @see _.find
|
5910 |
+
*/
|
5911 |
+
find<TObject extends {}, TResult>(
|
5912 |
+
predicate?: TObject
|
5913 |
+
): TResult;
|
5914 |
+
}
|
5915 |
+
|
5916 |
+
//_.findWhere
|
5917 |
+
interface LoDashStatic {
|
5918 |
+
/**
|
5919 |
+
* @see _.find
|
5920 |
+
**/
|
5921 |
+
findWhere<T>(
|
5922 |
+
collection: Array<T>,
|
5923 |
+
callback: ListIterator<T, boolean>,
|
5924 |
+
thisArg?: any): T;
|
5925 |
+
|
5926 |
+
/**
|
5927 |
+
* @see _.find
|
5928 |
+
**/
|
5929 |
+
findWhere<T>(
|
5930 |
+
collection: List<T>,
|
5931 |
+
callback: ListIterator<T, boolean>,
|
5932 |
+
thisArg?: any): T;
|
5933 |
+
|
5934 |
+
/**
|
5935 |
+
* @see _.find
|
5936 |
+
**/
|
5937 |
+
findWhere<T>(
|
5938 |
+
collection: Dictionary<T>,
|
5939 |
+
callback: DictionaryIterator<T, boolean>,
|
5940 |
+
thisArg?: any): T;
|
5941 |
+
|
5942 |
+
/**
|
5943 |
+
* @see _.find
|
5944 |
+
* @param _.matches style callback
|
5945 |
+
**/
|
5946 |
+
findWhere<W, T>(
|
5947 |
+
collection: Array<T>,
|
5948 |
+
whereValue: W): T;
|
5949 |
+
|
5950 |
+
/**
|
5951 |
+
* @see _.find
|
5952 |
+
* @param _.matches style callback
|
5953 |
+
**/
|
5954 |
+
findWhere<W, T>(
|
5955 |
+
collection: List<T>,
|
5956 |
+
whereValue: W): T;
|
5957 |
+
|
5958 |
+
/**
|
5959 |
+
* @see _.find
|
5960 |
+
* @param _.matches style callback
|
5961 |
+
**/
|
5962 |
+
findWhere<W, T>(
|
5963 |
+
collection: Dictionary<T>,
|
5964 |
+
whereValue: W): T;
|
5965 |
+
|
5966 |
+
/**
|
5967 |
+
* @see _.find
|
5968 |
+
* @param _.property style callback
|
5969 |
+
**/
|
5970 |
+
findWhere<T>(
|
5971 |
+
collection: Array<T>,
|
5972 |
+
pluckValue: string): T;
|
5973 |
+
|
5974 |
+
/**
|
5975 |
+
* @see _.find
|
5976 |
+
* @param _.property style callback
|
5977 |
+
**/
|
5978 |
+
findWhere<T>(
|
5979 |
+
collection: List<T>,
|
5980 |
+
pluckValue: string): T;
|
5981 |
+
|
5982 |
+
/**
|
5983 |
+
* @see _.find
|
5984 |
+
* @param _.property style callback
|
5985 |
+
**/
|
5986 |
+
findWhere<T>(
|
5987 |
+
collection: Dictionary<T>,
|
5988 |
+
pluckValue: string): T;
|
5989 |
+
}
|
5990 |
+
|
5991 |
+
//_.findLast
|
5992 |
+
interface LoDashStatic {
|
5993 |
+
/**
|
5994 |
+
* This method is like _.find except that it iterates over elements of a collection from
|
5995 |
+
* right to left.
|
5996 |
+
* @param collection Searches for a value in this list.
|
5997 |
+
* @param callback The function called per iteration.
|
5998 |
+
* @param thisArg The this binding of callback.
|
5999 |
+
* @return The found element, else undefined.
|
6000 |
+
**/
|
6001 |
+
findLast<T>(
|
6002 |
+
collection: Array<T>,
|
6003 |
+
callback: ListIterator<T, boolean>,
|
6004 |
+
thisArg?: any): T;
|
6005 |
+
|
6006 |
+
/**
|
6007 |
+
* @see _.find
|
6008 |
+
**/
|
6009 |
+
findLast<T>(
|
6010 |
+
collection: List<T>,
|
6011 |
+
callback: ListIterator<T, boolean>,
|
6012 |
+
thisArg?: any): T;
|
6013 |
+
|
6014 |
+
/**
|
6015 |
+
* @see _.find
|
6016 |
+
**/
|
6017 |
+
findLast<T>(
|
6018 |
+
collection: Dictionary<T>,
|
6019 |
+
callback: DictionaryIterator<T, boolean>,
|
6020 |
+
thisArg?: any): T;
|
6021 |
+
|
6022 |
+
/**
|
6023 |
+
* @see _.find
|
6024 |
+
* @param _.pluck style callback
|
6025 |
+
**/
|
6026 |
+
findLast<W, T>(
|
6027 |
+
collection: Array<T>,
|
6028 |
+
whereValue: W): T;
|
6029 |
+
|
6030 |
+
/**
|
6031 |
+
* @see _.find
|
6032 |
+
* @param _.pluck style callback
|
6033 |
+
**/
|
6034 |
+
findLast<W, T>(
|
6035 |
+
collection: List<T>,
|
6036 |
+
whereValue: W): T;
|
6037 |
+
|
6038 |
+
/**
|
6039 |
+
* @see _.find
|
6040 |
+
* @param _.pluck style callback
|
6041 |
+
**/
|
6042 |
+
findLast<W, T>(
|
6043 |
+
collection: Dictionary<T>,
|
6044 |
+
whereValue: W): T;
|
6045 |
+
|
6046 |
+
/**
|
6047 |
+
* @see _.find
|
6048 |
+
* @param _.where style callback
|
6049 |
+
**/
|
6050 |
+
findLast<T>(
|
6051 |
+
collection: Array<T>,
|
6052 |
+
pluckValue: string): T;
|
6053 |
+
|
6054 |
+
/**
|
6055 |
+
* @see _.find
|
6056 |
+
* @param _.where style callback
|
6057 |
+
**/
|
6058 |
+
findLast<T>(
|
6059 |
+
collection: List<T>,
|
6060 |
+
pluckValue: string): T;
|
6061 |
+
|
6062 |
+
/**
|
6063 |
+
* @see _.find
|
6064 |
+
* @param _.where style callback
|
6065 |
+
**/
|
6066 |
+
findLast<T>(
|
6067 |
+
collection: Dictionary<T>,
|
6068 |
+
pluckValue: string): T;
|
6069 |
+
}
|
6070 |
+
|
6071 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6072 |
+
/**
|
6073 |
+
* @see _.findLast
|
6074 |
+
*/
|
6075 |
+
findLast(
|
6076 |
+
callback: ListIterator<T, boolean>,
|
6077 |
+
thisArg?: any): T;
|
6078 |
+
/**
|
6079 |
+
* @see _.findLast
|
6080 |
+
* @param _.where style callback
|
6081 |
+
*/
|
6082 |
+
findLast<W>(
|
6083 |
+
whereValue: W): T;
|
6084 |
+
|
6085 |
+
/**
|
6086 |
+
* @see _.findLast
|
6087 |
+
* @param _.where style callback
|
6088 |
+
*/
|
6089 |
+
findLast(
|
6090 |
+
pluckValue: string): T;
|
6091 |
+
}
|
6092 |
+
|
6093 |
+
//_.forEach
|
6094 |
+
interface LoDashStatic {
|
6095 |
+
/**
|
6096 |
+
* Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg
|
6097 |
+
* and invoked with three arguments:
|
6098 |
+
* (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.
|
6099 |
+
*
|
6100 |
+
* Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To
|
6101 |
+
* avoid this behavior _.forIn or _.forOwn may be used for object iteration.
|
6102 |
+
*
|
6103 |
+
* @alias _.each
|
6104 |
+
*
|
6105 |
+
* @param collection The collection to iterate over.
|
6106 |
+
* @param iteratee The function invoked per iteration.
|
6107 |
+
* @param thisArg The this binding of iteratee.
|
6108 |
+
*/
|
6109 |
+
forEach<T>(
|
6110 |
+
collection: T[],
|
6111 |
+
iteratee?: ListIterator<T, any>,
|
6112 |
+
thisArg?: any
|
6113 |
+
): T[];
|
6114 |
+
|
6115 |
+
/**
|
6116 |
+
* @see _.forEach
|
6117 |
+
*/
|
6118 |
+
forEach<T>(
|
6119 |
+
collection: List<T>,
|
6120 |
+
iteratee?: ListIterator<T, any>,
|
6121 |
+
thisArg?: any
|
6122 |
+
): List<T>;
|
6123 |
+
|
6124 |
+
/**
|
6125 |
+
* @see _.forEach
|
6126 |
+
*/
|
6127 |
+
forEach<T>(
|
6128 |
+
collection: Dictionary<T>,
|
6129 |
+
iteratee?: DictionaryIterator<T, any>,
|
6130 |
+
thisArg?: any
|
6131 |
+
): Dictionary<T>;
|
6132 |
+
|
6133 |
+
/**
|
6134 |
+
* @see _.forEach
|
6135 |
+
*/
|
6136 |
+
forEach<T extends {}>(
|
6137 |
+
collection: T,
|
6138 |
+
iteratee?: ObjectIterator<any, any>,
|
6139 |
+
thisArgs?: any
|
6140 |
+
): T;
|
6141 |
+
|
6142 |
+
/**
|
6143 |
+
* @see _.forEach
|
6144 |
+
*/
|
6145 |
+
forEach<T extends {}, TValue>(
|
6146 |
+
collection: T,
|
6147 |
+
iteratee?: ObjectIterator<TValue, any>,
|
6148 |
+
thisArgs?: any
|
6149 |
+
): T;
|
6150 |
+
}
|
6151 |
+
|
6152 |
+
interface LoDashImplicitWrapper<T> {
|
6153 |
+
/**
|
6154 |
+
* @see _.forEach
|
6155 |
+
*/
|
6156 |
+
forEach(
|
6157 |
+
iteratee: ListIterator<string, any>,
|
6158 |
+
thisArg?: any
|
6159 |
+
): LoDashImplicitWrapper<string>;
|
6160 |
+
}
|
6161 |
+
|
6162 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6163 |
+
/**
|
6164 |
+
* @see _.forEach
|
6165 |
+
*/
|
6166 |
+
forEach(
|
6167 |
+
iteratee: ListIterator<T, any>,
|
6168 |
+
thisArg?: any
|
6169 |
+
): LoDashImplicitArrayWrapper<T>;
|
6170 |
+
}
|
6171 |
+
|
6172 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6173 |
+
/**
|
6174 |
+
* @see _.forEach
|
6175 |
+
*/
|
6176 |
+
forEach<TValue>(
|
6177 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
6178 |
+
thisArg?: any
|
6179 |
+
): LoDashImplicitObjectWrapper<T>;
|
6180 |
+
}
|
6181 |
+
|
6182 |
+
interface LoDashExplicitWrapper<T> {
|
6183 |
+
/**
|
6184 |
+
* @see _.forEach
|
6185 |
+
*/
|
6186 |
+
forEach(
|
6187 |
+
iteratee: ListIterator<string, any>,
|
6188 |
+
thisArg?: any
|
6189 |
+
): LoDashExplicitWrapper<string>;
|
6190 |
+
}
|
6191 |
+
|
6192 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6193 |
+
/**
|
6194 |
+
* @see _.forEach
|
6195 |
+
*/
|
6196 |
+
forEach(
|
6197 |
+
iteratee: ListIterator<T, any>,
|
6198 |
+
thisArg?: any
|
6199 |
+
): LoDashExplicitArrayWrapper<T>;
|
6200 |
+
}
|
6201 |
+
|
6202 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6203 |
+
/**
|
6204 |
+
* @see _.forEach
|
6205 |
+
*/
|
6206 |
+
forEach<TValue>(
|
6207 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
6208 |
+
thisArg?: any
|
6209 |
+
): LoDashExplicitObjectWrapper<T>;
|
6210 |
+
}
|
6211 |
+
|
6212 |
+
//_.forEachRight
|
6213 |
+
interface LoDashStatic {
|
6214 |
+
/**
|
6215 |
+
* This method is like _.forEach except that it iterates over elements of collection from right to left.
|
6216 |
+
*
|
6217 |
+
* @alias _.eachRight
|
6218 |
+
*
|
6219 |
+
* @param collection The collection to iterate over.
|
6220 |
+
* @param iteratee The function called per iteration.
|
6221 |
+
* @param thisArg The this binding of callback.
|
6222 |
+
*/
|
6223 |
+
forEachRight<T>(
|
6224 |
+
collection: T[],
|
6225 |
+
iteratee?: ListIterator<T, any>,
|
6226 |
+
thisArg?: any
|
6227 |
+
): T[];
|
6228 |
+
|
6229 |
+
/**
|
6230 |
+
* @see _.forEachRight
|
6231 |
+
*/
|
6232 |
+
forEachRight<T>(
|
6233 |
+
collection: List<T>,
|
6234 |
+
iteratee?: ListIterator<T, any>,
|
6235 |
+
thisArg?: any
|
6236 |
+
): List<T>;
|
6237 |
+
|
6238 |
+
/**
|
6239 |
+
* @see _.forEachRight
|
6240 |
+
*/
|
6241 |
+
forEachRight<T>(
|
6242 |
+
collection: Dictionary<T>,
|
6243 |
+
iteratee?: DictionaryIterator<T, any>,
|
6244 |
+
thisArg?: any
|
6245 |
+
): Dictionary<T>;
|
6246 |
+
|
6247 |
+
/**
|
6248 |
+
* @see _.forEachRight
|
6249 |
+
*/
|
6250 |
+
forEachRight<T extends {}>(
|
6251 |
+
collection: T,
|
6252 |
+
iteratee?: ObjectIterator<any, any>,
|
6253 |
+
thisArgs?: any
|
6254 |
+
): T;
|
6255 |
+
|
6256 |
+
/**
|
6257 |
+
* @see _.forEachRight
|
6258 |
+
*/
|
6259 |
+
forEachRight<T extends {}, TValue>(
|
6260 |
+
collection: T,
|
6261 |
+
iteratee?: ObjectIterator<TValue, any>,
|
6262 |
+
thisArgs?: any
|
6263 |
+
): T;
|
6264 |
+
}
|
6265 |
+
|
6266 |
+
interface LoDashImplicitWrapper<T> {
|
6267 |
+
/**
|
6268 |
+
* @see _.forEachRight
|
6269 |
+
*/
|
6270 |
+
forEachRight(
|
6271 |
+
iteratee: ListIterator<string, any>,
|
6272 |
+
thisArg?: any
|
6273 |
+
): LoDashImplicitWrapper<string>;
|
6274 |
+
}
|
6275 |
+
|
6276 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6277 |
+
/**
|
6278 |
+
* @see _.forEachRight
|
6279 |
+
*/
|
6280 |
+
forEachRight(
|
6281 |
+
iteratee: ListIterator<T, any>,
|
6282 |
+
thisArg?: any
|
6283 |
+
): LoDashImplicitArrayWrapper<T>;
|
6284 |
+
}
|
6285 |
+
|
6286 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6287 |
+
/**
|
6288 |
+
* @see _.forEachRight
|
6289 |
+
*/
|
6290 |
+
forEachRight<TValue>(
|
6291 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
6292 |
+
thisArg?: any
|
6293 |
+
): LoDashImplicitObjectWrapper<T>;
|
6294 |
+
}
|
6295 |
+
|
6296 |
+
interface LoDashExplicitWrapper<T> {
|
6297 |
+
/**
|
6298 |
+
* @see _.forEachRight
|
6299 |
+
*/
|
6300 |
+
forEachRight(
|
6301 |
+
iteratee: ListIterator<string, any>,
|
6302 |
+
thisArg?: any
|
6303 |
+
): LoDashExplicitWrapper<string>;
|
6304 |
+
}
|
6305 |
+
|
6306 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6307 |
+
/**
|
6308 |
+
* @see _.forEachRight
|
6309 |
+
*/
|
6310 |
+
forEachRight(
|
6311 |
+
iteratee: ListIterator<T, any>,
|
6312 |
+
thisArg?: any
|
6313 |
+
): LoDashExplicitArrayWrapper<T>;
|
6314 |
+
}
|
6315 |
+
|
6316 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6317 |
+
/**
|
6318 |
+
* @see _.forEachRight
|
6319 |
+
*/
|
6320 |
+
forEachRight<TValue>(
|
6321 |
+
iteratee?: ListIterator<TValue, any>|DictionaryIterator<TValue, any>,
|
6322 |
+
thisArg?: any
|
6323 |
+
): LoDashExplicitObjectWrapper<T>;
|
6324 |
+
}
|
6325 |
+
|
6326 |
+
//_.groupBy
|
6327 |
+
interface LoDashStatic {
|
6328 |
+
/**
|
6329 |
+
* Creates an object composed of keys generated from the results of running each element of collection through
|
6330 |
+
* iteratee. The corresponding value of each key is an array of the elements responsible for generating the
|
6331 |
+
* key. The iteratee is bound to thisArg and invoked with three arguments:
|
6332 |
+
* (value, index|key, collection).
|
6333 |
+
*
|
6334 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property
|
6335 |
+
* value of the given element.
|
6336 |
+
*
|
6337 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
6338 |
+
* elements that have a matching property value, else false.
|
6339 |
+
*
|
6340 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
6341 |
+
* have the properties of the given object, else false.
|
6342 |
+
*
|
6343 |
+
* @param collection The collection to iterate over.
|
6344 |
+
* @param iteratee The function invoked per iteration.
|
6345 |
+
* @param thisArg The this binding of iteratee.
|
6346 |
+
* @return Returns the composed aggregate object.
|
6347 |
+
*/
|
6348 |
+
groupBy<T, TKey>(
|
6349 |
+
collection: List<T>,
|
6350 |
+
iteratee?: ListIterator<T, TKey>,
|
6351 |
+
thisArg?: any
|
6352 |
+
): Dictionary<T[]>;
|
6353 |
+
|
6354 |
+
/**
|
6355 |
+
* @see _.groupBy
|
6356 |
+
*/
|
6357 |
+
groupBy<T>(
|
6358 |
+
collection: List<any>,
|
6359 |
+
iteratee?: ListIterator<T, any>,
|
6360 |
+
thisArg?: any
|
6361 |
+
): Dictionary<T[]>;
|
6362 |
+
|
6363 |
+
/**
|
6364 |
+
* @see _.groupBy
|
6365 |
+
*/
|
6366 |
+
groupBy<T, TKey>(
|
6367 |
+
collection: Dictionary<T>,
|
6368 |
+
iteratee?: DictionaryIterator<T, TKey>,
|
6369 |
+
thisArg?: any
|
6370 |
+
): Dictionary<T[]>;
|
6371 |
+
|
6372 |
+
/**
|
6373 |
+
* @see _.groupBy
|
6374 |
+
*/
|
6375 |
+
groupBy<T>(
|
6376 |
+
collection: Dictionary<any>,
|
6377 |
+
iteratee?: DictionaryIterator<T, any>,
|
6378 |
+
thisArg?: any
|
6379 |
+
): Dictionary<T[]>;
|
6380 |
+
|
6381 |
+
/**
|
6382 |
+
* @see _.groupBy
|
6383 |
+
*/
|
6384 |
+
groupBy<T, TValue>(
|
6385 |
+
collection: List<T>|Dictionary<T>,
|
6386 |
+
iteratee?: string,
|
6387 |
+
thisArg?: TValue
|
6388 |
+
): Dictionary<T[]>;
|
6389 |
+
|
6390 |
+
/**
|
6391 |
+
* @see _.groupBy
|
6392 |
+
*/
|
6393 |
+
groupBy<T>(
|
6394 |
+
collection: List<T>|Dictionary<T>,
|
6395 |
+
iteratee?: string,
|
6396 |
+
thisArg?: any
|
6397 |
+
): Dictionary<T[]>;
|
6398 |
+
|
6399 |
+
/**
|
6400 |
+
* @see _.groupBy
|
6401 |
+
*/
|
6402 |
+
groupBy<TWhere, T>(
|
6403 |
+
collection: List<T>|Dictionary<T>,
|
6404 |
+
iteratee?: TWhere
|
6405 |
+
): Dictionary<T[]>;
|
6406 |
+
|
6407 |
+
/**
|
6408 |
+
* @see _.groupBy
|
6409 |
+
*/
|
6410 |
+
groupBy<T>(
|
6411 |
+
collection: List<T>|Dictionary<T>,
|
6412 |
+
iteratee?: Object
|
6413 |
+
): Dictionary<T[]>;
|
6414 |
+
}
|
6415 |
+
|
6416 |
+
interface LoDashImplicitWrapper<T> {
|
6417 |
+
/**
|
6418 |
+
* @see _.groupBy
|
6419 |
+
*/
|
6420 |
+
groupBy<TKey>(
|
6421 |
+
iteratee?: ListIterator<T, TKey>,
|
6422 |
+
thisArg?: any
|
6423 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6424 |
+
}
|
6425 |
+
|
6426 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6427 |
+
/**
|
6428 |
+
* @see _.groupBy
|
6429 |
+
*/
|
6430 |
+
groupBy<TKey>(
|
6431 |
+
iteratee?: ListIterator<T, TKey>,
|
6432 |
+
thisArg?: any
|
6433 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6434 |
+
|
6435 |
+
/**
|
6436 |
+
* @see _.groupBy
|
6437 |
+
*/
|
6438 |
+
groupBy<TValue>(
|
6439 |
+
iteratee?: string,
|
6440 |
+
thisArg?: TValue
|
6441 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6442 |
+
|
6443 |
+
/**
|
6444 |
+
* @see _.groupBy
|
6445 |
+
*/
|
6446 |
+
groupBy<TWhere>(
|
6447 |
+
iteratee?: TWhere
|
6448 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6449 |
+
}
|
6450 |
+
|
6451 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6452 |
+
/**
|
6453 |
+
* @see _.groupBy
|
6454 |
+
*/
|
6455 |
+
groupBy<T, TKey>(
|
6456 |
+
iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>,
|
6457 |
+
thisArg?: any
|
6458 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6459 |
+
|
6460 |
+
/**
|
6461 |
+
* @see _.groupBy
|
6462 |
+
*/
|
6463 |
+
groupBy<T>(
|
6464 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
|
6465 |
+
thisArg?: any
|
6466 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6467 |
+
|
6468 |
+
/**
|
6469 |
+
* @see _.groupBy
|
6470 |
+
*/
|
6471 |
+
groupBy<T, TValue>(
|
6472 |
+
iteratee?: string,
|
6473 |
+
thisArg?: TValue
|
6474 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6475 |
+
|
6476 |
+
/**
|
6477 |
+
* @see _.groupBy
|
6478 |
+
*/
|
6479 |
+
groupBy<T>(
|
6480 |
+
iteratee?: string,
|
6481 |
+
thisArg?: any
|
6482 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6483 |
+
|
6484 |
+
/**
|
6485 |
+
* @see _.groupBy
|
6486 |
+
*/
|
6487 |
+
groupBy<TWhere, T>(
|
6488 |
+
iteratee?: TWhere
|
6489 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6490 |
+
|
6491 |
+
/**
|
6492 |
+
* @see _.groupBy
|
6493 |
+
*/
|
6494 |
+
groupBy<T>(
|
6495 |
+
iteratee?: Object
|
6496 |
+
): LoDashImplicitObjectWrapper<Dictionary<T[]>>;
|
6497 |
+
}
|
6498 |
+
|
6499 |
+
interface LoDashExplicitWrapper<T> {
|
6500 |
+
/**
|
6501 |
+
* @see _.groupBy
|
6502 |
+
*/
|
6503 |
+
groupBy<TKey>(
|
6504 |
+
iteratee?: ListIterator<T, TKey>,
|
6505 |
+
thisArg?: any
|
6506 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6507 |
+
}
|
6508 |
+
|
6509 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6510 |
+
/**
|
6511 |
+
* @see _.groupBy
|
6512 |
+
*/
|
6513 |
+
groupBy<TKey>(
|
6514 |
+
iteratee?: ListIterator<T, TKey>,
|
6515 |
+
thisArg?: any
|
6516 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6517 |
+
|
6518 |
+
/**
|
6519 |
+
* @see _.groupBy
|
6520 |
+
*/
|
6521 |
+
groupBy<TValue>(
|
6522 |
+
iteratee?: string,
|
6523 |
+
thisArg?: TValue
|
6524 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6525 |
+
|
6526 |
+
/**
|
6527 |
+
* @see _.groupBy
|
6528 |
+
*/
|
6529 |
+
groupBy<TWhere>(
|
6530 |
+
iteratee?: TWhere
|
6531 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6532 |
+
}
|
6533 |
+
|
6534 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6535 |
+
/**
|
6536 |
+
* @see _.groupBy
|
6537 |
+
*/
|
6538 |
+
groupBy<T, TKey>(
|
6539 |
+
iteratee?: ListIterator<T, TKey>|DictionaryIterator<T, TKey>,
|
6540 |
+
thisArg?: any
|
6541 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6542 |
+
|
6543 |
+
/**
|
6544 |
+
* @see _.groupBy
|
6545 |
+
*/
|
6546 |
+
groupBy<T>(
|
6547 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
|
6548 |
+
thisArg?: any
|
6549 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6550 |
+
|
6551 |
+
/**
|
6552 |
+
* @see _.groupBy
|
6553 |
+
*/
|
6554 |
+
groupBy<T, TValue>(
|
6555 |
+
iteratee?: string,
|
6556 |
+
thisArg?: TValue
|
6557 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6558 |
+
|
6559 |
+
/**
|
6560 |
+
* @see _.groupBy
|
6561 |
+
*/
|
6562 |
+
groupBy<T>(
|
6563 |
+
iteratee?: string,
|
6564 |
+
thisArg?: any
|
6565 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6566 |
+
|
6567 |
+
/**
|
6568 |
+
* @see _.groupBy
|
6569 |
+
*/
|
6570 |
+
groupBy<TWhere, T>(
|
6571 |
+
iteratee?: TWhere
|
6572 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6573 |
+
|
6574 |
+
/**
|
6575 |
+
* @see _.groupBy
|
6576 |
+
*/
|
6577 |
+
groupBy<T>(
|
6578 |
+
iteratee?: Object
|
6579 |
+
): LoDashExplicitObjectWrapper<Dictionary<T[]>>;
|
6580 |
+
}
|
6581 |
+
|
6582 |
+
//_.include
|
6583 |
+
interface LoDashStatic {
|
6584 |
+
/**
|
6585 |
+
* @see _.includes
|
6586 |
+
*/
|
6587 |
+
include<T>(
|
6588 |
+
collection: List<T>|Dictionary<T>,
|
6589 |
+
target: T,
|
6590 |
+
fromIndex?: number
|
6591 |
+
): boolean;
|
6592 |
+
|
6593 |
+
/**
|
6594 |
+
* @see _.includes
|
6595 |
+
*/
|
6596 |
+
include(
|
6597 |
+
collection: string,
|
6598 |
+
target: string,
|
6599 |
+
fromIndex?: number
|
6600 |
+
): boolean;
|
6601 |
+
}
|
6602 |
+
|
6603 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6604 |
+
/**
|
6605 |
+
* @see _.includes
|
6606 |
+
*/
|
6607 |
+
include(
|
6608 |
+
target: T,
|
6609 |
+
fromIndex?: number
|
6610 |
+
): boolean;
|
6611 |
+
}
|
6612 |
+
|
6613 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6614 |
+
/**
|
6615 |
+
* @see _.includes
|
6616 |
+
*/
|
6617 |
+
include<TValue>(
|
6618 |
+
target: TValue,
|
6619 |
+
fromIndex?: number
|
6620 |
+
): boolean;
|
6621 |
+
}
|
6622 |
+
|
6623 |
+
interface LoDashImplicitWrapper<T> {
|
6624 |
+
/**
|
6625 |
+
* @see _.includes
|
6626 |
+
*/
|
6627 |
+
include(
|
6628 |
+
target: string,
|
6629 |
+
fromIndex?: number
|
6630 |
+
): boolean;
|
6631 |
+
}
|
6632 |
+
|
6633 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6634 |
+
/**
|
6635 |
+
* @see _.includes
|
6636 |
+
*/
|
6637 |
+
include(
|
6638 |
+
target: T,
|
6639 |
+
fromIndex?: number
|
6640 |
+
): LoDashExplicitWrapper<boolean>;
|
6641 |
+
}
|
6642 |
+
|
6643 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6644 |
+
/**
|
6645 |
+
* @see _.includes
|
6646 |
+
*/
|
6647 |
+
include<TValue>(
|
6648 |
+
target: TValue,
|
6649 |
+
fromIndex?: number
|
6650 |
+
): LoDashExplicitWrapper<boolean>;
|
6651 |
+
}
|
6652 |
+
|
6653 |
+
interface LoDashExplicitWrapper<T> {
|
6654 |
+
/**
|
6655 |
+
* @see _.includes
|
6656 |
+
*/
|
6657 |
+
include(
|
6658 |
+
target: string,
|
6659 |
+
fromIndex?: number
|
6660 |
+
): LoDashExplicitWrapper<boolean>;
|
6661 |
+
}
|
6662 |
+
|
6663 |
+
//_.includes
|
6664 |
+
interface LoDashStatic {
|
6665 |
+
/**
|
6666 |
+
* Checks if target is in collection using SameValueZero for equality comparisons. If fromIndex is negative,
|
6667 |
+
* it’s used as the offset from the end of collection.
|
6668 |
+
*
|
6669 |
+
* @alias _.contains, _.include
|
6670 |
+
*
|
6671 |
+
* @param collection The collection to search.
|
6672 |
+
* @param target The value to search for.
|
6673 |
+
* @param fromIndex The index to search from.
|
6674 |
+
* @return True if the target element is found, else false.
|
6675 |
+
*/
|
6676 |
+
includes<T>(
|
6677 |
+
collection: List<T>|Dictionary<T>,
|
6678 |
+
target: T,
|
6679 |
+
fromIndex?: number
|
6680 |
+
): boolean;
|
6681 |
+
|
6682 |
+
/**
|
6683 |
+
* @see _.includes
|
6684 |
+
*/
|
6685 |
+
includes(
|
6686 |
+
collection: string,
|
6687 |
+
target: string,
|
6688 |
+
fromIndex?: number
|
6689 |
+
): boolean;
|
6690 |
+
}
|
6691 |
+
|
6692 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6693 |
+
/**
|
6694 |
+
* @see _.includes
|
6695 |
+
*/
|
6696 |
+
includes(
|
6697 |
+
target: T,
|
6698 |
+
fromIndex?: number
|
6699 |
+
): boolean;
|
6700 |
+
}
|
6701 |
+
|
6702 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6703 |
+
/**
|
6704 |
+
* @see _.includes
|
6705 |
+
*/
|
6706 |
+
includes<TValue>(
|
6707 |
+
target: TValue,
|
6708 |
+
fromIndex?: number
|
6709 |
+
): boolean;
|
6710 |
+
}
|
6711 |
+
|
6712 |
+
interface LoDashImplicitWrapper<T> {
|
6713 |
+
/**
|
6714 |
+
* @see _.includes
|
6715 |
+
*/
|
6716 |
+
includes(
|
6717 |
+
target: string,
|
6718 |
+
fromIndex?: number
|
6719 |
+
): boolean;
|
6720 |
+
}
|
6721 |
+
|
6722 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6723 |
+
/**
|
6724 |
+
* @see _.includes
|
6725 |
+
*/
|
6726 |
+
includes(
|
6727 |
+
target: T,
|
6728 |
+
fromIndex?: number
|
6729 |
+
): LoDashExplicitWrapper<boolean>;
|
6730 |
+
}
|
6731 |
+
|
6732 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6733 |
+
/**
|
6734 |
+
* @see _.includes
|
6735 |
+
*/
|
6736 |
+
includes<TValue>(
|
6737 |
+
target: TValue,
|
6738 |
+
fromIndex?: number
|
6739 |
+
): LoDashExplicitWrapper<boolean>;
|
6740 |
+
}
|
6741 |
+
|
6742 |
+
interface LoDashExplicitWrapper<T> {
|
6743 |
+
/**
|
6744 |
+
* @see _.includes
|
6745 |
+
*/
|
6746 |
+
includes(
|
6747 |
+
target: string,
|
6748 |
+
fromIndex?: number
|
6749 |
+
): LoDashExplicitWrapper<boolean>;
|
6750 |
+
}
|
6751 |
+
|
6752 |
+
//_.indexBy
|
6753 |
+
interface LoDashStatic {
|
6754 |
+
/**
|
6755 |
+
* Creates an object composed of keys generated from the results of running each element of collection through
|
6756 |
+
* iteratee. The corresponding value of each key is the last element responsible for generating the key. The
|
6757 |
+
* iteratee function is bound to thisArg and invoked with three arguments:
|
6758 |
+
* (value, index|key, collection).
|
6759 |
+
*
|
6760 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property
|
6761 |
+
* value of the given element.
|
6762 |
+
*
|
6763 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
6764 |
+
* elements that have a matching property value, else false.
|
6765 |
+
*
|
6766 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
6767 |
+
* have the properties of the given object, else false.
|
6768 |
+
*
|
6769 |
+
* @param collection The collection to iterate over.
|
6770 |
+
* @param iteratee The function invoked per iteration.
|
6771 |
+
* @param thisArg The this binding of iteratee.
|
6772 |
+
* @return Returns the composed aggregate object.
|
6773 |
+
*/
|
6774 |
+
indexBy<T>(
|
6775 |
+
collection: List<T>,
|
6776 |
+
iteratee?: ListIterator<T, any>,
|
6777 |
+
thisArg?: any
|
6778 |
+
): Dictionary<T>;
|
6779 |
+
|
6780 |
+
/**
|
6781 |
+
* @see _.indexBy
|
6782 |
+
*/
|
6783 |
+
indexBy<T>(
|
6784 |
+
collection: NumericDictionary<T>,
|
6785 |
+
iteratee?: NumericDictionaryIterator<T, any>,
|
6786 |
+
thisArg?: any
|
6787 |
+
): Dictionary<T>;
|
6788 |
+
|
6789 |
+
/**
|
6790 |
+
* @see _.indexBy
|
6791 |
+
*/
|
6792 |
+
indexBy<T>(
|
6793 |
+
collection: Dictionary<T>,
|
6794 |
+
iteratee?: DictionaryIterator<T, any>,
|
6795 |
+
thisArg?: any
|
6796 |
+
): Dictionary<T>;
|
6797 |
+
|
6798 |
+
/**
|
6799 |
+
* @see _.indexBy
|
6800 |
+
*/
|
6801 |
+
indexBy<T>(
|
6802 |
+
collection: List<T>|NumericDictionary<T>|Dictionary<T>,
|
6803 |
+
iteratee?: string,
|
6804 |
+
thisArg?: any
|
6805 |
+
): Dictionary<T>;
|
6806 |
+
|
6807 |
+
/**
|
6808 |
+
* @see _.indexBy
|
6809 |
+
*/
|
6810 |
+
indexBy<W extends Object, T>(
|
6811 |
+
collection: List<T>|NumericDictionary<T>|Dictionary<T>,
|
6812 |
+
iteratee?: W
|
6813 |
+
): Dictionary<T>;
|
6814 |
+
|
6815 |
+
/**
|
6816 |
+
* @see _.indexBy
|
6817 |
+
*/
|
6818 |
+
indexBy<T>(
|
6819 |
+
collection: List<T>|NumericDictionary<T>|Dictionary<T>,
|
6820 |
+
iteratee?: Object
|
6821 |
+
): Dictionary<T>;
|
6822 |
+
}
|
6823 |
+
|
6824 |
+
interface LoDashImplicitWrapper<T> {
|
6825 |
+
/**
|
6826 |
+
* @see _.indexBy
|
6827 |
+
*/
|
6828 |
+
indexBy(
|
6829 |
+
iteratee?: ListIterator<T, any>,
|
6830 |
+
thisArg?: any
|
6831 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6832 |
+
}
|
6833 |
+
|
6834 |
+
interface LoDashImplicitArrayWrapper<T> {
|
6835 |
+
/**
|
6836 |
+
* @see _.indexBy
|
6837 |
+
*/
|
6838 |
+
indexBy(
|
6839 |
+
iteratee?: ListIterator<T, any>,
|
6840 |
+
thisArg?: any
|
6841 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6842 |
+
|
6843 |
+
/**
|
6844 |
+
* @see _.indexBy
|
6845 |
+
*/
|
6846 |
+
indexBy(
|
6847 |
+
iteratee?: string,
|
6848 |
+
thisArg?: any
|
6849 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6850 |
+
|
6851 |
+
/**
|
6852 |
+
* @see _.indexBy
|
6853 |
+
*/
|
6854 |
+
indexBy<W extends Object>(
|
6855 |
+
iteratee?: W
|
6856 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6857 |
+
}
|
6858 |
+
|
6859 |
+
interface LoDashImplicitObjectWrapper<T> {
|
6860 |
+
/**
|
6861 |
+
* @see _.indexBy
|
6862 |
+
*/
|
6863 |
+
indexBy<T>(
|
6864 |
+
iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>,
|
6865 |
+
thisArg?: any
|
6866 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6867 |
+
|
6868 |
+
/**
|
6869 |
+
* @see _.indexBy
|
6870 |
+
*/
|
6871 |
+
indexBy<T>(
|
6872 |
+
iteratee?: string,
|
6873 |
+
thisArg?: any
|
6874 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6875 |
+
|
6876 |
+
/**
|
6877 |
+
* @see _.indexBy
|
6878 |
+
*/
|
6879 |
+
indexBy<W extends Object, T>(
|
6880 |
+
iteratee?: W
|
6881 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6882 |
+
|
6883 |
+
/**
|
6884 |
+
* @see _.indexBy
|
6885 |
+
*/
|
6886 |
+
indexBy<T>(
|
6887 |
+
iteratee?: Object
|
6888 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
6889 |
+
}
|
6890 |
+
|
6891 |
+
interface LoDashExplicitWrapper<T> {
|
6892 |
+
/**
|
6893 |
+
* @see _.indexBy
|
6894 |
+
*/
|
6895 |
+
indexBy(
|
6896 |
+
iteratee?: ListIterator<T, any>,
|
6897 |
+
thisArg?: any
|
6898 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6899 |
+
}
|
6900 |
+
|
6901 |
+
interface LoDashExplicitArrayWrapper<T> {
|
6902 |
+
/**
|
6903 |
+
* @see _.indexBy
|
6904 |
+
*/
|
6905 |
+
indexBy(
|
6906 |
+
iteratee?: ListIterator<T, any>,
|
6907 |
+
thisArg?: any
|
6908 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6909 |
+
|
6910 |
+
/**
|
6911 |
+
* @see _.indexBy
|
6912 |
+
*/
|
6913 |
+
indexBy(
|
6914 |
+
iteratee?: string,
|
6915 |
+
thisArg?: any
|
6916 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6917 |
+
|
6918 |
+
/**
|
6919 |
+
* @see _.indexBy
|
6920 |
+
*/
|
6921 |
+
indexBy<W extends Object>(
|
6922 |
+
iteratee?: W
|
6923 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6924 |
+
}
|
6925 |
+
|
6926 |
+
interface LoDashExplicitObjectWrapper<T> {
|
6927 |
+
/**
|
6928 |
+
* @see _.indexBy
|
6929 |
+
*/
|
6930 |
+
indexBy<T>(
|
6931 |
+
iteratee?: ListIterator<T, any>|NumericDictionaryIterator<T, any>|DictionaryIterator<T, any>,
|
6932 |
+
thisArg?: any
|
6933 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6934 |
+
|
6935 |
+
/**
|
6936 |
+
* @see _.indexBy
|
6937 |
+
*/
|
6938 |
+
indexBy<T>(
|
6939 |
+
iteratee?: string,
|
6940 |
+
thisArg?: any
|
6941 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6942 |
+
|
6943 |
+
/**
|
6944 |
+
* @see _.indexBy
|
6945 |
+
*/
|
6946 |
+
indexBy<W extends Object, T>(
|
6947 |
+
iteratee?: W
|
6948 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6949 |
+
|
6950 |
+
/**
|
6951 |
+
* @see _.indexBy
|
6952 |
+
*/
|
6953 |
+
indexBy<T>(
|
6954 |
+
iteratee?: Object
|
6955 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
6956 |
+
}
|
6957 |
+
|
6958 |
+
//_.invoke
|
6959 |
+
interface LoDashStatic {
|
6960 |
+
/**
|
6961 |
+
* Invokes the method named by methodName on each element in the collection returning
|
6962 |
+
* an array of the results of each invoked method. Additional arguments will be provided
|
6963 |
+
* to each invoked method. If methodName is a function it will be invoked for, and this
|
6964 |
+
* bound to, each element in the collection.
|
6965 |
+
* @param collection The collection to iterate over.
|
6966 |
+
* @param methodName The name of the method to invoke.
|
6967 |
+
* @param args Arguments to invoke the method with.
|
6968 |
+
**/
|
6969 |
+
invoke<T extends {}>(
|
6970 |
+
collection: Array<T>,
|
6971 |
+
methodName: string,
|
6972 |
+
...args: any[]): any;
|
6973 |
+
|
6974 |
+
/**
|
6975 |
+
* @see _.invoke
|
6976 |
+
**/
|
6977 |
+
invoke<T extends {}>(
|
6978 |
+
collection: List<T>,
|
6979 |
+
methodName: string,
|
6980 |
+
...args: any[]): any;
|
6981 |
+
|
6982 |
+
/**
|
6983 |
+
* @see _.invoke
|
6984 |
+
**/
|
6985 |
+
invoke<T extends {}>(
|
6986 |
+
collection: Dictionary<T>,
|
6987 |
+
methodName: string,
|
6988 |
+
...args: any[]): any;
|
6989 |
+
|
6990 |
+
/**
|
6991 |
+
* @see _.invoke
|
6992 |
+
**/
|
6993 |
+
invoke<T extends {}>(
|
6994 |
+
collection: Array<T>,
|
6995 |
+
method: Function,
|
6996 |
+
...args: any[]): any;
|
6997 |
+
|
6998 |
+
/**
|
6999 |
+
* @see _.invoke
|
7000 |
+
**/
|
7001 |
+
invoke<T extends {}>(
|
7002 |
+
collection: List<T>,
|
7003 |
+
method: Function,
|
7004 |
+
...args: any[]): any;
|
7005 |
+
|
7006 |
+
/**
|
7007 |
+
* @see _.invoke
|
7008 |
+
**/
|
7009 |
+
invoke<T extends {}>(
|
7010 |
+
collection: Dictionary<T>,
|
7011 |
+
method: Function,
|
7012 |
+
...args: any[]): any;
|
7013 |
+
}
|
7014 |
+
|
7015 |
+
//_.map
|
7016 |
+
interface LoDashStatic {
|
7017 |
+
/**
|
7018 |
+
* Creates an array of values by running each element in collection through iteratee. The iteratee is bound to
|
7019 |
+
* thisArg and invoked with three arguments: (value, index|key, collection).
|
7020 |
+
*
|
7021 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property value
|
7022 |
+
* of the given element.
|
7023 |
+
*
|
7024 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
7025 |
+
* elements that have a matching property value, else false.
|
7026 |
+
*
|
7027 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
7028 |
+
* have the properties of the given object, else false.
|
7029 |
+
*
|
7030 |
+
* Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues,
|
7031 |
+
* _.reject, and _.some.
|
7032 |
+
*
|
7033 |
+
* The guarded methods are:
|
7034 |
+
* ary, callback, chunk, clone, create, curry, curryRight, drop, dropRight, every, fill, flatten, invert, max,
|
7035 |
+
* min, parseInt, slice, sortBy, take, takeRight, template, trim, trimLeft, trimRight, trunc, random, range,
|
7036 |
+
* sample, some, sum, uniq, and words
|
7037 |
+
*
|
7038 |
+
* @alias _.collect
|
7039 |
+
*
|
7040 |
+
* @param collection The collection to iterate over.
|
7041 |
+
* @param iteratee The function invoked per iteration.
|
7042 |
+
* @param thisArg The this binding of iteratee.
|
7043 |
+
* @return Returns the new mapped array.
|
7044 |
+
*/
|
7045 |
+
map<T, TResult>(
|
7046 |
+
collection: List<T>,
|
7047 |
+
iteratee?: ListIterator<T, TResult>,
|
7048 |
+
thisArg?: any
|
7049 |
+
): TResult[];
|
7050 |
+
|
7051 |
+
/**
|
7052 |
+
* @see _.map
|
7053 |
+
*/
|
7054 |
+
map<T extends {}, TResult>(
|
7055 |
+
collection: Dictionary<T>,
|
7056 |
+
iteratee?: DictionaryIterator<T, TResult>,
|
7057 |
+
thisArg?: any
|
7058 |
+
): TResult[];
|
7059 |
+
|
7060 |
+
/**
|
7061 |
+
* @see _.map
|
7062 |
+
*/
|
7063 |
+
map<T, TResult>(
|
7064 |
+
collection: List<T>|Dictionary<T>,
|
7065 |
+
iteratee?: string
|
7066 |
+
): TResult[];
|
7067 |
+
|
7068 |
+
/**
|
7069 |
+
* @see _.map
|
7070 |
+
*/
|
7071 |
+
map<T, TObject extends {}>(
|
7072 |
+
collection: List<T>|Dictionary<T>,
|
7073 |
+
iteratee?: TObject
|
7074 |
+
): boolean[];
|
7075 |
+
}
|
7076 |
+
|
7077 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7078 |
+
/**
|
7079 |
+
* @see _.map
|
7080 |
+
*/
|
7081 |
+
map<TResult>(
|
7082 |
+
iteratee?: ListIterator<T, TResult>,
|
7083 |
+
thisArg?: any
|
7084 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
7085 |
+
|
7086 |
+
/**
|
7087 |
+
* @see _.map
|
7088 |
+
*/
|
7089 |
+
map<TResult>(
|
7090 |
+
iteratee?: string
|
7091 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
7092 |
+
|
7093 |
+
/**
|
7094 |
+
* @see _.map
|
7095 |
+
*/
|
7096 |
+
map<TObject extends {}>(
|
7097 |
+
iteratee?: TObject
|
7098 |
+
): LoDashImplicitArrayWrapper<boolean>;
|
7099 |
+
}
|
7100 |
+
|
7101 |
+
interface LoDashImplicitObjectWrapper<T> {
|
7102 |
+
/**
|
7103 |
+
* @see _.map
|
7104 |
+
*/
|
7105 |
+
map<TValue, TResult>(
|
7106 |
+
iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
|
7107 |
+
thisArg?: any
|
7108 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
7109 |
+
|
7110 |
+
/**
|
7111 |
+
* @see _.map
|
7112 |
+
*/
|
7113 |
+
map<TValue, TResult>(
|
7114 |
+
iteratee?: string
|
7115 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
7116 |
+
|
7117 |
+
/**
|
7118 |
+
* @see _.map
|
7119 |
+
*/
|
7120 |
+
map<TObject extends {}>(
|
7121 |
+
iteratee?: TObject
|
7122 |
+
): LoDashImplicitArrayWrapper<boolean>;
|
7123 |
+
}
|
7124 |
+
|
7125 |
+
interface LoDashExplicitArrayWrapper<T> {
|
7126 |
+
/**
|
7127 |
+
* @see _.map
|
7128 |
+
*/
|
7129 |
+
map<TResult>(
|
7130 |
+
iteratee?: ListIterator<T, TResult>,
|
7131 |
+
thisArg?: any
|
7132 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
7133 |
+
|
7134 |
+
/**
|
7135 |
+
* @see _.map
|
7136 |
+
*/
|
7137 |
+
map<TResult>(
|
7138 |
+
iteratee?: string
|
7139 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
7140 |
+
|
7141 |
+
/**
|
7142 |
+
* @see _.map
|
7143 |
+
*/
|
7144 |
+
map<TObject extends {}>(
|
7145 |
+
iteratee?: TObject
|
7146 |
+
): LoDashExplicitArrayWrapper<boolean>;
|
7147 |
+
}
|
7148 |
+
|
7149 |
+
interface LoDashExplicitObjectWrapper<T> {
|
7150 |
+
/**
|
7151 |
+
* @see _.map
|
7152 |
+
*/
|
7153 |
+
map<TValue, TResult>(
|
7154 |
+
iteratee?: ListIterator<TValue, TResult>|DictionaryIterator<TValue, TResult>,
|
7155 |
+
thisArg?: any
|
7156 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
7157 |
+
|
7158 |
+
/**
|
7159 |
+
* @see _.map
|
7160 |
+
*/
|
7161 |
+
map<TValue, TResult>(
|
7162 |
+
iteratee?: string
|
7163 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
7164 |
+
|
7165 |
+
/**
|
7166 |
+
* @see _.map
|
7167 |
+
*/
|
7168 |
+
map<TObject extends {}>(
|
7169 |
+
iteratee?: TObject
|
7170 |
+
): LoDashExplicitArrayWrapper<boolean>;
|
7171 |
+
}
|
7172 |
+
|
7173 |
+
//_.partition
|
7174 |
+
interface LoDashStatic {
|
7175 |
+
/**
|
7176 |
+
* Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for,
|
7177 |
+
* while the second of which contains elements predicate returns falsey for.
|
7178 |
+
* The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection).
|
7179 |
+
*
|
7180 |
+
* If a property name is provided for predicate the created _.property style callback
|
7181 |
+
* returns the property value of the given element.
|
7182 |
+
*
|
7183 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback
|
7184 |
+
* returns true for elements that have a matching property value, else false.
|
7185 |
+
*
|
7186 |
+
* If an object is provided for predicate the created _.matches style callback returns
|
7187 |
+
* true for elements that have the properties of the given object, else false.
|
7188 |
+
*
|
7189 |
+
* @param collection The collection to iterate over.
|
7190 |
+
* @param callback The function called per iteration.
|
7191 |
+
* @param thisArg The this binding of predicate.
|
7192 |
+
* @return Returns the array of grouped elements.
|
7193 |
+
**/
|
7194 |
+
partition<T>(
|
7195 |
+
collection: List<T>,
|
7196 |
+
callback: ListIterator<T, boolean>,
|
7197 |
+
thisArg?: any): T[][];
|
7198 |
+
|
7199 |
+
/**
|
7200 |
+
* @see _.partition
|
7201 |
+
**/
|
7202 |
+
partition<T>(
|
7203 |
+
collection: Dictionary<T>,
|
7204 |
+
callback: DictionaryIterator<T, boolean>,
|
7205 |
+
thisArg?: any): T[][];
|
7206 |
+
|
7207 |
+
/**
|
7208 |
+
* @see _.partition
|
7209 |
+
**/
|
7210 |
+
partition<W, T>(
|
7211 |
+
collection: List<T>,
|
7212 |
+
whereValue: W): T[][];
|
7213 |
+
|
7214 |
+
/**
|
7215 |
+
* @see _.partition
|
7216 |
+
**/
|
7217 |
+
partition<W, T>(
|
7218 |
+
collection: Dictionary<T>,
|
7219 |
+
whereValue: W): T[][];
|
7220 |
+
|
7221 |
+
/**
|
7222 |
+
* @see _.partition
|
7223 |
+
**/
|
7224 |
+
partition<T>(
|
7225 |
+
collection: List<T>,
|
7226 |
+
path: string,
|
7227 |
+
srcValue: any): T[][];
|
7228 |
+
|
7229 |
+
/**
|
7230 |
+
* @see _.partition
|
7231 |
+
**/
|
7232 |
+
partition<T>(
|
7233 |
+
collection: Dictionary<T>,
|
7234 |
+
path: string,
|
7235 |
+
srcValue: any): T[][];
|
7236 |
+
|
7237 |
+
/**
|
7238 |
+
* @see _.partition
|
7239 |
+
**/
|
7240 |
+
partition<T>(
|
7241 |
+
collection: List<T>,
|
7242 |
+
pluckValue: string): T[][];
|
7243 |
+
|
7244 |
+
/**
|
7245 |
+
* @see _.partition
|
7246 |
+
**/
|
7247 |
+
partition<T>(
|
7248 |
+
collection: Dictionary<T>,
|
7249 |
+
pluckValue: string): T[][];
|
7250 |
+
}
|
7251 |
+
|
7252 |
+
interface LoDashImplicitStringWrapper {
|
7253 |
+
/**
|
7254 |
+
* @see _.partition
|
7255 |
+
*/
|
7256 |
+
partition(
|
7257 |
+
callback: ListIterator<string, boolean>,
|
7258 |
+
thisArg?: any): LoDashImplicitArrayWrapper<string[]>;
|
7259 |
+
}
|
7260 |
+
|
7261 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7262 |
+
/**
|
7263 |
+
* @see _.partition
|
7264 |
+
*/
|
7265 |
+
partition(
|
7266 |
+
callback: ListIterator<T, boolean>,
|
7267 |
+
thisArg?: any): LoDashImplicitArrayWrapper<T[]>;
|
7268 |
+
/**
|
7269 |
+
* @see _.partition
|
7270 |
+
*/
|
7271 |
+
partition<W>(
|
7272 |
+
whereValue: W): LoDashImplicitArrayWrapper<T[]>;
|
7273 |
+
/**
|
7274 |
+
* @see _.partition
|
7275 |
+
*/
|
7276 |
+
partition(
|
7277 |
+
path: string,
|
7278 |
+
srcValue: any): LoDashImplicitArrayWrapper<T[]>;
|
7279 |
+
/**
|
7280 |
+
* @see _.partition
|
7281 |
+
*/
|
7282 |
+
partition(
|
7283 |
+
pluckValue: string): LoDashImplicitArrayWrapper<T[]>;
|
7284 |
+
}
|
7285 |
+
|
7286 |
+
interface LoDashImplicitObjectWrapper<T> {
|
7287 |
+
/**
|
7288 |
+
* @see _.partition
|
7289 |
+
*/
|
7290 |
+
partition<TResult>(
|
7291 |
+
callback: ListIterator<TResult, boolean>,
|
7292 |
+
thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
|
7293 |
+
|
7294 |
+
/**
|
7295 |
+
* @see _.partition
|
7296 |
+
*/
|
7297 |
+
partition<TResult>(
|
7298 |
+
callback: DictionaryIterator<TResult, boolean>,
|
7299 |
+
thisArg?: any): LoDashImplicitArrayWrapper<TResult[]>;
|
7300 |
+
|
7301 |
+
/**
|
7302 |
+
* @see _.partition
|
7303 |
+
*/
|
7304 |
+
partition<W, TResult>(
|
7305 |
+
whereValue: W): LoDashImplicitArrayWrapper<TResult[]>;
|
7306 |
+
|
7307 |
+
/**
|
7308 |
+
* @see _.partition
|
7309 |
+
*/
|
7310 |
+
partition<TResult>(
|
7311 |
+
path: string,
|
7312 |
+
srcValue: any): LoDashImplicitArrayWrapper<TResult[]>;
|
7313 |
+
|
7314 |
+
/**
|
7315 |
+
* @see _.partition
|
7316 |
+
*/
|
7317 |
+
partition<TResult>(
|
7318 |
+
pluckValue: string): LoDashImplicitArrayWrapper<TResult[]>;
|
7319 |
+
}
|
7320 |
+
|
7321 |
+
//_.pluck
|
7322 |
+
interface LoDashStatic {
|
7323 |
+
/**
|
7324 |
+
* Gets the property value of path from all elements in collection.
|
7325 |
+
*
|
7326 |
+
* @param collection The collection to iterate over.
|
7327 |
+
* @param path The path of the property to pluck.
|
7328 |
+
* @return A new array of property values.
|
7329 |
+
*/
|
7330 |
+
pluck<T extends {}>(
|
7331 |
+
collection: List<T>|Dictionary<T>,
|
7332 |
+
path: StringRepresentable|StringRepresentable[]
|
7333 |
+
): any[];
|
7334 |
+
|
7335 |
+
/**
|
7336 |
+
* @see _.pluck
|
7337 |
+
*/
|
7338 |
+
pluck<T extends {}, TResult>(
|
7339 |
+
collection: List<T>|Dictionary<T>,
|
7340 |
+
path: StringRepresentable|StringRepresentable[]
|
7341 |
+
): TResult[];
|
7342 |
+
}
|
7343 |
+
|
7344 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7345 |
+
/**
|
7346 |
+
* @see _.pluck
|
7347 |
+
*/
|
7348 |
+
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7349 |
+
}
|
7350 |
+
|
7351 |
+
interface LoDashImplicitObjectWrapper<T> {
|
7352 |
+
/**
|
7353 |
+
* @see _.pluck
|
7354 |
+
*/
|
7355 |
+
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashImplicitArrayWrapper<TResult>;
|
7356 |
+
}
|
7357 |
+
|
7358 |
+
interface LoDashExplicitArrayWrapper<T> {
|
7359 |
+
/**
|
7360 |
+
* @see _.pluck
|
7361 |
+
*/
|
7362 |
+
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7363 |
+
}
|
7364 |
+
|
7365 |
+
interface LoDashExplicitObjectWrapper<T> {
|
7366 |
+
/**
|
7367 |
+
* @see _.pluck
|
7368 |
+
*/
|
7369 |
+
pluck<TResult>(path: StringRepresentable|StringRepresentable[]): LoDashExplicitArrayWrapper<TResult>;
|
7370 |
+
}
|
7371 |
+
|
7372 |
+
//_.reduce
|
7373 |
+
interface LoDashStatic {
|
7374 |
+
/**
|
7375 |
+
* Reduces a collection to a value which is the accumulated result of running each
|
7376 |
+
* element in the collection through the callback, where each successive callback execution
|
7377 |
+
* consumes the return value of the previous execution. If accumulator is not provided the
|
7378 |
+
* first element of the collection will be used as the initial accumulator value. The callback
|
7379 |
+
* is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection).
|
7380 |
+
* @param collection The collection to iterate over.
|
7381 |
+
* @param callback The function called per iteration.
|
7382 |
+
* @param accumulator Initial value of the accumulator.
|
7383 |
+
* @param thisArg The this binding of callback.
|
7384 |
+
* @return Returns the accumulated value.
|
7385 |
+
**/
|
7386 |
+
reduce<T, TResult>(
|
7387 |
+
collection: Array<T>,
|
7388 |
+
callback: MemoIterator<T, TResult>,
|
7389 |
+
accumulator: TResult,
|
7390 |
+
thisArg?: any): TResult;
|
7391 |
+
|
7392 |
+
/**
|
7393 |
+
* @see _.reduce
|
7394 |
+
**/
|
7395 |
+
reduce<T, TResult>(
|
7396 |
+
collection: List<T>,
|
7397 |
+
callback: MemoIterator<T, TResult>,
|
7398 |
+
accumulator: TResult,
|
7399 |
+
thisArg?: any): TResult;
|
7400 |
+
|
7401 |
+
/**
|
7402 |
+
* @see _.reduce
|
7403 |
+
**/
|
7404 |
+
reduce<T, TResult>(
|
7405 |
+
collection: Dictionary<T>,
|
7406 |
+
callback: MemoIterator<T, TResult>,
|
7407 |
+
accumulator: TResult,
|
7408 |
+
thisArg?: any): TResult;
|
7409 |
+
|
7410 |
+
/**
|
7411 |
+
* @see _.reduce
|
7412 |
+
**/
|
7413 |
+
reduce<T, TResult>(
|
7414 |
+
collection: Array<T>,
|
7415 |
+
callback: MemoIterator<T, TResult>,
|
7416 |
+
thisArg?: any): TResult;
|
7417 |
+
|
7418 |
+
/**
|
7419 |
+
* @see _.reduce
|
7420 |
+
**/
|
7421 |
+
reduce<T, TResult>(
|
7422 |
+
collection: List<T>,
|
7423 |
+
callback: MemoIterator<T, TResult>,
|
7424 |
+
thisArg?: any): TResult;
|
7425 |
+
|
7426 |
+
/**
|
7427 |
+
* @see _.reduce
|
7428 |
+
**/
|
7429 |
+
reduce<T, TResult>(
|
7430 |
+
collection: Dictionary<T>,
|
7431 |
+
callback: MemoIterator<T, TResult>,
|
7432 |
+
thisArg?: any): TResult;
|
7433 |
+
|
7434 |
+
/**
|
7435 |
+
* @see _.reduce
|
7436 |
+
**/
|
7437 |
+
inject<T, TResult>(
|
7438 |
+
collection: Array<T>,
|
7439 |
+
callback: MemoIterator<T, TResult>,
|
7440 |
+
accumulator: TResult,
|
7441 |
+
thisArg?: any): TResult;
|
7442 |
+
|
7443 |
+
/**
|
7444 |
+
* @see _.reduce
|
7445 |
+
**/
|
7446 |
+
inject<T, TResult>(
|
7447 |
+
collection: List<T>,
|
7448 |
+
callback: MemoIterator<T, TResult>,
|
7449 |
+
accumulator: TResult,
|
7450 |
+
thisArg?: any): TResult;
|
7451 |
+
|
7452 |
+
/**
|
7453 |
+
* @see _.reduce
|
7454 |
+
**/
|
7455 |
+
inject<T, TResult>(
|
7456 |
+
collection: Dictionary<T>,
|
7457 |
+
callback: MemoIterator<T, TResult>,
|
7458 |
+
accumulator: TResult,
|
7459 |
+
thisArg?: any): TResult;
|
7460 |
+
|
7461 |
+
/**
|
7462 |
+
* @see _.reduce
|
7463 |
+
**/
|
7464 |
+
inject<T, TResult>(
|
7465 |
+
collection: Array<T>,
|
7466 |
+
callback: MemoIterator<T, TResult>,
|
7467 |
+
thisArg?: any): TResult;
|
7468 |
+
|
7469 |
+
/**
|
7470 |
+
* @see _.reduce
|
7471 |
+
**/
|
7472 |
+
inject<T, TResult>(
|
7473 |
+
collection: List<T>,
|
7474 |
+
callback: MemoIterator<T, TResult>,
|
7475 |
+
thisArg?: any): TResult;
|
7476 |
+
|
7477 |
+
/**
|
7478 |
+
* @see _.reduce
|
7479 |
+
**/
|
7480 |
+
inject<T, TResult>(
|
7481 |
+
collection: Dictionary<T>,
|
7482 |
+
callback: MemoIterator<T, TResult>,
|
7483 |
+
thisArg?: any): TResult;
|
7484 |
+
|
7485 |
+
/**
|
7486 |
+
* @see _.reduce
|
7487 |
+
**/
|
7488 |
+
foldl<T, TResult>(
|
7489 |
+
collection: Array<T>,
|
7490 |
+
callback: MemoIterator<T, TResult>,
|
7491 |
+
accumulator: TResult,
|
7492 |
+
thisArg?: any): TResult;
|
7493 |
+
|
7494 |
+
/**
|
7495 |
+
* @see _.reduce
|
7496 |
+
**/
|
7497 |
+
foldl<T, TResult>(
|
7498 |
+
collection: List<T>,
|
7499 |
+
callback: MemoIterator<T, TResult>,
|
7500 |
+
accumulator: TResult,
|
7501 |
+
thisArg?: any): TResult;
|
7502 |
+
|
7503 |
+
/**
|
7504 |
+
* @see _.reduce
|
7505 |
+
**/
|
7506 |
+
foldl<T, TResult>(
|
7507 |
+
collection: Dictionary<T>,
|
7508 |
+
callback: MemoIterator<T, TResult>,
|
7509 |
+
accumulator: TResult,
|
7510 |
+
thisArg?: any): TResult;
|
7511 |
+
|
7512 |
+
/**
|
7513 |
+
* @see _.reduce
|
7514 |
+
**/
|
7515 |
+
foldl<T, TResult>(
|
7516 |
+
collection: Array<T>,
|
7517 |
+
callback: MemoIterator<T, TResult>,
|
7518 |
+
thisArg?: any): TResult;
|
7519 |
+
|
7520 |
+
/**
|
7521 |
+
* @see _.reduce
|
7522 |
+
**/
|
7523 |
+
foldl<T, TResult>(
|
7524 |
+
collection: List<T>,
|
7525 |
+
callback: MemoIterator<T, TResult>,
|
7526 |
+
thisArg?: any): TResult;
|
7527 |
+
|
7528 |
+
/**
|
7529 |
+
* @see _.reduce
|
7530 |
+
**/
|
7531 |
+
foldl<T, TResult>(
|
7532 |
+
collection: Dictionary<T>,
|
7533 |
+
callback: MemoIterator<T, TResult>,
|
7534 |
+
thisArg?: any): TResult;
|
7535 |
+
}
|
7536 |
+
|
7537 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7538 |
+
/**
|
7539 |
+
* @see _.reduce
|
7540 |
+
**/
|
7541 |
+
reduce<TResult>(
|
7542 |
+
callback: MemoIterator<T, TResult>,
|
7543 |
+
accumulator: TResult,
|
7544 |
+
thisArg?: any): TResult;
|
7545 |
+
|
7546 |
+
/**
|
7547 |
+
* @see _.reduce
|
7548 |
+
**/
|
7549 |
+
reduce<TResult>(
|
7550 |
+
callback: MemoIterator<T, TResult>,
|
7551 |
+
thisArg?: any): TResult;
|
7552 |
+
|
7553 |
+
/**
|
7554 |
+
* @see _.reduce
|
7555 |
+
**/
|
7556 |
+
inject<TResult>(
|
7557 |
+
callback: MemoIterator<T, TResult>,
|
7558 |
+
accumulator: TResult,
|
7559 |
+
thisArg?: any): TResult;
|
7560 |
+
|
7561 |
+
/**
|
7562 |
+
* @see _.reduce
|
7563 |
+
**/
|
7564 |
+
inject<TResult>(
|
7565 |
+
callback: MemoIterator<T, TResult>,
|
7566 |
+
thisArg?: any): TResult;
|
7567 |
+
|
7568 |
+
/**
|
7569 |
+
* @see _.reduce
|
7570 |
+
**/
|
7571 |
+
foldl<TResult>(
|
7572 |
+
callback: MemoIterator<T, TResult>,
|
7573 |
+
accumulator: TResult,
|
7574 |
+
thisArg?: any): TResult;
|
7575 |
+
|
7576 |
+
/**
|
7577 |
+
* @see _.reduce
|
7578 |
+
**/
|
7579 |
+
foldl<TResult>(
|
7580 |
+
callback: MemoIterator<T, TResult>,
|
7581 |
+
thisArg?: any): TResult;
|
7582 |
+
}
|
7583 |
+
|
7584 |
+
interface LoDashImplicitObjectWrapper<T> {
|
7585 |
+
/**
|
7586 |
+
* @see _.reduce
|
7587 |
+
**/
|
7588 |
+
reduce<TValue, TResult>(
|
7589 |
+
callback: MemoIterator<TValue, TResult>,
|
7590 |
+
accumulator: TResult,
|
7591 |
+
thisArg?: any): TResult;
|
7592 |
+
|
7593 |
+
/**
|
7594 |
+
* @see _.reduce
|
7595 |
+
**/
|
7596 |
+
reduce<TValue, TResult>(
|
7597 |
+
callback: MemoIterator<TValue, TResult>,
|
7598 |
+
thisArg?: any): TResult;
|
7599 |
+
|
7600 |
+
/**
|
7601 |
+
* @see _.reduce
|
7602 |
+
**/
|
7603 |
+
inject<TValue, TResult>(
|
7604 |
+
callback: MemoIterator<TValue, TResult>,
|
7605 |
+
accumulator: TResult,
|
7606 |
+
thisArg?: any): TResult;
|
7607 |
+
|
7608 |
+
/**
|
7609 |
+
* @see _.reduce
|
7610 |
+
**/
|
7611 |
+
inject<TValue, TResult>(
|
7612 |
+
callback: MemoIterator<TValue, TResult>,
|
7613 |
+
thisArg?: any): TResult;
|
7614 |
+
|
7615 |
+
/**
|
7616 |
+
* @see _.reduce
|
7617 |
+
**/
|
7618 |
+
foldl<TValue, TResult>(
|
7619 |
+
callback: MemoIterator<TValue, TResult>,
|
7620 |
+
accumulator: TResult,
|
7621 |
+
thisArg?: any): TResult;
|
7622 |
+
|
7623 |
+
/**
|
7624 |
+
* @see _.reduce
|
7625 |
+
**/
|
7626 |
+
foldl<TValue, TResult>(
|
7627 |
+
callback: MemoIterator<TValue, TResult>,
|
7628 |
+
thisArg?: any): TResult;
|
7629 |
+
}
|
7630 |
+
|
7631 |
+
//_.reduceRight
|
7632 |
+
interface LoDashStatic {
|
7633 |
+
/**
|
7634 |
+
* This method is like _.reduce except that it iterates over elements of a collection from
|
7635 |
+
* right to left.
|
7636 |
+
* @param collection The collection to iterate over.
|
7637 |
+
* @param callback The function called per iteration.
|
7638 |
+
* @param accumulator Initial value of the accumulator.
|
7639 |
+
* @param thisArg The this binding of callback.
|
7640 |
+
* @return The accumulated value.
|
7641 |
+
**/
|
7642 |
+
reduceRight<T, TResult>(
|
7643 |
+
collection: Array<T>,
|
7644 |
+
callback: MemoIterator<T, TResult>,
|
7645 |
+
accumulator: TResult,
|
7646 |
+
thisArg?: any): TResult;
|
7647 |
+
|
7648 |
+
/**
|
7649 |
+
* @see _.reduceRight
|
7650 |
+
**/
|
7651 |
+
reduceRight<T, TResult>(
|
7652 |
+
collection: List<T>,
|
7653 |
+
callback: MemoIterator<T, TResult>,
|
7654 |
+
accumulator: TResult,
|
7655 |
+
thisArg?: any): TResult;
|
7656 |
+
|
7657 |
+
/**
|
7658 |
+
* @see _.reduceRight
|
7659 |
+
**/
|
7660 |
+
reduceRight<T, TResult>(
|
7661 |
+
collection: Dictionary<T>,
|
7662 |
+
callback: MemoIterator<T, TResult>,
|
7663 |
+
accumulator: TResult,
|
7664 |
+
thisArg?: any): TResult;
|
7665 |
+
|
7666 |
+
/**
|
7667 |
+
* @see _.reduceRight
|
7668 |
+
**/
|
7669 |
+
reduceRight<T, TResult>(
|
7670 |
+
collection: Array<T>,
|
7671 |
+
callback: MemoIterator<T, TResult>,
|
7672 |
+
thisArg?: any): TResult;
|
7673 |
+
|
7674 |
+
/**
|
7675 |
+
* @see _.reduceRight
|
7676 |
+
**/
|
7677 |
+
reduceRight<T, TResult>(
|
7678 |
+
collection: List<T>,
|
7679 |
+
callback: MemoIterator<T, TResult>,
|
7680 |
+
thisArg?: any): TResult;
|
7681 |
+
|
7682 |
+
/**
|
7683 |
+
* @see _.reduceRight
|
7684 |
+
**/
|
7685 |
+
reduceRight<T, TResult>(
|
7686 |
+
collection: Dictionary<T>,
|
7687 |
+
callback: MemoIterator<T, TResult>,
|
7688 |
+
thisArg?: any): TResult;
|
7689 |
+
|
7690 |
+
/**
|
7691 |
+
* @see _.reduceRight
|
7692 |
+
**/
|
7693 |
+
foldr<T, TResult>(
|
7694 |
+
collection: Array<T>,
|
7695 |
+
callback: MemoIterator<T, TResult>,
|
7696 |
+
accumulator: TResult,
|
7697 |
+
thisArg?: any): TResult;
|
7698 |
+
|
7699 |
+
/**
|
7700 |
+
* @see _.reduceRight
|
7701 |
+
**/
|
7702 |
+
foldr<T, TResult>(
|
7703 |
+
collection: List<T>,
|
7704 |
+
callback: MemoIterator<T, TResult>,
|
7705 |
+
accumulator: TResult,
|
7706 |
+
thisArg?: any): TResult;
|
7707 |
+
|
7708 |
+
/**
|
7709 |
+
* @see _.reduceRight
|
7710 |
+
**/
|
7711 |
+
foldr<T, TResult>(
|
7712 |
+
collection: Dictionary<T>,
|
7713 |
+
callback: MemoIterator<T, TResult>,
|
7714 |
+
accumulator: TResult,
|
7715 |
+
thisArg?: any): TResult;
|
7716 |
+
|
7717 |
+
/**
|
7718 |
+
* @see _.reduceRight
|
7719 |
+
**/
|
7720 |
+
foldr<T, TResult>(
|
7721 |
+
collection: Array<T>,
|
7722 |
+
callback: MemoIterator<T, TResult>,
|
7723 |
+
thisArg?: any): TResult;
|
7724 |
+
|
7725 |
+
/**
|
7726 |
+
* @see _.reduceRight
|
7727 |
+
**/
|
7728 |
+
foldr<T, TResult>(
|
7729 |
+
collection: List<T>,
|
7730 |
+
callback: MemoIterator<T, TResult>,
|
7731 |
+
thisArg?: any): TResult;
|
7732 |
+
|
7733 |
+
/**
|
7734 |
+
* @see _.reduceRight
|
7735 |
+
**/
|
7736 |
+
foldr<T, TResult>(
|
7737 |
+
collection: Dictionary<T>,
|
7738 |
+
callback: MemoIterator<T, TResult>,
|
7739 |
+
thisArg?: any): TResult;
|
7740 |
+
}
|
7741 |
+
|
7742 |
+
//_.reject
|
7743 |
+
interface LoDashStatic {
|
7744 |
+
/**
|
7745 |
+
* The opposite of _.filter; this method returns the elements of collection that predicate does not return
|
7746 |
+
* truthy for.
|
7747 |
+
*
|
7748 |
+
* @param collection The collection to iterate over.
|
7749 |
+
* @param predicate The function invoked per iteration.
|
7750 |
+
* @param thisArg The this binding of predicate.
|
7751 |
+
* @return Returns the new filtered array.
|
7752 |
+
*/
|
7753 |
+
reject<T>(
|
7754 |
+
collection: List<T>,
|
7755 |
+
predicate?: ListIterator<T, boolean>,
|
7756 |
+
thisArg?: any
|
7757 |
+
): T[];
|
7758 |
+
|
7759 |
+
/**
|
7760 |
+
* @see _.reject
|
7761 |
+
*/
|
7762 |
+
reject<T>(
|
7763 |
+
collection: Dictionary<T>,
|
7764 |
+
predicate?: DictionaryIterator<T, boolean>,
|
7765 |
+
thisArg?: any
|
7766 |
+
): T[];
|
7767 |
+
|
7768 |
+
/**
|
7769 |
+
* @see _.reject
|
7770 |
+
*/
|
7771 |
+
reject(
|
7772 |
+
collection: string,
|
7773 |
+
predicate?: StringIterator<boolean>,
|
7774 |
+
thisArg?: any
|
7775 |
+
): string[];
|
7776 |
+
|
7777 |
+
/**
|
7778 |
+
* @see _.reject
|
7779 |
+
*/
|
7780 |
+
reject<T>(
|
7781 |
+
collection: List<T>|Dictionary<T>,
|
7782 |
+
predicate: string,
|
7783 |
+
thisArg?: any
|
7784 |
+
): T[];
|
7785 |
+
|
7786 |
+
/**
|
7787 |
+
* @see _.reject
|
7788 |
+
*/
|
7789 |
+
reject<W extends {}, T>(
|
7790 |
+
collection: List<T>|Dictionary<T>,
|
7791 |
+
predicate: W
|
7792 |
+
): T[];
|
7793 |
+
}
|
7794 |
+
|
7795 |
+
interface LoDashImplicitWrapper<T> {
|
7796 |
+
/**
|
7797 |
+
* @see _.reject
|
7798 |
+
*/
|
7799 |
+
reject(
|
7800 |
+
predicate?: StringIterator<boolean>,
|
7801 |
+
thisArg?: any
|
7802 |
+
): LoDashImplicitArrayWrapper<string>;
|
7803 |
+
}
|
7804 |
+
|
7805 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7806 |
+
/**
|
7807 |
+
* @see _.reject
|
7808 |
+
*/
|
7809 |
+
reject(
|
7810 |
+
predicate: ListIterator<T, boolean>,
|
7811 |
+
thisArg?: any
|
7812 |
+
): LoDashImplicitArrayWrapper<T>;
|
7813 |
+
|
7814 |
+
/**
|
7815 |
+
* @see _.reject
|
7816 |
+
*/
|
7817 |
+
reject(
|
7818 |
+
predicate: string,
|
7819 |
+
thisArg?: any
|
7820 |
+
): LoDashImplicitArrayWrapper<T>;
|
7821 |
+
|
7822 |
+
/**
|
7823 |
+
* @see _.reject
|
7824 |
+
*/
|
7825 |
+
reject<W>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
7826 |
+
}
|
7827 |
+
|
7828 |
+
interface LoDashImplicitObjectWrapper<T> {
|
7829 |
+
/**
|
7830 |
+
* @see _.reject
|
7831 |
+
*/
|
7832 |
+
reject<T>(
|
7833 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
7834 |
+
thisArg?: any
|
7835 |
+
): LoDashImplicitArrayWrapper<T>;
|
7836 |
+
|
7837 |
+
/**
|
7838 |
+
* @see _.reject
|
7839 |
+
*/
|
7840 |
+
reject<T>(
|
7841 |
+
predicate: string,
|
7842 |
+
thisArg?: any
|
7843 |
+
): LoDashImplicitArrayWrapper<T>;
|
7844 |
+
|
7845 |
+
/**
|
7846 |
+
* @see _.reject
|
7847 |
+
*/
|
7848 |
+
reject<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
7849 |
+
}
|
7850 |
+
|
7851 |
+
interface LoDashExplicitWrapper<T> {
|
7852 |
+
/**
|
7853 |
+
* @see _.reject
|
7854 |
+
*/
|
7855 |
+
reject(
|
7856 |
+
predicate?: StringIterator<boolean>,
|
7857 |
+
thisArg?: any
|
7858 |
+
): LoDashExplicitArrayWrapper<string>;
|
7859 |
+
}
|
7860 |
+
|
7861 |
+
interface LoDashExplicitArrayWrapper<T> {
|
7862 |
+
/**
|
7863 |
+
* @see _.reject
|
7864 |
+
*/
|
7865 |
+
reject(
|
7866 |
+
predicate: ListIterator<T, boolean>,
|
7867 |
+
thisArg?: any
|
7868 |
+
): LoDashExplicitArrayWrapper<T>;
|
7869 |
+
|
7870 |
+
/**
|
7871 |
+
* @see _.reject
|
7872 |
+
*/
|
7873 |
+
reject(
|
7874 |
+
predicate: string,
|
7875 |
+
thisArg?: any
|
7876 |
+
): LoDashExplicitArrayWrapper<T>;
|
7877 |
+
|
7878 |
+
/**
|
7879 |
+
* @see _.reject
|
7880 |
+
*/
|
7881 |
+
reject<W>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
7882 |
+
}
|
7883 |
+
|
7884 |
+
interface LoDashExplicitObjectWrapper<T> {
|
7885 |
+
/**
|
7886 |
+
* @see _.reject
|
7887 |
+
*/
|
7888 |
+
reject<T>(
|
7889 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
7890 |
+
thisArg?: any
|
7891 |
+
): LoDashExplicitArrayWrapper<T>;
|
7892 |
+
|
7893 |
+
/**
|
7894 |
+
* @see _.reject
|
7895 |
+
*/
|
7896 |
+
reject<T>(
|
7897 |
+
predicate: string,
|
7898 |
+
thisArg?: any
|
7899 |
+
): LoDashExplicitArrayWrapper<T>;
|
7900 |
+
|
7901 |
+
/**
|
7902 |
+
* @see _.reject
|
7903 |
+
*/
|
7904 |
+
reject<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
7905 |
+
}
|
7906 |
+
|
7907 |
+
//_.sample
|
7908 |
+
interface LoDashStatic {
|
7909 |
+
/**
|
7910 |
+
* Retrieves a random element or n random elements from a collection.
|
7911 |
+
* @param collection The collection to sample.
|
7912 |
+
* @return Returns the random sample(s) of collection.
|
7913 |
+
**/
|
7914 |
+
sample<T>(collection: Array<T>): T;
|
7915 |
+
|
7916 |
+
/**
|
7917 |
+
* @see _.sample
|
7918 |
+
**/
|
7919 |
+
sample<T>(collection: List<T>): T;
|
7920 |
+
|
7921 |
+
/**
|
7922 |
+
* @see _.sample
|
7923 |
+
**/
|
7924 |
+
sample<T>(collection: Dictionary<T>): T;
|
7925 |
+
|
7926 |
+
/**
|
7927 |
+
* @see _.sample
|
7928 |
+
* @param n The number of elements to sample.
|
7929 |
+
**/
|
7930 |
+
sample<T>(collection: Array<T>, n: number): T[];
|
7931 |
+
|
7932 |
+
/**
|
7933 |
+
* @see _.sample
|
7934 |
+
* @param n The number of elements to sample.
|
7935 |
+
**/
|
7936 |
+
sample<T>(collection: List<T>, n: number): T[];
|
7937 |
+
|
7938 |
+
/**
|
7939 |
+
* @see _.sample
|
7940 |
+
* @param n The number of elements to sample.
|
7941 |
+
**/
|
7942 |
+
sample<T>(collection: Dictionary<T>, n: number): T[];
|
7943 |
+
}
|
7944 |
+
|
7945 |
+
interface LoDashImplicitArrayWrapper<T> {
|
7946 |
+
/**
|
7947 |
+
* @see _.sample
|
7948 |
+
**/
|
7949 |
+
sample(n: number): LoDashImplicitArrayWrapper<T>;
|
7950 |
+
|
7951 |
+
/**
|
7952 |
+
* @see _.sample
|
7953 |
+
**/
|
7954 |
+
sample(): LoDashImplicitWrapper<T>;
|
7955 |
+
}
|
7956 |
+
|
7957 |
+
//_.select
|
7958 |
+
interface LoDashStatic {
|
7959 |
+
/**
|
7960 |
+
* @see _.filter
|
7961 |
+
*/
|
7962 |
+
select<T>(
|
7963 |
+
collection: List<T>,
|
7964 |
+
predicate?: ListIterator<T, boolean>,
|
7965 |
+
thisArg?: any
|
7966 |
+
): T[];
|
7967 |
+
|
7968 |
+
/**
|
7969 |
+
* @see _.filter
|
7970 |
+
*/
|
7971 |
+
select<T>(
|
7972 |
+
collection: Dictionary<T>,
|
7973 |
+
predicate?: DictionaryIterator<T, boolean>,
|
7974 |
+
thisArg?: any
|
7975 |
+
): T[];
|
7976 |
+
|
7977 |
+
/**
|
7978 |
+
* @see _.filter
|
7979 |
+
*/
|
7980 |
+
select(
|
7981 |
+
collection: string,
|
7982 |
+
predicate?: StringIterator<boolean>,
|
7983 |
+
thisArg?: any
|
7984 |
+
): string[];
|
7985 |
+
|
7986 |
+
/**
|
7987 |
+
* @see _.filter
|
7988 |
+
*/
|
7989 |
+
select<T>(
|
7990 |
+
collection: List<T>|Dictionary<T>,
|
7991 |
+
predicate: string,
|
7992 |
+
thisArg?: any
|
7993 |
+
): T[];
|
7994 |
+
|
7995 |
+
/**
|
7996 |
+
* @see _.filter
|
7997 |
+
*/
|
7998 |
+
select<W extends {}, T>(
|
7999 |
+
collection: List<T>|Dictionary<T>,
|
8000 |
+
predicate: W
|
8001 |
+
): T[];
|
8002 |
+
}
|
8003 |
+
|
8004 |
+
interface LoDashImplicitWrapper<T> {
|
8005 |
+
/**
|
8006 |
+
* @see _.filter
|
8007 |
+
*/
|
8008 |
+
select(
|
8009 |
+
predicate?: StringIterator<boolean>,
|
8010 |
+
thisArg?: any
|
8011 |
+
): LoDashImplicitArrayWrapper<string>;
|
8012 |
+
}
|
8013 |
+
|
8014 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8015 |
+
/**
|
8016 |
+
* @see _.filter
|
8017 |
+
*/
|
8018 |
+
select(
|
8019 |
+
predicate: ListIterator<T, boolean>,
|
8020 |
+
thisArg?: any
|
8021 |
+
): LoDashImplicitArrayWrapper<T>;
|
8022 |
+
|
8023 |
+
/**
|
8024 |
+
* @see _.filter
|
8025 |
+
*/
|
8026 |
+
select(
|
8027 |
+
predicate: string,
|
8028 |
+
thisArg?: any
|
8029 |
+
): LoDashImplicitArrayWrapper<T>;
|
8030 |
+
|
8031 |
+
/**
|
8032 |
+
* @see _.filter
|
8033 |
+
*/
|
8034 |
+
select<W>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
8035 |
+
}
|
8036 |
+
|
8037 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8038 |
+
/**
|
8039 |
+
* @see _.filter
|
8040 |
+
*/
|
8041 |
+
select<T>(
|
8042 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
8043 |
+
thisArg?: any
|
8044 |
+
): LoDashImplicitArrayWrapper<T>;
|
8045 |
+
|
8046 |
+
/**
|
8047 |
+
* @see _.filter
|
8048 |
+
*/
|
8049 |
+
select<T>(
|
8050 |
+
predicate: string,
|
8051 |
+
thisArg?: any
|
8052 |
+
): LoDashImplicitArrayWrapper<T>;
|
8053 |
+
|
8054 |
+
/**
|
8055 |
+
* @see _.filter
|
8056 |
+
*/
|
8057 |
+
select<W, T>(predicate: W): LoDashImplicitArrayWrapper<T>;
|
8058 |
+
}
|
8059 |
+
|
8060 |
+
interface LoDashExplicitWrapper<T> {
|
8061 |
+
/**
|
8062 |
+
* @see _.filter
|
8063 |
+
*/
|
8064 |
+
select(
|
8065 |
+
predicate?: StringIterator<boolean>,
|
8066 |
+
thisArg?: any
|
8067 |
+
): LoDashExplicitArrayWrapper<string>;
|
8068 |
+
}
|
8069 |
+
|
8070 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8071 |
+
/**
|
8072 |
+
* @see _.filter
|
8073 |
+
*/
|
8074 |
+
select(
|
8075 |
+
predicate: ListIterator<T, boolean>,
|
8076 |
+
thisArg?: any
|
8077 |
+
): LoDashExplicitArrayWrapper<T>;
|
8078 |
+
|
8079 |
+
/**
|
8080 |
+
* @see _.filter
|
8081 |
+
*/
|
8082 |
+
select(
|
8083 |
+
predicate: string,
|
8084 |
+
thisArg?: any
|
8085 |
+
): LoDashExplicitArrayWrapper<T>;
|
8086 |
+
|
8087 |
+
/**
|
8088 |
+
* @see _.filter
|
8089 |
+
*/
|
8090 |
+
select<W>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
8091 |
+
}
|
8092 |
+
|
8093 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8094 |
+
/**
|
8095 |
+
* @see _.filter
|
8096 |
+
*/
|
8097 |
+
select<T>(
|
8098 |
+
predicate: ListIterator<T, boolean>|DictionaryIterator<T, boolean>,
|
8099 |
+
thisArg?: any
|
8100 |
+
): LoDashExplicitArrayWrapper<T>;
|
8101 |
+
|
8102 |
+
/**
|
8103 |
+
* @see _.filter
|
8104 |
+
*/
|
8105 |
+
select<T>(
|
8106 |
+
predicate: string,
|
8107 |
+
thisArg?: any
|
8108 |
+
): LoDashExplicitArrayWrapper<T>;
|
8109 |
+
|
8110 |
+
/**
|
8111 |
+
* @see _.filter
|
8112 |
+
*/
|
8113 |
+
select<W, T>(predicate: W): LoDashExplicitArrayWrapper<T>;
|
8114 |
+
}
|
8115 |
+
|
8116 |
+
//_.shuffle
|
8117 |
+
interface LoDashStatic {
|
8118 |
+
/**
|
8119 |
+
* Creates an array of shuffled values, using a version of the Fisher-Yates shuffle.
|
8120 |
+
*
|
8121 |
+
* @param collection The collection to shuffle.
|
8122 |
+
* @return Returns the new shuffled array.
|
8123 |
+
*/
|
8124 |
+
shuffle<T>(collection: List<T>|Dictionary<T>): T[];
|
8125 |
+
|
8126 |
+
/**
|
8127 |
+
* @see _.shuffle
|
8128 |
+
*/
|
8129 |
+
shuffle(collection: string): string[];
|
8130 |
+
}
|
8131 |
+
|
8132 |
+
interface LoDashImplicitWrapper<T> {
|
8133 |
+
/**
|
8134 |
+
* @see _.shuffle
|
8135 |
+
*/
|
8136 |
+
shuffle(): LoDashImplicitArrayWrapper<string>;
|
8137 |
+
}
|
8138 |
+
|
8139 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8140 |
+
/**
|
8141 |
+
* @see _.shuffle
|
8142 |
+
*/
|
8143 |
+
shuffle(): LoDashImplicitArrayWrapper<T>;
|
8144 |
+
}
|
8145 |
+
|
8146 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8147 |
+
/**
|
8148 |
+
* @see _.shuffle
|
8149 |
+
*/
|
8150 |
+
shuffle<T>(): LoDashImplicitArrayWrapper<T>;
|
8151 |
+
}
|
8152 |
+
|
8153 |
+
interface LoDashExplicitWrapper<T> {
|
8154 |
+
/**
|
8155 |
+
* @see _.shuffle
|
8156 |
+
*/
|
8157 |
+
shuffle(): LoDashExplicitArrayWrapper<string>;
|
8158 |
+
}
|
8159 |
+
|
8160 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8161 |
+
/**
|
8162 |
+
* @see _.shuffle
|
8163 |
+
*/
|
8164 |
+
shuffle(): LoDashExplicitArrayWrapper<T>;
|
8165 |
+
}
|
8166 |
+
|
8167 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8168 |
+
/**
|
8169 |
+
* @see _.shuffle
|
8170 |
+
*/
|
8171 |
+
shuffle<T>(): LoDashExplicitArrayWrapper<T>;
|
8172 |
+
}
|
8173 |
+
|
8174 |
+
//_.size
|
8175 |
+
interface LoDashStatic {
|
8176 |
+
/**
|
8177 |
+
* Gets the size of collection by returning its length for array-like values or the number of own enumerable
|
8178 |
+
* properties for objects.
|
8179 |
+
*
|
8180 |
+
* @param collection The collection to inspect.
|
8181 |
+
* @return Returns the size of collection.
|
8182 |
+
*/
|
8183 |
+
size<T>(collection: List<T>|Dictionary<T>): number;
|
8184 |
+
|
8185 |
+
/**
|
8186 |
+
* @see _.size
|
8187 |
+
*/
|
8188 |
+
size(collection: string): number;
|
8189 |
+
}
|
8190 |
+
|
8191 |
+
interface LoDashImplicitWrapper<T> {
|
8192 |
+
/**
|
8193 |
+
* @see _.size
|
8194 |
+
*/
|
8195 |
+
size(): number;
|
8196 |
+
}
|
8197 |
+
|
8198 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8199 |
+
/**
|
8200 |
+
* @see _.size
|
8201 |
+
*/
|
8202 |
+
size(): number;
|
8203 |
+
}
|
8204 |
+
|
8205 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8206 |
+
/**
|
8207 |
+
* @see _.size
|
8208 |
+
*/
|
8209 |
+
size(): number;
|
8210 |
+
}
|
8211 |
+
|
8212 |
+
interface LoDashExplicitWrapper<T> {
|
8213 |
+
/**
|
8214 |
+
* @see _.size
|
8215 |
+
*/
|
8216 |
+
size(): LoDashExplicitWrapper<number>;
|
8217 |
+
}
|
8218 |
+
|
8219 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8220 |
+
/**
|
8221 |
+
* @see _.size
|
8222 |
+
*/
|
8223 |
+
size(): LoDashExplicitWrapper<number>;
|
8224 |
+
}
|
8225 |
+
|
8226 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8227 |
+
/**
|
8228 |
+
* @see _.size
|
8229 |
+
*/
|
8230 |
+
size(): LoDashExplicitWrapper<number>;
|
8231 |
+
}
|
8232 |
+
|
8233 |
+
//_.some
|
8234 |
+
interface LoDashStatic {
|
8235 |
+
/**
|
8236 |
+
* Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds
|
8237 |
+
* a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and
|
8238 |
+
* invoked with three arguments: (value, index|key, collection).
|
8239 |
+
*
|
8240 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
8241 |
+
* value of the given element.
|
8242 |
+
*
|
8243 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
8244 |
+
* elements that have a matching property value, else false.
|
8245 |
+
*
|
8246 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
8247 |
+
* have the properties of the given object, else false.
|
8248 |
+
*
|
8249 |
+
* @alias _.any
|
8250 |
+
*
|
8251 |
+
* @param collection The collection to iterate over.
|
8252 |
+
* @param predicate The function invoked per iteration.
|
8253 |
+
* @param thisArg The this binding of predicate.
|
8254 |
+
* @return Returns true if any element passes the predicate check, else false.
|
8255 |
+
*/
|
8256 |
+
some<T>(
|
8257 |
+
collection: List<T>,
|
8258 |
+
predicate?: ListIterator<T, boolean>,
|
8259 |
+
thisArg?: any
|
8260 |
+
): boolean;
|
8261 |
+
|
8262 |
+
/**
|
8263 |
+
* @see _.some
|
8264 |
+
*/
|
8265 |
+
some<T>(
|
8266 |
+
collection: Dictionary<T>,
|
8267 |
+
predicate?: DictionaryIterator<T, boolean>,
|
8268 |
+
thisArg?: any
|
8269 |
+
): boolean;
|
8270 |
+
|
8271 |
+
/**
|
8272 |
+
* @see _.some
|
8273 |
+
*/
|
8274 |
+
some<T>(
|
8275 |
+
collection: NumericDictionary<T>,
|
8276 |
+
predicate?: NumericDictionaryIterator<T, boolean>,
|
8277 |
+
thisArg?: any
|
8278 |
+
): boolean;
|
8279 |
+
|
8280 |
+
/**
|
8281 |
+
* @see _.some
|
8282 |
+
*/
|
8283 |
+
some<T>(
|
8284 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
8285 |
+
predicate?: string,
|
8286 |
+
thisArg?: any
|
8287 |
+
): boolean;
|
8288 |
+
|
8289 |
+
/**
|
8290 |
+
* @see _.some
|
8291 |
+
*/
|
8292 |
+
some<TObject extends {}, T>(
|
8293 |
+
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
8294 |
+
predicate?: TObject
|
8295 |
+
): boolean;
|
8296 |
+
}
|
8297 |
+
|
8298 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8299 |
+
/**
|
8300 |
+
* @see _.some
|
8301 |
+
*/
|
8302 |
+
some(
|
8303 |
+
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
8304 |
+
thisArg?: any
|
8305 |
+
): boolean;
|
8306 |
+
|
8307 |
+
/**
|
8308 |
+
* @see _.some
|
8309 |
+
*/
|
8310 |
+
some(
|
8311 |
+
predicate?: string,
|
8312 |
+
thisArg?: any
|
8313 |
+
): boolean;
|
8314 |
+
|
8315 |
+
/**
|
8316 |
+
* @see _.some
|
8317 |
+
*/
|
8318 |
+
some<TObject extends {}>(
|
8319 |
+
predicate?: TObject
|
8320 |
+
): boolean;
|
8321 |
+
}
|
8322 |
+
|
8323 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8324 |
+
/**
|
8325 |
+
* @see _.some
|
8326 |
+
*/
|
8327 |
+
some<TResult>(
|
8328 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
8329 |
+
thisArg?: any
|
8330 |
+
): boolean;
|
8331 |
+
|
8332 |
+
/**
|
8333 |
+
* @see _.some
|
8334 |
+
*/
|
8335 |
+
some(
|
8336 |
+
predicate?: string,
|
8337 |
+
thisArg?: any
|
8338 |
+
): boolean;
|
8339 |
+
|
8340 |
+
/**
|
8341 |
+
* @see _.some
|
8342 |
+
*/
|
8343 |
+
some<TObject extends {}>(
|
8344 |
+
predicate?: TObject
|
8345 |
+
): boolean;
|
8346 |
+
}
|
8347 |
+
|
8348 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8349 |
+
/**
|
8350 |
+
* @see _.some
|
8351 |
+
*/
|
8352 |
+
some(
|
8353 |
+
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
8354 |
+
thisArg?: any
|
8355 |
+
): LoDashExplicitWrapper<boolean>;
|
8356 |
+
|
8357 |
+
/**
|
8358 |
+
* @see _.some
|
8359 |
+
*/
|
8360 |
+
some(
|
8361 |
+
predicate?: string,
|
8362 |
+
thisArg?: any
|
8363 |
+
): LoDashExplicitWrapper<boolean>;
|
8364 |
+
|
8365 |
+
/**
|
8366 |
+
* @see _.some
|
8367 |
+
*/
|
8368 |
+
some<TObject extends {}>(
|
8369 |
+
predicate?: TObject
|
8370 |
+
): LoDashExplicitWrapper<boolean>;
|
8371 |
+
}
|
8372 |
+
|
8373 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8374 |
+
/**
|
8375 |
+
* @see _.some
|
8376 |
+
*/
|
8377 |
+
some<TResult>(
|
8378 |
+
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
8379 |
+
thisArg?: any
|
8380 |
+
): LoDashExplicitWrapper<boolean>;
|
8381 |
+
|
8382 |
+
/**
|
8383 |
+
* @see _.some
|
8384 |
+
*/
|
8385 |
+
some(
|
8386 |
+
predicate?: string,
|
8387 |
+
thisArg?: any
|
8388 |
+
): LoDashExplicitWrapper<boolean>;
|
8389 |
+
|
8390 |
+
/**
|
8391 |
+
* @see _.some
|
8392 |
+
*/
|
8393 |
+
some<TObject extends {}>(
|
8394 |
+
predicate?: TObject
|
8395 |
+
): LoDashExplicitWrapper<boolean>;
|
8396 |
+
}
|
8397 |
+
|
8398 |
+
//_.sortBy
|
8399 |
+
interface LoDashStatic {
|
8400 |
+
/**
|
8401 |
+
* Creates an array of elements, sorted in ascending order by the results of running each element in a
|
8402 |
+
* collection through iteratee. This method performs a stable sort, that is, it preserves the original sort
|
8403 |
+
* order of equal elements. The iteratee is bound to thisArg and invoked with three arguments:
|
8404 |
+
* (value, index|key, collection).
|
8405 |
+
*
|
8406 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property
|
8407 |
+
* valueof the given element.
|
8408 |
+
*
|
8409 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
8410 |
+
* elements that have a matching property value, else false.
|
8411 |
+
*
|
8412 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
8413 |
+
* have the properties of the given object, else false.
|
8414 |
+
*
|
8415 |
+
* @param collection The collection to iterate over.
|
8416 |
+
* @param iteratee The function invoked per iteration.
|
8417 |
+
* @param thisArg The this binding of iteratee.
|
8418 |
+
* @return Returns the new sorted array.
|
8419 |
+
*/
|
8420 |
+
sortBy<T, TSort>(
|
8421 |
+
collection: List<T>,
|
8422 |
+
iteratee?: ListIterator<T, TSort>,
|
8423 |
+
thisArg?: any
|
8424 |
+
): T[];
|
8425 |
+
|
8426 |
+
/**
|
8427 |
+
* @see _.sortBy
|
8428 |
+
*/
|
8429 |
+
sortBy<T, TSort>(
|
8430 |
+
collection: Dictionary<T>,
|
8431 |
+
iteratee?: DictionaryIterator<T, TSort>,
|
8432 |
+
thisArg?: any
|
8433 |
+
): T[];
|
8434 |
+
|
8435 |
+
/**
|
8436 |
+
* @see _.sortBy
|
8437 |
+
*/
|
8438 |
+
sortBy<T>(
|
8439 |
+
collection: List<T>|Dictionary<T>,
|
8440 |
+
iteratee: string
|
8441 |
+
): T[];
|
8442 |
+
|
8443 |
+
/**
|
8444 |
+
* @see _.sortBy
|
8445 |
+
*/
|
8446 |
+
sortBy<W extends {}, T>(
|
8447 |
+
collection: List<T>|Dictionary<T>,
|
8448 |
+
whereValue: W
|
8449 |
+
): T[];
|
8450 |
+
|
8451 |
+
/**
|
8452 |
+
* @see _.sortBy
|
8453 |
+
*/
|
8454 |
+
sortBy<T>(
|
8455 |
+
collection: List<T>|Dictionary<T>
|
8456 |
+
): T[];
|
8457 |
+
}
|
8458 |
+
|
8459 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8460 |
+
/**
|
8461 |
+
* @see _.sortBy
|
8462 |
+
*/
|
8463 |
+
sortBy<TSort>(
|
8464 |
+
iteratee?: ListIterator<T, TSort>,
|
8465 |
+
thisArg?: any
|
8466 |
+
): LoDashImplicitArrayWrapper<T>;
|
8467 |
+
|
8468 |
+
/**
|
8469 |
+
* @see _.sortBy
|
8470 |
+
*/
|
8471 |
+
sortBy(iteratee: string): LoDashImplicitArrayWrapper<T>;
|
8472 |
+
|
8473 |
+
/**
|
8474 |
+
* @see _.sortBy
|
8475 |
+
*/
|
8476 |
+
sortBy<W extends {}>(whereValue: W): LoDashImplicitArrayWrapper<T>;
|
8477 |
+
|
8478 |
+
/**
|
8479 |
+
* @see _.sortBy
|
8480 |
+
*/
|
8481 |
+
sortBy(): LoDashImplicitArrayWrapper<T>;
|
8482 |
+
}
|
8483 |
+
|
8484 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8485 |
+
/**
|
8486 |
+
* @see _.sortBy
|
8487 |
+
*/
|
8488 |
+
sortBy<T, TSort>(
|
8489 |
+
iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort>,
|
8490 |
+
thisArg?: any
|
8491 |
+
): LoDashImplicitArrayWrapper<T>;
|
8492 |
+
|
8493 |
+
/**
|
8494 |
+
* @see _.sortBy
|
8495 |
+
*/
|
8496 |
+
sortBy<T>(iteratee: string): LoDashImplicitArrayWrapper<T>;
|
8497 |
+
|
8498 |
+
/**
|
8499 |
+
* @see _.sortBy
|
8500 |
+
*/
|
8501 |
+
sortBy<W extends {}, T>(whereValue: W): LoDashImplicitArrayWrapper<T>;
|
8502 |
+
|
8503 |
+
/**
|
8504 |
+
* @see _.sortBy
|
8505 |
+
*/
|
8506 |
+
sortBy<T>(): LoDashImplicitArrayWrapper<T>;
|
8507 |
+
}
|
8508 |
+
|
8509 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8510 |
+
/**
|
8511 |
+
* @see _.sortBy
|
8512 |
+
*/
|
8513 |
+
sortBy<TSort>(
|
8514 |
+
iteratee?: ListIterator<T, TSort>,
|
8515 |
+
thisArg?: any
|
8516 |
+
): LoDashExplicitArrayWrapper<T>;
|
8517 |
+
|
8518 |
+
/**
|
8519 |
+
* @see _.sortBy
|
8520 |
+
*/
|
8521 |
+
sortBy(iteratee: string): LoDashExplicitArrayWrapper<T>;
|
8522 |
+
|
8523 |
+
/**
|
8524 |
+
* @see _.sortBy
|
8525 |
+
*/
|
8526 |
+
sortBy<W extends {}>(whereValue: W): LoDashExplicitArrayWrapper<T>;
|
8527 |
+
|
8528 |
+
/**
|
8529 |
+
* @see _.sortBy
|
8530 |
+
*/
|
8531 |
+
sortBy(): LoDashExplicitArrayWrapper<T>;
|
8532 |
+
}
|
8533 |
+
|
8534 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8535 |
+
/**
|
8536 |
+
* @see _.sortBy
|
8537 |
+
*/
|
8538 |
+
sortBy<T, TSort>(
|
8539 |
+
iteratee?: ListIterator<T, TSort>|DictionaryIterator<T, TSort>,
|
8540 |
+
thisArg?: any
|
8541 |
+
): LoDashExplicitArrayWrapper<T>;
|
8542 |
+
|
8543 |
+
/**
|
8544 |
+
* @see _.sortBy
|
8545 |
+
*/
|
8546 |
+
sortBy<T>(iteratee: string): LoDashExplicitArrayWrapper<T>;
|
8547 |
+
|
8548 |
+
/**
|
8549 |
+
* @see _.sortBy
|
8550 |
+
*/
|
8551 |
+
sortBy<W extends {}, T>(whereValue: W): LoDashExplicitArrayWrapper<T>;
|
8552 |
+
|
8553 |
+
/**
|
8554 |
+
* @see _.sortBy
|
8555 |
+
*/
|
8556 |
+
sortBy<T>(): LoDashExplicitArrayWrapper<T>;
|
8557 |
+
}
|
8558 |
+
|
8559 |
+
//_.sortByAll
|
8560 |
+
interface LoDashStatic {
|
8561 |
+
/**
|
8562 |
+
* This method is like "_.sortBy" except that it can sort by multiple iteratees or
|
8563 |
+
* property names.
|
8564 |
+
*
|
8565 |
+
* If a property name is provided for an iteratee the created "_.property" style callback
|
8566 |
+
* returns the property value of the given element.
|
8567 |
+
*
|
8568 |
+
* If a value is also provided for thisArg the created "_.matchesProperty" style callback
|
8569 |
+
* returns true for elements that have a matching property value, else false.
|
8570 |
+
*
|
8571 |
+
* If an object is provided for an iteratee the created "_.matches" style callback returns
|
8572 |
+
* true for elements that have the properties of the given object, else false.
|
8573 |
+
*
|
8574 |
+
* @param collection The collection to iterate over.
|
8575 |
+
* @param callback The function called per iteration.
|
8576 |
+
* @param thisArg The this binding of callback.
|
8577 |
+
* @return A new array of sorted elements.
|
8578 |
+
**/
|
8579 |
+
sortByAll<T>(
|
8580 |
+
collection: Array<T>,
|
8581 |
+
iteratees: (ListIterator<T, any>|string|Object)[]): T[];
|
8582 |
+
|
8583 |
+
/**
|
8584 |
+
* @see _.sortByAll
|
8585 |
+
**/
|
8586 |
+
sortByAll<T>(
|
8587 |
+
collection: List<T>,
|
8588 |
+
iteratees: (ListIterator<T, any>|string|Object)[]): T[];
|
8589 |
+
|
8590 |
+
/**
|
8591 |
+
* @see _.sortByAll
|
8592 |
+
**/
|
8593 |
+
sortByAll<T>(
|
8594 |
+
collection: Array<T>,
|
8595 |
+
...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
|
8596 |
+
|
8597 |
+
/**
|
8598 |
+
* @see _.sortByAll
|
8599 |
+
**/
|
8600 |
+
sortByAll<T>(
|
8601 |
+
collection: List<T>,
|
8602 |
+
...iteratees: (ListIterator<T, any>|string|Object)[]): T[];
|
8603 |
+
|
8604 |
+
/**
|
8605 |
+
* Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
|
8606 |
+
* @param args The rules by which to sort
|
8607 |
+
*/
|
8608 |
+
sortByAll<T>(
|
8609 |
+
collection: (Array<T>|List<T>),
|
8610 |
+
...args: (ListIterator<T, boolean>|Object|string)[]
|
8611 |
+
): T[];
|
8612 |
+
}
|
8613 |
+
|
8614 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8615 |
+
/**
|
8616 |
+
* Sorts by all the given arguments, using either ListIterator, pluckValue, or whereValue foramts
|
8617 |
+
* @param args The rules by which to sort
|
8618 |
+
*/
|
8619 |
+
sortByAll(...args: (ListIterator<T, boolean>|Object|string)[]): LoDashImplicitArrayWrapper<T>;
|
8620 |
+
|
8621 |
+
/**
|
8622 |
+
* @see _.sortByAll
|
8623 |
+
**/
|
8624 |
+
sortByAll(
|
8625 |
+
iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>;
|
8626 |
+
|
8627 |
+
/**
|
8628 |
+
* @see _.sortByAll
|
8629 |
+
**/
|
8630 |
+
sortByAll(
|
8631 |
+
...iteratees: (ListIterator<T, any>|string|Object)[]): LoDashImplicitArrayWrapper<T>;
|
8632 |
+
}
|
8633 |
+
|
8634 |
+
//_.sortByOrder
|
8635 |
+
interface LoDashStatic {
|
8636 |
+
/**
|
8637 |
+
* This method is like _.sortByAll except that it allows specifying the sort orders of the iteratees to sort
|
8638 |
+
* by. If orders is unspecified, all values are sorted in ascending order. Otherwise, a value is sorted in
|
8639 |
+
* ascending order if its corresponding order is "asc", and descending if "desc".
|
8640 |
+
*
|
8641 |
+
* If a property name is provided for an iteratee the created _.property style callback returns the property
|
8642 |
+
* value of the given element.
|
8643 |
+
*
|
8644 |
+
* If an object is provided for an iteratee the created _.matches style callback returns true for elements
|
8645 |
+
* that have the properties of the given object, else false.
|
8646 |
+
*
|
8647 |
+
* @param collection The collection to iterate over.
|
8648 |
+
* @param iteratees The iteratees to sort by.
|
8649 |
+
* @param orders The sort orders of iteratees.
|
8650 |
+
* @return Returns the new sorted array.
|
8651 |
+
*/
|
8652 |
+
sortByOrder<W extends Object, T>(
|
8653 |
+
collection: List<T>,
|
8654 |
+
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
8655 |
+
orders?: boolean|string|(boolean|string)[]
|
8656 |
+
): T[];
|
8657 |
+
|
8658 |
+
/**
|
8659 |
+
* @see _.sortByOrder
|
8660 |
+
*/
|
8661 |
+
sortByOrder<T>(
|
8662 |
+
collection: List<T>,
|
8663 |
+
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
8664 |
+
orders?: boolean|string|(boolean|string)[]
|
8665 |
+
): T[];
|
8666 |
+
|
8667 |
+
/**
|
8668 |
+
* @see _.sortByOrder
|
8669 |
+
*/
|
8670 |
+
sortByOrder<W extends Object, T>(
|
8671 |
+
collection: NumericDictionary<T>,
|
8672 |
+
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
8673 |
+
orders?: boolean|string|(boolean|string)[]
|
8674 |
+
): T[];
|
8675 |
+
|
8676 |
+
/**
|
8677 |
+
* @see _.sortByOrder
|
8678 |
+
*/
|
8679 |
+
sortByOrder<T>(
|
8680 |
+
collection: NumericDictionary<T>,
|
8681 |
+
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
8682 |
+
orders?: boolean|string|(boolean|string)[]
|
8683 |
+
): T[];
|
8684 |
+
|
8685 |
+
/**
|
8686 |
+
* @see _.sortByOrder
|
8687 |
+
*/
|
8688 |
+
sortByOrder<W extends Object, T>(
|
8689 |
+
collection: Dictionary<T>,
|
8690 |
+
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
8691 |
+
orders?: boolean|string|(boolean|string)[]
|
8692 |
+
): T[];
|
8693 |
+
|
8694 |
+
/**
|
8695 |
+
* @see _.sortByOrder
|
8696 |
+
*/
|
8697 |
+
sortByOrder<T>(
|
8698 |
+
collection: Dictionary<T>,
|
8699 |
+
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
8700 |
+
orders?: boolean|string|(boolean|string)[]
|
8701 |
+
): T[];
|
8702 |
+
}
|
8703 |
+
|
8704 |
+
interface LoDashImplicitWrapper<T> {
|
8705 |
+
/**
|
8706 |
+
* @see _.sortByOrder
|
8707 |
+
*/
|
8708 |
+
sortByOrder(
|
8709 |
+
iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
|
8710 |
+
orders?: boolean|string|(boolean|string)[]
|
8711 |
+
): LoDashImplicitArrayWrapper<T>;
|
8712 |
+
}
|
8713 |
+
|
8714 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8715 |
+
/**
|
8716 |
+
* @see _.sortByOrder
|
8717 |
+
*/
|
8718 |
+
sortByOrder<W extends Object>(
|
8719 |
+
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
8720 |
+
orders?: boolean|string|(boolean|string)[]
|
8721 |
+
): LoDashImplicitArrayWrapper<T>;
|
8722 |
+
}
|
8723 |
+
|
8724 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8725 |
+
/**
|
8726 |
+
* @see _.sortByOrder
|
8727 |
+
*/
|
8728 |
+
sortByOrder<W extends Object, T>(
|
8729 |
+
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
8730 |
+
orders?: boolean|string|(boolean|string)[]
|
8731 |
+
): LoDashImplicitArrayWrapper<T>;
|
8732 |
+
|
8733 |
+
/**
|
8734 |
+
* @see _.sortByOrder
|
8735 |
+
*/
|
8736 |
+
sortByOrder<T>(
|
8737 |
+
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
8738 |
+
orders?: boolean|string|(boolean|string)[]
|
8739 |
+
): LoDashImplicitArrayWrapper<T>;
|
8740 |
+
|
8741 |
+
/**
|
8742 |
+
* @see _.sortByOrder
|
8743 |
+
*/
|
8744 |
+
sortByOrder<W extends Object, T>(
|
8745 |
+
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
8746 |
+
orders?: boolean|string|(boolean|string)[]
|
8747 |
+
): LoDashImplicitArrayWrapper<T>;
|
8748 |
+
|
8749 |
+
/**
|
8750 |
+
* @see _.sortByOrder
|
8751 |
+
*/
|
8752 |
+
sortByOrder<T>(
|
8753 |
+
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
8754 |
+
orders?: boolean|string|(boolean|string)[]
|
8755 |
+
): LoDashImplicitArrayWrapper<T>;
|
8756 |
+
|
8757 |
+
/**
|
8758 |
+
* @see _.sortByOrder
|
8759 |
+
*/
|
8760 |
+
sortByOrder<W extends Object, T>(
|
8761 |
+
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
8762 |
+
orders?: boolean|string|(boolean|string)[]
|
8763 |
+
): LoDashImplicitArrayWrapper<T>;
|
8764 |
+
|
8765 |
+
/**
|
8766 |
+
* @see _.sortByOrder
|
8767 |
+
*/
|
8768 |
+
sortByOrder<T>(
|
8769 |
+
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
8770 |
+
orders?: boolean|string|(boolean|string)[]
|
8771 |
+
): LoDashImplicitArrayWrapper<T>;
|
8772 |
+
}
|
8773 |
+
|
8774 |
+
interface LoDashExplicitWrapper<T> {
|
8775 |
+
/**
|
8776 |
+
* @see _.sortByOrder
|
8777 |
+
*/
|
8778 |
+
sortByOrder(
|
8779 |
+
iteratees: ListIterator<T, any>|string|(ListIterator<T, any>|string)[],
|
8780 |
+
orders?: boolean|string|(boolean|string)[]
|
8781 |
+
): LoDashExplicitArrayWrapper<T>;
|
8782 |
+
}
|
8783 |
+
|
8784 |
+
interface LoDashExplicitArrayWrapper<T> {
|
8785 |
+
/**
|
8786 |
+
* @see _.sortByOrder
|
8787 |
+
*/
|
8788 |
+
sortByOrder<W extends Object>(
|
8789 |
+
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
8790 |
+
orders?: boolean|string|(boolean|string)[]
|
8791 |
+
): LoDashExplicitArrayWrapper<T>;
|
8792 |
+
}
|
8793 |
+
|
8794 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8795 |
+
/**
|
8796 |
+
* @see _.sortByOrder
|
8797 |
+
*/
|
8798 |
+
sortByOrder<W extends Object, T>(
|
8799 |
+
iteratees: ListIterator<T, any>|string|W|(ListIterator<T, any>|string|W)[],
|
8800 |
+
orders?: boolean|string|(boolean|string)[]
|
8801 |
+
): LoDashExplicitArrayWrapper<T>;
|
8802 |
+
|
8803 |
+
/**
|
8804 |
+
* @see _.sortByOrder
|
8805 |
+
*/
|
8806 |
+
sortByOrder<T>(
|
8807 |
+
iteratees: ListIterator<T, any>|string|Object|(ListIterator<T, any>|string|Object)[],
|
8808 |
+
orders?: boolean|string|(boolean|string)[]
|
8809 |
+
): LoDashExplicitArrayWrapper<T>;
|
8810 |
+
|
8811 |
+
/**
|
8812 |
+
* @see _.sortByOrder
|
8813 |
+
*/
|
8814 |
+
sortByOrder<W extends Object, T>(
|
8815 |
+
iteratees: NumericDictionaryIterator<T, any>|string|W|(NumericDictionaryIterator<T, any>|string|W)[],
|
8816 |
+
orders?: boolean|string|(boolean|string)[]
|
8817 |
+
): LoDashExplicitArrayWrapper<T>;
|
8818 |
+
|
8819 |
+
/**
|
8820 |
+
* @see _.sortByOrder
|
8821 |
+
*/
|
8822 |
+
sortByOrder<T>(
|
8823 |
+
iteratees: NumericDictionaryIterator<T, any>|string|Object|(NumericDictionaryIterator<T, any>|string|Object)[],
|
8824 |
+
orders?: boolean|string|(boolean|string)[]
|
8825 |
+
): LoDashExplicitArrayWrapper<T>;
|
8826 |
+
|
8827 |
+
/**
|
8828 |
+
* @see _.sortByOrder
|
8829 |
+
*/
|
8830 |
+
sortByOrder<W extends Object, T>(
|
8831 |
+
iteratees: DictionaryIterator<T, any>|string|W|(DictionaryIterator<T, any>|string|W)[],
|
8832 |
+
orders?: boolean|string|(boolean|string)[]
|
8833 |
+
): LoDashExplicitArrayWrapper<T>;
|
8834 |
+
|
8835 |
+
/**
|
8836 |
+
* @see _.sortByOrder
|
8837 |
+
*/
|
8838 |
+
sortByOrder<T>(
|
8839 |
+
iteratees: DictionaryIterator<T, any>|string|Object|(DictionaryIterator<T, any>|string|Object)[],
|
8840 |
+
orders?: boolean|string|(boolean|string)[]
|
8841 |
+
): LoDashExplicitArrayWrapper<T>;
|
8842 |
+
}
|
8843 |
+
|
8844 |
+
//_.where
|
8845 |
+
interface LoDashStatic {
|
8846 |
+
/**
|
8847 |
+
* Performs a deep comparison of each element in a collection to the given properties
|
8848 |
+
* object, returning an array of all elements that have equivalent property values.
|
8849 |
+
* @param collection The collection to iterate over.
|
8850 |
+
* @param properties The object of property values to filter by.
|
8851 |
+
* @return A new array of elements that have the given properties.
|
8852 |
+
**/
|
8853 |
+
where<T, U extends {}>(
|
8854 |
+
list: Array<T>,
|
8855 |
+
properties: U): T[];
|
8856 |
+
|
8857 |
+
/**
|
8858 |
+
* @see _.where
|
8859 |
+
**/
|
8860 |
+
where<T, U extends {}>(
|
8861 |
+
list: List<T>,
|
8862 |
+
properties: U): T[];
|
8863 |
+
|
8864 |
+
/**
|
8865 |
+
* @see _.where
|
8866 |
+
**/
|
8867 |
+
where<T, U extends {}>(
|
8868 |
+
list: Dictionary<T>,
|
8869 |
+
properties: U): T[];
|
8870 |
+
}
|
8871 |
+
|
8872 |
+
interface LoDashImplicitArrayWrapper<T> {
|
8873 |
+
/**
|
8874 |
+
* @see _.where
|
8875 |
+
**/
|
8876 |
+
where<U extends {}>(properties: U): LoDashImplicitArrayWrapper<T>;
|
8877 |
+
}
|
8878 |
+
|
8879 |
+
/********
|
8880 |
+
* Date *
|
8881 |
+
********/
|
8882 |
+
|
8883 |
+
//_.now
|
8884 |
+
interface LoDashStatic {
|
8885 |
+
/**
|
8886 |
+
* Gets the number of milliseconds that have elapsed since the Unix epoch (1 January 1970 00:00:00 UTC).
|
8887 |
+
*
|
8888 |
+
* @return The number of milliseconds.
|
8889 |
+
*/
|
8890 |
+
now(): number;
|
8891 |
+
}
|
8892 |
+
|
8893 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
8894 |
+
/**
|
8895 |
+
* @see _.now
|
8896 |
+
*/
|
8897 |
+
now(): number;
|
8898 |
+
}
|
8899 |
+
|
8900 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
8901 |
+
/**
|
8902 |
+
* @see _.now
|
8903 |
+
*/
|
8904 |
+
now(): LoDashExplicitWrapper<number>;
|
8905 |
+
}
|
8906 |
+
|
8907 |
+
/*************
|
8908 |
+
* Functions *
|
8909 |
+
*************/
|
8910 |
+
|
8911 |
+
//_.after
|
8912 |
+
interface LoDashStatic {
|
8913 |
+
/**
|
8914 |
+
* The opposite of _.before; this method creates a function that invokes func once it’s called n or more times.
|
8915 |
+
*
|
8916 |
+
* @param n The number of calls before func is invoked.
|
8917 |
+
* @param func The function to restrict.
|
8918 |
+
* @return Returns the new restricted function.
|
8919 |
+
*/
|
8920 |
+
after<TFunc extends Function>(
|
8921 |
+
n: number,
|
8922 |
+
func: TFunc
|
8923 |
+
): TFunc;
|
8924 |
+
}
|
8925 |
+
|
8926 |
+
interface LoDashImplicitWrapper<T> {
|
8927 |
+
/**
|
8928 |
+
* @see _.after
|
8929 |
+
**/
|
8930 |
+
after<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>;
|
8931 |
+
}
|
8932 |
+
|
8933 |
+
interface LoDashExplicitWrapper<T> {
|
8934 |
+
/**
|
8935 |
+
* @see _.after
|
8936 |
+
**/
|
8937 |
+
after<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>;
|
8938 |
+
}
|
8939 |
+
|
8940 |
+
//_.ary
|
8941 |
+
interface LoDashStatic {
|
8942 |
+
/**
|
8943 |
+
* Creates a function that accepts up to n arguments ignoring any additional arguments.
|
8944 |
+
*
|
8945 |
+
* @param func The function to cap arguments for.
|
8946 |
+
* @param n The arity cap.
|
8947 |
+
* @returns Returns the new function.
|
8948 |
+
*/
|
8949 |
+
ary<TResult extends Function>(
|
8950 |
+
func: Function,
|
8951 |
+
n?: number
|
8952 |
+
): TResult;
|
8953 |
+
|
8954 |
+
ary<T extends Function, TResult extends Function>(
|
8955 |
+
func: T,
|
8956 |
+
n?: number
|
8957 |
+
): TResult;
|
8958 |
+
}
|
8959 |
+
|
8960 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8961 |
+
/**
|
8962 |
+
* @see _.ary
|
8963 |
+
*/
|
8964 |
+
ary<TResult extends Function>(n?: number): LoDashImplicitObjectWrapper<TResult>;
|
8965 |
+
}
|
8966 |
+
|
8967 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8968 |
+
/**
|
8969 |
+
* @see _.ary
|
8970 |
+
*/
|
8971 |
+
ary<TResult extends Function>(n?: number): LoDashExplicitObjectWrapper<TResult>;
|
8972 |
+
}
|
8973 |
+
|
8974 |
+
//_.backflow
|
8975 |
+
interface LoDashStatic {
|
8976 |
+
/**
|
8977 |
+
* @see _.flowRight
|
8978 |
+
*/
|
8979 |
+
backflow<TResult extends Function>(...funcs: Function[]): TResult;
|
8980 |
+
}
|
8981 |
+
|
8982 |
+
interface LoDashImplicitObjectWrapper<T> {
|
8983 |
+
/**
|
8984 |
+
* @see _.flowRight
|
8985 |
+
*/
|
8986 |
+
backflow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
8987 |
+
}
|
8988 |
+
|
8989 |
+
interface LoDashExplicitObjectWrapper<T> {
|
8990 |
+
/**
|
8991 |
+
* @see _.flowRight
|
8992 |
+
*/
|
8993 |
+
backflow<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
8994 |
+
}
|
8995 |
+
|
8996 |
+
//_.before
|
8997 |
+
interface LoDashStatic {
|
8998 |
+
/**
|
8999 |
+
* Creates a function that invokes func, with the this binding and arguments of the created function, while
|
9000 |
+
* it’s called less than n times. Subsequent calls to the created function return the result of the last func
|
9001 |
+
* invocation.
|
9002 |
+
*
|
9003 |
+
* @param n The number of calls at which func is no longer invoked.
|
9004 |
+
* @param func The function to restrict.
|
9005 |
+
* @return Returns the new restricted function.
|
9006 |
+
*/
|
9007 |
+
before<TFunc extends Function>(
|
9008 |
+
n: number,
|
9009 |
+
func: TFunc
|
9010 |
+
): TFunc;
|
9011 |
+
}
|
9012 |
+
|
9013 |
+
interface LoDashImplicitWrapper<T> {
|
9014 |
+
/**
|
9015 |
+
* @see _.before
|
9016 |
+
**/
|
9017 |
+
before<TFunc extends Function>(func: TFunc): LoDashImplicitObjectWrapper<TFunc>;
|
9018 |
+
}
|
9019 |
+
|
9020 |
+
interface LoDashExplicitWrapper<T> {
|
9021 |
+
/**
|
9022 |
+
* @see _.before
|
9023 |
+
**/
|
9024 |
+
before<TFunc extends Function>(func: TFunc): LoDashExplicitObjectWrapper<TFunc>;
|
9025 |
+
}
|
9026 |
+
|
9027 |
+
//_.bind
|
9028 |
+
interface FunctionBind {
|
9029 |
+
placeholder: any;
|
9030 |
+
|
9031 |
+
<T extends Function, TResult extends Function>(
|
9032 |
+
func: T,
|
9033 |
+
thisArg: any,
|
9034 |
+
...partials: any[]
|
9035 |
+
): TResult;
|
9036 |
+
|
9037 |
+
<TResult extends Function>(
|
9038 |
+
func: Function,
|
9039 |
+
thisArg: any,
|
9040 |
+
...partials: any[]
|
9041 |
+
): TResult;
|
9042 |
+
}
|
9043 |
+
|
9044 |
+
interface LoDashStatic {
|
9045 |
+
/**
|
9046 |
+
* Creates a function that invokes func with the this binding of thisArg and prepends any additional _.bind
|
9047 |
+
* arguments to those provided to the bound function.
|
9048 |
+
*
|
9049 |
+
* The _.bind.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for
|
9050 |
+
* partially applied arguments.
|
9051 |
+
*
|
9052 |
+
* Note: Unlike native Function#bind this method does not set the "length" property of bound functions.
|
9053 |
+
*
|
9054 |
+
* @param func The function to bind.
|
9055 |
+
* @param thisArg The this binding of func.
|
9056 |
+
* @param partials The arguments to be partially applied.
|
9057 |
+
* @return Returns the new bound function.
|
9058 |
+
*/
|
9059 |
+
bind: FunctionBind;
|
9060 |
+
}
|
9061 |
+
|
9062 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9063 |
+
/**
|
9064 |
+
* @see _.bind
|
9065 |
+
*/
|
9066 |
+
bind<TResult extends Function>(
|
9067 |
+
thisArg: any,
|
9068 |
+
...partials: any[]
|
9069 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
9070 |
+
}
|
9071 |
+
|
9072 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9073 |
+
/**
|
9074 |
+
* @see _.bind
|
9075 |
+
*/
|
9076 |
+
bind<TResult extends Function>(
|
9077 |
+
thisArg: any,
|
9078 |
+
...partials: any[]
|
9079 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
9080 |
+
}
|
9081 |
+
|
9082 |
+
//_.bindAll
|
9083 |
+
interface LoDashStatic {
|
9084 |
+
/**
|
9085 |
+
* Binds methods of an object to the object itself, overwriting the existing method. Method names may be
|
9086 |
+
* specified as individual arguments or as arrays of method names. If no method names are provided all
|
9087 |
+
* enumerable function properties, own and inherited, of object are bound.
|
9088 |
+
*
|
9089 |
+
* Note: This method does not set the "length" property of bound functions.
|
9090 |
+
*
|
9091 |
+
* @param object The object to bind and assign the bound methods to.
|
9092 |
+
* @param methodNames The object method names to bind, specified as individual method names or arrays of
|
9093 |
+
* method names.
|
9094 |
+
* @return Returns object.
|
9095 |
+
*/
|
9096 |
+
bindAll<T>(
|
9097 |
+
object: T,
|
9098 |
+
...methodNames: (string|string[])[]
|
9099 |
+
): T;
|
9100 |
+
}
|
9101 |
+
|
9102 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9103 |
+
/**
|
9104 |
+
* @see _.bindAll
|
9105 |
+
*/
|
9106 |
+
bindAll(...methodNames: (string|string[])[]): LoDashImplicitObjectWrapper<T>;
|
9107 |
+
}
|
9108 |
+
|
9109 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9110 |
+
/**
|
9111 |
+
* @see _.bindAll
|
9112 |
+
*/
|
9113 |
+
bindAll(...methodNames: (string|string[])[]): LoDashExplicitObjectWrapper<T>;
|
9114 |
+
}
|
9115 |
+
|
9116 |
+
//_.bindKey
|
9117 |
+
interface FunctionBindKey {
|
9118 |
+
placeholder: any;
|
9119 |
+
|
9120 |
+
<T extends Object, TResult extends Function>(
|
9121 |
+
object: T,
|
9122 |
+
key: any,
|
9123 |
+
...partials: any[]
|
9124 |
+
): TResult;
|
9125 |
+
|
9126 |
+
<TResult extends Function>(
|
9127 |
+
object: Object,
|
9128 |
+
key: any,
|
9129 |
+
...partials: any[]
|
9130 |
+
): TResult;
|
9131 |
+
}
|
9132 |
+
|
9133 |
+
interface LoDashStatic {
|
9134 |
+
/**
|
9135 |
+
* Creates a function that invokes the method at object[key] and prepends any additional _.bindKey arguments
|
9136 |
+
* to those provided to the bound function.
|
9137 |
+
*
|
9138 |
+
* This method differs from _.bind by allowing bound functions to reference methods that may be redefined
|
9139 |
+
* or don’t yet exist. See Peter Michaux’s article for more details.
|
9140 |
+
*
|
9141 |
+
* The _.bindKey.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder
|
9142 |
+
* for partially applied arguments.
|
9143 |
+
*
|
9144 |
+
* @param object The object the method belongs to.
|
9145 |
+
* @param key The key of the method.
|
9146 |
+
* @param partials The arguments to be partially applied.
|
9147 |
+
* @return Returns the new bound function.
|
9148 |
+
*/
|
9149 |
+
bindKey: FunctionBindKey;
|
9150 |
+
}
|
9151 |
+
|
9152 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9153 |
+
/**
|
9154 |
+
* @see _.bindKey
|
9155 |
+
*/
|
9156 |
+
bindKey<TResult extends Function>(
|
9157 |
+
key: any,
|
9158 |
+
...partials: any[]
|
9159 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
9160 |
+
}
|
9161 |
+
|
9162 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9163 |
+
/**
|
9164 |
+
* @see _.bindKey
|
9165 |
+
*/
|
9166 |
+
bindKey<TResult extends Function>(
|
9167 |
+
key: any,
|
9168 |
+
...partials: any[]
|
9169 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
9170 |
+
}
|
9171 |
+
|
9172 |
+
//_.compose
|
9173 |
+
interface LoDashStatic {
|
9174 |
+
/**
|
9175 |
+
* @see _.flowRight
|
9176 |
+
*/
|
9177 |
+
compose<TResult extends Function>(...funcs: Function[]): TResult;
|
9178 |
+
}
|
9179 |
+
|
9180 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9181 |
+
/**
|
9182 |
+
* @see _.flowRight
|
9183 |
+
*/
|
9184 |
+
compose<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
9185 |
+
}
|
9186 |
+
|
9187 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9188 |
+
/**
|
9189 |
+
* @see _.flowRight
|
9190 |
+
*/
|
9191 |
+
compose<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
9192 |
+
}
|
9193 |
+
|
9194 |
+
//_.createCallback
|
9195 |
+
interface LoDashStatic {
|
9196 |
+
/**
|
9197 |
+
* Produces a callback bound to an optional thisArg. If func is a property name the created
|
9198 |
+
* callback will return the property value for a given element. If func is an object the created
|
9199 |
+
* callback will return true for elements that contain the equivalent object properties,
|
9200 |
+
* otherwise it will return false.
|
9201 |
+
* @param func The value to convert to a callback.
|
9202 |
+
* @param thisArg The this binding of the created callback.
|
9203 |
+
* @param argCount The number of arguments the callback accepts.
|
9204 |
+
* @return A callback function.
|
9205 |
+
**/
|
9206 |
+
createCallback(
|
9207 |
+
func: string,
|
9208 |
+
thisArg?: any,
|
9209 |
+
argCount?: number): () => any;
|
9210 |
+
|
9211 |
+
/**
|
9212 |
+
* @see _.createCallback
|
9213 |
+
**/
|
9214 |
+
createCallback(
|
9215 |
+
func: Dictionary<any>,
|
9216 |
+
thisArg?: any,
|
9217 |
+
argCount?: number): () => boolean;
|
9218 |
+
}
|
9219 |
+
|
9220 |
+
interface LoDashImplicitWrapper<T> {
|
9221 |
+
/**
|
9222 |
+
* @see _.createCallback
|
9223 |
+
**/
|
9224 |
+
createCallback(
|
9225 |
+
thisArg?: any,
|
9226 |
+
argCount?: number): LoDashImplicitObjectWrapper<() => any>;
|
9227 |
+
}
|
9228 |
+
|
9229 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9230 |
+
/**
|
9231 |
+
* @see _.createCallback
|
9232 |
+
**/
|
9233 |
+
createCallback(
|
9234 |
+
thisArg?: any,
|
9235 |
+
argCount?: number): LoDashImplicitObjectWrapper<() => any>;
|
9236 |
+
}
|
9237 |
+
|
9238 |
+
//_.curry
|
9239 |
+
interface LoDashStatic {
|
9240 |
+
/**
|
9241 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9242 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9243 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9244 |
+
* @param func The function to curry.
|
9245 |
+
* @return Returns the new curried function.
|
9246 |
+
*/
|
9247 |
+
curry<T1, R>(func: (t1: T1) => R):
|
9248 |
+
CurriedFunction1<T1, R>;
|
9249 |
+
/**
|
9250 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9251 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9252 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9253 |
+
* @param func The function to curry.
|
9254 |
+
* @return Returns the new curried function.
|
9255 |
+
*/
|
9256 |
+
curry<T1, T2, R>(func: (t1: T1, t2: T2) => R):
|
9257 |
+
CurriedFunction2<T1, T2, R>;
|
9258 |
+
/**
|
9259 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9260 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9261 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9262 |
+
* @param func The function to curry.
|
9263 |
+
* @return Returns the new curried function.
|
9264 |
+
*/
|
9265 |
+
curry<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
|
9266 |
+
CurriedFunction3<T1, T2, T3, R>;
|
9267 |
+
/**
|
9268 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9269 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9270 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9271 |
+
* @param func The function to curry.
|
9272 |
+
* @return Returns the new curried function.
|
9273 |
+
*/
|
9274 |
+
curry<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
|
9275 |
+
CurriedFunction4<T1, T2, T3, T4, R>;
|
9276 |
+
/**
|
9277 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9278 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9279 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9280 |
+
* @param func The function to curry.
|
9281 |
+
* @return Returns the new curried function.
|
9282 |
+
*/
|
9283 |
+
curry<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
|
9284 |
+
CurriedFunction5<T1, T2, T3, T4, T5, R>;
|
9285 |
+
/**
|
9286 |
+
* Creates a function that accepts one or more arguments of func that when called either invokes func returning
|
9287 |
+
* its result, if all func arguments have been provided, or returns a function that accepts one or more of the
|
9288 |
+
* remaining func arguments, and so on. The arity of func may be specified if func.length is not sufficient.
|
9289 |
+
* @param func The function to curry.
|
9290 |
+
* @param arity The arity of func.
|
9291 |
+
* @return Returns the new curried function.
|
9292 |
+
*/
|
9293 |
+
curry<TResult extends Function>(
|
9294 |
+
func: Function,
|
9295 |
+
arity?: number): TResult;
|
9296 |
+
}
|
9297 |
+
|
9298 |
+
interface CurriedFunction1<T1, R> {
|
9299 |
+
(): CurriedFunction1<T1, R>;
|
9300 |
+
(t1: T1): R;
|
9301 |
+
}
|
9302 |
+
|
9303 |
+
interface CurriedFunction2<T1, T2, R> {
|
9304 |
+
(): CurriedFunction2<T1, T2, R>;
|
9305 |
+
(t1: T1): CurriedFunction1<T2, R>;
|
9306 |
+
(t1: T1, t2: T2): R;
|
9307 |
+
}
|
9308 |
+
|
9309 |
+
interface CurriedFunction3<T1, T2, T3, R> {
|
9310 |
+
(): CurriedFunction3<T1, T2, T3, R>;
|
9311 |
+
(t1: T1): CurriedFunction2<T2, T3, R>;
|
9312 |
+
(t1: T1, t2: T2): CurriedFunction1<T3, R>;
|
9313 |
+
(t1: T1, t2: T2, t3: T3): R;
|
9314 |
+
}
|
9315 |
+
|
9316 |
+
interface CurriedFunction4<T1, T2, T3, T4, R> {
|
9317 |
+
(): CurriedFunction4<T1, T2, T3, T4, R>;
|
9318 |
+
(t1: T1): CurriedFunction3<T2, T3, T4, R>;
|
9319 |
+
(t1: T1, t2: T2): CurriedFunction2<T3, T4, R>;
|
9320 |
+
(t1: T1, t2: T2, t3: T3): CurriedFunction1<T4, R>;
|
9321 |
+
(t1: T1, t2: T2, t3: T3, t4: T4): R;
|
9322 |
+
}
|
9323 |
+
|
9324 |
+
interface CurriedFunction5<T1, T2, T3, T4, T5, R> {
|
9325 |
+
(): CurriedFunction5<T1, T2, T3, T4, T5, R>;
|
9326 |
+
(t1: T1): CurriedFunction4<T2, T3, T4, T5, R>;
|
9327 |
+
(t1: T1, t2: T2): CurriedFunction3<T3, T4, T5, R>;
|
9328 |
+
(t1: T1, t2: T2, t3: T3): CurriedFunction2<T4, T5, R>;
|
9329 |
+
(t1: T1, t2: T2, t3: T3, t4: T4): CurriedFunction1<T5, R>;
|
9330 |
+
(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): R;
|
9331 |
+
}
|
9332 |
+
|
9333 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9334 |
+
/**
|
9335 |
+
* @see _.curry
|
9336 |
+
**/
|
9337 |
+
curry<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
|
9338 |
+
}
|
9339 |
+
|
9340 |
+
//_.curryRight
|
9341 |
+
interface LoDashStatic {
|
9342 |
+
/**
|
9343 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9344 |
+
* instead of _.partial.
|
9345 |
+
* @param func The function to curry.
|
9346 |
+
* @return Returns the new curried function.
|
9347 |
+
*/
|
9348 |
+
curryRight<T1, R>(func: (t1: T1) => R):
|
9349 |
+
CurriedFunction1<T1, R>;
|
9350 |
+
/**
|
9351 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9352 |
+
* instead of _.partial.
|
9353 |
+
* @param func The function to curry.
|
9354 |
+
* @return Returns the new curried function.
|
9355 |
+
*/
|
9356 |
+
curryRight<T1, T2, R>(func: (t1: T1, t2: T2) => R):
|
9357 |
+
CurriedFunction2<T2, T1, R>;
|
9358 |
+
/**
|
9359 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9360 |
+
* instead of _.partial.
|
9361 |
+
* @param func The function to curry.
|
9362 |
+
* @return Returns the new curried function.
|
9363 |
+
*/
|
9364 |
+
curryRight<T1, T2, T3, R>(func: (t1: T1, t2: T2, t3: T3) => R):
|
9365 |
+
CurriedFunction3<T3, T2, T1, R>;
|
9366 |
+
/**
|
9367 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9368 |
+
* instead of _.partial.
|
9369 |
+
* @param func The function to curry.
|
9370 |
+
* @return Returns the new curried function.
|
9371 |
+
*/
|
9372 |
+
curryRight<T1, T2, T3, T4, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4) => R):
|
9373 |
+
CurriedFunction4<T4, T3, T2, T1, R>;
|
9374 |
+
/**
|
9375 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9376 |
+
* instead of _.partial.
|
9377 |
+
* @param func The function to curry.
|
9378 |
+
* @return Returns the new curried function.
|
9379 |
+
*/
|
9380 |
+
curryRight<T1, T2, T3, T4, T5, R>(func: (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R):
|
9381 |
+
CurriedFunction5<T5, T4, T3, T2, T1, R>;
|
9382 |
+
/**
|
9383 |
+
* This method is like _.curry except that arguments are applied to func in the manner of _.partialRight
|
9384 |
+
* instead of _.partial.
|
9385 |
+
* @param func The function to curry.
|
9386 |
+
* @param arity The arity of func.
|
9387 |
+
* @return Returns the new curried function.
|
9388 |
+
*/
|
9389 |
+
curryRight<TResult extends Function>(
|
9390 |
+
func: Function,
|
9391 |
+
arity?: number): TResult;
|
9392 |
+
}
|
9393 |
+
|
9394 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9395 |
+
/**
|
9396 |
+
* @see _.curryRight
|
9397 |
+
**/
|
9398 |
+
curryRight<TResult extends Function>(arity?: number): LoDashImplicitObjectWrapper<TResult>;
|
9399 |
+
}
|
9400 |
+
|
9401 |
+
//_.debounce
|
9402 |
+
interface DebounceSettings {
|
9403 |
+
/**
|
9404 |
+
* Specify invoking on the leading edge of the timeout.
|
9405 |
+
*/
|
9406 |
+
leading?: boolean;
|
9407 |
+
|
9408 |
+
/**
|
9409 |
+
* The maximum time func is allowed to be delayed before it’s invoked.
|
9410 |
+
*/
|
9411 |
+
maxWait?: number;
|
9412 |
+
|
9413 |
+
/**
|
9414 |
+
* Specify invoking on the trailing edge of the timeout.
|
9415 |
+
*/
|
9416 |
+
trailing?: boolean;
|
9417 |
+
}
|
9418 |
+
|
9419 |
+
interface LoDashStatic {
|
9420 |
+
/**
|
9421 |
+
* Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since
|
9422 |
+
* the last time the debounced function was invoked. The debounced function comes with a cancel method to
|
9423 |
+
* cancel delayed invocations. Provide an options object to indicate that func should be invoked on the
|
9424 |
+
* leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the
|
9425 |
+
* result of the last func invocation.
|
9426 |
+
*
|
9427 |
+
* Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only
|
9428 |
+
* if the the debounced function is invoked more than once during the wait timeout.
|
9429 |
+
*
|
9430 |
+
* See David Corbacho’s article for details over the differences between _.debounce and _.throttle.
|
9431 |
+
*
|
9432 |
+
* @param func The function to debounce.
|
9433 |
+
* @param wait The number of milliseconds to delay.
|
9434 |
+
* @param options The options object.
|
9435 |
+
* @param options.leading Specify invoking on the leading edge of the timeout.
|
9436 |
+
* @param options.maxWait The maximum time func is allowed to be delayed before it’s invoked.
|
9437 |
+
* @param options.trailing Specify invoking on the trailing edge of the timeout.
|
9438 |
+
* @return Returns the new debounced function.
|
9439 |
+
*/
|
9440 |
+
debounce<T extends Function>(
|
9441 |
+
func: T,
|
9442 |
+
wait?: number,
|
9443 |
+
options?: DebounceSettings
|
9444 |
+
): T & Cancelable;
|
9445 |
+
}
|
9446 |
+
|
9447 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9448 |
+
/**
|
9449 |
+
* @see _.debounce
|
9450 |
+
*/
|
9451 |
+
debounce(
|
9452 |
+
wait?: number,
|
9453 |
+
options?: DebounceSettings
|
9454 |
+
): LoDashImplicitObjectWrapper<T & Cancelable>;
|
9455 |
+
}
|
9456 |
+
|
9457 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9458 |
+
/**
|
9459 |
+
* @see _.debounce
|
9460 |
+
*/
|
9461 |
+
debounce(
|
9462 |
+
wait?: number,
|
9463 |
+
options?: DebounceSettings
|
9464 |
+
): LoDashExplicitObjectWrapper<T & Cancelable>;
|
9465 |
+
}
|
9466 |
+
|
9467 |
+
//_.defer
|
9468 |
+
interface LoDashStatic {
|
9469 |
+
/**
|
9470 |
+
* Defers invoking the func until the current call stack has cleared. Any additional arguments are provided to
|
9471 |
+
* func when it’s invoked.
|
9472 |
+
*
|
9473 |
+
* @param func The function to defer.
|
9474 |
+
* @param args The arguments to invoke the function with.
|
9475 |
+
* @return Returns the timer id.
|
9476 |
+
*/
|
9477 |
+
defer<T extends Function>(
|
9478 |
+
func: T,
|
9479 |
+
...args: any[]
|
9480 |
+
): number;
|
9481 |
+
}
|
9482 |
+
|
9483 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9484 |
+
/**
|
9485 |
+
* @see _.defer
|
9486 |
+
*/
|
9487 |
+
defer(...args: any[]): LoDashImplicitWrapper<number>;
|
9488 |
+
}
|
9489 |
+
|
9490 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9491 |
+
/**
|
9492 |
+
* @see _.defer
|
9493 |
+
*/
|
9494 |
+
defer(...args: any[]): LoDashExplicitWrapper<number>;
|
9495 |
+
}
|
9496 |
+
|
9497 |
+
//_.delay
|
9498 |
+
interface LoDashStatic {
|
9499 |
+
/**
|
9500 |
+
* Invokes func after wait milliseconds. Any additional arguments are provided to func when it’s invoked.
|
9501 |
+
*
|
9502 |
+
* @param func The function to delay.
|
9503 |
+
* @param wait The number of milliseconds to delay invocation.
|
9504 |
+
* @param args The arguments to invoke the function with.
|
9505 |
+
* @return Returns the timer id.
|
9506 |
+
*/
|
9507 |
+
delay<T extends Function>(
|
9508 |
+
func: T,
|
9509 |
+
wait: number,
|
9510 |
+
...args: any[]
|
9511 |
+
): number;
|
9512 |
+
}
|
9513 |
+
|
9514 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9515 |
+
/**
|
9516 |
+
* @see _.delay
|
9517 |
+
*/
|
9518 |
+
delay(
|
9519 |
+
wait: number,
|
9520 |
+
...args: any[]
|
9521 |
+
): LoDashImplicitWrapper<number>;
|
9522 |
+
}
|
9523 |
+
|
9524 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9525 |
+
/**
|
9526 |
+
* @see _.delay
|
9527 |
+
*/
|
9528 |
+
delay(
|
9529 |
+
wait: number,
|
9530 |
+
...args: any[]
|
9531 |
+
): LoDashExplicitWrapper<number>;
|
9532 |
+
}
|
9533 |
+
|
9534 |
+
//_.flow
|
9535 |
+
interface LoDashStatic {
|
9536 |
+
/**
|
9537 |
+
* Creates a function that returns the result of invoking the provided functions with the this binding of the
|
9538 |
+
* created function, where each successive invocation is supplied the return value of the previous.
|
9539 |
+
*
|
9540 |
+
* @param funcs Functions to invoke.
|
9541 |
+
* @return Returns the new function.
|
9542 |
+
*/
|
9543 |
+
flow<TResult extends Function>(...funcs: Function[]): TResult;
|
9544 |
+
}
|
9545 |
+
|
9546 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9547 |
+
/**
|
9548 |
+
* @see _.flow
|
9549 |
+
*/
|
9550 |
+
flow<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
9551 |
+
}
|
9552 |
+
|
9553 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9554 |
+
/**
|
9555 |
+
* @see _.flow
|
9556 |
+
*/
|
9557 |
+
flow<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
9558 |
+
}
|
9559 |
+
|
9560 |
+
//_.flowRight
|
9561 |
+
interface LoDashStatic {
|
9562 |
+
/**
|
9563 |
+
* This method is like _.flow except that it creates a function that invokes the provided functions from right
|
9564 |
+
* to left.
|
9565 |
+
*
|
9566 |
+
* @alias _.backflow, _.compose
|
9567 |
+
*
|
9568 |
+
* @param funcs Functions to invoke.
|
9569 |
+
* @return Returns the new function.
|
9570 |
+
*/
|
9571 |
+
flowRight<TResult extends Function>(...funcs: Function[]): TResult;
|
9572 |
+
}
|
9573 |
+
|
9574 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9575 |
+
/**
|
9576 |
+
* @see _.flowRight
|
9577 |
+
*/
|
9578 |
+
flowRight<TResult extends Function>(...funcs: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
9579 |
+
}
|
9580 |
+
|
9581 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9582 |
+
/**
|
9583 |
+
* @see _.flowRight
|
9584 |
+
*/
|
9585 |
+
flowRight<TResult extends Function>(...funcs: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
9586 |
+
}
|
9587 |
+
|
9588 |
+
|
9589 |
+
//_.memoize
|
9590 |
+
interface MemoizedFunction extends Function {
|
9591 |
+
cache: MapCache;
|
9592 |
+
}
|
9593 |
+
|
9594 |
+
interface LoDashStatic {
|
9595 |
+
/**
|
9596 |
+
* Creates a function that memoizes the result of func. If resolver is provided it determines the cache key for
|
9597 |
+
* storing the result based on the arguments provided to the memoized function. By default, the first argument
|
9598 |
+
* provided to the memoized function is coerced to a string and used as the cache key. The func is invoked with
|
9599 |
+
* the this binding of the memoized function.
|
9600 |
+
* @param func The function to have its output memoized.
|
9601 |
+
* @param resolver The function to resolve the cache key.
|
9602 |
+
* @return Returns the new memoizing function.
|
9603 |
+
*/
|
9604 |
+
memoize<TResult extends MemoizedFunction>(
|
9605 |
+
func: Function,
|
9606 |
+
resolver?: Function): TResult;
|
9607 |
+
}
|
9608 |
+
|
9609 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9610 |
+
/**
|
9611 |
+
* @see _.memoize
|
9612 |
+
*/
|
9613 |
+
memoize<TResult extends MemoizedFunction>(resolver?: Function): LoDashImplicitObjectWrapper<TResult>;
|
9614 |
+
}
|
9615 |
+
|
9616 |
+
//_.modArgs
|
9617 |
+
interface LoDashStatic {
|
9618 |
+
/**
|
9619 |
+
* Creates a function that runs each argument through a corresponding transform function.
|
9620 |
+
*
|
9621 |
+
* @param func The function to wrap.
|
9622 |
+
* @param transforms The functions to transform arguments, specified as individual functions or arrays
|
9623 |
+
* of functions.
|
9624 |
+
* @return Returns the new function.
|
9625 |
+
*/
|
9626 |
+
modArgs<T extends Function, TResult extends Function>(
|
9627 |
+
func: T,
|
9628 |
+
...transforms: Function[]
|
9629 |
+
): TResult;
|
9630 |
+
|
9631 |
+
/**
|
9632 |
+
* @see _.modArgs
|
9633 |
+
*/
|
9634 |
+
modArgs<T extends Function, TResult extends Function>(
|
9635 |
+
func: T,
|
9636 |
+
transforms: Function[]
|
9637 |
+
): TResult;
|
9638 |
+
}
|
9639 |
+
|
9640 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9641 |
+
/**
|
9642 |
+
* @see _.modArgs
|
9643 |
+
*/
|
9644 |
+
modArgs<TResult extends Function>(...transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
9645 |
+
|
9646 |
+
/**
|
9647 |
+
* @see _.modArgs
|
9648 |
+
*/
|
9649 |
+
modArgs<TResult extends Function>(transforms: Function[]): LoDashImplicitObjectWrapper<TResult>;
|
9650 |
+
}
|
9651 |
+
|
9652 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9653 |
+
/**
|
9654 |
+
* @see _.modArgs
|
9655 |
+
*/
|
9656 |
+
modArgs<TResult extends Function>(...transforms: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
9657 |
+
|
9658 |
+
/**
|
9659 |
+
* @see _.modArgs
|
9660 |
+
*/
|
9661 |
+
modArgs<TResult extends Function>(transforms: Function[]): LoDashExplicitObjectWrapper<TResult>;
|
9662 |
+
}
|
9663 |
+
|
9664 |
+
//_.negate
|
9665 |
+
interface LoDashStatic {
|
9666 |
+
/**
|
9667 |
+
* Creates a function that negates the result of the predicate func. The func predicate is invoked with
|
9668 |
+
* the this binding and arguments of the created function.
|
9669 |
+
*
|
9670 |
+
* @param predicate The predicate to negate.
|
9671 |
+
* @return Returns the new function.
|
9672 |
+
*/
|
9673 |
+
negate<T extends Function>(predicate: T): (...args: any[]) => boolean;
|
9674 |
+
|
9675 |
+
/**
|
9676 |
+
* @see _.negate
|
9677 |
+
*/
|
9678 |
+
negate<T extends Function, TResult extends Function>(predicate: T): TResult;
|
9679 |
+
}
|
9680 |
+
|
9681 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9682 |
+
/**
|
9683 |
+
* @see _.negate
|
9684 |
+
*/
|
9685 |
+
negate(): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
|
9686 |
+
|
9687 |
+
/**
|
9688 |
+
* @see _.negate
|
9689 |
+
*/
|
9690 |
+
negate<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
|
9691 |
+
}
|
9692 |
+
|
9693 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9694 |
+
/**
|
9695 |
+
* @see _.negate
|
9696 |
+
*/
|
9697 |
+
negate(): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
|
9698 |
+
|
9699 |
+
/**
|
9700 |
+
* @see _.negate
|
9701 |
+
*/
|
9702 |
+
negate<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
|
9703 |
+
}
|
9704 |
+
|
9705 |
+
//_.once
|
9706 |
+
interface LoDashStatic {
|
9707 |
+
/**
|
9708 |
+
* Creates a function that is restricted to invoking func once. Repeat calls to the function return the value
|
9709 |
+
* of the first call. The func is invoked with the this binding and arguments of the created function.
|
9710 |
+
*
|
9711 |
+
* @param func The function to restrict.
|
9712 |
+
* @return Returns the new restricted function.
|
9713 |
+
*/
|
9714 |
+
once<T extends Function>(func: T): T;
|
9715 |
+
}
|
9716 |
+
|
9717 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9718 |
+
/**
|
9719 |
+
* @see _.once
|
9720 |
+
*/
|
9721 |
+
once(): LoDashImplicitObjectWrapper<T>;
|
9722 |
+
}
|
9723 |
+
|
9724 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9725 |
+
/**
|
9726 |
+
* @see _.once
|
9727 |
+
*/
|
9728 |
+
once(): LoDashExplicitObjectWrapper<T>;
|
9729 |
+
}
|
9730 |
+
|
9731 |
+
//_.partial
|
9732 |
+
interface LoDashStatic {
|
9733 |
+
/**
|
9734 |
+
* Creates a function that, when called, invokes func with any additional partial arguments
|
9735 |
+
* prepended to those provided to the new function. This method is similar to _.bind except
|
9736 |
+
* it does not alter the this binding.
|
9737 |
+
* @param func The function to partially apply arguments to.
|
9738 |
+
* @param args Arguments to be partially applied.
|
9739 |
+
* @return The new partially applied function.
|
9740 |
+
**/
|
9741 |
+
partial: Partial;
|
9742 |
+
}
|
9743 |
+
|
9744 |
+
type PH = LoDashStatic;
|
9745 |
+
|
9746 |
+
interface Function0<R> {
|
9747 |
+
(): R;
|
9748 |
+
}
|
9749 |
+
interface Function1<T1, R> {
|
9750 |
+
(t1: T1): R;
|
9751 |
+
}
|
9752 |
+
interface Function2<T1, T2, R> {
|
9753 |
+
(t1: T1, t2: T2): R;
|
9754 |
+
}
|
9755 |
+
interface Function3<T1, T2, T3, R> {
|
9756 |
+
(t1: T1, t2: T2, t3: T3): R;
|
9757 |
+
}
|
9758 |
+
interface Function4<T1, T2, T3, T4, R> {
|
9759 |
+
(t1: T1, t2: T2, t3: T3, t4: T4): R;
|
9760 |
+
}
|
9761 |
+
|
9762 |
+
interface Partial {
|
9763 |
+
// arity 0
|
9764 |
+
<R>(func: Function0<R>): Function0<R>;
|
9765 |
+
// arity 1
|
9766 |
+
<T1, R>(func: Function1<T1, R>): Function1<T1, R>;
|
9767 |
+
<T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
|
9768 |
+
// arity 2
|
9769 |
+
<T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
|
9770 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1): Function1< T2, R>;
|
9771 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, plc1: PH, arg2: T2): Function1<T1, R>;
|
9772 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
|
9773 |
+
// arity 3
|
9774 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
|
9775 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1): Function2< T2, T3, R>;
|
9776 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2): Function2<T1, T3, R>;
|
9777 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2): Function1< T3, R>;
|
9778 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, plc2: PH, arg3: T3): Function2<T1, T2, R>;
|
9779 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
|
9780 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, plc1: PH, arg2: T2, arg3: T3): Function1<T1, R>;
|
9781 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
|
9782 |
+
// arity 4
|
9783 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
|
9784 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1): Function3< T2, T3, T4, R>;
|
9785 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2): Function3<T1, T3, T4, R>;
|
9786 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2): Function2< T3, T4, R>;
|
9787 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3): Function3<T1, T2, T4, R>;
|
9788 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3): Function2< T2, T4, R>;
|
9789 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3): Function2<T1, T4, R>;
|
9790 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3): Function1< T4, R>;
|
9791 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, plc3: PH, arg4: T4): Function3<T1, T2, T3, R>;
|
9792 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
|
9793 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
|
9794 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
|
9795 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, plc2: PH, arg3: T3, arg4: T4): Function2<T1, T2, R>;
|
9796 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
|
9797 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, plc1: PH, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
|
9798 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
|
9799 |
+
// catch-all
|
9800 |
+
(func: Function, ...args: any[]): Function;
|
9801 |
+
}
|
9802 |
+
|
9803 |
+
//_.partialRight
|
9804 |
+
interface LoDashStatic {
|
9805 |
+
/**
|
9806 |
+
* This method is like _.partial except that partial arguments are appended to those provided
|
9807 |
+
* to the new function.
|
9808 |
+
* @param func The function to partially apply arguments to.
|
9809 |
+
* @param args Arguments to be partially applied.
|
9810 |
+
* @return The new partially applied function.
|
9811 |
+
**/
|
9812 |
+
partialRight: PartialRight
|
9813 |
+
}
|
9814 |
+
|
9815 |
+
interface PartialRight {
|
9816 |
+
// arity 0
|
9817 |
+
<R>(func: Function0<R>): Function0<R>;
|
9818 |
+
// arity 1
|
9819 |
+
<T1, R>(func: Function1<T1, R>): Function1<T1, R>;
|
9820 |
+
<T1, R>(func: Function1<T1, R>, arg1: T1): Function0<R>;
|
9821 |
+
// arity 2
|
9822 |
+
<T1, T2, R>(func: Function2<T1, T2, R>): Function2<T1, T2, R>;
|
9823 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, plc2: PH): Function1< T2, R>;
|
9824 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, arg2: T2): Function1<T1, R>;
|
9825 |
+
<T1, T2, R>(func: Function2<T1, T2, R>, arg1: T1, arg2: T2): Function0< R>;
|
9826 |
+
// arity 3
|
9827 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>): Function3<T1, T2, T3, R>;
|
9828 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, plc3: PH): Function2< T2, T3, R>;
|
9829 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, plc3: PH): Function2<T1, T3, R>;
|
9830 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, plc3: PH): Function1< T3, R>;
|
9831 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg3: T3): Function2<T1, T2, R>;
|
9832 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, plc2: PH, arg3: T3): Function1< T2, R>;
|
9833 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg2: T2, arg3: T3): Function1<T1, R>;
|
9834 |
+
<T1, T2, T3, R>(func: Function3<T1, T2, T3, R>, arg1: T1, arg2: T2, arg3: T3): Function0< R>;
|
9835 |
+
// arity 4
|
9836 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>): Function4<T1, T2, T3, T4, R>;
|
9837 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, plc4: PH): Function3< T2, T3, T4, R>;
|
9838 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, plc4: PH): Function3<T1, T3, T4, R>;
|
9839 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, plc4: PH): Function2< T3, T4, R>;
|
9840 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, plc4: PH): Function3<T1, T2, T4, R>;
|
9841 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, plc4: PH): Function2< T2, T4, R>;
|
9842 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, plc4: PH): Function2<T1, T4, R>;
|
9843 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, plc4: PH): Function1< T4, R>;
|
9844 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg4: T4): Function3<T1, T2, T3, R>;
|
9845 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, plc3: PH, arg4: T4): Function2< T2, T3, R>;
|
9846 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, plc3: PH, arg4: T4): Function2<T1, T3, R>;
|
9847 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, plc3: PH, arg4: T4): Function1< T3, R>;
|
9848 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg3: T3, arg4: T4): Function2<T1, T2, R>;
|
9849 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, plc2: PH, arg3: T3, arg4: T4): Function1< T2, R>;
|
9850 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg2: T2, arg3: T3, arg4: T4): Function1<T1, R>;
|
9851 |
+
<T1, T2, T3, T4, R>(func: Function4<T1, T2, T3, T4, R>, arg1: T1, arg2: T2, arg3: T3, arg4: T4): Function0< R>;
|
9852 |
+
// catch-all
|
9853 |
+
(func: Function, ...args: any[]): Function;
|
9854 |
+
}
|
9855 |
+
|
9856 |
+
//_.rearg
|
9857 |
+
interface LoDashStatic {
|
9858 |
+
/**
|
9859 |
+
* Creates a function that invokes func with arguments arranged according to the specified indexes where the
|
9860 |
+
* argument value at the first index is provided as the first argument, the argument value at the second index
|
9861 |
+
* is provided as the second argument, and so on.
|
9862 |
+
* @param func The function to rearrange arguments for.
|
9863 |
+
* @param indexes The arranged argument indexes, specified as individual indexes or arrays of indexes.
|
9864 |
+
* @return Returns the new function.
|
9865 |
+
*/
|
9866 |
+
rearg<TResult extends Function>(func: Function, indexes: number[]): TResult;
|
9867 |
+
|
9868 |
+
/**
|
9869 |
+
* @see _.rearg
|
9870 |
+
*/
|
9871 |
+
rearg<TResult extends Function>(func: Function, ...indexes: number[]): TResult;
|
9872 |
+
}
|
9873 |
+
|
9874 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9875 |
+
/**
|
9876 |
+
* @see _.rearg
|
9877 |
+
*/
|
9878 |
+
rearg<TResult extends Function>(indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
|
9879 |
+
|
9880 |
+
/**
|
9881 |
+
* @see _.rearg
|
9882 |
+
*/
|
9883 |
+
rearg<TResult extends Function>(...indexes: number[]): LoDashImplicitObjectWrapper<TResult>;
|
9884 |
+
}
|
9885 |
+
|
9886 |
+
//_.restParam
|
9887 |
+
interface LoDashStatic {
|
9888 |
+
/**
|
9889 |
+
* Creates a function that invokes func with the this binding of the created function and arguments from start
|
9890 |
+
* and beyond provided as an array.
|
9891 |
+
*
|
9892 |
+
* Note: This method is based on the rest parameter.
|
9893 |
+
*
|
9894 |
+
* @param func The function to apply a rest parameter to.
|
9895 |
+
* @param start The start position of the rest parameter.
|
9896 |
+
* @return Returns the new function.
|
9897 |
+
*/
|
9898 |
+
restParam<TResult extends Function>(
|
9899 |
+
func: Function,
|
9900 |
+
start?: number
|
9901 |
+
): TResult;
|
9902 |
+
|
9903 |
+
/**
|
9904 |
+
* @see _.restParam
|
9905 |
+
*/
|
9906 |
+
restParam<TResult extends Function, TFunc extends Function>(
|
9907 |
+
func: TFunc,
|
9908 |
+
start?: number
|
9909 |
+
): TResult;
|
9910 |
+
}
|
9911 |
+
|
9912 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9913 |
+
/**
|
9914 |
+
* @see _.restParam
|
9915 |
+
*/
|
9916 |
+
restParam<TResult extends Function>(start?: number): LoDashImplicitObjectWrapper<TResult>;
|
9917 |
+
}
|
9918 |
+
|
9919 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9920 |
+
/**
|
9921 |
+
* @see _.restParam
|
9922 |
+
*/
|
9923 |
+
restParam<TResult extends Function>(start?: number): LoDashExplicitObjectWrapper<TResult>;
|
9924 |
+
}
|
9925 |
+
|
9926 |
+
//_.spread
|
9927 |
+
interface LoDashStatic {
|
9928 |
+
/**
|
9929 |
+
* Creates a function that invokes func with the this binding of the created function and an array of arguments
|
9930 |
+
* much like Function#apply.
|
9931 |
+
*
|
9932 |
+
* Note: This method is based on the spread operator.
|
9933 |
+
*
|
9934 |
+
* @param func The function to spread arguments over.
|
9935 |
+
* @return Returns the new function.
|
9936 |
+
*/
|
9937 |
+
spread<F extends Function, T extends Function>(func: F): T;
|
9938 |
+
|
9939 |
+
/**
|
9940 |
+
* @see _.spread
|
9941 |
+
*/
|
9942 |
+
spread<T extends Function>(func: Function): T;
|
9943 |
+
}
|
9944 |
+
|
9945 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9946 |
+
/**
|
9947 |
+
* @see _.spread
|
9948 |
+
*/
|
9949 |
+
spread<T extends Function>(): LoDashImplicitObjectWrapper<T>;
|
9950 |
+
}
|
9951 |
+
|
9952 |
+
interface LoDashExplicitObjectWrapper<T> {
|
9953 |
+
/**
|
9954 |
+
* @see _.spread
|
9955 |
+
*/
|
9956 |
+
spread<T extends Function>(): LoDashExplicitObjectWrapper<T>;
|
9957 |
+
}
|
9958 |
+
|
9959 |
+
//_.throttle
|
9960 |
+
interface ThrottleSettings {
|
9961 |
+
/**
|
9962 |
+
* If you'd like to disable the leading-edge call, pass this as false.
|
9963 |
+
*/
|
9964 |
+
leading?: boolean;
|
9965 |
+
|
9966 |
+
/**
|
9967 |
+
* If you'd like to disable the execution on the trailing-edge, pass false.
|
9968 |
+
*/
|
9969 |
+
trailing?: boolean;
|
9970 |
+
}
|
9971 |
+
|
9972 |
+
interface LoDashStatic {
|
9973 |
+
/**
|
9974 |
+
* Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled
|
9975 |
+
* function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate
|
9976 |
+
* that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to
|
9977 |
+
* the throttled function return the result of the last func call.
|
9978 |
+
*
|
9979 |
+
* Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if
|
9980 |
+
* the the throttled function is invoked more than once during the wait timeout.
|
9981 |
+
*
|
9982 |
+
* @param func The function to throttle.
|
9983 |
+
* @param wait The number of milliseconds to throttle invocations to.
|
9984 |
+
* @param options The options object.
|
9985 |
+
* @param options.leading Specify invoking on the leading edge of the timeout.
|
9986 |
+
* @param options.trailing Specify invoking on the trailing edge of the timeout.
|
9987 |
+
* @return Returns the new throttled function.
|
9988 |
+
*/
|
9989 |
+
throttle<T extends Function>(
|
9990 |
+
func: T,
|
9991 |
+
wait?: number,
|
9992 |
+
options?: ThrottleSettings
|
9993 |
+
): T & Cancelable;
|
9994 |
+
}
|
9995 |
+
|
9996 |
+
interface LoDashImplicitObjectWrapper<T> {
|
9997 |
+
/**
|
9998 |
+
* @see _.throttle
|
9999 |
+
*/
|
10000 |
+
throttle(
|
10001 |
+
wait?: number,
|
10002 |
+
options?: ThrottleSettings
|
10003 |
+
): LoDashImplicitObjectWrapper<T & Cancelable>;
|
10004 |
+
}
|
10005 |
+
|
10006 |
+
interface LoDashExplicitObjectWrapper<T> {
|
10007 |
+
/**
|
10008 |
+
* @see _.throttle
|
10009 |
+
*/
|
10010 |
+
throttle(
|
10011 |
+
wait?: number,
|
10012 |
+
options?: ThrottleSettings
|
10013 |
+
): LoDashExplicitObjectWrapper<T & Cancelable>;
|
10014 |
+
}
|
10015 |
+
|
10016 |
+
//_.wrap
|
10017 |
+
interface LoDashStatic {
|
10018 |
+
/**
|
10019 |
+
* Creates a function that provides value to the wrapper function as its first argument. Any additional
|
10020 |
+
* arguments provided to the function are appended to those provided to the wrapper function. The wrapper is
|
10021 |
+
* invoked with the this binding of the created function.
|
10022 |
+
*
|
10023 |
+
* @param value The value to wrap.
|
10024 |
+
* @param wrapper The wrapper function.
|
10025 |
+
* @return Returns the new function.
|
10026 |
+
*/
|
10027 |
+
wrap<V, W extends Function, R extends Function>(
|
10028 |
+
value: V,
|
10029 |
+
wrapper: W
|
10030 |
+
): R;
|
10031 |
+
|
10032 |
+
/**
|
10033 |
+
* @see _.wrap
|
10034 |
+
*/
|
10035 |
+
wrap<V, R extends Function>(
|
10036 |
+
value: V,
|
10037 |
+
wrapper: Function
|
10038 |
+
): R;
|
10039 |
+
|
10040 |
+
/**
|
10041 |
+
* @see _.wrap
|
10042 |
+
*/
|
10043 |
+
wrap<R extends Function>(
|
10044 |
+
value: any,
|
10045 |
+
wrapper: Function
|
10046 |
+
): R;
|
10047 |
+
}
|
10048 |
+
|
10049 |
+
interface LoDashImplicitWrapper<T> {
|
10050 |
+
/**
|
10051 |
+
* @see _.wrap
|
10052 |
+
*/
|
10053 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
|
10054 |
+
|
10055 |
+
/**
|
10056 |
+
* @see _.wrap
|
10057 |
+
*/
|
10058 |
+
wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
|
10059 |
+
}
|
10060 |
+
|
10061 |
+
interface LoDashImplicitArrayWrapper<T> {
|
10062 |
+
/**
|
10063 |
+
* @see _.wrap
|
10064 |
+
*/
|
10065 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
|
10066 |
+
|
10067 |
+
/**
|
10068 |
+
* @see _.wrap
|
10069 |
+
*/
|
10070 |
+
wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
|
10071 |
+
}
|
10072 |
+
|
10073 |
+
interface LoDashImplicitObjectWrapper<T> {
|
10074 |
+
/**
|
10075 |
+
* @see _.wrap
|
10076 |
+
*/
|
10077 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashImplicitObjectWrapper<R>;
|
10078 |
+
|
10079 |
+
/**
|
10080 |
+
* @see _.wrap
|
10081 |
+
*/
|
10082 |
+
wrap<R extends Function>(wrapper: Function): LoDashImplicitObjectWrapper<R>;
|
10083 |
+
}
|
10084 |
+
|
10085 |
+
interface LoDashExplicitWrapper<T> {
|
10086 |
+
/**
|
10087 |
+
* @see _.wrap
|
10088 |
+
*/
|
10089 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
|
10090 |
+
|
10091 |
+
/**
|
10092 |
+
* @see _.wrap
|
10093 |
+
*/
|
10094 |
+
wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
|
10095 |
+
}
|
10096 |
+
|
10097 |
+
interface LoDashExplicitArrayWrapper<T> {
|
10098 |
+
/**
|
10099 |
+
* @see _.wrap
|
10100 |
+
*/
|
10101 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
|
10102 |
+
|
10103 |
+
/**
|
10104 |
+
* @see _.wrap
|
10105 |
+
*/
|
10106 |
+
wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
|
10107 |
+
}
|
10108 |
+
|
10109 |
+
interface LoDashExplicitObjectWrapper<T> {
|
10110 |
+
/**
|
10111 |
+
* @see _.wrap
|
10112 |
+
*/
|
10113 |
+
wrap<W extends Function, R extends Function>(wrapper: W): LoDashExplicitObjectWrapper<R>;
|
10114 |
+
|
10115 |
+
/**
|
10116 |
+
* @see _.wrap
|
10117 |
+
*/
|
10118 |
+
wrap<R extends Function>(wrapper: Function): LoDashExplicitObjectWrapper<R>;
|
10119 |
+
}
|
10120 |
+
|
10121 |
+
/********
|
10122 |
+
* Lang *
|
10123 |
+
********/
|
10124 |
+
|
10125 |
+
//_.clone
|
10126 |
+
interface LoDashStatic {
|
10127 |
+
/**
|
10128 |
+
* Creates a clone of value. If isDeep is true nested objects are cloned, otherwise they are assigned by
|
10129 |
+
* reference. If customizer is provided it’s invoked to produce the cloned values. If customizer returns
|
10130 |
+
* undefined cloning is handled by the method instead. The customizer is bound to thisArg and invoked with up
|
10131 |
+
* to three argument; (value [, index|key, object]).
|
10132 |
+
* Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
|
10133 |
+
* objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
|
10134 |
+
* object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
|
10135 |
+
* @param value The value to clone.
|
10136 |
+
* @param isDeep Specify a deep clone.
|
10137 |
+
* @param customizer The function to customize cloning values.
|
10138 |
+
* @param thisArg The this binding of customizer.
|
10139 |
+
* @return Returns the cloned value.
|
10140 |
+
*/
|
10141 |
+
clone<T>(
|
10142 |
+
value: T,
|
10143 |
+
isDeep?: boolean,
|
10144 |
+
customizer?: (value: any) => any,
|
10145 |
+
thisArg?: any): T;
|
10146 |
+
|
10147 |
+
/**
|
10148 |
+
* @see _.clone
|
10149 |
+
*/
|
10150 |
+
clone<T>(
|
10151 |
+
value: T,
|
10152 |
+
customizer?: (value: any) => any,
|
10153 |
+
thisArg?: any): T;
|
10154 |
+
}
|
10155 |
+
|
10156 |
+
interface LoDashImplicitWrapper<T> {
|
10157 |
+
/**
|
10158 |
+
* @see _.clone
|
10159 |
+
*/
|
10160 |
+
clone(
|
10161 |
+
isDeep?: boolean,
|
10162 |
+
customizer?: (value: any) => any,
|
10163 |
+
thisArg?: any): T;
|
10164 |
+
|
10165 |
+
/**
|
10166 |
+
* @see _.clone
|
10167 |
+
*/
|
10168 |
+
clone(
|
10169 |
+
customizer?: (value: any) => any,
|
10170 |
+
thisArg?: any): T;
|
10171 |
+
}
|
10172 |
+
|
10173 |
+
interface LoDashImplicitArrayWrapper<T> {
|
10174 |
+
/**
|
10175 |
+
* @see _.clone
|
10176 |
+
*/
|
10177 |
+
clone(
|
10178 |
+
isDeep?: boolean,
|
10179 |
+
customizer?: (value: any) => any,
|
10180 |
+
thisArg?: any): T[];
|
10181 |
+
|
10182 |
+
/**
|
10183 |
+
* @see _.clone
|
10184 |
+
*/
|
10185 |
+
clone(
|
10186 |
+
customizer?: (value: any) => any,
|
10187 |
+
thisArg?: any): T[];
|
10188 |
+
}
|
10189 |
+
|
10190 |
+
interface LoDashImplicitObjectWrapper<T> {
|
10191 |
+
/**
|
10192 |
+
* @see _.clone
|
10193 |
+
*/
|
10194 |
+
clone(
|
10195 |
+
isDeep?: boolean,
|
10196 |
+
customizer?: (value: any) => any,
|
10197 |
+
thisArg?: any): T;
|
10198 |
+
|
10199 |
+
/**
|
10200 |
+
* @see _.clone
|
10201 |
+
*/
|
10202 |
+
clone(
|
10203 |
+
customizer?: (value: any) => any,
|
10204 |
+
thisArg?: any): T;
|
10205 |
+
}
|
10206 |
+
|
10207 |
+
//_.cloneDeep
|
10208 |
+
interface LoDashStatic {
|
10209 |
+
/**
|
10210 |
+
* Creates a deep clone of value. If customizer is provided it’s invoked to produce the cloned values. If
|
10211 |
+
* customizer returns undefined cloning is handled by the method instead. The customizer is bound to thisArg
|
10212 |
+
* and invoked with up to three argument; (value [, index|key, object]).
|
10213 |
+
* Note: This method is loosely based on the structured clone algorithm. The enumerable properties of arguments
|
10214 |
+
* objects and objects created by constructors other than Object are cloned to plain Object objects. An empty
|
10215 |
+
* object is returned for uncloneable values such as functions, DOM nodes, Maps, Sets, and WeakMaps.
|
10216 |
+
* @param value The value to deep clone.
|
10217 |
+
* @param customizer The function to customize cloning values.
|
10218 |
+
* @param thisArg The this binding of customizer.
|
10219 |
+
* @return Returns the deep cloned value.
|
10220 |
+
*/
|
10221 |
+
cloneDeep<T>(
|
10222 |
+
value: T,
|
10223 |
+
customizer?: (value: any) => any,
|
10224 |
+
thisArg?: any): T;
|
10225 |
+
}
|
10226 |
+
|
10227 |
+
interface LoDashImplicitWrapper<T> {
|
10228 |
+
/**
|
10229 |
+
* @see _.cloneDeep
|
10230 |
+
*/
|
10231 |
+
cloneDeep(
|
10232 |
+
customizer?: (value: any) => any,
|
10233 |
+
thisArg?: any): T;
|
10234 |
+
}
|
10235 |
+
|
10236 |
+
interface LoDashImplicitArrayWrapper<T> {
|
10237 |
+
/**
|
10238 |
+
* @see _.cloneDeep
|
10239 |
+
*/
|
10240 |
+
cloneDeep(
|
10241 |
+
customizer?: (value: any) => any,
|
10242 |
+
thisArg?: any): T[];
|
10243 |
+
}
|
10244 |
+
|
10245 |
+
interface LoDashImplicitObjectWrapper<T> {
|
10246 |
+
/**
|
10247 |
+
* @see _.cloneDeep
|
10248 |
+
*/
|
10249 |
+
cloneDeep(
|
10250 |
+
customizer?: (value: any) => any,
|
10251 |
+
thisArg?: any): T;
|
10252 |
+
}
|
10253 |
+
|
10254 |
+
//_.eq
|
10255 |
+
interface LoDashStatic {
|
10256 |
+
/**
|
10257 |
+
* @see _.isEqual
|
10258 |
+
*/
|
10259 |
+
eq(
|
10260 |
+
value: any,
|
10261 |
+
other: any,
|
10262 |
+
customizer?: IsEqualCustomizer,
|
10263 |
+
thisArg?: any
|
10264 |
+
): boolean;
|
10265 |
+
}
|
10266 |
+
|
10267 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10268 |
+
/**
|
10269 |
+
* @see _.isEqual
|
10270 |
+
*/
|
10271 |
+
eq(
|
10272 |
+
other: any,
|
10273 |
+
customizer?: IsEqualCustomizer,
|
10274 |
+
thisArg?: any
|
10275 |
+
): boolean;
|
10276 |
+
}
|
10277 |
+
|
10278 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10279 |
+
/**
|
10280 |
+
* @see _.isEqual
|
10281 |
+
*/
|
10282 |
+
eq(
|
10283 |
+
other: any,
|
10284 |
+
customizer?: IsEqualCustomizer,
|
10285 |
+
thisArg?: any
|
10286 |
+
): LoDashExplicitWrapper<boolean>;
|
10287 |
+
}
|
10288 |
+
|
10289 |
+
//_.gt
|
10290 |
+
interface LoDashStatic {
|
10291 |
+
/**
|
10292 |
+
* Checks if value is greater than other.
|
10293 |
+
*
|
10294 |
+
* @param value The value to compare.
|
10295 |
+
* @param other The other value to compare.
|
10296 |
+
* @return Returns true if value is greater than other, else false.
|
10297 |
+
*/
|
10298 |
+
gt(
|
10299 |
+
value: any,
|
10300 |
+
other: any
|
10301 |
+
): boolean;
|
10302 |
+
}
|
10303 |
+
|
10304 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10305 |
+
/**
|
10306 |
+
* @see _.gt
|
10307 |
+
*/
|
10308 |
+
gt(other: any): boolean;
|
10309 |
+
}
|
10310 |
+
|
10311 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10312 |
+
/**
|
10313 |
+
* @see _.gt
|
10314 |
+
*/
|
10315 |
+
gt(other: any): LoDashExplicitWrapper<boolean>;
|
10316 |
+
}
|
10317 |
+
|
10318 |
+
//_.gte
|
10319 |
+
interface LoDashStatic {
|
10320 |
+
/**
|
10321 |
+
* Checks if value is greater than or equal to other.
|
10322 |
+
*
|
10323 |
+
* @param value The value to compare.
|
10324 |
+
* @param other The other value to compare.
|
10325 |
+
* @return Returns true if value is greater than or equal to other, else false.
|
10326 |
+
*/
|
10327 |
+
gte(
|
10328 |
+
value: any,
|
10329 |
+
other: any
|
10330 |
+
): boolean;
|
10331 |
+
}
|
10332 |
+
|
10333 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10334 |
+
/**
|
10335 |
+
* @see _.gte
|
10336 |
+
*/
|
10337 |
+
gte(other: any): boolean;
|
10338 |
+
}
|
10339 |
+
|
10340 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10341 |
+
/**
|
10342 |
+
* @see _.gte
|
10343 |
+
*/
|
10344 |
+
gte(other: any): LoDashExplicitWrapper<boolean>;
|
10345 |
+
}
|
10346 |
+
|
10347 |
+
//_.isArguments
|
10348 |
+
interface LoDashStatic {
|
10349 |
+
/**
|
10350 |
+
* Checks if value is classified as an arguments object.
|
10351 |
+
*
|
10352 |
+
* @param value The value to check.
|
10353 |
+
* @return Returns true if value is correctly classified, else false.
|
10354 |
+
*/
|
10355 |
+
isArguments(value?: any): value is IArguments;
|
10356 |
+
}
|
10357 |
+
|
10358 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10359 |
+
/**
|
10360 |
+
* @see _.isArguments
|
10361 |
+
*/
|
10362 |
+
isArguments(): boolean;
|
10363 |
+
}
|
10364 |
+
|
10365 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10366 |
+
/**
|
10367 |
+
* @see _.isArguments
|
10368 |
+
*/
|
10369 |
+
isArguments(): LoDashExplicitWrapper<boolean>;
|
10370 |
+
}
|
10371 |
+
|
10372 |
+
//_.isArray
|
10373 |
+
interface LoDashStatic {
|
10374 |
+
/**
|
10375 |
+
* Checks if value is classified as an Array object.
|
10376 |
+
* @param value The value to check.
|
10377 |
+
*
|
10378 |
+
* @return Returns true if value is correctly classified, else false.
|
10379 |
+
*/
|
10380 |
+
isArray<T>(value?: any): value is T[];
|
10381 |
+
}
|
10382 |
+
|
10383 |
+
interface LoDashImplicitWrapperBase<T,TWrapper> {
|
10384 |
+
/**
|
10385 |
+
* @see _.isArray
|
10386 |
+
*/
|
10387 |
+
isArray(): boolean;
|
10388 |
+
}
|
10389 |
+
|
10390 |
+
interface LoDashExplicitWrapperBase<T,TWrapper> {
|
10391 |
+
/**
|
10392 |
+
* @see _.isArray
|
10393 |
+
*/
|
10394 |
+
isArray(): LoDashExplicitWrapper<boolean>;
|
10395 |
+
}
|
10396 |
+
|
10397 |
+
//_.isBoolean
|
10398 |
+
interface LoDashStatic {
|
10399 |
+
/**
|
10400 |
+
* Checks if value is classified as a boolean primitive or object.
|
10401 |
+
*
|
10402 |
+
* @param value The value to check.
|
10403 |
+
* @return Returns true if value is correctly classified, else false.
|
10404 |
+
*/
|
10405 |
+
isBoolean(value?: any): value is boolean;
|
10406 |
+
}
|
10407 |
+
|
10408 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10409 |
+
/**
|
10410 |
+
* @see _.isBoolean
|
10411 |
+
*/
|
10412 |
+
isBoolean(): boolean;
|
10413 |
+
}
|
10414 |
+
|
10415 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10416 |
+
/**
|
10417 |
+
* @see _.isBoolean
|
10418 |
+
*/
|
10419 |
+
isBoolean(): LoDashExplicitWrapper<boolean>;
|
10420 |
+
}
|
10421 |
+
|
10422 |
+
//_.isDate
|
10423 |
+
interface LoDashStatic {
|
10424 |
+
/**
|
10425 |
+
* Checks if value is classified as a Date object.
|
10426 |
+
* @param value The value to check.
|
10427 |
+
*
|
10428 |
+
* @return Returns true if value is correctly classified, else false.
|
10429 |
+
*/
|
10430 |
+
isDate(value?: any): value is Date;
|
10431 |
+
}
|
10432 |
+
|
10433 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10434 |
+
/**
|
10435 |
+
* @see _.isDate
|
10436 |
+
*/
|
10437 |
+
isDate(): boolean;
|
10438 |
+
}
|
10439 |
+
|
10440 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10441 |
+
/**
|
10442 |
+
* @see _.isDate
|
10443 |
+
*/
|
10444 |
+
isDate(): LoDashExplicitWrapper<boolean>;
|
10445 |
+
}
|
10446 |
+
|
10447 |
+
//_.isElement
|
10448 |
+
interface LoDashStatic {
|
10449 |
+
/**
|
10450 |
+
* Checks if value is a DOM element.
|
10451 |
+
*
|
10452 |
+
* @param value The value to check.
|
10453 |
+
* @return Returns true if value is a DOM element, else false.
|
10454 |
+
*/
|
10455 |
+
isElement(value?: any): boolean;
|
10456 |
+
}
|
10457 |
+
|
10458 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10459 |
+
/**
|
10460 |
+
* @see _.isElement
|
10461 |
+
*/
|
10462 |
+
isElement(): boolean;
|
10463 |
+
}
|
10464 |
+
|
10465 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10466 |
+
/**
|
10467 |
+
* @see _.isElement
|
10468 |
+
*/
|
10469 |
+
isElement(): LoDashExplicitWrapper<boolean>;
|
10470 |
+
}
|
10471 |
+
|
10472 |
+
//_.isEmpty
|
10473 |
+
interface LoDashStatic {
|
10474 |
+
/**
|
10475 |
+
* Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string, or
|
10476 |
+
* jQuery-like collection with a length greater than 0 or an object with own enumerable properties.
|
10477 |
+
*
|
10478 |
+
* @param value The value to inspect.
|
10479 |
+
* @return Returns true if value is empty, else false.
|
10480 |
+
*/
|
10481 |
+
isEmpty(value?: any): boolean;
|
10482 |
+
}
|
10483 |
+
|
10484 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10485 |
+
/**
|
10486 |
+
* @see _.isEmpty
|
10487 |
+
*/
|
10488 |
+
isEmpty(): boolean;
|
10489 |
+
}
|
10490 |
+
|
10491 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10492 |
+
/**
|
10493 |
+
* @see _.isEmpty
|
10494 |
+
*/
|
10495 |
+
isEmpty(): LoDashExplicitWrapper<boolean>;
|
10496 |
+
}
|
10497 |
+
|
10498 |
+
//_.isEqual
|
10499 |
+
interface IsEqualCustomizer {
|
10500 |
+
(value: any, other: any, indexOrKey?: number|string): boolean;
|
10501 |
+
}
|
10502 |
+
|
10503 |
+
interface LoDashStatic {
|
10504 |
+
/**
|
10505 |
+
* Performs a deep comparison between two values to determine if they are equivalent. If customizer is
|
10506 |
+
* provided it’s invoked to compare values. If customizer returns undefined comparisons are handled by the
|
10507 |
+
* method instead. The customizer is bound to thisArg and invoked with up to three arguments: (value, other
|
10508 |
+
* [, index|key]).
|
10509 |
+
*
|
10510 |
+
* Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes,
|
10511 |
+
* and strings. Objects are compared by their own, not inherited, enumerable properties. Functions and DOM
|
10512 |
+
* nodes are not supported. Provide a customizer function to extend support for comparing other values.
|
10513 |
+
*
|
10514 |
+
* @alias _.eq
|
10515 |
+
*
|
10516 |
+
* @param value The value to compare.
|
10517 |
+
* @param other The other value to compare.
|
10518 |
+
* @param customizer The function to customize value comparisons.
|
10519 |
+
* @param thisArg The this binding of customizer.
|
10520 |
+
* @return Returns true if the values are equivalent, else false.
|
10521 |
+
*/
|
10522 |
+
isEqual(
|
10523 |
+
value: any,
|
10524 |
+
other: any,
|
10525 |
+
customizer?: IsEqualCustomizer,
|
10526 |
+
thisArg?: any
|
10527 |
+
): boolean;
|
10528 |
+
}
|
10529 |
+
|
10530 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10531 |
+
/**
|
10532 |
+
* @see _.isEqual
|
10533 |
+
*/
|
10534 |
+
isEqual(
|
10535 |
+
other: any,
|
10536 |
+
customizer?: IsEqualCustomizer,
|
10537 |
+
thisArg?: any
|
10538 |
+
): boolean;
|
10539 |
+
}
|
10540 |
+
|
10541 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10542 |
+
/**
|
10543 |
+
* @see _.isEqual
|
10544 |
+
*/
|
10545 |
+
isEqual(
|
10546 |
+
other: any,
|
10547 |
+
customizer?: IsEqualCustomizer,
|
10548 |
+
thisArg?: any
|
10549 |
+
): LoDashExplicitWrapper<boolean>;
|
10550 |
+
}
|
10551 |
+
|
10552 |
+
//_.isError
|
10553 |
+
interface LoDashStatic {
|
10554 |
+
/**
|
10555 |
+
* Checks if value is an Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, or URIError
|
10556 |
+
* object.
|
10557 |
+
*
|
10558 |
+
* @param value The value to check.
|
10559 |
+
* @return Returns true if value is an error object, else false.
|
10560 |
+
*/
|
10561 |
+
isError(value: any): value is Error;
|
10562 |
+
}
|
10563 |
+
|
10564 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10565 |
+
/**
|
10566 |
+
* @see _.isError
|
10567 |
+
*/
|
10568 |
+
isError(): boolean;
|
10569 |
+
}
|
10570 |
+
|
10571 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10572 |
+
/**
|
10573 |
+
* @see _.isError
|
10574 |
+
*/
|
10575 |
+
isError(): LoDashExplicitWrapper<boolean>;
|
10576 |
+
}
|
10577 |
+
|
10578 |
+
//_.isFinite
|
10579 |
+
interface LoDashStatic {
|
10580 |
+
/**
|
10581 |
+
* Checks if value is a finite primitive number.
|
10582 |
+
*
|
10583 |
+
* Note: This method is based on Number.isFinite.
|
10584 |
+
*
|
10585 |
+
* @param value The value to check.
|
10586 |
+
* @return Returns true if value is a finite number, else false.
|
10587 |
+
*/
|
10588 |
+
isFinite(value?: any): boolean;
|
10589 |
+
}
|
10590 |
+
|
10591 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10592 |
+
/**
|
10593 |
+
* @see _.isFinite
|
10594 |
+
*/
|
10595 |
+
isFinite(): boolean;
|
10596 |
+
}
|
10597 |
+
|
10598 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10599 |
+
/**
|
10600 |
+
* @see _.isFinite
|
10601 |
+
*/
|
10602 |
+
isFinite(): LoDashExplicitWrapper<boolean>;
|
10603 |
+
}
|
10604 |
+
|
10605 |
+
//_.isFunction
|
10606 |
+
interface LoDashStatic {
|
10607 |
+
/**
|
10608 |
+
* Checks if value is classified as a Function object.
|
10609 |
+
*
|
10610 |
+
* @param value The value to check.
|
10611 |
+
* @return Returns true if value is correctly classified, else false.
|
10612 |
+
*/
|
10613 |
+
isFunction(value?: any): value is Function;
|
10614 |
+
}
|
10615 |
+
|
10616 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10617 |
+
/**
|
10618 |
+
* @see _.isFunction
|
10619 |
+
*/
|
10620 |
+
isFunction(): boolean;
|
10621 |
+
}
|
10622 |
+
|
10623 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10624 |
+
/**
|
10625 |
+
* @see _.isFunction
|
10626 |
+
*/
|
10627 |
+
isFunction(): LoDashExplicitWrapper<boolean>;
|
10628 |
+
}
|
10629 |
+
|
10630 |
+
//_.isMatch
|
10631 |
+
interface isMatchCustomizer {
|
10632 |
+
(value: any, other: any, indexOrKey?: number|string): boolean;
|
10633 |
+
}
|
10634 |
+
|
10635 |
+
interface LoDashStatic {
|
10636 |
+
/**
|
10637 |
+
* Performs a deep comparison between object and source to determine if object contains equivalent property
|
10638 |
+
* values. If customizer is provided it’s invoked to compare values. If customizer returns undefined
|
10639 |
+
* comparisons are handled by the method instead. The customizer is bound to thisArg and invoked with three
|
10640 |
+
* arguments: (value, other, index|key).
|
10641 |
+
* @param object The object to inspect.
|
10642 |
+
* @param source The object of property values to match.
|
10643 |
+
* @param customizer The function to customize value comparisons.
|
10644 |
+
* @param thisArg The this binding of customizer.
|
10645 |
+
* @return Returns true if object is a match, else false.
|
10646 |
+
*/
|
10647 |
+
isMatch(object: Object, source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
|
10648 |
+
}
|
10649 |
+
|
10650 |
+
interface LoDashImplicitObjectWrapper<T> {
|
10651 |
+
/**
|
10652 |
+
* @see _.isMatch
|
10653 |
+
*/
|
10654 |
+
isMatch(source: Object, customizer?: isMatchCustomizer, thisArg?: any): boolean;
|
10655 |
+
}
|
10656 |
+
|
10657 |
+
//_.isNaN
|
10658 |
+
interface LoDashStatic {
|
10659 |
+
/**
|
10660 |
+
* Checks if value is NaN.
|
10661 |
+
*
|
10662 |
+
* Note: This method is not the same as isNaN which returns true for undefined and other non-numeric values.
|
10663 |
+
*
|
10664 |
+
* @param value The value to check.
|
10665 |
+
* @return Returns true if value is NaN, else false.
|
10666 |
+
*/
|
10667 |
+
isNaN(value?: any): boolean;
|
10668 |
+
}
|
10669 |
+
|
10670 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10671 |
+
/**
|
10672 |
+
* @see _.isNaN
|
10673 |
+
*/
|
10674 |
+
isNaN(): boolean;
|
10675 |
+
}
|
10676 |
+
|
10677 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10678 |
+
/**
|
10679 |
+
* @see _.isNaN
|
10680 |
+
*/
|
10681 |
+
isNaN(): LoDashExplicitWrapper<boolean>;
|
10682 |
+
}
|
10683 |
+
|
10684 |
+
//_.isNative
|
10685 |
+
interface LoDashStatic {
|
10686 |
+
/**
|
10687 |
+
* Checks if value is a native function.
|
10688 |
+
* @param value The value to check.
|
10689 |
+
*
|
10690 |
+
* @retrun Returns true if value is a native function, else false.
|
10691 |
+
*/
|
10692 |
+
isNative(value: any): value is Function;
|
10693 |
+
}
|
10694 |
+
|
10695 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10696 |
+
/**
|
10697 |
+
* see _.isNative
|
10698 |
+
*/
|
10699 |
+
isNative(): boolean;
|
10700 |
+
}
|
10701 |
+
|
10702 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10703 |
+
/**
|
10704 |
+
* see _.isNative
|
10705 |
+
*/
|
10706 |
+
isNative(): LoDashExplicitWrapper<boolean>;
|
10707 |
+
}
|
10708 |
+
|
10709 |
+
//_.isNull
|
10710 |
+
interface LoDashStatic {
|
10711 |
+
/**
|
10712 |
+
* Checks if value is null.
|
10713 |
+
*
|
10714 |
+
* @param value The value to check.
|
10715 |
+
* @return Returns true if value is null, else false.
|
10716 |
+
*/
|
10717 |
+
isNull(value?: any): boolean;
|
10718 |
+
}
|
10719 |
+
|
10720 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10721 |
+
/**
|
10722 |
+
* see _.isNull
|
10723 |
+
*/
|
10724 |
+
isNull(): boolean;
|
10725 |
+
}
|
10726 |
+
|
10727 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10728 |
+
/**
|
10729 |
+
* see _.isNull
|
10730 |
+
*/
|
10731 |
+
isNull(): LoDashExplicitWrapper<boolean>;
|
10732 |
+
}
|
10733 |
+
|
10734 |
+
//_.isNumber
|
10735 |
+
interface LoDashStatic {
|
10736 |
+
/**
|
10737 |
+
* Checks if value is classified as a Number primitive or object.
|
10738 |
+
*
|
10739 |
+
* Note: To exclude Infinity, -Infinity, and NaN, which are classified as numbers, use the _.isFinite method.
|
10740 |
+
*
|
10741 |
+
* @param value The value to check.
|
10742 |
+
* @return Returns true if value is correctly classified, else false.
|
10743 |
+
*/
|
10744 |
+
isNumber(value?: any): value is number;
|
10745 |
+
}
|
10746 |
+
|
10747 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10748 |
+
/**
|
10749 |
+
* see _.isNumber
|
10750 |
+
*/
|
10751 |
+
isNumber(): boolean;
|
10752 |
+
}
|
10753 |
+
|
10754 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10755 |
+
/**
|
10756 |
+
* see _.isNumber
|
10757 |
+
*/
|
10758 |
+
isNumber(): LoDashExplicitWrapper<boolean>;
|
10759 |
+
}
|
10760 |
+
|
10761 |
+
//_.isObject
|
10762 |
+
interface LoDashStatic {
|
10763 |
+
/**
|
10764 |
+
* Checks if value is the language type of Object. (e.g. arrays, functions, objects, regexes, new Number(0),
|
10765 |
+
* and new String(''))
|
10766 |
+
*
|
10767 |
+
* @param value The value to check.
|
10768 |
+
* @return Returns true if value is an object, else false.
|
10769 |
+
*/
|
10770 |
+
isObject(value?: any): boolean;
|
10771 |
+
}
|
10772 |
+
|
10773 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10774 |
+
/**
|
10775 |
+
* see _.isObject
|
10776 |
+
*/
|
10777 |
+
isObject(): boolean;
|
10778 |
+
}
|
10779 |
+
|
10780 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10781 |
+
/**
|
10782 |
+
* see _.isObject
|
10783 |
+
*/
|
10784 |
+
isObject(): LoDashExplicitWrapper<boolean>;
|
10785 |
+
}
|
10786 |
+
|
10787 |
+
//_.isPlainObject
|
10788 |
+
interface LoDashStatic {
|
10789 |
+
/**
|
10790 |
+
* Checks if value is a plain object, that is, an object created by the Object constructor or one with a
|
10791 |
+
* [[Prototype]] of null.
|
10792 |
+
*
|
10793 |
+
* Note: This method assumes objects created by the Object constructor have no inherited enumerable properties.
|
10794 |
+
*
|
10795 |
+
* @param value The value to check.
|
10796 |
+
* @return Returns true if value is a plain object, else false.
|
10797 |
+
*/
|
10798 |
+
isPlainObject(value?: any): boolean;
|
10799 |
+
}
|
10800 |
+
|
10801 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10802 |
+
/**
|
10803 |
+
* see _.isPlainObject
|
10804 |
+
*/
|
10805 |
+
isPlainObject(): boolean;
|
10806 |
+
}
|
10807 |
+
|
10808 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10809 |
+
/**
|
10810 |
+
* see _.isPlainObject
|
10811 |
+
*/
|
10812 |
+
isPlainObject(): LoDashExplicitWrapper<boolean>;
|
10813 |
+
}
|
10814 |
+
|
10815 |
+
//_.isRegExp
|
10816 |
+
interface LoDashStatic {
|
10817 |
+
/**
|
10818 |
+
* Checks if value is classified as a RegExp object.
|
10819 |
+
* @param value The value to check.
|
10820 |
+
*
|
10821 |
+
* @return Returns true if value is correctly classified, else false.
|
10822 |
+
*/
|
10823 |
+
isRegExp(value?: any): value is RegExp;
|
10824 |
+
}
|
10825 |
+
|
10826 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10827 |
+
/**
|
10828 |
+
* see _.isRegExp
|
10829 |
+
*/
|
10830 |
+
isRegExp(): boolean;
|
10831 |
+
}
|
10832 |
+
|
10833 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10834 |
+
/**
|
10835 |
+
* see _.isRegExp
|
10836 |
+
*/
|
10837 |
+
isRegExp(): LoDashExplicitWrapper<boolean>;
|
10838 |
+
}
|
10839 |
+
|
10840 |
+
//_.isString
|
10841 |
+
interface LoDashStatic {
|
10842 |
+
/**
|
10843 |
+
* Checks if value is classified as a String primitive or object.
|
10844 |
+
*
|
10845 |
+
* @param value The value to check.
|
10846 |
+
* @return Returns true if value is correctly classified, else false.
|
10847 |
+
*/
|
10848 |
+
isString(value?: any): value is string;
|
10849 |
+
}
|
10850 |
+
|
10851 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10852 |
+
/**
|
10853 |
+
* see _.isString
|
10854 |
+
*/
|
10855 |
+
isString(): boolean;
|
10856 |
+
}
|
10857 |
+
|
10858 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10859 |
+
/**
|
10860 |
+
* see _.isString
|
10861 |
+
*/
|
10862 |
+
isString(): LoDashExplicitWrapper<boolean>;
|
10863 |
+
}
|
10864 |
+
|
10865 |
+
//_.isTypedArray
|
10866 |
+
interface LoDashStatic {
|
10867 |
+
/**
|
10868 |
+
* Checks if value is classified as a typed array.
|
10869 |
+
*
|
10870 |
+
* @param value The value to check.
|
10871 |
+
* @return Returns true if value is correctly classified, else false.
|
10872 |
+
*/
|
10873 |
+
isTypedArray(value: any): boolean;
|
10874 |
+
}
|
10875 |
+
|
10876 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10877 |
+
/**
|
10878 |
+
* see _.isTypedArray
|
10879 |
+
*/
|
10880 |
+
isTypedArray(): boolean;
|
10881 |
+
}
|
10882 |
+
|
10883 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10884 |
+
/**
|
10885 |
+
* see _.isTypedArray
|
10886 |
+
*/
|
10887 |
+
isTypedArray(): LoDashExplicitWrapper<boolean>;
|
10888 |
+
}
|
10889 |
+
|
10890 |
+
//_.isUndefined
|
10891 |
+
interface LoDashStatic {
|
10892 |
+
/**
|
10893 |
+
* Checks if value is undefined.
|
10894 |
+
*
|
10895 |
+
* @param value The value to check.
|
10896 |
+
* @return Returns true if value is undefined, else false.
|
10897 |
+
*/
|
10898 |
+
isUndefined(value: any): boolean;
|
10899 |
+
}
|
10900 |
+
|
10901 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10902 |
+
/**
|
10903 |
+
* see _.isUndefined
|
10904 |
+
*/
|
10905 |
+
isUndefined(): boolean;
|
10906 |
+
}
|
10907 |
+
|
10908 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10909 |
+
/**
|
10910 |
+
* see _.isUndefined
|
10911 |
+
*/
|
10912 |
+
isUndefined(): LoDashExplicitWrapper<boolean>;
|
10913 |
+
}
|
10914 |
+
|
10915 |
+
//_.lt
|
10916 |
+
interface LoDashStatic {
|
10917 |
+
/**
|
10918 |
+
* Checks if value is less than other.
|
10919 |
+
*
|
10920 |
+
* @param value The value to compare.
|
10921 |
+
* @param other The other value to compare.
|
10922 |
+
* @return Returns true if value is less than other, else false.
|
10923 |
+
*/
|
10924 |
+
lt(
|
10925 |
+
value: any,
|
10926 |
+
other: any
|
10927 |
+
): boolean;
|
10928 |
+
}
|
10929 |
+
|
10930 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10931 |
+
/**
|
10932 |
+
* @see _.lt
|
10933 |
+
*/
|
10934 |
+
lt(other: any): boolean;
|
10935 |
+
}
|
10936 |
+
|
10937 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10938 |
+
/**
|
10939 |
+
* @see _.lt
|
10940 |
+
*/
|
10941 |
+
lt(other: any): LoDashExplicitWrapper<boolean>;
|
10942 |
+
}
|
10943 |
+
|
10944 |
+
//_.lte
|
10945 |
+
interface LoDashStatic {
|
10946 |
+
/**
|
10947 |
+
* Checks if value is less than or equal to other.
|
10948 |
+
*
|
10949 |
+
* @param value The value to compare.
|
10950 |
+
* @param other The other value to compare.
|
10951 |
+
* @return Returns true if value is less than or equal to other, else false.
|
10952 |
+
*/
|
10953 |
+
lte(
|
10954 |
+
value: any,
|
10955 |
+
other: any
|
10956 |
+
): boolean;
|
10957 |
+
}
|
10958 |
+
|
10959 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
10960 |
+
/**
|
10961 |
+
* @see _.lte
|
10962 |
+
*/
|
10963 |
+
lte(other: any): boolean;
|
10964 |
+
}
|
10965 |
+
|
10966 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
10967 |
+
/**
|
10968 |
+
* @see _.lte
|
10969 |
+
*/
|
10970 |
+
lte(other: any): LoDashExplicitWrapper<boolean>;
|
10971 |
+
}
|
10972 |
+
|
10973 |
+
//_.toArray
|
10974 |
+
interface LoDashStatic {
|
10975 |
+
/**
|
10976 |
+
* Converts value to an array.
|
10977 |
+
*
|
10978 |
+
* @param value The value to convert.
|
10979 |
+
* @return Returns the converted array.
|
10980 |
+
*/
|
10981 |
+
toArray<T>(value: List<T>|Dictionary<T>|NumericDictionary<T>): T[];
|
10982 |
+
|
10983 |
+
/**
|
10984 |
+
* @see _.toArray
|
10985 |
+
*/
|
10986 |
+
toArray<TValue, TResult>(value: TValue): TResult[];
|
10987 |
+
|
10988 |
+
/**
|
10989 |
+
* @see _.toArray
|
10990 |
+
*/
|
10991 |
+
toArray<TResult>(value?: any): TResult[];
|
10992 |
+
}
|
10993 |
+
|
10994 |
+
interface LoDashImplicitWrapper<T> {
|
10995 |
+
/**
|
10996 |
+
* @see _.toArray
|
10997 |
+
*/
|
10998 |
+
toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
|
10999 |
+
}
|
11000 |
+
|
11001 |
+
interface LoDashImplicitArrayWrapper<T> {
|
11002 |
+
/**
|
11003 |
+
* @see _.toArray
|
11004 |
+
*/
|
11005 |
+
toArray(): LoDashImplicitArrayWrapper<T>;
|
11006 |
+
}
|
11007 |
+
|
11008 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11009 |
+
/**
|
11010 |
+
* @see _.toArray
|
11011 |
+
*/
|
11012 |
+
toArray<TResult>(): LoDashImplicitArrayWrapper<TResult>;
|
11013 |
+
}
|
11014 |
+
|
11015 |
+
interface LoDashExplicitWrapper<T> {
|
11016 |
+
/**
|
11017 |
+
* @see _.toArray
|
11018 |
+
*/
|
11019 |
+
toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
|
11020 |
+
}
|
11021 |
+
|
11022 |
+
interface LoDashExplicitArrayWrapper<T> {
|
11023 |
+
/**
|
11024 |
+
* @see _.toArray
|
11025 |
+
*/
|
11026 |
+
toArray(): LoDashExplicitArrayWrapper<T>;
|
11027 |
+
}
|
11028 |
+
|
11029 |
+
interface LoDashExplicitObjectWrapper<T> {
|
11030 |
+
/**
|
11031 |
+
* @see _.toArray
|
11032 |
+
*/
|
11033 |
+
toArray<TResult>(): LoDashExplicitArrayWrapper<TResult>;
|
11034 |
+
}
|
11035 |
+
|
11036 |
+
//_.toPlainObject
|
11037 |
+
interface LoDashStatic {
|
11038 |
+
/**
|
11039 |
+
* Converts value to a plain object flattening inherited enumerable properties of value to own properties
|
11040 |
+
* of the plain object.
|
11041 |
+
*
|
11042 |
+
* @param value The value to convert.
|
11043 |
+
* @return Returns the converted plain object.
|
11044 |
+
*/
|
11045 |
+
toPlainObject<TResult extends {}>(value?: any): TResult;
|
11046 |
+
}
|
11047 |
+
|
11048 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
11049 |
+
/**
|
11050 |
+
* @see _.toPlainObject
|
11051 |
+
*/
|
11052 |
+
toPlainObject<TResult extends {}>(): LoDashImplicitObjectWrapper<TResult>;
|
11053 |
+
}
|
11054 |
+
|
11055 |
+
/********
|
11056 |
+
* Math *
|
11057 |
+
********/
|
11058 |
+
|
11059 |
+
//_.add
|
11060 |
+
interface LoDashStatic {
|
11061 |
+
/**
|
11062 |
+
* Adds two numbers.
|
11063 |
+
*
|
11064 |
+
* @param augend The first number to add.
|
11065 |
+
* @param addend The second number to add.
|
11066 |
+
* @return Returns the sum.
|
11067 |
+
*/
|
11068 |
+
add(
|
11069 |
+
augend: number,
|
11070 |
+
addend: number
|
11071 |
+
): number;
|
11072 |
+
}
|
11073 |
+
|
11074 |
+
interface LoDashImplicitWrapper<T> {
|
11075 |
+
/**
|
11076 |
+
* @see _.add
|
11077 |
+
*/
|
11078 |
+
add(addend: number): number;
|
11079 |
+
}
|
11080 |
+
|
11081 |
+
interface LoDashExplicitWrapper<T> {
|
11082 |
+
/**
|
11083 |
+
* @see _.add
|
11084 |
+
*/
|
11085 |
+
add(addend: number): LoDashExplicitWrapper<number>;
|
11086 |
+
}
|
11087 |
+
|
11088 |
+
//_.ceil
|
11089 |
+
interface LoDashStatic {
|
11090 |
+
/**
|
11091 |
+
* Calculates n rounded up to precision.
|
11092 |
+
*
|
11093 |
+
* @param n The number to round up.
|
11094 |
+
* @param precision The precision to round up to.
|
11095 |
+
* @return Returns the rounded up number.
|
11096 |
+
*/
|
11097 |
+
ceil(
|
11098 |
+
n: number,
|
11099 |
+
precision?: number
|
11100 |
+
): number;
|
11101 |
+
}
|
11102 |
+
|
11103 |
+
interface LoDashImplicitWrapper<T> {
|
11104 |
+
/**
|
11105 |
+
* @see _.ceil
|
11106 |
+
*/
|
11107 |
+
ceil(precision?: number): number;
|
11108 |
+
}
|
11109 |
+
|
11110 |
+
interface LoDashExplicitWrapper<T> {
|
11111 |
+
/**
|
11112 |
+
* @see _.ceil
|
11113 |
+
*/
|
11114 |
+
ceil(precision?: number): LoDashExplicitWrapper<number>;
|
11115 |
+
}
|
11116 |
+
|
11117 |
+
//_.floor
|
11118 |
+
interface LoDashStatic {
|
11119 |
+
/**
|
11120 |
+
* Calculates n rounded down to precision.
|
11121 |
+
*
|
11122 |
+
* @param n The number to round down.
|
11123 |
+
* @param precision The precision to round down to.
|
11124 |
+
* @return Returns the rounded down number.
|
11125 |
+
*/
|
11126 |
+
floor(
|
11127 |
+
n: number,
|
11128 |
+
precision?: number
|
11129 |
+
): number;
|
11130 |
+
}
|
11131 |
+
|
11132 |
+
interface LoDashImplicitWrapper<T> {
|
11133 |
+
/**
|
11134 |
+
* @see _.floor
|
11135 |
+
*/
|
11136 |
+
floor(precision?: number): number;
|
11137 |
+
}
|
11138 |
+
|
11139 |
+
interface LoDashExplicitWrapper<T> {
|
11140 |
+
/**
|
11141 |
+
* @see _.floor
|
11142 |
+
*/
|
11143 |
+
floor(precision?: number): LoDashExplicitWrapper<number>;
|
11144 |
+
}
|
11145 |
+
|
11146 |
+
//_.max
|
11147 |
+
interface LoDashStatic {
|
11148 |
+
/**
|
11149 |
+
* Gets the maximum value of collection. If collection is empty or falsey -Infinity is returned. If an iteratee
|
11150 |
+
* function is provided it’s invoked for each value in collection to generate the criterion by which the value
|
11151 |
+
* is ranked. The iteratee is bound to thisArg and invoked with three arguments: (value, index, collection).
|
11152 |
+
*
|
11153 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property value
|
11154 |
+
* of the given element.
|
11155 |
+
*
|
11156 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
11157 |
+
* elements that have a matching property value, else false.
|
11158 |
+
*
|
11159 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
11160 |
+
* have the properties of the given object, else false.
|
11161 |
+
*
|
11162 |
+
* @param collection The collection to iterate over.
|
11163 |
+
* @param iteratee The function invoked per iteration.
|
11164 |
+
* @param thisArg The this binding of iteratee.
|
11165 |
+
* @return Returns the maximum value.
|
11166 |
+
*/
|
11167 |
+
max<T>(
|
11168 |
+
collection: List<T>,
|
11169 |
+
iteratee?: ListIterator<T, any>,
|
11170 |
+
thisArg?: any
|
11171 |
+
): T;
|
11172 |
+
|
11173 |
+
/**
|
11174 |
+
* @see _.max
|
11175 |
+
*/
|
11176 |
+
max<T>(
|
11177 |
+
collection: Dictionary<T>,
|
11178 |
+
iteratee?: DictionaryIterator<T, any>,
|
11179 |
+
thisArg?: any
|
11180 |
+
): T;
|
11181 |
+
|
11182 |
+
/**
|
11183 |
+
* @see _.max
|
11184 |
+
*/
|
11185 |
+
max<T>(
|
11186 |
+
collection: List<T>|Dictionary<T>,
|
11187 |
+
iteratee?: string,
|
11188 |
+
thisArg?: any
|
11189 |
+
): T;
|
11190 |
+
|
11191 |
+
/**
|
11192 |
+
* @see _.max
|
11193 |
+
*/
|
11194 |
+
max<TObject extends {}, T>(
|
11195 |
+
collection: List<T>|Dictionary<T>,
|
11196 |
+
whereValue?: TObject
|
11197 |
+
): T;
|
11198 |
+
}
|
11199 |
+
|
11200 |
+
interface LoDashImplicitArrayWrapper<T> {
|
11201 |
+
/**
|
11202 |
+
* @see _.max
|
11203 |
+
*/
|
11204 |
+
max(
|
11205 |
+
iteratee?: ListIterator<T, any>,
|
11206 |
+
thisArg?: any
|
11207 |
+
): T;
|
11208 |
+
|
11209 |
+
/**
|
11210 |
+
* @see _.max
|
11211 |
+
*/
|
11212 |
+
max(
|
11213 |
+
iteratee?: string,
|
11214 |
+
thisArg?: any
|
11215 |
+
): T;
|
11216 |
+
|
11217 |
+
/**
|
11218 |
+
* @see _.max
|
11219 |
+
*/
|
11220 |
+
max<TObject extends {}>(
|
11221 |
+
whereValue?: TObject
|
11222 |
+
): T;
|
11223 |
+
}
|
11224 |
+
|
11225 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11226 |
+
/**
|
11227 |
+
* @see _.max
|
11228 |
+
*/
|
11229 |
+
max<T>(
|
11230 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
|
11231 |
+
thisArg?: any
|
11232 |
+
): T;
|
11233 |
+
|
11234 |
+
/**
|
11235 |
+
* @see _.max
|
11236 |
+
*/
|
11237 |
+
max<T>(
|
11238 |
+
iteratee?: string,
|
11239 |
+
thisArg?: any
|
11240 |
+
): T;
|
11241 |
+
|
11242 |
+
/**
|
11243 |
+
* @see _.max
|
11244 |
+
*/
|
11245 |
+
max<TObject extends {}, T>(
|
11246 |
+
whereValue?: TObject
|
11247 |
+
): T;
|
11248 |
+
}
|
11249 |
+
|
11250 |
+
//_.min
|
11251 |
+
interface LoDashStatic {
|
11252 |
+
/**
|
11253 |
+
* Gets the minimum value of collection. If collection is empty or falsey Infinity is returned. If an iteratee
|
11254 |
+
* function is provided it’s invoked for each value in collection to generate the criterion by which the value
|
11255 |
+
* is ranked. The iteratee is bound to thisArg and invoked with three arguments: (value, index, collection).
|
11256 |
+
*
|
11257 |
+
* If a property name is provided for iteratee the created _.property style callback returns the property value
|
11258 |
+
* of the given element.
|
11259 |
+
*
|
11260 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
11261 |
+
* elements that have a matching property value, else false.
|
11262 |
+
*
|
11263 |
+
* If an object is provided for iteratee the created _.matches style callback returns true for elements that
|
11264 |
+
* have the properties of the given object, else false.
|
11265 |
+
*
|
11266 |
+
* @param collection The collection to iterate over.
|
11267 |
+
* @param iteratee The function invoked per iteration.
|
11268 |
+
* @param thisArg The this binding of iteratee.
|
11269 |
+
* @return Returns the minimum value.
|
11270 |
+
*/
|
11271 |
+
min<T>(
|
11272 |
+
collection: List<T>,
|
11273 |
+
iteratee?: ListIterator<T, any>,
|
11274 |
+
thisArg?: any
|
11275 |
+
): T;
|
11276 |
+
|
11277 |
+
/**
|
11278 |
+
* @see _.min
|
11279 |
+
*/
|
11280 |
+
min<T>(
|
11281 |
+
collection: Dictionary<T>,
|
11282 |
+
iteratee?: DictionaryIterator<T, any>,
|
11283 |
+
thisArg?: any
|
11284 |
+
): T;
|
11285 |
+
|
11286 |
+
/**
|
11287 |
+
* @see _.min
|
11288 |
+
*/
|
11289 |
+
min<T>(
|
11290 |
+
collection: List<T>|Dictionary<T>,
|
11291 |
+
iteratee?: string,
|
11292 |
+
thisArg?: any
|
11293 |
+
): T;
|
11294 |
+
|
11295 |
+
/**
|
11296 |
+
* @see _.min
|
11297 |
+
*/
|
11298 |
+
min<TObject extends {}, T>(
|
11299 |
+
collection: List<T>|Dictionary<T>,
|
11300 |
+
whereValue?: TObject
|
11301 |
+
): T;
|
11302 |
+
}
|
11303 |
+
|
11304 |
+
interface LoDashImplicitArrayWrapper<T> {
|
11305 |
+
/**
|
11306 |
+
* @see _.min
|
11307 |
+
*/
|
11308 |
+
min(
|
11309 |
+
iteratee?: ListIterator<T, any>,
|
11310 |
+
thisArg?: any
|
11311 |
+
): T;
|
11312 |
+
|
11313 |
+
/**
|
11314 |
+
* @see _.min
|
11315 |
+
*/
|
11316 |
+
min(
|
11317 |
+
iteratee?: string,
|
11318 |
+
thisArg?: any
|
11319 |
+
): T;
|
11320 |
+
|
11321 |
+
/**
|
11322 |
+
* @see _.min
|
11323 |
+
*/
|
11324 |
+
min<TObject extends {}>(
|
11325 |
+
whereValue?: TObject
|
11326 |
+
): T;
|
11327 |
+
}
|
11328 |
+
|
11329 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11330 |
+
/**
|
11331 |
+
* @see _.min
|
11332 |
+
*/
|
11333 |
+
min<T>(
|
11334 |
+
iteratee?: ListIterator<T, any>|DictionaryIterator<T, any>,
|
11335 |
+
thisArg?: any
|
11336 |
+
): T;
|
11337 |
+
|
11338 |
+
/**
|
11339 |
+
* @see _.min
|
11340 |
+
*/
|
11341 |
+
min<T>(
|
11342 |
+
iteratee?: string,
|
11343 |
+
thisArg?: any
|
11344 |
+
): T;
|
11345 |
+
|
11346 |
+
/**
|
11347 |
+
* @see _.min
|
11348 |
+
*/
|
11349 |
+
min<TObject extends {}, T>(
|
11350 |
+
whereValue?: TObject
|
11351 |
+
): T;
|
11352 |
+
}
|
11353 |
+
|
11354 |
+
//_.round
|
11355 |
+
interface LoDashStatic {
|
11356 |
+
/**
|
11357 |
+
* Calculates n rounded to precision.
|
11358 |
+
*
|
11359 |
+
* @param n The number to round.
|
11360 |
+
* @param precision The precision to round to.
|
11361 |
+
* @return Returns the rounded number.
|
11362 |
+
*/
|
11363 |
+
round(
|
11364 |
+
n: number,
|
11365 |
+
precision?: number
|
11366 |
+
): number;
|
11367 |
+
}
|
11368 |
+
|
11369 |
+
interface LoDashImplicitWrapper<T> {
|
11370 |
+
/**
|
11371 |
+
* @see _.round
|
11372 |
+
*/
|
11373 |
+
round(precision?: number): number;
|
11374 |
+
}
|
11375 |
+
|
11376 |
+
interface LoDashExplicitWrapper<T> {
|
11377 |
+
/**
|
11378 |
+
* @see _.round
|
11379 |
+
*/
|
11380 |
+
round(precision?: number): LoDashExplicitWrapper<number>;
|
11381 |
+
}
|
11382 |
+
|
11383 |
+
//_.sum
|
11384 |
+
interface LoDashStatic {
|
11385 |
+
/**
|
11386 |
+
* Gets the sum of the values in collection.
|
11387 |
+
*
|
11388 |
+
* @param collection The collection to iterate over.
|
11389 |
+
* @param iteratee The function invoked per iteration.
|
11390 |
+
* @param thisArg The this binding of iteratee.
|
11391 |
+
* @return Returns the sum.
|
11392 |
+
*/
|
11393 |
+
sum<T>(
|
11394 |
+
collection: List<T>,
|
11395 |
+
iteratee: ListIterator<T, number>,
|
11396 |
+
thisArg?: any
|
11397 |
+
): number;
|
11398 |
+
|
11399 |
+
/**
|
11400 |
+
* @see _.sum
|
11401 |
+
**/
|
11402 |
+
sum<T>(
|
11403 |
+
collection: Dictionary<T>,
|
11404 |
+
iteratee: DictionaryIterator<T, number>,
|
11405 |
+
thisArg?: any
|
11406 |
+
): number;
|
11407 |
+
|
11408 |
+
/**
|
11409 |
+
* @see _.sum
|
11410 |
+
*/
|
11411 |
+
sum<T>(
|
11412 |
+
collection: List<number>|Dictionary<number>,
|
11413 |
+
iteratee: string
|
11414 |
+
): number;
|
11415 |
+
|
11416 |
+
/**
|
11417 |
+
* @see _.sum
|
11418 |
+
*/
|
11419 |
+
sum<T>(collection: List<T>|Dictionary<T>): number;
|
11420 |
+
|
11421 |
+
/**
|
11422 |
+
* @see _.sum
|
11423 |
+
*/
|
11424 |
+
sum(collection: List<number>|Dictionary<number>): number;
|
11425 |
+
}
|
11426 |
+
|
11427 |
+
interface LoDashImplicitArrayWrapper<T> {
|
11428 |
+
/**
|
11429 |
+
* @see _.sum
|
11430 |
+
*/
|
11431 |
+
sum(
|
11432 |
+
iteratee: ListIterator<T, number>,
|
11433 |
+
thisArg?: any
|
11434 |
+
): number;
|
11435 |
+
|
11436 |
+
/**
|
11437 |
+
* @see _.sum
|
11438 |
+
*/
|
11439 |
+
sum(iteratee: string): number;
|
11440 |
+
|
11441 |
+
/**
|
11442 |
+
* @see _.sum
|
11443 |
+
*/
|
11444 |
+
sum(): number;
|
11445 |
+
}
|
11446 |
+
|
11447 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11448 |
+
/**
|
11449 |
+
* @see _.sum
|
11450 |
+
**/
|
11451 |
+
sum<TValue>(
|
11452 |
+
iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number>,
|
11453 |
+
thisArg?: any
|
11454 |
+
): number;
|
11455 |
+
|
11456 |
+
/**
|
11457 |
+
* @see _.sum
|
11458 |
+
*/
|
11459 |
+
sum(iteratee: string): number;
|
11460 |
+
|
11461 |
+
/**
|
11462 |
+
* @see _.sum
|
11463 |
+
*/
|
11464 |
+
sum(): number;
|
11465 |
+
}
|
11466 |
+
|
11467 |
+
interface LoDashExplicitArrayWrapper<T> {
|
11468 |
+
/**
|
11469 |
+
* @see _.sum
|
11470 |
+
*/
|
11471 |
+
sum(
|
11472 |
+
iteratee: ListIterator<T, number>,
|
11473 |
+
thisArg?: any
|
11474 |
+
): LoDashExplicitWrapper<number>;
|
11475 |
+
|
11476 |
+
/**
|
11477 |
+
* @see _.sum
|
11478 |
+
*/
|
11479 |
+
sum(iteratee: string): LoDashExplicitWrapper<number>;
|
11480 |
+
|
11481 |
+
/**
|
11482 |
+
* @see _.sum
|
11483 |
+
*/
|
11484 |
+
sum(): LoDashExplicitWrapper<number>;
|
11485 |
+
}
|
11486 |
+
|
11487 |
+
interface LoDashExplicitObjectWrapper<T> {
|
11488 |
+
/**
|
11489 |
+
* @see _.sum
|
11490 |
+
*/
|
11491 |
+
sum<TValue>(
|
11492 |
+
iteratee: ListIterator<TValue, number>|DictionaryIterator<TValue, number>,
|
11493 |
+
thisArg?: any
|
11494 |
+
): LoDashExplicitWrapper<number>;
|
11495 |
+
|
11496 |
+
/**
|
11497 |
+
* @see _.sum
|
11498 |
+
*/
|
11499 |
+
sum(iteratee: string): LoDashExplicitWrapper<number>;
|
11500 |
+
|
11501 |
+
/**
|
11502 |
+
* @see _.sum
|
11503 |
+
*/
|
11504 |
+
sum(): LoDashExplicitWrapper<number>;
|
11505 |
+
}
|
11506 |
+
|
11507 |
+
/**********
|
11508 |
+
* Number *
|
11509 |
+
**********/
|
11510 |
+
|
11511 |
+
//_.inRange
|
11512 |
+
interface LoDashStatic {
|
11513 |
+
/**
|
11514 |
+
* Checks if n is between start and up to but not including, end. If end is not specified it’s set to start
|
11515 |
+
* with start then set to 0.
|
11516 |
+
*
|
11517 |
+
* @param n The number to check.
|
11518 |
+
* @param start The start of the range.
|
11519 |
+
* @param end The end of the range.
|
11520 |
+
* @return Returns true if n is in the range, else false.
|
11521 |
+
*/
|
11522 |
+
inRange(
|
11523 |
+
n: number,
|
11524 |
+
start: number,
|
11525 |
+
end: number
|
11526 |
+
): boolean;
|
11527 |
+
|
11528 |
+
|
11529 |
+
/**
|
11530 |
+
* @see _.inRange
|
11531 |
+
*/
|
11532 |
+
inRange(
|
11533 |
+
n: number,
|
11534 |
+
end: number
|
11535 |
+
): boolean;
|
11536 |
+
}
|
11537 |
+
|
11538 |
+
interface LoDashImplicitWrapper<T> {
|
11539 |
+
/**
|
11540 |
+
* @see _.inRange
|
11541 |
+
*/
|
11542 |
+
inRange(
|
11543 |
+
start: number,
|
11544 |
+
end: number
|
11545 |
+
): boolean;
|
11546 |
+
|
11547 |
+
/**
|
11548 |
+
* @see _.inRange
|
11549 |
+
*/
|
11550 |
+
inRange(end: number): boolean;
|
11551 |
+
}
|
11552 |
+
|
11553 |
+
interface LoDashExplicitWrapper<T> {
|
11554 |
+
/**
|
11555 |
+
* @see _.inRange
|
11556 |
+
*/
|
11557 |
+
inRange(
|
11558 |
+
start: number,
|
11559 |
+
end: number
|
11560 |
+
): LoDashExplicitWrapper<boolean>;
|
11561 |
+
|
11562 |
+
/**
|
11563 |
+
* @see _.inRange
|
11564 |
+
*/
|
11565 |
+
inRange(end: number): LoDashExplicitWrapper<boolean>;
|
11566 |
+
}
|
11567 |
+
|
11568 |
+
//_.random
|
11569 |
+
interface LoDashStatic {
|
11570 |
+
/**
|
11571 |
+
* Produces a random number between min and max (inclusive). If only one argument is provided a number between
|
11572 |
+
* 0 and the given number is returned. If floating is true, or either min or max are floats, a floating-point
|
11573 |
+
* number is returned instead of an integer.
|
11574 |
+
*
|
11575 |
+
* @param min The minimum possible value.
|
11576 |
+
* @param max The maximum possible value.
|
11577 |
+
* @param floating Specify returning a floating-point number.
|
11578 |
+
* @return Returns the random number.
|
11579 |
+
*/
|
11580 |
+
random(
|
11581 |
+
min?: number,
|
11582 |
+
max?: number,
|
11583 |
+
floating?: boolean
|
11584 |
+
): number;
|
11585 |
+
|
11586 |
+
/**
|
11587 |
+
* @see _.random
|
11588 |
+
*/
|
11589 |
+
random(
|
11590 |
+
min?: number,
|
11591 |
+
floating?: boolean
|
11592 |
+
): number;
|
11593 |
+
|
11594 |
+
/**
|
11595 |
+
* @see _.random
|
11596 |
+
*/
|
11597 |
+
random(floating?: boolean): number;
|
11598 |
+
}
|
11599 |
+
|
11600 |
+
interface LoDashImplicitWrapper<T> {
|
11601 |
+
/**
|
11602 |
+
* @see _.random
|
11603 |
+
*/
|
11604 |
+
random(
|
11605 |
+
max?: number,
|
11606 |
+
floating?: boolean
|
11607 |
+
): number;
|
11608 |
+
|
11609 |
+
/**
|
11610 |
+
* @see _.random
|
11611 |
+
*/
|
11612 |
+
random(floating?: boolean): number;
|
11613 |
+
}
|
11614 |
+
|
11615 |
+
interface LoDashExplicitWrapper<T> {
|
11616 |
+
/**
|
11617 |
+
* @see _.random
|
11618 |
+
*/
|
11619 |
+
random(
|
11620 |
+
max?: number,
|
11621 |
+
floating?: boolean
|
11622 |
+
): LoDashExplicitWrapper<number>;
|
11623 |
+
|
11624 |
+
/**
|
11625 |
+
* @see _.random
|
11626 |
+
*/
|
11627 |
+
random(floating?: boolean): LoDashExplicitWrapper<number>;
|
11628 |
+
}
|
11629 |
+
|
11630 |
+
/**********
|
11631 |
+
* Object *
|
11632 |
+
**********/
|
11633 |
+
|
11634 |
+
//_.assign
|
11635 |
+
interface AssignCustomizer {
|
11636 |
+
(objectValue: any, sourceValue: any, key?: string, object?: {}, source?: {}): any;
|
11637 |
+
}
|
11638 |
+
|
11639 |
+
interface LoDashStatic {
|
11640 |
+
/**
|
11641 |
+
* Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources
|
11642 |
+
* overwrite property assignments of previous sources. If customizer is provided it’s invoked to produce the
|
11643 |
+
* assigned values. The customizer is bound to thisArg and invoked with five arguments:
|
11644 |
+
* (objectValue, sourceValue, key, object, source).
|
11645 |
+
*
|
11646 |
+
* Note: This method mutates object and is based on Object.assign.
|
11647 |
+
*
|
11648 |
+
* @alias _.extend
|
11649 |
+
*
|
11650 |
+
* @param object The destination object.
|
11651 |
+
* @param source The source objects.
|
11652 |
+
* @param customizer The function to customize assigned values.
|
11653 |
+
* @param thisArg The this binding of callback.
|
11654 |
+
* @return The destination object.
|
11655 |
+
*/
|
11656 |
+
assign<TObject extends {}, TSource extends {}, TResult extends {}>(
|
11657 |
+
object: TObject,
|
11658 |
+
source: TSource,
|
11659 |
+
customizer?: AssignCustomizer,
|
11660 |
+
thisArg?: any
|
11661 |
+
): TResult;
|
11662 |
+
|
11663 |
+
/**
|
11664 |
+
* @see assign
|
11665 |
+
*/
|
11666 |
+
assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
11667 |
+
object: TObject,
|
11668 |
+
source1: TSource1,
|
11669 |
+
source2: TSource2,
|
11670 |
+
customizer?: AssignCustomizer,
|
11671 |
+
thisArg?: any
|
11672 |
+
): TResult;
|
11673 |
+
|
11674 |
+
/**
|
11675 |
+
* @see assign
|
11676 |
+
*/
|
11677 |
+
assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
11678 |
+
object: TObject,
|
11679 |
+
source1: TSource1,
|
11680 |
+
source2: TSource2,
|
11681 |
+
source3: TSource3,
|
11682 |
+
customizer?: AssignCustomizer,
|
11683 |
+
thisArg?: any
|
11684 |
+
): TResult;
|
11685 |
+
|
11686 |
+
/**
|
11687 |
+
* @see assign
|
11688 |
+
*/
|
11689 |
+
assign<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
|
11690 |
+
TResult extends {}>
|
11691 |
+
(
|
11692 |
+
object: TObject,
|
11693 |
+
source1: TSource1,
|
11694 |
+
source2: TSource2,
|
11695 |
+
source3: TSource3,
|
11696 |
+
source4: TSource4,
|
11697 |
+
customizer?: AssignCustomizer,
|
11698 |
+
thisArg?: any
|
11699 |
+
): TResult;
|
11700 |
+
|
11701 |
+
/**
|
11702 |
+
* @see _.assign
|
11703 |
+
*/
|
11704 |
+
assign<TObject extends {}>(object: TObject): TObject;
|
11705 |
+
|
11706 |
+
/**
|
11707 |
+
* @see _.assign
|
11708 |
+
*/
|
11709 |
+
assign<TObject extends {}, TResult extends {}>(
|
11710 |
+
object: TObject, ...otherArgs: any[]
|
11711 |
+
): TResult;
|
11712 |
+
}
|
11713 |
+
|
11714 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11715 |
+
/**
|
11716 |
+
* @see _.assign
|
11717 |
+
*/
|
11718 |
+
assign<TSource extends {}, TResult extends {}>(
|
11719 |
+
source: TSource,
|
11720 |
+
customizer?: AssignCustomizer,
|
11721 |
+
thisArg?: any
|
11722 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11723 |
+
|
11724 |
+
/**
|
11725 |
+
* @see assign
|
11726 |
+
*/
|
11727 |
+
assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
11728 |
+
source1: TSource1,
|
11729 |
+
source2: TSource2,
|
11730 |
+
customizer?: AssignCustomizer,
|
11731 |
+
thisArg?: any
|
11732 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11733 |
+
|
11734 |
+
/**
|
11735 |
+
* @see assign
|
11736 |
+
*/
|
11737 |
+
assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
11738 |
+
source1: TSource1,
|
11739 |
+
source2: TSource2,
|
11740 |
+
source3: TSource3,
|
11741 |
+
customizer?: AssignCustomizer,
|
11742 |
+
thisArg?: any
|
11743 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11744 |
+
|
11745 |
+
/**
|
11746 |
+
* @see assign
|
11747 |
+
*/
|
11748 |
+
assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
|
11749 |
+
source1: TSource1,
|
11750 |
+
source2: TSource2,
|
11751 |
+
source3: TSource3,
|
11752 |
+
source4: TSource4,
|
11753 |
+
customizer?: AssignCustomizer,
|
11754 |
+
thisArg?: any
|
11755 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11756 |
+
|
11757 |
+
/**
|
11758 |
+
* @see _.assign
|
11759 |
+
*/
|
11760 |
+
assign(): LoDashImplicitObjectWrapper<T>;
|
11761 |
+
|
11762 |
+
/**
|
11763 |
+
* @see _.assign
|
11764 |
+
*/
|
11765 |
+
assign<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
|
11766 |
+
}
|
11767 |
+
|
11768 |
+
interface LoDashExplicitObjectWrapper<T> {
|
11769 |
+
/**
|
11770 |
+
* @see _.assign
|
11771 |
+
*/
|
11772 |
+
assign<TSource extends {}, TResult extends {}>(
|
11773 |
+
source: TSource,
|
11774 |
+
customizer?: AssignCustomizer,
|
11775 |
+
thisArg?: any
|
11776 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11777 |
+
|
11778 |
+
/**
|
11779 |
+
* @see assign
|
11780 |
+
*/
|
11781 |
+
assign<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
11782 |
+
source1: TSource1,
|
11783 |
+
source2: TSource2,
|
11784 |
+
customizer?: AssignCustomizer,
|
11785 |
+
thisArg?: any
|
11786 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11787 |
+
|
11788 |
+
/**
|
11789 |
+
* @see assign
|
11790 |
+
*/
|
11791 |
+
assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
11792 |
+
source1: TSource1,
|
11793 |
+
source2: TSource2,
|
11794 |
+
source3: TSource3,
|
11795 |
+
customizer?: AssignCustomizer,
|
11796 |
+
thisArg?: any
|
11797 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11798 |
+
|
11799 |
+
/**
|
11800 |
+
* @see assign
|
11801 |
+
*/
|
11802 |
+
assign<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
|
11803 |
+
source1: TSource1,
|
11804 |
+
source2: TSource2,
|
11805 |
+
source3: TSource3,
|
11806 |
+
source4: TSource4,
|
11807 |
+
customizer?: AssignCustomizer,
|
11808 |
+
thisArg?: any
|
11809 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11810 |
+
|
11811 |
+
/**
|
11812 |
+
* @see _.assign
|
11813 |
+
*/
|
11814 |
+
assign(): LoDashExplicitObjectWrapper<T>;
|
11815 |
+
|
11816 |
+
/**
|
11817 |
+
* @see _.assign
|
11818 |
+
*/
|
11819 |
+
assign<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
|
11820 |
+
}
|
11821 |
+
|
11822 |
+
//_.create
|
11823 |
+
interface LoDashStatic {
|
11824 |
+
/**
|
11825 |
+
* Creates an object that inherits from the given prototype object. If a properties object is provided its own
|
11826 |
+
* enumerable properties are assigned to the created object.
|
11827 |
+
*
|
11828 |
+
* @param prototype The object to inherit from.
|
11829 |
+
* @param properties The properties to assign to the object.
|
11830 |
+
* @return Returns the new object.
|
11831 |
+
*/
|
11832 |
+
create<T extends Object, U extends Object>(
|
11833 |
+
prototype: T,
|
11834 |
+
properties?: U
|
11835 |
+
): T & U;
|
11836 |
+
}
|
11837 |
+
|
11838 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11839 |
+
/**
|
11840 |
+
* @see _.create
|
11841 |
+
*/
|
11842 |
+
create<U extends Object>(properties?: U): LoDashImplicitObjectWrapper<T & U>;
|
11843 |
+
}
|
11844 |
+
|
11845 |
+
interface LoDashExplicitObjectWrapper<T> {
|
11846 |
+
/**
|
11847 |
+
* @see _.create
|
11848 |
+
*/
|
11849 |
+
create<U extends Object>(properties?: U): LoDashExplicitObjectWrapper<T & U>;
|
11850 |
+
}
|
11851 |
+
|
11852 |
+
//_.defaults
|
11853 |
+
interface LoDashStatic {
|
11854 |
+
/**
|
11855 |
+
* Assigns own enumerable properties of source object(s) to the destination object for all destination
|
11856 |
+
* properties that resolve to undefined. Once a property is set, additional values of the same property are
|
11857 |
+
* ignored.
|
11858 |
+
*
|
11859 |
+
* Note: This method mutates object.
|
11860 |
+
*
|
11861 |
+
* @param object The destination object.
|
11862 |
+
* @param sources The source objects.
|
11863 |
+
* @return The destination object.
|
11864 |
+
*/
|
11865 |
+
defaults<Obj extends {}, TResult extends {}>(
|
11866 |
+
object: Obj,
|
11867 |
+
...sources: {}[]
|
11868 |
+
): TResult;
|
11869 |
+
|
11870 |
+
/**
|
11871 |
+
* @see _.defaults
|
11872 |
+
*/
|
11873 |
+
defaults<Obj extends {}, S1 extends {}, TResult extends {}>(
|
11874 |
+
object: Obj,
|
11875 |
+
source1: S1,
|
11876 |
+
...sources: {}[]
|
11877 |
+
): TResult;
|
11878 |
+
|
11879 |
+
/**
|
11880 |
+
* @see _.defaults
|
11881 |
+
*/
|
11882 |
+
defaults<Obj extends {}, S1 extends {}, S2 extends {}, TResult extends {}>(
|
11883 |
+
object: Obj,
|
11884 |
+
source1: S1,
|
11885 |
+
source2: S2,
|
11886 |
+
...sources: {}[]
|
11887 |
+
): TResult;
|
11888 |
+
|
11889 |
+
/**
|
11890 |
+
* @see _.defaults
|
11891 |
+
*/
|
11892 |
+
defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
|
11893 |
+
object: Obj,
|
11894 |
+
source1: S1,
|
11895 |
+
source2: S2,
|
11896 |
+
source3: S3,
|
11897 |
+
...sources: {}[]
|
11898 |
+
): TResult;
|
11899 |
+
|
11900 |
+
/**
|
11901 |
+
* @see _.defaults
|
11902 |
+
*/
|
11903 |
+
defaults<Obj extends {}, S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
|
11904 |
+
object: Obj,
|
11905 |
+
source1: S1,
|
11906 |
+
source2: S2,
|
11907 |
+
source3: S3,
|
11908 |
+
source4: S4,
|
11909 |
+
...sources: {}[]
|
11910 |
+
): TResult;
|
11911 |
+
|
11912 |
+
/**
|
11913 |
+
* @see _.defaults
|
11914 |
+
*/
|
11915 |
+
defaults<TResult extends {}>(
|
11916 |
+
object: {},
|
11917 |
+
...sources: {}[]
|
11918 |
+
): TResult;
|
11919 |
+
}
|
11920 |
+
|
11921 |
+
interface LoDashImplicitObjectWrapper<T> {
|
11922 |
+
/**
|
11923 |
+
* @see _.defaults
|
11924 |
+
*/
|
11925 |
+
defaults<S1 extends {}, TResult extends {}>(
|
11926 |
+
source1: S1,
|
11927 |
+
...sources: {}[]
|
11928 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11929 |
+
|
11930 |
+
/**
|
11931 |
+
* @see _.defaults
|
11932 |
+
*/
|
11933 |
+
defaults<S1 extends {}, S2 extends {}, TResult extends {}>(
|
11934 |
+
source1: S1,
|
11935 |
+
source2: S2,
|
11936 |
+
...sources: {}[]
|
11937 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11938 |
+
|
11939 |
+
/**
|
11940 |
+
* @see _.defaults
|
11941 |
+
*/
|
11942 |
+
defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
|
11943 |
+
source1: S1,
|
11944 |
+
source2: S2,
|
11945 |
+
source3: S3,
|
11946 |
+
...sources: {}[]
|
11947 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11948 |
+
|
11949 |
+
/**
|
11950 |
+
* @see _.defaults
|
11951 |
+
*/
|
11952 |
+
defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
|
11953 |
+
source1: S1,
|
11954 |
+
source2: S2,
|
11955 |
+
source3: S3,
|
11956 |
+
source4: S4,
|
11957 |
+
...sources: {}[]
|
11958 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
11959 |
+
|
11960 |
+
/**
|
11961 |
+
* @see _.defaults
|
11962 |
+
*/
|
11963 |
+
defaults(): LoDashImplicitObjectWrapper<T>;
|
11964 |
+
|
11965 |
+
/**
|
11966 |
+
* @see _.defaults
|
11967 |
+
*/
|
11968 |
+
defaults<TResult>(...sources: {}[]): LoDashImplicitObjectWrapper<TResult>;
|
11969 |
+
}
|
11970 |
+
|
11971 |
+
interface LoDashExplicitObjectWrapper<T> {
|
11972 |
+
/**
|
11973 |
+
* @see _.defaults
|
11974 |
+
*/
|
11975 |
+
defaults<S1 extends {}, TResult extends {}>(
|
11976 |
+
source1: S1,
|
11977 |
+
...sources: {}[]
|
11978 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11979 |
+
|
11980 |
+
/**
|
11981 |
+
* @see _.defaults
|
11982 |
+
*/
|
11983 |
+
defaults<S1 extends {}, S2 extends {}, TResult extends {}>(
|
11984 |
+
source1: S1,
|
11985 |
+
source2: S2,
|
11986 |
+
...sources: {}[]
|
11987 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11988 |
+
|
11989 |
+
/**
|
11990 |
+
* @see _.defaults
|
11991 |
+
*/
|
11992 |
+
defaults<S1 extends {}, S2 extends {}, S3 extends {}, TResult extends {}>(
|
11993 |
+
source1: S1,
|
11994 |
+
source2: S2,
|
11995 |
+
source3: S3,
|
11996 |
+
...sources: {}[]
|
11997 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
11998 |
+
|
11999 |
+
/**
|
12000 |
+
* @see _.defaults
|
12001 |
+
*/
|
12002 |
+
defaults<S1 extends {}, S2 extends {}, S3 extends {}, S4 extends {}, TResult extends {}>(
|
12003 |
+
source1: S1,
|
12004 |
+
source2: S2,
|
12005 |
+
source3: S3,
|
12006 |
+
source4: S4,
|
12007 |
+
...sources: {}[]
|
12008 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
12009 |
+
|
12010 |
+
/**
|
12011 |
+
* @see _.defaults
|
12012 |
+
*/
|
12013 |
+
defaults(): LoDashExplicitObjectWrapper<T>;
|
12014 |
+
|
12015 |
+
/**
|
12016 |
+
* @see _.defaults
|
12017 |
+
*/
|
12018 |
+
defaults<TResult>(...sources: {}[]): LoDashExplicitObjectWrapper<TResult>;
|
12019 |
+
}
|
12020 |
+
|
12021 |
+
//_.defaultsDeep
|
12022 |
+
interface LoDashStatic {
|
12023 |
+
/**
|
12024 |
+
* This method is like _.defaults except that it recursively assigns default properties.
|
12025 |
+
* @param object The destination object.
|
12026 |
+
* @param sources The source objects.
|
12027 |
+
* @return Returns object.
|
12028 |
+
**/
|
12029 |
+
defaultsDeep<T, TResult>(
|
12030 |
+
object: T,
|
12031 |
+
...sources: any[]): TResult;
|
12032 |
+
}
|
12033 |
+
|
12034 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12035 |
+
/**
|
12036 |
+
* @see _.defaultsDeep
|
12037 |
+
**/
|
12038 |
+
defaultsDeep<TResult>(...sources: any[]): LoDashImplicitObjectWrapper<TResult>
|
12039 |
+
}
|
12040 |
+
|
12041 |
+
//_.extend
|
12042 |
+
interface LoDashStatic {
|
12043 |
+
/**
|
12044 |
+
* @see assign
|
12045 |
+
*/
|
12046 |
+
extend<TObject extends {}, TSource extends {}, TResult extends {}>(
|
12047 |
+
object: TObject,
|
12048 |
+
source: TSource,
|
12049 |
+
customizer?: AssignCustomizer,
|
12050 |
+
thisArg?: any
|
12051 |
+
): TResult;
|
12052 |
+
|
12053 |
+
/**
|
12054 |
+
* @see assign
|
12055 |
+
*/
|
12056 |
+
extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
12057 |
+
object: TObject,
|
12058 |
+
source1: TSource1,
|
12059 |
+
source2: TSource2,
|
12060 |
+
customizer?: AssignCustomizer,
|
12061 |
+
thisArg?: any
|
12062 |
+
): TResult;
|
12063 |
+
|
12064 |
+
/**
|
12065 |
+
* @see assign
|
12066 |
+
*/
|
12067 |
+
extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
12068 |
+
object: TObject,
|
12069 |
+
source1: TSource1,
|
12070 |
+
source2: TSource2,
|
12071 |
+
source3: TSource3,
|
12072 |
+
customizer?: AssignCustomizer,
|
12073 |
+
thisArg?: any
|
12074 |
+
): TResult;
|
12075 |
+
|
12076 |
+
/**
|
12077 |
+
* @see assign
|
12078 |
+
*/
|
12079 |
+
extend<TObject extends {}, TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {},
|
12080 |
+
TResult extends {}>
|
12081 |
+
(
|
12082 |
+
object: TObject,
|
12083 |
+
source1: TSource1,
|
12084 |
+
source2: TSource2,
|
12085 |
+
source3: TSource3,
|
12086 |
+
source4: TSource4,
|
12087 |
+
customizer?: AssignCustomizer,
|
12088 |
+
thisArg?: any
|
12089 |
+
): TResult;
|
12090 |
+
|
12091 |
+
/**
|
12092 |
+
* @see _.assign
|
12093 |
+
*/
|
12094 |
+
extend<TObject extends {}>(object: TObject): TObject;
|
12095 |
+
|
12096 |
+
/**
|
12097 |
+
* @see _.assign
|
12098 |
+
*/
|
12099 |
+
extend<TObject extends {}, TResult extends {}>(
|
12100 |
+
object: TObject, ...otherArgs: any[]
|
12101 |
+
): TResult;
|
12102 |
+
}
|
12103 |
+
|
12104 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12105 |
+
/**
|
12106 |
+
* @see _.assign
|
12107 |
+
*/
|
12108 |
+
extend<TSource extends {}, TResult extends {}>(
|
12109 |
+
source: TSource,
|
12110 |
+
customizer?: AssignCustomizer,
|
12111 |
+
thisArg?: any
|
12112 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
12113 |
+
|
12114 |
+
/**
|
12115 |
+
* @see assign
|
12116 |
+
*/
|
12117 |
+
extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
12118 |
+
source1: TSource1,
|
12119 |
+
source2: TSource2,
|
12120 |
+
customizer?: AssignCustomizer,
|
12121 |
+
thisArg?: any
|
12122 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
12123 |
+
|
12124 |
+
/**
|
12125 |
+
* @see assign
|
12126 |
+
*/
|
12127 |
+
extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
12128 |
+
source1: TSource1,
|
12129 |
+
source2: TSource2,
|
12130 |
+
source3: TSource3,
|
12131 |
+
customizer?: AssignCustomizer,
|
12132 |
+
thisArg?: any
|
12133 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
12134 |
+
|
12135 |
+
/**
|
12136 |
+
* @see assign
|
12137 |
+
*/
|
12138 |
+
extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
|
12139 |
+
source1: TSource1,
|
12140 |
+
source2: TSource2,
|
12141 |
+
source3: TSource3,
|
12142 |
+
source4: TSource4,
|
12143 |
+
customizer?: AssignCustomizer,
|
12144 |
+
thisArg?: any
|
12145 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
12146 |
+
|
12147 |
+
/**
|
12148 |
+
* @see _.assign
|
12149 |
+
*/
|
12150 |
+
extend(): LoDashImplicitObjectWrapper<T>;
|
12151 |
+
|
12152 |
+
/**
|
12153 |
+
* @see _.assign
|
12154 |
+
*/
|
12155 |
+
extend<TResult extends {}>(...otherArgs: any[]): LoDashImplicitObjectWrapper<TResult>;
|
12156 |
+
}
|
12157 |
+
|
12158 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12159 |
+
/**
|
12160 |
+
* @see _.assign
|
12161 |
+
*/
|
12162 |
+
extend<TSource extends {}, TResult extends {}>(
|
12163 |
+
source: TSource,
|
12164 |
+
customizer?: AssignCustomizer,
|
12165 |
+
thisArg?: any
|
12166 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
12167 |
+
|
12168 |
+
/**
|
12169 |
+
* @see assign
|
12170 |
+
*/
|
12171 |
+
extend<TSource1 extends {}, TSource2 extends {}, TResult extends {}>(
|
12172 |
+
source1: TSource1,
|
12173 |
+
source2: TSource2,
|
12174 |
+
customizer?: AssignCustomizer,
|
12175 |
+
thisArg?: any
|
12176 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
12177 |
+
|
12178 |
+
/**
|
12179 |
+
* @see assign
|
12180 |
+
*/
|
12181 |
+
extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TResult extends {}>(
|
12182 |
+
source1: TSource1,
|
12183 |
+
source2: TSource2,
|
12184 |
+
source3: TSource3,
|
12185 |
+
customizer?: AssignCustomizer,
|
12186 |
+
thisArg?: any
|
12187 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
12188 |
+
|
12189 |
+
/**
|
12190 |
+
* @see assign
|
12191 |
+
*/
|
12192 |
+
extend<TSource1 extends {}, TSource2 extends {}, TSource3 extends {}, TSource4 extends {}, TResult extends {}>(
|
12193 |
+
source1: TSource1,
|
12194 |
+
source2: TSource2,
|
12195 |
+
source3: TSource3,
|
12196 |
+
source4: TSource4,
|
12197 |
+
customizer?: AssignCustomizer,
|
12198 |
+
thisArg?: any
|
12199 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
12200 |
+
|
12201 |
+
/**
|
12202 |
+
* @see _.assign
|
12203 |
+
*/
|
12204 |
+
extend(): LoDashExplicitObjectWrapper<T>;
|
12205 |
+
|
12206 |
+
/**
|
12207 |
+
* @see _.assign
|
12208 |
+
*/
|
12209 |
+
extend<TResult extends {}>(...otherArgs: any[]): LoDashExplicitObjectWrapper<TResult>;
|
12210 |
+
}
|
12211 |
+
|
12212 |
+
//_.findKey
|
12213 |
+
interface LoDashStatic {
|
12214 |
+
/**
|
12215 |
+
* This method is like _.find except that it returns the key of the first element predicate returns truthy for
|
12216 |
+
* instead of the element itself.
|
12217 |
+
*
|
12218 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
12219 |
+
* value of the given element.
|
12220 |
+
*
|
12221 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
12222 |
+
* elements that have a matching property value, else false.
|
12223 |
+
*
|
12224 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
12225 |
+
* have the properties of the given object, else false.
|
12226 |
+
*
|
12227 |
+
* @param object The object to search.
|
12228 |
+
* @param predicate The function invoked per iteration.
|
12229 |
+
* @param thisArg The this binding of predicate.
|
12230 |
+
* @return Returns the key of the matched element, else undefined.
|
12231 |
+
*/
|
12232 |
+
findKey<TValues, TObject>(
|
12233 |
+
object: TObject,
|
12234 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12235 |
+
thisArg?: any
|
12236 |
+
): string;
|
12237 |
+
|
12238 |
+
/**
|
12239 |
+
* @see _.findKey
|
12240 |
+
*/
|
12241 |
+
findKey<TObject>(
|
12242 |
+
object: TObject,
|
12243 |
+
predicate?: ObjectIterator<any, boolean>,
|
12244 |
+
thisArg?: any
|
12245 |
+
): string;
|
12246 |
+
|
12247 |
+
/**
|
12248 |
+
* @see _.findKey
|
12249 |
+
*/
|
12250 |
+
findKey<TObject>(
|
12251 |
+
object: TObject,
|
12252 |
+
predicate?: string,
|
12253 |
+
thisArg?: any
|
12254 |
+
): string;
|
12255 |
+
|
12256 |
+
/**
|
12257 |
+
* @see _.findKey
|
12258 |
+
*/
|
12259 |
+
findKey<TWhere extends Dictionary<any>, TObject>(
|
12260 |
+
object: TObject,
|
12261 |
+
predicate?: TWhere
|
12262 |
+
): string;
|
12263 |
+
}
|
12264 |
+
|
12265 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12266 |
+
/**
|
12267 |
+
* @see _.findKey
|
12268 |
+
*/
|
12269 |
+
findKey<TValues>(
|
12270 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12271 |
+
thisArg?: any
|
12272 |
+
): string;
|
12273 |
+
|
12274 |
+
/**
|
12275 |
+
* @see _.findKey
|
12276 |
+
*/
|
12277 |
+
findKey(
|
12278 |
+
predicate?: ObjectIterator<any, boolean>,
|
12279 |
+
thisArg?: any
|
12280 |
+
): string;
|
12281 |
+
|
12282 |
+
/**
|
12283 |
+
* @see _.findKey
|
12284 |
+
*/
|
12285 |
+
findKey(
|
12286 |
+
predicate?: string,
|
12287 |
+
thisArg?: any
|
12288 |
+
): string;
|
12289 |
+
|
12290 |
+
/**
|
12291 |
+
* @see _.findKey
|
12292 |
+
*/
|
12293 |
+
findKey<TWhere extends Dictionary<any>>(
|
12294 |
+
predicate?: TWhere
|
12295 |
+
): string;
|
12296 |
+
}
|
12297 |
+
|
12298 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12299 |
+
/**
|
12300 |
+
* @see _.findKey
|
12301 |
+
*/
|
12302 |
+
findKey<TValues>(
|
12303 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12304 |
+
thisArg?: any
|
12305 |
+
): LoDashExplicitWrapper<string>;
|
12306 |
+
|
12307 |
+
/**
|
12308 |
+
* @see _.findKey
|
12309 |
+
*/
|
12310 |
+
findKey(
|
12311 |
+
predicate?: ObjectIterator<any, boolean>,
|
12312 |
+
thisArg?: any
|
12313 |
+
): LoDashExplicitWrapper<string>;
|
12314 |
+
|
12315 |
+
/**
|
12316 |
+
* @see _.findKey
|
12317 |
+
*/
|
12318 |
+
findKey(
|
12319 |
+
predicate?: string,
|
12320 |
+
thisArg?: any
|
12321 |
+
): LoDashExplicitWrapper<string>;
|
12322 |
+
|
12323 |
+
/**
|
12324 |
+
* @see _.findKey
|
12325 |
+
*/
|
12326 |
+
findKey<TWhere extends Dictionary<any>>(
|
12327 |
+
predicate?: TWhere
|
12328 |
+
): LoDashExplicitWrapper<string>;
|
12329 |
+
}
|
12330 |
+
|
12331 |
+
//_.findLastKey
|
12332 |
+
interface LoDashStatic {
|
12333 |
+
/**
|
12334 |
+
* This method is like _.findKey except that it iterates over elements of a collection in the opposite order.
|
12335 |
+
*
|
12336 |
+
* If a property name is provided for predicate the created _.property style callback returns the property
|
12337 |
+
* value of the given element.
|
12338 |
+
*
|
12339 |
+
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
12340 |
+
* elements that have a matching property value, else false.
|
12341 |
+
*
|
12342 |
+
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
12343 |
+
* have the properties of the given object, else false.
|
12344 |
+
*
|
12345 |
+
* @param object The object to search.
|
12346 |
+
* @param predicate The function invoked per iteration.
|
12347 |
+
* @param thisArg The this binding of predicate.
|
12348 |
+
* @return Returns the key of the matched element, else undefined.
|
12349 |
+
*/
|
12350 |
+
findLastKey<TValues, TObject>(
|
12351 |
+
object: TObject,
|
12352 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12353 |
+
thisArg?: any
|
12354 |
+
): string;
|
12355 |
+
|
12356 |
+
/**
|
12357 |
+
* @see _.findLastKey
|
12358 |
+
*/
|
12359 |
+
findLastKey<TObject>(
|
12360 |
+
object: TObject,
|
12361 |
+
predicate?: ObjectIterator<any, boolean>,
|
12362 |
+
thisArg?: any
|
12363 |
+
): string;
|
12364 |
+
|
12365 |
+
/**
|
12366 |
+
* @see _.findLastKey
|
12367 |
+
*/
|
12368 |
+
findLastKey<TObject>(
|
12369 |
+
object: TObject,
|
12370 |
+
predicate?: string,
|
12371 |
+
thisArg?: any
|
12372 |
+
): string;
|
12373 |
+
|
12374 |
+
/**
|
12375 |
+
* @see _.findLastKey
|
12376 |
+
*/
|
12377 |
+
findLastKey<TWhere extends Dictionary<any>, TObject>(
|
12378 |
+
object: TObject,
|
12379 |
+
predicate?: TWhere
|
12380 |
+
): string;
|
12381 |
+
}
|
12382 |
+
|
12383 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12384 |
+
/**
|
12385 |
+
* @see _.findLastKey
|
12386 |
+
*/
|
12387 |
+
findLastKey<TValues>(
|
12388 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12389 |
+
thisArg?: any
|
12390 |
+
): string;
|
12391 |
+
|
12392 |
+
/**
|
12393 |
+
* @see _.findLastKey
|
12394 |
+
*/
|
12395 |
+
findLastKey(
|
12396 |
+
predicate?: ObjectIterator<any, boolean>,
|
12397 |
+
thisArg?: any
|
12398 |
+
): string;
|
12399 |
+
|
12400 |
+
/**
|
12401 |
+
* @see _.findLastKey
|
12402 |
+
*/
|
12403 |
+
findLastKey(
|
12404 |
+
predicate?: string,
|
12405 |
+
thisArg?: any
|
12406 |
+
): string;
|
12407 |
+
|
12408 |
+
/**
|
12409 |
+
* @see _.findLastKey
|
12410 |
+
*/
|
12411 |
+
findLastKey<TWhere extends Dictionary<any>>(
|
12412 |
+
predicate?: TWhere
|
12413 |
+
): string;
|
12414 |
+
}
|
12415 |
+
|
12416 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12417 |
+
/**
|
12418 |
+
* @see _.findLastKey
|
12419 |
+
*/
|
12420 |
+
findLastKey<TValues>(
|
12421 |
+
predicate?: DictionaryIterator<TValues, boolean>,
|
12422 |
+
thisArg?: any
|
12423 |
+
): LoDashExplicitWrapper<string>;
|
12424 |
+
|
12425 |
+
/**
|
12426 |
+
* @see _.findLastKey
|
12427 |
+
*/
|
12428 |
+
findLastKey(
|
12429 |
+
predicate?: ObjectIterator<any, boolean>,
|
12430 |
+
thisArg?: any
|
12431 |
+
): LoDashExplicitWrapper<string>;
|
12432 |
+
|
12433 |
+
/**
|
12434 |
+
* @see _.findLastKey
|
12435 |
+
*/
|
12436 |
+
findLastKey(
|
12437 |
+
predicate?: string,
|
12438 |
+
thisArg?: any
|
12439 |
+
): LoDashExplicitWrapper<string>;
|
12440 |
+
|
12441 |
+
/**
|
12442 |
+
* @see _.findLastKey
|
12443 |
+
*/
|
12444 |
+
findLastKey<TWhere extends Dictionary<any>>(
|
12445 |
+
predicate?: TWhere
|
12446 |
+
): LoDashExplicitWrapper<string>;
|
12447 |
+
}
|
12448 |
+
|
12449 |
+
//_.forIn
|
12450 |
+
interface LoDashStatic {
|
12451 |
+
/**
|
12452 |
+
* Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The
|
12453 |
+
* iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may
|
12454 |
+
* exit iteration early by explicitly returning false.
|
12455 |
+
*
|
12456 |
+
* @param object The object to iterate over.
|
12457 |
+
* @param iteratee The function invoked per iteration.
|
12458 |
+
* @param thisArg The this binding of iteratee.
|
12459 |
+
* @return Returns object.
|
12460 |
+
*/
|
12461 |
+
forIn<T>(
|
12462 |
+
object: Dictionary<T>,
|
12463 |
+
iteratee?: DictionaryIterator<T, any>,
|
12464 |
+
thisArg?: any
|
12465 |
+
): Dictionary<T>;
|
12466 |
+
|
12467 |
+
/**
|
12468 |
+
* @see _.forIn
|
12469 |
+
*/
|
12470 |
+
forIn<T extends {}>(
|
12471 |
+
object: T,
|
12472 |
+
iteratee?: ObjectIterator<any, any>,
|
12473 |
+
thisArg?: any
|
12474 |
+
): T;
|
12475 |
+
}
|
12476 |
+
|
12477 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12478 |
+
/**
|
12479 |
+
* @see _.forIn
|
12480 |
+
*/
|
12481 |
+
forIn<TValue>(
|
12482 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12483 |
+
thisArg?: any
|
12484 |
+
): _.LoDashImplicitObjectWrapper<T>;
|
12485 |
+
}
|
12486 |
+
|
12487 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12488 |
+
/**
|
12489 |
+
* @see _.forIn
|
12490 |
+
*/
|
12491 |
+
forIn<TValue>(
|
12492 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12493 |
+
thisArg?: any
|
12494 |
+
): _.LoDashExplicitObjectWrapper<T>;
|
12495 |
+
}
|
12496 |
+
|
12497 |
+
//_.forInRight
|
12498 |
+
interface LoDashStatic {
|
12499 |
+
/**
|
12500 |
+
* This method is like _.forIn except that it iterates over properties of object in the opposite order.
|
12501 |
+
*
|
12502 |
+
* @param object The object to iterate over.
|
12503 |
+
* @param iteratee The function invoked per iteration.
|
12504 |
+
* @param thisArg The this binding of iteratee.
|
12505 |
+
* @return Returns object.
|
12506 |
+
*/
|
12507 |
+
forInRight<T>(
|
12508 |
+
object: Dictionary<T>,
|
12509 |
+
iteratee?: DictionaryIterator<T, any>,
|
12510 |
+
thisArg?: any
|
12511 |
+
): Dictionary<T>;
|
12512 |
+
|
12513 |
+
/**
|
12514 |
+
* @see _.forInRight
|
12515 |
+
*/
|
12516 |
+
forInRight<T extends {}>(
|
12517 |
+
object: T,
|
12518 |
+
iteratee?: ObjectIterator<any, any>,
|
12519 |
+
thisArg?: any
|
12520 |
+
): T;
|
12521 |
+
}
|
12522 |
+
|
12523 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12524 |
+
/**
|
12525 |
+
* @see _.forInRight
|
12526 |
+
*/
|
12527 |
+
forInRight<TValue>(
|
12528 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12529 |
+
thisArg?: any
|
12530 |
+
): _.LoDashImplicitObjectWrapper<T>;
|
12531 |
+
}
|
12532 |
+
|
12533 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12534 |
+
/**
|
12535 |
+
* @see _.forInRight
|
12536 |
+
*/
|
12537 |
+
forInRight<TValue>(
|
12538 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12539 |
+
thisArg?: any
|
12540 |
+
): _.LoDashExplicitObjectWrapper<T>;
|
12541 |
+
}
|
12542 |
+
|
12543 |
+
//_.forOwn
|
12544 |
+
interface LoDashStatic {
|
12545 |
+
/**
|
12546 |
+
* Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is
|
12547 |
+
* bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit
|
12548 |
+
* iteration early by explicitly returning false.
|
12549 |
+
*
|
12550 |
+
* @param object The object to iterate over.
|
12551 |
+
* @param iteratee The function invoked per iteration.
|
12552 |
+
* @param thisArg The this binding of iteratee.
|
12553 |
+
* @return Returns object.
|
12554 |
+
*/
|
12555 |
+
forOwn<T>(
|
12556 |
+
object: Dictionary<T>,
|
12557 |
+
iteratee?: DictionaryIterator<T, any>,
|
12558 |
+
thisArg?: any
|
12559 |
+
): Dictionary<T>;
|
12560 |
+
|
12561 |
+
/**
|
12562 |
+
* @see _.forOwn
|
12563 |
+
*/
|
12564 |
+
forOwn<T extends {}>(
|
12565 |
+
object: T,
|
12566 |
+
iteratee?: ObjectIterator<any, any>,
|
12567 |
+
thisArg?: any
|
12568 |
+
): T;
|
12569 |
+
}
|
12570 |
+
|
12571 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12572 |
+
/**
|
12573 |
+
* @see _.forOwn
|
12574 |
+
*/
|
12575 |
+
forOwn<TValue>(
|
12576 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12577 |
+
thisArg?: any
|
12578 |
+
): _.LoDashImplicitObjectWrapper<T>;
|
12579 |
+
}
|
12580 |
+
|
12581 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12582 |
+
/**
|
12583 |
+
* @see _.forOwn
|
12584 |
+
*/
|
12585 |
+
forOwn<TValue>(
|
12586 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12587 |
+
thisArg?: any
|
12588 |
+
): _.LoDashExplicitObjectWrapper<T>;
|
12589 |
+
}
|
12590 |
+
|
12591 |
+
//_.forOwnRight
|
12592 |
+
interface LoDashStatic {
|
12593 |
+
/**
|
12594 |
+
* This method is like _.forOwn except that it iterates over properties of object in the opposite order.
|
12595 |
+
*
|
12596 |
+
* @param object The object to iterate over.
|
12597 |
+
* @param iteratee The function invoked per iteration.
|
12598 |
+
* @param thisArg The this binding of iteratee.
|
12599 |
+
* @return Returns object.
|
12600 |
+
*/
|
12601 |
+
forOwnRight<T>(
|
12602 |
+
object: Dictionary<T>,
|
12603 |
+
iteratee?: DictionaryIterator<T, any>,
|
12604 |
+
thisArg?: any
|
12605 |
+
): Dictionary<T>;
|
12606 |
+
|
12607 |
+
/**
|
12608 |
+
* @see _.forOwnRight
|
12609 |
+
*/
|
12610 |
+
forOwnRight<T extends {}>(
|
12611 |
+
object: T,
|
12612 |
+
iteratee?: ObjectIterator<any, any>,
|
12613 |
+
thisArg?: any
|
12614 |
+
): T;
|
12615 |
+
}
|
12616 |
+
|
12617 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12618 |
+
/**
|
12619 |
+
* @see _.forOwnRight
|
12620 |
+
*/
|
12621 |
+
forOwnRight<TValue>(
|
12622 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12623 |
+
thisArg?: any
|
12624 |
+
): _.LoDashImplicitObjectWrapper<T>;
|
12625 |
+
}
|
12626 |
+
|
12627 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12628 |
+
/**
|
12629 |
+
* @see _.forOwnRight
|
12630 |
+
*/
|
12631 |
+
forOwnRight<TValue>(
|
12632 |
+
iteratee?: DictionaryIterator<TValue, any>,
|
12633 |
+
thisArg?: any
|
12634 |
+
): _.LoDashExplicitObjectWrapper<T>;
|
12635 |
+
}
|
12636 |
+
|
12637 |
+
//_.functions
|
12638 |
+
interface LoDashStatic {
|
12639 |
+
/**
|
12640 |
+
* Creates an array of function property names from all enumerable properties, own and inherited, of object.
|
12641 |
+
*
|
12642 |
+
* @alias _.methods
|
12643 |
+
*
|
12644 |
+
* @param object The object to inspect.
|
12645 |
+
* @return Returns the new array of property names.
|
12646 |
+
*/
|
12647 |
+
functions<T extends {}>(object: any): string[];
|
12648 |
+
}
|
12649 |
+
|
12650 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12651 |
+
/**
|
12652 |
+
* @see _.functions
|
12653 |
+
*/
|
12654 |
+
functions(): _.LoDashImplicitArrayWrapper<string>;
|
12655 |
+
}
|
12656 |
+
|
12657 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12658 |
+
/**
|
12659 |
+
* @see _.functions
|
12660 |
+
*/
|
12661 |
+
functions(): _.LoDashExplicitArrayWrapper<string>;
|
12662 |
+
}
|
12663 |
+
|
12664 |
+
//_.get
|
12665 |
+
interface LoDashStatic {
|
12666 |
+
/**
|
12667 |
+
* Gets the property value at path of object. If the resolved
|
12668 |
+
* value is undefined the defaultValue is used in its place.
|
12669 |
+
* @param object The object to query.
|
12670 |
+
* @param path The path of the property to get.
|
12671 |
+
* @param defaultValue The value returned if the resolved value is undefined.
|
12672 |
+
* @return Returns the resolved value.
|
12673 |
+
**/
|
12674 |
+
get<TResult>(object: Object,
|
12675 |
+
path: string|number|boolean|Array<string|number|boolean>,
|
12676 |
+
defaultValue?:TResult
|
12677 |
+
): TResult;
|
12678 |
+
}
|
12679 |
+
|
12680 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12681 |
+
/**
|
12682 |
+
* @see _.get
|
12683 |
+
**/
|
12684 |
+
get<TResult>(path: string|number|boolean|Array<string|number|boolean>,
|
12685 |
+
defaultValue?: TResult
|
12686 |
+
): TResult;
|
12687 |
+
}
|
12688 |
+
|
12689 |
+
//_.has
|
12690 |
+
interface LoDashStatic {
|
12691 |
+
/**
|
12692 |
+
* Checks if path is a direct property.
|
12693 |
+
*
|
12694 |
+
* @param object The object to query.
|
12695 |
+
* @param path The path to check.
|
12696 |
+
* @return Returns true if path is a direct property, else false.
|
12697 |
+
*/
|
12698 |
+
has<T extends {}>(
|
12699 |
+
object: T,
|
12700 |
+
path: StringRepresentable|StringRepresentable[]
|
12701 |
+
): boolean;
|
12702 |
+
}
|
12703 |
+
|
12704 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12705 |
+
/**
|
12706 |
+
* @see _.has
|
12707 |
+
*/
|
12708 |
+
has(path: StringRepresentable|StringRepresentable[]): boolean;
|
12709 |
+
}
|
12710 |
+
|
12711 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12712 |
+
/**
|
12713 |
+
* @see _.has
|
12714 |
+
*/
|
12715 |
+
has(path: StringRepresentable|StringRepresentable[]): LoDashExplicitWrapper<boolean>;
|
12716 |
+
}
|
12717 |
+
|
12718 |
+
//_.invert
|
12719 |
+
interface LoDashStatic {
|
12720 |
+
/**
|
12721 |
+
* Creates an object composed of the inverted keys and values of object. If object contains duplicate values,
|
12722 |
+
* subsequent values overwrite property assignments of previous values unless multiValue is true.
|
12723 |
+
*
|
12724 |
+
* @param object The object to invert.
|
12725 |
+
* @param multiValue Allow multiple values per key.
|
12726 |
+
* @return Returns the new inverted object.
|
12727 |
+
*/
|
12728 |
+
invert<T extends {}, TResult extends {}>(
|
12729 |
+
object: T,
|
12730 |
+
multiValue?: boolean
|
12731 |
+
): TResult;
|
12732 |
+
|
12733 |
+
/**
|
12734 |
+
* @see _.invert
|
12735 |
+
*/
|
12736 |
+
invert<TResult extends {}>(
|
12737 |
+
object: Object,
|
12738 |
+
multiValue?: boolean
|
12739 |
+
): TResult;
|
12740 |
+
}
|
12741 |
+
|
12742 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12743 |
+
/**
|
12744 |
+
* @see _.invert
|
12745 |
+
*/
|
12746 |
+
invert<TResult extends {}>(multiValue?: boolean): LoDashImplicitObjectWrapper<TResult>;
|
12747 |
+
}
|
12748 |
+
|
12749 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12750 |
+
/**
|
12751 |
+
* @see _.invert
|
12752 |
+
*/
|
12753 |
+
invert<TResult extends {}>(multiValue?: boolean): LoDashExplicitObjectWrapper<TResult>;
|
12754 |
+
}
|
12755 |
+
|
12756 |
+
//_.keys
|
12757 |
+
interface LoDashStatic {
|
12758 |
+
/**
|
12759 |
+
* Creates an array of the own enumerable property names of object.
|
12760 |
+
*
|
12761 |
+
* Note: Non-object values are coerced to objects. See the ES spec for more details.
|
12762 |
+
*
|
12763 |
+
* @param object The object to query.
|
12764 |
+
* @return Returns the array of property names.
|
12765 |
+
*/
|
12766 |
+
keys(object?: any): string[];
|
12767 |
+
}
|
12768 |
+
|
12769 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12770 |
+
/**
|
12771 |
+
* @see _.keys
|
12772 |
+
*/
|
12773 |
+
keys(): LoDashImplicitArrayWrapper<string>;
|
12774 |
+
}
|
12775 |
+
|
12776 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12777 |
+
/**
|
12778 |
+
* @see _.keys
|
12779 |
+
*/
|
12780 |
+
keys(): LoDashExplicitArrayWrapper<string>;
|
12781 |
+
}
|
12782 |
+
|
12783 |
+
//_.keysIn
|
12784 |
+
interface LoDashStatic {
|
12785 |
+
/**
|
12786 |
+
* Creates an array of the own and inherited enumerable property names of object.
|
12787 |
+
*
|
12788 |
+
* Note: Non-object values are coerced to objects.
|
12789 |
+
*
|
12790 |
+
* @param object The object to query.
|
12791 |
+
* @return An array of property names.
|
12792 |
+
*/
|
12793 |
+
keysIn(object?: any): string[];
|
12794 |
+
}
|
12795 |
+
|
12796 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12797 |
+
/**
|
12798 |
+
* @see _.keysIn
|
12799 |
+
*/
|
12800 |
+
keysIn(): LoDashImplicitArrayWrapper<string>;
|
12801 |
+
}
|
12802 |
+
|
12803 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12804 |
+
/**
|
12805 |
+
* @see _.keysIn
|
12806 |
+
*/
|
12807 |
+
keysIn(): LoDashExplicitArrayWrapper<string>;
|
12808 |
+
}
|
12809 |
+
|
12810 |
+
//_.mapKeys
|
12811 |
+
interface LoDashStatic {
|
12812 |
+
/**
|
12813 |
+
* The opposite of _.mapValues; this method creates an object with the same values as object and keys generated
|
12814 |
+
* by running each own enumerable property of object through iteratee.
|
12815 |
+
*
|
12816 |
+
* @param object The object to iterate over.
|
12817 |
+
* @param iteratee The function invoked per iteration.
|
12818 |
+
* @param thisArg The this binding of iteratee.
|
12819 |
+
* @return Returns the new mapped object.
|
12820 |
+
*/
|
12821 |
+
mapKeys<T, TKey>(
|
12822 |
+
object: List<T>,
|
12823 |
+
iteratee?: ListIterator<T, TKey>,
|
12824 |
+
thisArg?: any
|
12825 |
+
): Dictionary<T>;
|
12826 |
+
|
12827 |
+
/**
|
12828 |
+
* @see _.mapKeys
|
12829 |
+
*/
|
12830 |
+
mapKeys<T, TKey>(
|
12831 |
+
object: Dictionary<T>,
|
12832 |
+
iteratee?: DictionaryIterator<T, TKey>,
|
12833 |
+
thisArg?: any
|
12834 |
+
): Dictionary<T>;
|
12835 |
+
|
12836 |
+
/**
|
12837 |
+
* @see _.mapKeys
|
12838 |
+
*/
|
12839 |
+
mapKeys<T, TObject extends {}>(
|
12840 |
+
object: List<T>|Dictionary<T>,
|
12841 |
+
iteratee?: TObject
|
12842 |
+
): Dictionary<T>;
|
12843 |
+
|
12844 |
+
/**
|
12845 |
+
* @see _.mapKeys
|
12846 |
+
*/
|
12847 |
+
mapKeys<T>(
|
12848 |
+
object: List<T>|Dictionary<T>,
|
12849 |
+
iteratee?: string,
|
12850 |
+
thisArg?: any
|
12851 |
+
): Dictionary<T>;
|
12852 |
+
}
|
12853 |
+
|
12854 |
+
interface LoDashImplicitArrayWrapper<T> {
|
12855 |
+
/**
|
12856 |
+
* @see _.mapKeys
|
12857 |
+
*/
|
12858 |
+
mapKeys<TKey>(
|
12859 |
+
iteratee?: ListIterator<T, TKey>,
|
12860 |
+
thisArg?: any
|
12861 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
12862 |
+
|
12863 |
+
/**
|
12864 |
+
* @see _.mapKeys
|
12865 |
+
*/
|
12866 |
+
mapKeys<TObject extends {}>(
|
12867 |
+
iteratee?: TObject
|
12868 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
12869 |
+
|
12870 |
+
/**
|
12871 |
+
* @see _.mapKeys
|
12872 |
+
*/
|
12873 |
+
mapKeys(
|
12874 |
+
iteratee?: string,
|
12875 |
+
thisArg?: any
|
12876 |
+
): LoDashImplicitObjectWrapper<Dictionary<T>>;
|
12877 |
+
}
|
12878 |
+
|
12879 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12880 |
+
/**
|
12881 |
+
* @see _.mapKeys
|
12882 |
+
*/
|
12883 |
+
mapKeys<TResult, TKey>(
|
12884 |
+
iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>,
|
12885 |
+
thisArg?: any
|
12886 |
+
): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
12887 |
+
|
12888 |
+
/**
|
12889 |
+
* @see _.mapKeys
|
12890 |
+
*/
|
12891 |
+
mapKeys<TResult, TObject extends {}>(
|
12892 |
+
iteratee?: TObject
|
12893 |
+
): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
12894 |
+
|
12895 |
+
/**
|
12896 |
+
* @see _.mapKeys
|
12897 |
+
*/
|
12898 |
+
mapKeys<TResult>(
|
12899 |
+
iteratee?: string,
|
12900 |
+
thisArg?: any
|
12901 |
+
): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
12902 |
+
}
|
12903 |
+
|
12904 |
+
interface LoDashExplicitArrayWrapper<T> {
|
12905 |
+
/**
|
12906 |
+
* @see _.mapKeys
|
12907 |
+
*/
|
12908 |
+
mapKeys<TKey>(
|
12909 |
+
iteratee?: ListIterator<T, TKey>,
|
12910 |
+
thisArg?: any
|
12911 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
12912 |
+
|
12913 |
+
/**
|
12914 |
+
* @see _.mapKeys
|
12915 |
+
*/
|
12916 |
+
mapKeys<TObject extends {}>(
|
12917 |
+
iteratee?: TObject
|
12918 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
12919 |
+
|
12920 |
+
/**
|
12921 |
+
* @see _.mapKeys
|
12922 |
+
*/
|
12923 |
+
mapKeys(
|
12924 |
+
iteratee?: string,
|
12925 |
+
thisArg?: any
|
12926 |
+
): LoDashExplicitObjectWrapper<Dictionary<T>>;
|
12927 |
+
}
|
12928 |
+
|
12929 |
+
interface LoDashExplicitObjectWrapper<T> {
|
12930 |
+
/**
|
12931 |
+
* @see _.mapKeys
|
12932 |
+
*/
|
12933 |
+
mapKeys<TResult, TKey>(
|
12934 |
+
iteratee?: ListIterator<TResult, TKey>|DictionaryIterator<TResult, TKey>,
|
12935 |
+
thisArg?: any
|
12936 |
+
): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
|
12937 |
+
|
12938 |
+
/**
|
12939 |
+
* @see _.mapKeys
|
12940 |
+
*/
|
12941 |
+
mapKeys<TResult, TObject extends {}>(
|
12942 |
+
iteratee?: TObject
|
12943 |
+
): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
|
12944 |
+
|
12945 |
+
/**
|
12946 |
+
* @see _.mapKeys
|
12947 |
+
*/
|
12948 |
+
mapKeys<TResult>(
|
12949 |
+
iteratee?: string,
|
12950 |
+
thisArg?: any
|
12951 |
+
): LoDashExplicitObjectWrapper<Dictionary<TResult>>;
|
12952 |
+
}
|
12953 |
+
|
12954 |
+
//_.mapValues
|
12955 |
+
interface LoDashStatic {
|
12956 |
+
/**
|
12957 |
+
* Creates an object with the same keys as object and values generated by running each own
|
12958 |
+
* enumerable property of object through iteratee. The iteratee function is bound to thisArg
|
12959 |
+
* and invoked with three arguments: (value, key, object).
|
12960 |
+
*
|
12961 |
+
* If a property name is provided iteratee the created "_.property" style callback returns
|
12962 |
+
* the property value of the given element.
|
12963 |
+
*
|
12964 |
+
* If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns
|
12965 |
+
* true for elements that have a matching property value, else false;.
|
12966 |
+
*
|
12967 |
+
* If an object is provided for iteratee the created "_.matches" style callback returns true
|
12968 |
+
* for elements that have the properties of the given object, else false.
|
12969 |
+
*
|
12970 |
+
* @param {Object} object The object to iterate over.
|
12971 |
+
* @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration.
|
12972 |
+
* @param {Object} [thisArg] The `this` binding of `iteratee`.
|
12973 |
+
* @return {Object} Returns the new mapped object.
|
12974 |
+
*/
|
12975 |
+
mapValues<T, TResult>(obj: Dictionary<T>, callback: ObjectIterator<T, TResult>, thisArg?: any): Dictionary<TResult>;
|
12976 |
+
mapValues<T>(obj: Dictionary<T>, where: Dictionary<T>): Dictionary<boolean>;
|
12977 |
+
mapValues<T, TMapped>(obj: T, pluck: string): TMapped;
|
12978 |
+
mapValues<T>(obj: T, callback: ObjectIterator<any, any>, thisArg?: any): T;
|
12979 |
+
}
|
12980 |
+
|
12981 |
+
interface LoDashImplicitObjectWrapper<T> {
|
12982 |
+
/**
|
12983 |
+
* @see _.mapValues
|
12984 |
+
* TValue is the type of the property values of T.
|
12985 |
+
* TResult is the type output by the ObjectIterator function
|
12986 |
+
*/
|
12987 |
+
mapValues<TValue, TResult>(callback: ObjectIterator<TValue, TResult>, thisArg?: any): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
12988 |
+
|
12989 |
+
/**
|
12990 |
+
* @see _.mapValues
|
12991 |
+
* TResult is the type of the property specified by pluck.
|
12992 |
+
* T should be a Dictionary<Dictionary<TResult>>
|
12993 |
+
*/
|
12994 |
+
mapValues<TResult>(pluck: string): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
12995 |
+
|
12996 |
+
/**
|
12997 |
+
* @see _.mapValues
|
12998 |
+
* TResult is the type of the properties on the object specified by pluck.
|
12999 |
+
* T should be a Dictionary<Dictionary<Dictionary<TResult>>>
|
13000 |
+
*/
|
13001 |
+
mapValues<TResult>(pluck: string, where: Dictionary<TResult>): LoDashImplicitArrayWrapper<Dictionary<boolean>>;
|
13002 |
+
|
13003 |
+
/**
|
13004 |
+
* @see _.mapValues
|
13005 |
+
* TResult is the type of the properties of each object in the values of T
|
13006 |
+
* T should be a Dictionary<Dictionary<TResult>>
|
13007 |
+
*/
|
13008 |
+
mapValues<TResult>(where: Dictionary<TResult>): LoDashImplicitArrayWrapper<boolean>;
|
13009 |
+
}
|
13010 |
+
|
13011 |
+
//_.merge
|
13012 |
+
interface MergeCustomizer {
|
13013 |
+
(value: any, srcValue: any, key?: string, object?: Object, source?: Object): any;
|
13014 |
+
}
|
13015 |
+
|
13016 |
+
interface LoDashStatic {
|
13017 |
+
/**
|
13018 |
+
* Recursively merges own enumerable properties of the source object(s), that don’t resolve to undefined into
|
13019 |
+
* the destination object. Subsequent sources overwrite property assignments of previous sources. If customizer
|
13020 |
+
* is provided it’s invoked to produce the merged values of the destination and source properties. If
|
13021 |
+
* customizer returns undefined merging is handled by the method instead. The customizer is bound to thisArg
|
13022 |
+
* and invoked with five arguments: (objectValue, sourceValue, key, object, source).
|
13023 |
+
*
|
13024 |
+
* @param object The destination object.
|
13025 |
+
* @param source The source objects.
|
13026 |
+
* @param customizer The function to customize assigned values.
|
13027 |
+
* @param thisArg The this binding of customizer.
|
13028 |
+
* @return Returns object.
|
13029 |
+
*/
|
13030 |
+
merge<TObject, TSource>(
|
13031 |
+
object: TObject,
|
13032 |
+
source: TSource,
|
13033 |
+
customizer?: MergeCustomizer,
|
13034 |
+
thisArg?: any
|
13035 |
+
): TObject & TSource;
|
13036 |
+
|
13037 |
+
/**
|
13038 |
+
* @see _.merge
|
13039 |
+
*/
|
13040 |
+
merge<TObject, TSource1, TSource2>(
|
13041 |
+
object: TObject,
|
13042 |
+
source1: TSource1,
|
13043 |
+
source2: TSource2,
|
13044 |
+
customizer?: MergeCustomizer,
|
13045 |
+
thisArg?: any
|
13046 |
+
): TObject & TSource1 & TSource2;
|
13047 |
+
|
13048 |
+
/**
|
13049 |
+
* @see _.merge
|
13050 |
+
*/
|
13051 |
+
merge<TObject, TSource1, TSource2, TSource3>(
|
13052 |
+
object: TObject,
|
13053 |
+
source1: TSource1,
|
13054 |
+
source2: TSource2,
|
13055 |
+
source3: TSource3,
|
13056 |
+
customizer?: MergeCustomizer,
|
13057 |
+
thisArg?: any
|
13058 |
+
): TObject & TSource1 & TSource2 & TSource3;
|
13059 |
+
|
13060 |
+
/**
|
13061 |
+
* @see _.merge
|
13062 |
+
*/
|
13063 |
+
merge<TObject, TSource1, TSource2, TSource3, TSource4>(
|
13064 |
+
object: TObject,
|
13065 |
+
source1: TSource1,
|
13066 |
+
source2: TSource2,
|
13067 |
+
source3: TSource3,
|
13068 |
+
source4: TSource4,
|
13069 |
+
customizer?: MergeCustomizer,
|
13070 |
+
thisArg?: any
|
13071 |
+
): TObject & TSource1 & TSource2 & TSource3 & TSource4;
|
13072 |
+
|
13073 |
+
/**
|
13074 |
+
* @see _.merge
|
13075 |
+
*/
|
13076 |
+
merge<TResult>(
|
13077 |
+
object: any,
|
13078 |
+
...otherArgs: any[]
|
13079 |
+
): TResult;
|
13080 |
+
}
|
13081 |
+
|
13082 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13083 |
+
/**
|
13084 |
+
* @see _.merge
|
13085 |
+
*/
|
13086 |
+
merge<TSource>(
|
13087 |
+
source: TSource,
|
13088 |
+
customizer?: MergeCustomizer,
|
13089 |
+
thisArg?: any
|
13090 |
+
): LoDashImplicitObjectWrapper<T & TSource>;
|
13091 |
+
|
13092 |
+
/**
|
13093 |
+
* @see _.merge
|
13094 |
+
*/
|
13095 |
+
merge<TSource1, TSource2>(
|
13096 |
+
source1: TSource1,
|
13097 |
+
source2: TSource2,
|
13098 |
+
customizer?: MergeCustomizer,
|
13099 |
+
thisArg?: any
|
13100 |
+
): LoDashImplicitObjectWrapper<T & TSource1 & TSource2>;
|
13101 |
+
|
13102 |
+
/**
|
13103 |
+
* @see _.merge
|
13104 |
+
*/
|
13105 |
+
merge<TSource1, TSource2, TSource3>(
|
13106 |
+
source1: TSource1,
|
13107 |
+
source2: TSource2,
|
13108 |
+
source3: TSource3,
|
13109 |
+
customizer?: MergeCustomizer,
|
13110 |
+
thisArg?: any
|
13111 |
+
): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3>;
|
13112 |
+
|
13113 |
+
/**
|
13114 |
+
* @see _.merge
|
13115 |
+
*/
|
13116 |
+
merge<TSource1, TSource2, TSource3, TSource4>(
|
13117 |
+
source1: TSource1,
|
13118 |
+
source2: TSource2,
|
13119 |
+
source3: TSource3,
|
13120 |
+
source4: TSource4,
|
13121 |
+
customizer?: MergeCustomizer,
|
13122 |
+
thisArg?: any
|
13123 |
+
): LoDashImplicitObjectWrapper<T & TSource1 & TSource2 & TSource3 & TSource4>;
|
13124 |
+
|
13125 |
+
/**
|
13126 |
+
* @see _.merge
|
13127 |
+
*/
|
13128 |
+
merge<TResult>(
|
13129 |
+
...otherArgs: any[]
|
13130 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
13131 |
+
}
|
13132 |
+
|
13133 |
+
//_.methods
|
13134 |
+
interface LoDashStatic {
|
13135 |
+
/**
|
13136 |
+
* @see _.functions
|
13137 |
+
*/
|
13138 |
+
methods<T extends {}>(object: any): string[];
|
13139 |
+
}
|
13140 |
+
|
13141 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13142 |
+
/**
|
13143 |
+
* @see _.functions
|
13144 |
+
*/
|
13145 |
+
methods(): _.LoDashImplicitArrayWrapper<string>;
|
13146 |
+
}
|
13147 |
+
|
13148 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13149 |
+
/**
|
13150 |
+
* @see _.functions
|
13151 |
+
*/
|
13152 |
+
methods(): _.LoDashExplicitArrayWrapper<string>;
|
13153 |
+
}
|
13154 |
+
|
13155 |
+
//_.omit
|
13156 |
+
interface LoDashStatic {
|
13157 |
+
/**
|
13158 |
+
* The opposite of _.pick; this method creates an object composed of the own and inherited enumerable
|
13159 |
+
* properties of object that are not omitted.
|
13160 |
+
*
|
13161 |
+
* @param object The source object.
|
13162 |
+
* @param predicate The function invoked per iteration or property names to omit, specified as individual
|
13163 |
+
* property names or arrays of property names.
|
13164 |
+
* @param thisArg The this binding of predicate.
|
13165 |
+
* @return Returns the new object.
|
13166 |
+
*/
|
13167 |
+
omit<TResult extends {}, T extends {}>(
|
13168 |
+
object: T,
|
13169 |
+
predicate: ObjectIterator<any, boolean>,
|
13170 |
+
thisArg?: any
|
13171 |
+
): TResult;
|
13172 |
+
|
13173 |
+
/**
|
13174 |
+
* @see _.omit
|
13175 |
+
*/
|
13176 |
+
omit<TResult extends {}, T extends {}>(
|
13177 |
+
object: T,
|
13178 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13179 |
+
): TResult;
|
13180 |
+
}
|
13181 |
+
|
13182 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13183 |
+
/**
|
13184 |
+
* @see _.omit
|
13185 |
+
*/
|
13186 |
+
omit<TResult extends {}>(
|
13187 |
+
predicate: ObjectIterator<any, boolean>,
|
13188 |
+
thisArg?: any
|
13189 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
13190 |
+
|
13191 |
+
/**
|
13192 |
+
* @see _.omit
|
13193 |
+
*/
|
13194 |
+
omit<TResult extends {}>(
|
13195 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13196 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
13197 |
+
}
|
13198 |
+
|
13199 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13200 |
+
/**
|
13201 |
+
* @see _.omit
|
13202 |
+
*/
|
13203 |
+
omit<TResult extends {}>(
|
13204 |
+
predicate: ObjectIterator<any, boolean>,
|
13205 |
+
thisArg?: any
|
13206 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
13207 |
+
|
13208 |
+
/**
|
13209 |
+
* @see _.omit
|
13210 |
+
*/
|
13211 |
+
omit<TResult extends {}>(
|
13212 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13213 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
13214 |
+
}
|
13215 |
+
|
13216 |
+
//_.pairs
|
13217 |
+
interface LoDashStatic {
|
13218 |
+
/**
|
13219 |
+
* Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]].
|
13220 |
+
*
|
13221 |
+
* @param object The object to query.
|
13222 |
+
* @return Returns the new array of key-value pairs.
|
13223 |
+
*/
|
13224 |
+
pairs<T extends {}>(object?: T): any[][];
|
13225 |
+
|
13226 |
+
pairs<T extends {}, TResult>(object?: T): TResult[][];
|
13227 |
+
}
|
13228 |
+
|
13229 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13230 |
+
/**
|
13231 |
+
* @see _.pairs
|
13232 |
+
*/
|
13233 |
+
pairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
|
13234 |
+
}
|
13235 |
+
|
13236 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13237 |
+
/**
|
13238 |
+
* @see _.pairs
|
13239 |
+
*/
|
13240 |
+
pairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
|
13241 |
+
}
|
13242 |
+
|
13243 |
+
//_.pick
|
13244 |
+
interface LoDashStatic {
|
13245 |
+
/**
|
13246 |
+
* Creates an object composed of the picked object properties. Property names may be specified as individual
|
13247 |
+
* arguments or as arrays of property names. If predicate is provided it’s invoked for each property of object
|
13248 |
+
* picking the properties predicate returns truthy for. The predicate is bound to thisArg and invoked with
|
13249 |
+
* three arguments: (value, key, object).
|
13250 |
+
*
|
13251 |
+
* @param object The source object.
|
13252 |
+
* @param predicate The function invoked per iteration or property names to pick, specified as individual
|
13253 |
+
* property names or arrays of property names.
|
13254 |
+
* @param thisArg The this binding of predicate.
|
13255 |
+
* @return Returns the new object.
|
13256 |
+
*/
|
13257 |
+
pick<TResult extends {}, T extends {}>(
|
13258 |
+
object: T,
|
13259 |
+
predicate: ObjectIterator<any, boolean>,
|
13260 |
+
thisArg?: any
|
13261 |
+
): TResult;
|
13262 |
+
|
13263 |
+
/**
|
13264 |
+
* @see _.pick
|
13265 |
+
*/
|
13266 |
+
pick<TResult extends {}, T extends {}>(
|
13267 |
+
object: T,
|
13268 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13269 |
+
): TResult;
|
13270 |
+
}
|
13271 |
+
|
13272 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13273 |
+
/**
|
13274 |
+
* @see _.pick
|
13275 |
+
*/
|
13276 |
+
pick<TResult extends {}>(
|
13277 |
+
predicate: ObjectIterator<any, boolean>,
|
13278 |
+
thisArg?: any
|
13279 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
13280 |
+
|
13281 |
+
/**
|
13282 |
+
* @see _.pick
|
13283 |
+
*/
|
13284 |
+
pick<TResult extends {}>(
|
13285 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13286 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
13287 |
+
}
|
13288 |
+
|
13289 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13290 |
+
/**
|
13291 |
+
* @see _.pick
|
13292 |
+
*/
|
13293 |
+
pick<TResult extends {}>(
|
13294 |
+
predicate: ObjectIterator<any, boolean>,
|
13295 |
+
thisArg?: any
|
13296 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
13297 |
+
|
13298 |
+
/**
|
13299 |
+
* @see _.pick
|
13300 |
+
*/
|
13301 |
+
pick<TResult extends {}>(
|
13302 |
+
...predicate: (StringRepresentable|StringRepresentable[])[]
|
13303 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
13304 |
+
}
|
13305 |
+
|
13306 |
+
//_.result
|
13307 |
+
interface LoDashStatic {
|
13308 |
+
/**
|
13309 |
+
* This method is like _.get except that if the resolved value is a function it’s invoked with the this binding
|
13310 |
+
* of its parent object and its result is returned.
|
13311 |
+
*
|
13312 |
+
* @param object The object to query.
|
13313 |
+
* @param path The path of the property to resolve.
|
13314 |
+
* @param defaultValue The value returned if the resolved value is undefined.
|
13315 |
+
* @return Returns the resolved value.
|
13316 |
+
*/
|
13317 |
+
result<TObject, TResult>(
|
13318 |
+
object: TObject,
|
13319 |
+
path: number|string|boolean|Array<number|string|boolean>,
|
13320 |
+
defaultValue?: TResult
|
13321 |
+
): TResult;
|
13322 |
+
}
|
13323 |
+
|
13324 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
13325 |
+
/**
|
13326 |
+
* @see _.result
|
13327 |
+
*/
|
13328 |
+
result<TResult>(
|
13329 |
+
path: number|string|boolean|Array<number|string|boolean>,
|
13330 |
+
defaultValue?: TResult
|
13331 |
+
): TResult;
|
13332 |
+
}
|
13333 |
+
|
13334 |
+
//_.set
|
13335 |
+
interface LoDashStatic {
|
13336 |
+
/**
|
13337 |
+
* Sets the property value of path on object. If a portion of path does not exist it’s created.
|
13338 |
+
*
|
13339 |
+
* @param object The object to augment.
|
13340 |
+
* @param path The path of the property to set.
|
13341 |
+
* @param value The value to set.
|
13342 |
+
* @return Returns object.
|
13343 |
+
*/
|
13344 |
+
set<T>(
|
13345 |
+
object: T,
|
13346 |
+
path: StringRepresentable|StringRepresentable[],
|
13347 |
+
value: any
|
13348 |
+
): T;
|
13349 |
+
|
13350 |
+
/**
|
13351 |
+
* @see _.set
|
13352 |
+
*/
|
13353 |
+
set<V, T>(
|
13354 |
+
object: T,
|
13355 |
+
path: StringRepresentable|StringRepresentable[],
|
13356 |
+
value: V
|
13357 |
+
): T;
|
13358 |
+
}
|
13359 |
+
|
13360 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13361 |
+
/**
|
13362 |
+
* @see _.set
|
13363 |
+
*/
|
13364 |
+
set<V>(
|
13365 |
+
path: StringRepresentable|StringRepresentable[],
|
13366 |
+
value: V
|
13367 |
+
): LoDashImplicitObjectWrapper<T>;
|
13368 |
+
}
|
13369 |
+
|
13370 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13371 |
+
/**
|
13372 |
+
* @see _.set
|
13373 |
+
*/
|
13374 |
+
set<V>(
|
13375 |
+
path: StringRepresentable|StringRepresentable[],
|
13376 |
+
value: V
|
13377 |
+
): LoDashExplicitObjectWrapper<T>;
|
13378 |
+
}
|
13379 |
+
|
13380 |
+
//_.transform
|
13381 |
+
interface LoDashStatic {
|
13382 |
+
/**
|
13383 |
+
* An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of
|
13384 |
+
* running each of its own enumerable properties through iteratee, with each invocation potentially mutating
|
13385 |
+
* the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator,
|
13386 |
+
* value, key, object). Iteratee functions may exit iteration early by explicitly returning false.
|
13387 |
+
*
|
13388 |
+
* @param object The object to iterate over.
|
13389 |
+
* @param iteratee The function invoked per iteration.
|
13390 |
+
* @param accumulator The custom accumulator value.
|
13391 |
+
* @param thisArg The this binding of iteratee.
|
13392 |
+
* @return Returns the accumulated value.
|
13393 |
+
*/
|
13394 |
+
transform<T, TResult>(
|
13395 |
+
object: T[],
|
13396 |
+
iteratee?: MemoVoidArrayIterator<T, TResult[]>,
|
13397 |
+
accumulator?: TResult[],
|
13398 |
+
thisArg?: any
|
13399 |
+
): TResult[];
|
13400 |
+
|
13401 |
+
/**
|
13402 |
+
* @see _.transform
|
13403 |
+
*/
|
13404 |
+
transform<T, TResult>(
|
13405 |
+
object: T[],
|
13406 |
+
iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
|
13407 |
+
accumulator?: Dictionary<TResult>,
|
13408 |
+
thisArg?: any
|
13409 |
+
): Dictionary<TResult>;
|
13410 |
+
|
13411 |
+
/**
|
13412 |
+
* @see _.transform
|
13413 |
+
*/
|
13414 |
+
transform<T, TResult>(
|
13415 |
+
object: Dictionary<T>,
|
13416 |
+
iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
|
13417 |
+
accumulator?: Dictionary<TResult>,
|
13418 |
+
thisArg?: any
|
13419 |
+
): Dictionary<TResult>;
|
13420 |
+
|
13421 |
+
/**
|
13422 |
+
* @see _.transform
|
13423 |
+
*/
|
13424 |
+
transform<T, TResult>(
|
13425 |
+
object: Dictionary<T>,
|
13426 |
+
iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
|
13427 |
+
accumulator?: TResult[],
|
13428 |
+
thisArg?: any
|
13429 |
+
): TResult[];
|
13430 |
+
}
|
13431 |
+
|
13432 |
+
interface LoDashImplicitArrayWrapper<T> {
|
13433 |
+
/**
|
13434 |
+
* @see _.transform
|
13435 |
+
*/
|
13436 |
+
transform<TResult>(
|
13437 |
+
iteratee?: MemoVoidArrayIterator<T, TResult[]>,
|
13438 |
+
accumulator?: TResult[],
|
13439 |
+
thisArg?: any
|
13440 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
13441 |
+
|
13442 |
+
/**
|
13443 |
+
* @see _.transform
|
13444 |
+
*/
|
13445 |
+
transform<TResult>(
|
13446 |
+
iteratee?: MemoVoidArrayIterator<T, Dictionary<TResult>>,
|
13447 |
+
accumulator?: Dictionary<TResult>,
|
13448 |
+
thisArg?: any
|
13449 |
+
): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
13450 |
+
}
|
13451 |
+
|
13452 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13453 |
+
/**
|
13454 |
+
* @see _.transform
|
13455 |
+
*/
|
13456 |
+
transform<T, TResult>(
|
13457 |
+
iteratee?: MemoVoidDictionaryIterator<T, Dictionary<TResult>>,
|
13458 |
+
accumulator?: Dictionary<TResult>,
|
13459 |
+
thisArg?: any
|
13460 |
+
): LoDashImplicitObjectWrapper<Dictionary<TResult>>;
|
13461 |
+
|
13462 |
+
/**
|
13463 |
+
* @see _.transform
|
13464 |
+
*/
|
13465 |
+
transform<T, TResult>(
|
13466 |
+
iteratee?: MemoVoidDictionaryIterator<T, TResult[]>,
|
13467 |
+
accumulator?: TResult[],
|
13468 |
+
thisArg?: any
|
13469 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
13470 |
+
}
|
13471 |
+
|
13472 |
+
//_.values
|
13473 |
+
interface LoDashStatic {
|
13474 |
+
/**
|
13475 |
+
* Creates an array of the own enumerable property values of object.
|
13476 |
+
*
|
13477 |
+
* @param object The object to query.
|
13478 |
+
* @return Returns an array of property values.
|
13479 |
+
*/
|
13480 |
+
values<T>(object?: any): T[];
|
13481 |
+
}
|
13482 |
+
|
13483 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13484 |
+
/**
|
13485 |
+
* @see _.values
|
13486 |
+
*/
|
13487 |
+
values<T>(): LoDashImplicitArrayWrapper<T>;
|
13488 |
+
}
|
13489 |
+
|
13490 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13491 |
+
/**
|
13492 |
+
* @see _.values
|
13493 |
+
*/
|
13494 |
+
values<T>(): LoDashExplicitArrayWrapper<T>;
|
13495 |
+
}
|
13496 |
+
|
13497 |
+
//_.valuesIn
|
13498 |
+
interface LoDashStatic {
|
13499 |
+
/**
|
13500 |
+
* Creates an array of the own and inherited enumerable property values of object.
|
13501 |
+
*
|
13502 |
+
* @param object The object to query.
|
13503 |
+
* @return Returns the array of property values.
|
13504 |
+
*/
|
13505 |
+
valuesIn<T>(object?: any): T[];
|
13506 |
+
}
|
13507 |
+
|
13508 |
+
interface LoDashImplicitObjectWrapper<T> {
|
13509 |
+
/**
|
13510 |
+
* @see _.valuesIn
|
13511 |
+
*/
|
13512 |
+
valuesIn<T>(): LoDashImplicitArrayWrapper<T>;
|
13513 |
+
}
|
13514 |
+
|
13515 |
+
interface LoDashExplicitObjectWrapper<T> {
|
13516 |
+
/**
|
13517 |
+
* @see _.valuesIn
|
13518 |
+
*/
|
13519 |
+
valuesIn<T>(): LoDashExplicitArrayWrapper<T>;
|
13520 |
+
}
|
13521 |
+
|
13522 |
+
/**********
|
13523 |
+
* String *
|
13524 |
+
**********/
|
13525 |
+
|
13526 |
+
//_.camelCase
|
13527 |
+
interface LoDashStatic {
|
13528 |
+
/**
|
13529 |
+
* Converts string to camel case.
|
13530 |
+
*
|
13531 |
+
* @param string The string to convert.
|
13532 |
+
* @return Returns the camel cased string.
|
13533 |
+
*/
|
13534 |
+
camelCase(string?: string): string;
|
13535 |
+
}
|
13536 |
+
|
13537 |
+
interface LoDashImplicitWrapper<T> {
|
13538 |
+
/**
|
13539 |
+
* @see _.camelCase
|
13540 |
+
*/
|
13541 |
+
camelCase(): string;
|
13542 |
+
}
|
13543 |
+
|
13544 |
+
interface LoDashExplicitWrapper<T> {
|
13545 |
+
/**
|
13546 |
+
* @see _.camelCase
|
13547 |
+
*/
|
13548 |
+
camelCase(): LoDashExplicitWrapper<string>;
|
13549 |
+
}
|
13550 |
+
|
13551 |
+
//_.capitalize
|
13552 |
+
interface LoDashStatic {
|
13553 |
+
capitalize(string?: string): string;
|
13554 |
+
}
|
13555 |
+
|
13556 |
+
interface LoDashImplicitWrapper<T> {
|
13557 |
+
/**
|
13558 |
+
* @see _.capitalize
|
13559 |
+
*/
|
13560 |
+
capitalize(): string;
|
13561 |
+
}
|
13562 |
+
|
13563 |
+
interface LoDashExplicitWrapper<T> {
|
13564 |
+
/**
|
13565 |
+
* @see _.capitalize
|
13566 |
+
*/
|
13567 |
+
capitalize(): LoDashExplicitWrapper<string>;
|
13568 |
+
}
|
13569 |
+
|
13570 |
+
//_.deburr
|
13571 |
+
interface LoDashStatic {
|
13572 |
+
/**
|
13573 |
+
* Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining
|
13574 |
+
* diacritical marks.
|
13575 |
+
*
|
13576 |
+
* @param string The string to deburr.
|
13577 |
+
* @return Returns the deburred string.
|
13578 |
+
*/
|
13579 |
+
deburr(string?: string): string;
|
13580 |
+
}
|
13581 |
+
|
13582 |
+
interface LoDashImplicitWrapper<T> {
|
13583 |
+
/**
|
13584 |
+
* @see _.deburr
|
13585 |
+
*/
|
13586 |
+
deburr(): string;
|
13587 |
+
}
|
13588 |
+
|
13589 |
+
interface LoDashExplicitWrapper<T> {
|
13590 |
+
/**
|
13591 |
+
* @see _.deburr
|
13592 |
+
*/
|
13593 |
+
deburr(): LoDashExplicitWrapper<string>;
|
13594 |
+
}
|
13595 |
+
|
13596 |
+
//_.endsWith
|
13597 |
+
interface LoDashStatic {
|
13598 |
+
/**
|
13599 |
+
* Checks if string ends with the given target string.
|
13600 |
+
*
|
13601 |
+
* @param string The string to search.
|
13602 |
+
* @param target The string to search for.
|
13603 |
+
* @param position The position to search from.
|
13604 |
+
* @return Returns true if string ends with target, else false.
|
13605 |
+
*/
|
13606 |
+
endsWith(
|
13607 |
+
string?: string,
|
13608 |
+
target?: string,
|
13609 |
+
position?: number
|
13610 |
+
): boolean;
|
13611 |
+
}
|
13612 |
+
|
13613 |
+
interface LoDashImplicitWrapper<T> {
|
13614 |
+
/**
|
13615 |
+
* @see _.endsWith
|
13616 |
+
*/
|
13617 |
+
endsWith(
|
13618 |
+
target?: string,
|
13619 |
+
position?: number
|
13620 |
+
): boolean;
|
13621 |
+
}
|
13622 |
+
|
13623 |
+
interface LoDashExplicitWrapper<T> {
|
13624 |
+
/**
|
13625 |
+
* @see _.endsWith
|
13626 |
+
*/
|
13627 |
+
endsWith(
|
13628 |
+
target?: string,
|
13629 |
+
position?: number
|
13630 |
+
): LoDashExplicitWrapper<boolean>;
|
13631 |
+
}
|
13632 |
+
|
13633 |
+
// _.escape
|
13634 |
+
interface LoDashStatic {
|
13635 |
+
/**
|
13636 |
+
* Converts the characters "&", "<", ">", '"', "'", and "`", in string to their corresponding HTML entities.
|
13637 |
+
*
|
13638 |
+
* Note: No other characters are escaped. To escape additional characters use a third-party library like he.
|
13639 |
+
*
|
13640 |
+
* Though the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML
|
13641 |
+
* and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s
|
13642 |
+
* article (under "semi-related fun fact") for more details.
|
13643 |
+
*
|
13644 |
+
* Backticks are escaped because in Internet Explorer < 9, they can break out of attribute values or HTML
|
13645 |
+
* comments. See #59, #102, #108, and #133 of the HTML5 Security Cheatsheet for more details.
|
13646 |
+
*
|
13647 |
+
* When working with HTML you should always quote attribute values to reduce XSS vectors.
|
13648 |
+
*
|
13649 |
+
* @param string The string to escape.
|
13650 |
+
* @return Returns the escaped string.
|
13651 |
+
*/
|
13652 |
+
escape(string?: string): string;
|
13653 |
+
}
|
13654 |
+
|
13655 |
+
interface LoDashImplicitWrapper<T> {
|
13656 |
+
/**
|
13657 |
+
* @see _.escape
|
13658 |
+
*/
|
13659 |
+
escape(): string;
|
13660 |
+
}
|
13661 |
+
|
13662 |
+
interface LoDashExplicitWrapper<T> {
|
13663 |
+
/**
|
13664 |
+
* @see _.escape
|
13665 |
+
*/
|
13666 |
+
escape(): LoDashExplicitWrapper<string>;
|
13667 |
+
}
|
13668 |
+
|
13669 |
+
// _.escapeRegExp
|
13670 |
+
interface LoDashStatic {
|
13671 |
+
/**
|
13672 |
+
* Escapes the RegExp special characters "\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "[", "]",
|
13673 |
+
* "{" and "}" in string.
|
13674 |
+
*
|
13675 |
+
* @param string The string to escape.
|
13676 |
+
* @return Returns the escaped string.
|
13677 |
+
*/
|
13678 |
+
escapeRegExp(string?: string): string;
|
13679 |
+
}
|
13680 |
+
|
13681 |
+
interface LoDashImplicitWrapper<T> {
|
13682 |
+
/**
|
13683 |
+
* @see _.escapeRegExp
|
13684 |
+
*/
|
13685 |
+
escapeRegExp(): string;
|
13686 |
+
}
|
13687 |
+
|
13688 |
+
interface LoDashExplicitWrapper<T> {
|
13689 |
+
/**
|
13690 |
+
* @see _.escapeRegExp
|
13691 |
+
*/
|
13692 |
+
escapeRegExp(): LoDashExplicitWrapper<string>;
|
13693 |
+
}
|
13694 |
+
|
13695 |
+
//_.kebabCase
|
13696 |
+
interface LoDashStatic {
|
13697 |
+
/**
|
13698 |
+
* Converts string to kebab case.
|
13699 |
+
*
|
13700 |
+
* @param string The string to convert.
|
13701 |
+
* @return Returns the kebab cased string.
|
13702 |
+
*/
|
13703 |
+
kebabCase(string?: string): string;
|
13704 |
+
}
|
13705 |
+
|
13706 |
+
interface LoDashImplicitWrapper<T> {
|
13707 |
+
/**
|
13708 |
+
* @see _.kebabCase
|
13709 |
+
*/
|
13710 |
+
kebabCase(): string;
|
13711 |
+
}
|
13712 |
+
|
13713 |
+
interface LoDashExplicitWrapper<T> {
|
13714 |
+
/**
|
13715 |
+
* @see _.kebabCase
|
13716 |
+
*/
|
13717 |
+
kebabCase(): LoDashExplicitWrapper<string>;
|
13718 |
+
}
|
13719 |
+
|
13720 |
+
//_.pad
|
13721 |
+
interface LoDashStatic {
|
13722 |
+
/**
|
13723 |
+
* Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if
|
13724 |
+
* they can’t be evenly divided by length.
|
13725 |
+
*
|
13726 |
+
* @param string The string to pad.
|
13727 |
+
* @param length The padding length.
|
13728 |
+
* @param chars The string used as padding.
|
13729 |
+
* @return Returns the padded string.
|
13730 |
+
*/
|
13731 |
+
pad(
|
13732 |
+
string?: string,
|
13733 |
+
length?: number,
|
13734 |
+
chars?: string
|
13735 |
+
): string;
|
13736 |
+
}
|
13737 |
+
|
13738 |
+
interface LoDashImplicitWrapper<T> {
|
13739 |
+
/**
|
13740 |
+
* @see _.pad
|
13741 |
+
*/
|
13742 |
+
pad(
|
13743 |
+
length?: number,
|
13744 |
+
chars?: string
|
13745 |
+
): string;
|
13746 |
+
}
|
13747 |
+
|
13748 |
+
interface LoDashExplicitWrapper<T> {
|
13749 |
+
/**
|
13750 |
+
* @see _.pad
|
13751 |
+
*/
|
13752 |
+
pad(
|
13753 |
+
length?: number,
|
13754 |
+
chars?: string
|
13755 |
+
): LoDashExplicitWrapper<string>;
|
13756 |
+
}
|
13757 |
+
|
13758 |
+
//_.padLeft
|
13759 |
+
interface LoDashStatic {
|
13760 |
+
/**
|
13761 |
+
* Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed
|
13762 |
+
* length.
|
13763 |
+
*
|
13764 |
+
* @param string The string to pad.
|
13765 |
+
* @param length The padding length.
|
13766 |
+
* @param chars The string used as padding.
|
13767 |
+
* @return Returns the padded string.
|
13768 |
+
*/
|
13769 |
+
padLeft(
|
13770 |
+
string?: string,
|
13771 |
+
length?: number,
|
13772 |
+
chars?: string
|
13773 |
+
): string;
|
13774 |
+
}
|
13775 |
+
|
13776 |
+
interface LoDashImplicitWrapper<T> {
|
13777 |
+
/**
|
13778 |
+
* @see _.padLeft
|
13779 |
+
*/
|
13780 |
+
padLeft(
|
13781 |
+
length?: number,
|
13782 |
+
chars?: string
|
13783 |
+
): string;
|
13784 |
+
}
|
13785 |
+
|
13786 |
+
interface LoDashExplicitWrapper<T> {
|
13787 |
+
/**
|
13788 |
+
* @see _.padLeft
|
13789 |
+
*/
|
13790 |
+
padLeft(
|
13791 |
+
length?: number,
|
13792 |
+
chars?: string
|
13793 |
+
): LoDashExplicitWrapper<string>;
|
13794 |
+
}
|
13795 |
+
|
13796 |
+
//_.padRight
|
13797 |
+
interface LoDashStatic {
|
13798 |
+
/**
|
13799 |
+
* Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed
|
13800 |
+
* length.
|
13801 |
+
*
|
13802 |
+
* @param string The string to pad.
|
13803 |
+
* @param length The padding length.
|
13804 |
+
* @param chars The string used as padding.
|
13805 |
+
* @return Returns the padded string.
|
13806 |
+
*/
|
13807 |
+
padRight(
|
13808 |
+
string?: string,
|
13809 |
+
length?: number,
|
13810 |
+
chars?: string
|
13811 |
+
): string;
|
13812 |
+
}
|
13813 |
+
|
13814 |
+
interface LoDashImplicitWrapper<T> {
|
13815 |
+
/**
|
13816 |
+
* @see _.padRight
|
13817 |
+
*/
|
13818 |
+
padRight(
|
13819 |
+
length?: number,
|
13820 |
+
chars?: string
|
13821 |
+
): string;
|
13822 |
+
}
|
13823 |
+
|
13824 |
+
interface LoDashExplicitWrapper<T> {
|
13825 |
+
/**
|
13826 |
+
* @see _.padRight
|
13827 |
+
*/
|
13828 |
+
padRight(
|
13829 |
+
length?: number,
|
13830 |
+
chars?: string
|
13831 |
+
): LoDashExplicitWrapper<string>;
|
13832 |
+
}
|
13833 |
+
|
13834 |
+
//_.parseInt
|
13835 |
+
interface LoDashStatic {
|
13836 |
+
/**
|
13837 |
+
* Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used
|
13838 |
+
* unless value is a hexadecimal, in which case a radix of 16 is used.
|
13839 |
+
*
|
13840 |
+
* Note: This method aligns with the ES5 implementation of parseInt.
|
13841 |
+
*
|
13842 |
+
* @param string The string to convert.
|
13843 |
+
* @param radix The radix to interpret value by.
|
13844 |
+
* @return Returns the converted integer.
|
13845 |
+
*/
|
13846 |
+
parseInt(
|
13847 |
+
string: string,
|
13848 |
+
radix?: number
|
13849 |
+
): number;
|
13850 |
+
}
|
13851 |
+
|
13852 |
+
interface LoDashImplicitWrapper<T> {
|
13853 |
+
/**
|
13854 |
+
* @see _.parseInt
|
13855 |
+
*/
|
13856 |
+
parseInt(radix?: number): number;
|
13857 |
+
}
|
13858 |
+
|
13859 |
+
interface LoDashExplicitWrapper<T> {
|
13860 |
+
/**
|
13861 |
+
* @see _.parseInt
|
13862 |
+
*/
|
13863 |
+
parseInt(radix?: number): LoDashExplicitWrapper<number>;
|
13864 |
+
}
|
13865 |
+
|
13866 |
+
//_.repeat
|
13867 |
+
interface LoDashStatic {
|
13868 |
+
/**
|
13869 |
+
* Repeats the given string n times.
|
13870 |
+
*
|
13871 |
+
* @param string The string to repeat.
|
13872 |
+
* @param n The number of times to repeat the string.
|
13873 |
+
* @return Returns the repeated string.
|
13874 |
+
*/
|
13875 |
+
repeat(
|
13876 |
+
string?: string,
|
13877 |
+
n?: number
|
13878 |
+
): string;
|
13879 |
+
}
|
13880 |
+
|
13881 |
+
interface LoDashImplicitWrapper<T> {
|
13882 |
+
/**
|
13883 |
+
* @see _.repeat
|
13884 |
+
*/
|
13885 |
+
repeat(n?: number): string;
|
13886 |
+
}
|
13887 |
+
|
13888 |
+
interface LoDashExplicitWrapper<T> {
|
13889 |
+
/**
|
13890 |
+
* @see _.repeat
|
13891 |
+
*/
|
13892 |
+
repeat(n?: number): LoDashExplicitWrapper<string>;
|
13893 |
+
}
|
13894 |
+
|
13895 |
+
//_.snakeCase
|
13896 |
+
interface LoDashStatic {
|
13897 |
+
/**
|
13898 |
+
* Converts string to snake case.
|
13899 |
+
*
|
13900 |
+
* @param string The string to convert.
|
13901 |
+
* @return Returns the snake cased string.
|
13902 |
+
*/
|
13903 |
+
snakeCase(string?: string): string;
|
13904 |
+
}
|
13905 |
+
|
13906 |
+
interface LoDashImplicitWrapper<T> {
|
13907 |
+
/**
|
13908 |
+
* @see _.snakeCase
|
13909 |
+
*/
|
13910 |
+
snakeCase(): string;
|
13911 |
+
}
|
13912 |
+
|
13913 |
+
interface LoDashExplicitWrapper<T> {
|
13914 |
+
/**
|
13915 |
+
* @see _.snakeCase
|
13916 |
+
*/
|
13917 |
+
snakeCase(): LoDashExplicitWrapper<string>;
|
13918 |
+
}
|
13919 |
+
|
13920 |
+
//_.startCase
|
13921 |
+
interface LoDashStatic {
|
13922 |
+
/**
|
13923 |
+
* Converts string to start case.
|
13924 |
+
*
|
13925 |
+
* @param string The string to convert.
|
13926 |
+
* @return Returns the start cased string.
|
13927 |
+
*/
|
13928 |
+
startCase(string?: string): string;
|
13929 |
+
}
|
13930 |
+
|
13931 |
+
interface LoDashImplicitWrapper<T> {
|
13932 |
+
/**
|
13933 |
+
* @see _.startCase
|
13934 |
+
*/
|
13935 |
+
startCase(): string;
|
13936 |
+
}
|
13937 |
+
|
13938 |
+
interface LoDashExplicitWrapper<T> {
|
13939 |
+
/**
|
13940 |
+
* @see _.startCase
|
13941 |
+
*/
|
13942 |
+
startCase(): LoDashExplicitWrapper<string>;
|
13943 |
+
}
|
13944 |
+
|
13945 |
+
//_.startsWith
|
13946 |
+
interface LoDashStatic {
|
13947 |
+
/**
|
13948 |
+
* Checks if string starts with the given target string.
|
13949 |
+
*
|
13950 |
+
* @param string The string to search.
|
13951 |
+
* @param target The string to search for.
|
13952 |
+
* @param position The position to search from.
|
13953 |
+
* @return Returns true if string starts with target, else false.
|
13954 |
+
*/
|
13955 |
+
startsWith(
|
13956 |
+
string?: string,
|
13957 |
+
target?: string,
|
13958 |
+
position?: number
|
13959 |
+
): boolean;
|
13960 |
+
}
|
13961 |
+
|
13962 |
+
interface LoDashImplicitWrapper<T> {
|
13963 |
+
/**
|
13964 |
+
* @see _.startsWith
|
13965 |
+
*/
|
13966 |
+
startsWith(
|
13967 |
+
target?: string,
|
13968 |
+
position?: number
|
13969 |
+
): boolean;
|
13970 |
+
}
|
13971 |
+
|
13972 |
+
interface LoDashExplicitWrapper<T> {
|
13973 |
+
/**
|
13974 |
+
* @see _.startsWith
|
13975 |
+
*/
|
13976 |
+
startsWith(
|
13977 |
+
target?: string,
|
13978 |
+
position?: number
|
13979 |
+
): LoDashExplicitWrapper<boolean>;
|
13980 |
+
}
|
13981 |
+
|
13982 |
+
//_.template
|
13983 |
+
interface TemplateOptions extends TemplateSettings {
|
13984 |
+
/**
|
13985 |
+
* The sourceURL of the template's compiled source.
|
13986 |
+
*/
|
13987 |
+
sourceURL?: string;
|
13988 |
+
}
|
13989 |
+
|
13990 |
+
interface TemplateExecutor {
|
13991 |
+
(data?: Object): string;
|
13992 |
+
source: string;
|
13993 |
+
}
|
13994 |
+
|
13995 |
+
interface LoDashStatic {
|
13996 |
+
/**
|
13997 |
+
* Creates a compiled template function that can interpolate data properties in "interpolate" delimiters,
|
13998 |
+
* HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate"
|
13999 |
+
* delimiters. Data properties may be accessed as free variables in the template. If a setting object is
|
14000 |
+
* provided it takes precedence over _.templateSettings values.
|
14001 |
+
*
|
14002 |
+
* Note: In the development build _.template utilizes
|
14003 |
+
* [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier
|
14004 |
+
* debugging.
|
14005 |
+
*
|
14006 |
+
* For more information on precompiling templates see
|
14007 |
+
* [lodash's custom builds documentation](https://lodash.com/custom-builds).
|
14008 |
+
*
|
14009 |
+
* For more information on Chrome extension sandboxes see
|
14010 |
+
* [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
|
14011 |
+
*
|
14012 |
+
* @param string The template string.
|
14013 |
+
* @param options The options object.
|
14014 |
+
* @param options.escape The HTML "escape" delimiter.
|
14015 |
+
* @param options.evaluate The "evaluate" delimiter.
|
14016 |
+
* @param options.imports An object to import into the template as free variables.
|
14017 |
+
* @param options.interpolate The "interpolate" delimiter.
|
14018 |
+
* @param options.sourceURL The sourceURL of the template's compiled source.
|
14019 |
+
* @param options.variable The data object variable name.
|
14020 |
+
* @return Returns the compiled template function.
|
14021 |
+
*/
|
14022 |
+
template(
|
14023 |
+
string: string,
|
14024 |
+
options?: TemplateOptions
|
14025 |
+
): TemplateExecutor;
|
14026 |
+
}
|
14027 |
+
|
14028 |
+
interface LoDashImplicitWrapper<T> {
|
14029 |
+
/**
|
14030 |
+
* @see _.template
|
14031 |
+
*/
|
14032 |
+
template(options?: TemplateOptions): TemplateExecutor;
|
14033 |
+
}
|
14034 |
+
|
14035 |
+
interface LoDashExplicitWrapper<T> {
|
14036 |
+
/**
|
14037 |
+
* @see _.template
|
14038 |
+
*/
|
14039 |
+
template(options?: TemplateOptions): LoDashExplicitObjectWrapper<TemplateExecutor>;
|
14040 |
+
}
|
14041 |
+
|
14042 |
+
//_.trim
|
14043 |
+
interface LoDashStatic {
|
14044 |
+
/**
|
14045 |
+
* Removes leading and trailing whitespace or specified characters from string.
|
14046 |
+
*
|
14047 |
+
* @param string The string to trim.
|
14048 |
+
* @param chars The characters to trim.
|
14049 |
+
* @return Returns the trimmed string.
|
14050 |
+
*/
|
14051 |
+
trim(
|
14052 |
+
string?: string,
|
14053 |
+
chars?: string
|
14054 |
+
): string;
|
14055 |
+
}
|
14056 |
+
|
14057 |
+
interface LoDashImplicitWrapper<T> {
|
14058 |
+
/**
|
14059 |
+
* @see _.trim
|
14060 |
+
*/
|
14061 |
+
trim(chars?: string): string;
|
14062 |
+
}
|
14063 |
+
|
14064 |
+
interface LoDashExplicitWrapper<T> {
|
14065 |
+
/**
|
14066 |
+
* @see _.trim
|
14067 |
+
*/
|
14068 |
+
trim(chars?: string): LoDashExplicitWrapper<string>;
|
14069 |
+
}
|
14070 |
+
|
14071 |
+
//_.trimLeft
|
14072 |
+
interface LoDashStatic {
|
14073 |
+
/**
|
14074 |
+
* Removes leading whitespace or specified characters from string.
|
14075 |
+
*
|
14076 |
+
* @param string The string to trim.
|
14077 |
+
* @param chars The characters to trim.
|
14078 |
+
* @return Returns the trimmed string.
|
14079 |
+
*/
|
14080 |
+
trimLeft(
|
14081 |
+
string?: string,
|
14082 |
+
chars?: string
|
14083 |
+
): string;
|
14084 |
+
}
|
14085 |
+
|
14086 |
+
interface LoDashImplicitWrapper<T> {
|
14087 |
+
/**
|
14088 |
+
* @see _.trimLeft
|
14089 |
+
*/
|
14090 |
+
trimLeft(chars?: string): string;
|
14091 |
+
}
|
14092 |
+
|
14093 |
+
interface LoDashExplicitWrapper<T> {
|
14094 |
+
/**
|
14095 |
+
* @see _.trimLeft
|
14096 |
+
*/
|
14097 |
+
trimLeft(chars?: string): LoDashExplicitWrapper<string>;
|
14098 |
+
}
|
14099 |
+
|
14100 |
+
//_.trimRight
|
14101 |
+
interface LoDashStatic {
|
14102 |
+
/**
|
14103 |
+
* Removes trailing whitespace or specified characters from string.
|
14104 |
+
*
|
14105 |
+
* @param string The string to trim.
|
14106 |
+
* @param chars The characters to trim.
|
14107 |
+
* @return Returns the trimmed string.
|
14108 |
+
*/
|
14109 |
+
trimRight(
|
14110 |
+
string?: string,
|
14111 |
+
chars?: string
|
14112 |
+
): string;
|
14113 |
+
}
|
14114 |
+
|
14115 |
+
interface LoDashImplicitWrapper<T> {
|
14116 |
+
/**
|
14117 |
+
* @see _.trimRight
|
14118 |
+
*/
|
14119 |
+
trimRight(chars?: string): string;
|
14120 |
+
}
|
14121 |
+
|
14122 |
+
interface LoDashExplicitWrapper<T> {
|
14123 |
+
/**
|
14124 |
+
* @see _.trimRight
|
14125 |
+
*/
|
14126 |
+
trimRight(chars?: string): LoDashExplicitWrapper<string>;
|
14127 |
+
}
|
14128 |
+
|
14129 |
+
//_.trunc
|
14130 |
+
interface TruncOptions {
|
14131 |
+
/** The maximum string length. */
|
14132 |
+
length?: number;
|
14133 |
+
/** The string to indicate text is omitted. */
|
14134 |
+
omission?: string;
|
14135 |
+
/** The separator pattern to truncate to. */
|
14136 |
+
separator?: string|RegExp;
|
14137 |
+
}
|
14138 |
+
|
14139 |
+
interface LoDashStatic {
|
14140 |
+
/**
|
14141 |
+
* Truncates string if it’s longer than the given maximum string length. The last characters of the truncated
|
14142 |
+
* string are replaced with the omission string which defaults to "…".
|
14143 |
+
*
|
14144 |
+
* @param string The string to truncate.
|
14145 |
+
* @param options The options object or maximum string length.
|
14146 |
+
* @return Returns the truncated string.
|
14147 |
+
*/
|
14148 |
+
trunc(
|
14149 |
+
string?: string,
|
14150 |
+
options?: TruncOptions|number
|
14151 |
+
): string;
|
14152 |
+
}
|
14153 |
+
|
14154 |
+
interface LoDashImplicitWrapper<T> {
|
14155 |
+
/**
|
14156 |
+
* @see _.trunc
|
14157 |
+
*/
|
14158 |
+
trunc(options?: TruncOptions|number): string;
|
14159 |
+
}
|
14160 |
+
|
14161 |
+
interface LoDashExplicitWrapper<T> {
|
14162 |
+
/**
|
14163 |
+
* @see _.trunc
|
14164 |
+
*/
|
14165 |
+
trunc(options?: TruncOptions|number): LoDashExplicitWrapper<string>;
|
14166 |
+
}
|
14167 |
+
|
14168 |
+
//_.unescape
|
14169 |
+
interface LoDashStatic {
|
14170 |
+
/**
|
14171 |
+
* The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and `
|
14172 |
+
* in string to their corresponding characters.
|
14173 |
+
*
|
14174 |
+
* @param string The string to unescape.
|
14175 |
+
* @return Returns the unescaped string.
|
14176 |
+
*/
|
14177 |
+
unescape(string?: string): string;
|
14178 |
+
}
|
14179 |
+
|
14180 |
+
interface LoDashImplicitWrapper<T> {
|
14181 |
+
/**
|
14182 |
+
* @see _.unescape
|
14183 |
+
*/
|
14184 |
+
unescape(): string;
|
14185 |
+
}
|
14186 |
+
|
14187 |
+
interface LoDashExplicitWrapper<T> {
|
14188 |
+
/**
|
14189 |
+
* @see _.unescape
|
14190 |
+
*/
|
14191 |
+
unescape(): LoDashExplicitWrapper<string>;
|
14192 |
+
}
|
14193 |
+
|
14194 |
+
//_.words
|
14195 |
+
interface LoDashStatic {
|
14196 |
+
/**
|
14197 |
+
* Splits string into an array of its words.
|
14198 |
+
*
|
14199 |
+
* @param string The string to inspect.
|
14200 |
+
* @param pattern The pattern to match words.
|
14201 |
+
* @return Returns the words of string.
|
14202 |
+
*/
|
14203 |
+
words(
|
14204 |
+
string?: string,
|
14205 |
+
pattern?: string|RegExp
|
14206 |
+
): string[];
|
14207 |
+
}
|
14208 |
+
|
14209 |
+
interface LoDashImplicitWrapper<T> {
|
14210 |
+
/**
|
14211 |
+
* @see _.words
|
14212 |
+
*/
|
14213 |
+
words(pattern?: string|RegExp): string[];
|
14214 |
+
}
|
14215 |
+
|
14216 |
+
interface LoDashExplicitWrapper<T> {
|
14217 |
+
/**
|
14218 |
+
* @see _.words
|
14219 |
+
*/
|
14220 |
+
words(pattern?: string|RegExp): LoDashExplicitArrayWrapper<string>;
|
14221 |
+
}
|
14222 |
+
|
14223 |
+
/***********
|
14224 |
+
* Utility *
|
14225 |
+
***********/
|
14226 |
+
|
14227 |
+
//_.attempt
|
14228 |
+
interface LoDashStatic {
|
14229 |
+
/**
|
14230 |
+
* Attempts to invoke func, returning either the result or the caught error object. Any additional arguments
|
14231 |
+
* are provided to func when it’s invoked.
|
14232 |
+
*
|
14233 |
+
* @param func The function to attempt.
|
14234 |
+
* @return Returns the func result or error object.
|
14235 |
+
*/
|
14236 |
+
attempt<TResult>(func: (...args: any[]) => TResult, ...args: any[]): TResult|Error;
|
14237 |
+
}
|
14238 |
+
|
14239 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14240 |
+
/**
|
14241 |
+
* @see _.attempt
|
14242 |
+
*/
|
14243 |
+
attempt<TResult>(...args: any[]): TResult|Error;
|
14244 |
+
}
|
14245 |
+
|
14246 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14247 |
+
/**
|
14248 |
+
* @see _.attempt
|
14249 |
+
*/
|
14250 |
+
attempt<TResult>(...args: any[]): LoDashExplicitObjectWrapper<TResult|Error>;
|
14251 |
+
}
|
14252 |
+
|
14253 |
+
//_.callback
|
14254 |
+
interface LoDashStatic {
|
14255 |
+
/**
|
14256 |
+
* Creates a function that invokes func with the this binding of thisArg and arguments of the created function.
|
14257 |
+
* If func is a property name the created callback returns the property value for a given element. If func is
|
14258 |
+
* an object the created callback returns true for elements that contain the equivalent object properties,
|
14259 |
+
* otherwise it returns false.
|
14260 |
+
*
|
14261 |
+
* @param func The value to convert to a callback.
|
14262 |
+
* @param thisArg The this binding of func.
|
14263 |
+
* @result Returns the callback.
|
14264 |
+
*/
|
14265 |
+
callback<TResult>(
|
14266 |
+
func: Function,
|
14267 |
+
thisArg?: any
|
14268 |
+
): (...args: any[]) => TResult;
|
14269 |
+
|
14270 |
+
/**
|
14271 |
+
* @see _.callback
|
14272 |
+
*/
|
14273 |
+
callback<TResult>(
|
14274 |
+
func: string,
|
14275 |
+
thisArg?: any
|
14276 |
+
): (object: any) => TResult;
|
14277 |
+
|
14278 |
+
/**
|
14279 |
+
* @see _.callback
|
14280 |
+
*/
|
14281 |
+
callback(
|
14282 |
+
func: Object,
|
14283 |
+
thisArg?: any
|
14284 |
+
): (object: any) => boolean;
|
14285 |
+
|
14286 |
+
/**
|
14287 |
+
* @see _.callback
|
14288 |
+
*/
|
14289 |
+
callback<TResult>(): (value: TResult) => TResult;
|
14290 |
+
}
|
14291 |
+
|
14292 |
+
interface LoDashImplicitWrapper<T> {
|
14293 |
+
/**
|
14294 |
+
* @see _.callback
|
14295 |
+
*/
|
14296 |
+
callback<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
|
14297 |
+
}
|
14298 |
+
|
14299 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14300 |
+
/**
|
14301 |
+
* @see _.callback
|
14302 |
+
*/
|
14303 |
+
callback(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;
|
14304 |
+
|
14305 |
+
/**
|
14306 |
+
* @see _.callback
|
14307 |
+
*/
|
14308 |
+
callback<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
|
14309 |
+
}
|
14310 |
+
|
14311 |
+
interface LoDashExplicitWrapper<T> {
|
14312 |
+
/**
|
14313 |
+
* @see _.callback
|
14314 |
+
*/
|
14315 |
+
callback<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>;
|
14316 |
+
}
|
14317 |
+
|
14318 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14319 |
+
/**
|
14320 |
+
* @see _.callback
|
14321 |
+
*/
|
14322 |
+
callback(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>;
|
14323 |
+
|
14324 |
+
/**
|
14325 |
+
* @see _.callback
|
14326 |
+
*/
|
14327 |
+
callback<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>;
|
14328 |
+
}
|
14329 |
+
|
14330 |
+
//_.constant
|
14331 |
+
interface LoDashStatic {
|
14332 |
+
/**
|
14333 |
+
* Creates a function that returns value.
|
14334 |
+
*
|
14335 |
+
* @param value The value to return from the new function.
|
14336 |
+
* @return Returns the new function.
|
14337 |
+
*/
|
14338 |
+
constant<T>(value: T): () => T;
|
14339 |
+
}
|
14340 |
+
|
14341 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
14342 |
+
/**
|
14343 |
+
* @see _.constant
|
14344 |
+
*/
|
14345 |
+
constant<TResult>(): LoDashImplicitObjectWrapper<() => TResult>;
|
14346 |
+
}
|
14347 |
+
|
14348 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
14349 |
+
/**
|
14350 |
+
* @see _.constant
|
14351 |
+
*/
|
14352 |
+
constant<TResult>(): LoDashExplicitObjectWrapper<() => TResult>;
|
14353 |
+
}
|
14354 |
+
|
14355 |
+
//_.identity
|
14356 |
+
interface LoDashStatic {
|
14357 |
+
/**
|
14358 |
+
* This method returns the first argument provided to it.
|
14359 |
+
* @param value Any value.
|
14360 |
+
* @return Returns value.
|
14361 |
+
*/
|
14362 |
+
identity<T>(value?: T): T;
|
14363 |
+
}
|
14364 |
+
|
14365 |
+
interface LoDashImplicitWrapper<T> {
|
14366 |
+
/**
|
14367 |
+
* @see _.identity
|
14368 |
+
*/
|
14369 |
+
identity(): T;
|
14370 |
+
}
|
14371 |
+
|
14372 |
+
interface LoDashImplicitArrayWrapper<T> {
|
14373 |
+
/**
|
14374 |
+
* @see _.identity
|
14375 |
+
*/
|
14376 |
+
identity(): T[];
|
14377 |
+
}
|
14378 |
+
|
14379 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14380 |
+
/**
|
14381 |
+
* @see _.identity
|
14382 |
+
*/
|
14383 |
+
identity(): T;
|
14384 |
+
}
|
14385 |
+
|
14386 |
+
//_.iteratee
|
14387 |
+
interface LoDashStatic {
|
14388 |
+
/**
|
14389 |
+
* @see _.callback
|
14390 |
+
*/
|
14391 |
+
iteratee<TResult>(
|
14392 |
+
func: Function,
|
14393 |
+
thisArg?: any
|
14394 |
+
): (...args: any[]) => TResult;
|
14395 |
+
|
14396 |
+
/**
|
14397 |
+
* @see _.callback
|
14398 |
+
*/
|
14399 |
+
iteratee<TResult>(
|
14400 |
+
func: string,
|
14401 |
+
thisArg?: any
|
14402 |
+
): (object: any) => TResult;
|
14403 |
+
|
14404 |
+
/**
|
14405 |
+
* @see _.callback
|
14406 |
+
*/
|
14407 |
+
iteratee(
|
14408 |
+
func: Object,
|
14409 |
+
thisArg?: any
|
14410 |
+
): (object: any) => boolean;
|
14411 |
+
|
14412 |
+
/**
|
14413 |
+
* @see _.callback
|
14414 |
+
*/
|
14415 |
+
iteratee<TResult>(): (value: TResult) => TResult;
|
14416 |
+
}
|
14417 |
+
|
14418 |
+
interface LoDashImplicitWrapper<T> {
|
14419 |
+
/**
|
14420 |
+
* @see _.callback
|
14421 |
+
*/
|
14422 |
+
iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
|
14423 |
+
}
|
14424 |
+
|
14425 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14426 |
+
/**
|
14427 |
+
* @see _.callback
|
14428 |
+
*/
|
14429 |
+
iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;
|
14430 |
+
|
14431 |
+
/**
|
14432 |
+
* @see _.callback
|
14433 |
+
*/
|
14434 |
+
iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
|
14435 |
+
}
|
14436 |
+
|
14437 |
+
interface LoDashExplicitWrapper<T> {
|
14438 |
+
/**
|
14439 |
+
* @see _.callback
|
14440 |
+
*/
|
14441 |
+
iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>;
|
14442 |
+
}
|
14443 |
+
|
14444 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14445 |
+
/**
|
14446 |
+
* @see _.callback
|
14447 |
+
*/
|
14448 |
+
iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>;
|
14449 |
+
|
14450 |
+
/**
|
14451 |
+
* @see _.callback
|
14452 |
+
*/
|
14453 |
+
iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>;
|
14454 |
+
}
|
14455 |
+
|
14456 |
+
//_.matches
|
14457 |
+
interface LoDashStatic {
|
14458 |
+
/**
|
14459 |
+
* Creates a function that performs a deep comparison between a given object and source, returning true if the
|
14460 |
+
* given object has equivalent property values, else false.
|
14461 |
+
*
|
14462 |
+
* Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
|
14463 |
+
* strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own
|
14464 |
+
* or inherited property value see _.matchesProperty.
|
14465 |
+
*
|
14466 |
+
* @param source The object of property values to match.
|
14467 |
+
* @return Returns the new function.
|
14468 |
+
*/
|
14469 |
+
matches<T>(source: T): (value: any) => boolean;
|
14470 |
+
|
14471 |
+
/**
|
14472 |
+
* @see _.matches
|
14473 |
+
*/
|
14474 |
+
matches<T, V>(source: T): (value: V) => boolean;
|
14475 |
+
}
|
14476 |
+
|
14477 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
14478 |
+
/**
|
14479 |
+
* @see _.matches
|
14480 |
+
*/
|
14481 |
+
matches<V>(): LoDashImplicitObjectWrapper<(value: V) => boolean>;
|
14482 |
+
}
|
14483 |
+
|
14484 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
14485 |
+
/**
|
14486 |
+
* @see _.matches
|
14487 |
+
*/
|
14488 |
+
matches<V>(): LoDashExplicitObjectWrapper<(value: V) => boolean>;
|
14489 |
+
}
|
14490 |
+
|
14491 |
+
//_.matchesProperty
|
14492 |
+
interface LoDashStatic {
|
14493 |
+
/**
|
14494 |
+
* Creates a function that compares the property value of path on a given object to value.
|
14495 |
+
*
|
14496 |
+
* Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
|
14497 |
+
* strings. Objects are compared by their own, not inherited, enumerable properties.
|
14498 |
+
*
|
14499 |
+
* @param path The path of the property to get.
|
14500 |
+
* @param srcValue The value to match.
|
14501 |
+
* @return Returns the new function.
|
14502 |
+
*/
|
14503 |
+
matchesProperty<T>(
|
14504 |
+
path: StringRepresentable|StringRepresentable[],
|
14505 |
+
srcValue: T
|
14506 |
+
): (value: any) => boolean;
|
14507 |
+
|
14508 |
+
/**
|
14509 |
+
* @see _.matchesProperty
|
14510 |
+
*/
|
14511 |
+
matchesProperty<T, V>(
|
14512 |
+
path: StringRepresentable|StringRepresentable[],
|
14513 |
+
srcValue: T
|
14514 |
+
): (value: V) => boolean;
|
14515 |
+
}
|
14516 |
+
|
14517 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
14518 |
+
/**
|
14519 |
+
* @see _.matchesProperty
|
14520 |
+
*/
|
14521 |
+
matchesProperty<SrcValue>(
|
14522 |
+
srcValue: SrcValue
|
14523 |
+
): LoDashImplicitObjectWrapper<(value: any) => boolean>;
|
14524 |
+
|
14525 |
+
/**
|
14526 |
+
* @see _.matchesProperty
|
14527 |
+
*/
|
14528 |
+
matchesProperty<SrcValue, Value>(
|
14529 |
+
srcValue: SrcValue
|
14530 |
+
): LoDashImplicitObjectWrapper<(value: Value) => boolean>;
|
14531 |
+
}
|
14532 |
+
|
14533 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
14534 |
+
/**
|
14535 |
+
* @see _.matchesProperty
|
14536 |
+
*/
|
14537 |
+
matchesProperty<SrcValue>(
|
14538 |
+
srcValue: SrcValue
|
14539 |
+
): LoDashExplicitObjectWrapper<(value: any) => boolean>;
|
14540 |
+
|
14541 |
+
/**
|
14542 |
+
* @see _.matchesProperty
|
14543 |
+
*/
|
14544 |
+
matchesProperty<SrcValue, Value>(
|
14545 |
+
srcValue: SrcValue
|
14546 |
+
): LoDashExplicitObjectWrapper<(value: Value) => boolean>;
|
14547 |
+
}
|
14548 |
+
|
14549 |
+
//_.method
|
14550 |
+
interface LoDashStatic {
|
14551 |
+
/**
|
14552 |
+
* Creates a function that invokes the method at path on a given object. Any additional arguments are provided
|
14553 |
+
* to the invoked method.
|
14554 |
+
*
|
14555 |
+
* @param path The path of the method to invoke.
|
14556 |
+
* @param args The arguments to invoke the method with.
|
14557 |
+
* @return Returns the new function.
|
14558 |
+
*/
|
14559 |
+
method<TObject, TResult>(
|
14560 |
+
path: string|StringRepresentable[],
|
14561 |
+
...args: any[]
|
14562 |
+
): (object: TObject) => TResult;
|
14563 |
+
|
14564 |
+
/**
|
14565 |
+
* @see _.method
|
14566 |
+
*/
|
14567 |
+
method<TResult>(
|
14568 |
+
path: string|StringRepresentable[],
|
14569 |
+
...args: any[]
|
14570 |
+
): (object: any) => TResult;
|
14571 |
+
}
|
14572 |
+
|
14573 |
+
interface LoDashImplicitWrapper<T> {
|
14574 |
+
/**
|
14575 |
+
* @see _.method
|
14576 |
+
*/
|
14577 |
+
method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
|
14578 |
+
|
14579 |
+
/**
|
14580 |
+
* @see _.method
|
14581 |
+
*/
|
14582 |
+
method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
|
14583 |
+
}
|
14584 |
+
|
14585 |
+
interface LoDashImplicitArrayWrapper<T> {
|
14586 |
+
/**
|
14587 |
+
* @see _.method
|
14588 |
+
*/
|
14589 |
+
method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;
|
14590 |
+
|
14591 |
+
/**
|
14592 |
+
* @see _.method
|
14593 |
+
*/
|
14594 |
+
method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
|
14595 |
+
}
|
14596 |
+
|
14597 |
+
interface LoDashExplicitWrapper<T> {
|
14598 |
+
/**
|
14599 |
+
* @see _.method
|
14600 |
+
*/
|
14601 |
+
method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
|
14602 |
+
|
14603 |
+
/**
|
14604 |
+
* @see _.method
|
14605 |
+
*/
|
14606 |
+
method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
|
14607 |
+
}
|
14608 |
+
|
14609 |
+
interface LoDashExplicitArrayWrapper<T> {
|
14610 |
+
/**
|
14611 |
+
* @see _.method
|
14612 |
+
*/
|
14613 |
+
method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;
|
14614 |
+
|
14615 |
+
/**
|
14616 |
+
* @see _.method
|
14617 |
+
*/
|
14618 |
+
method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
|
14619 |
+
}
|
14620 |
+
|
14621 |
+
//_.methodOf
|
14622 |
+
interface LoDashStatic {
|
14623 |
+
/**
|
14624 |
+
* The opposite of _.method; this method creates a function that invokes the method at a given path on object.
|
14625 |
+
* Any additional arguments are provided to the invoked method.
|
14626 |
+
*
|
14627 |
+
* @param object The object to query.
|
14628 |
+
* @param args The arguments to invoke the method with.
|
14629 |
+
* @return Returns the new function.
|
14630 |
+
*/
|
14631 |
+
methodOf<TObject extends {}, TResult>(
|
14632 |
+
object: TObject,
|
14633 |
+
...args: any[]
|
14634 |
+
): (path: StringRepresentable|StringRepresentable[]) => TResult;
|
14635 |
+
|
14636 |
+
/**
|
14637 |
+
* @see _.methodOf
|
14638 |
+
*/
|
14639 |
+
methodOf<TResult>(
|
14640 |
+
object: {},
|
14641 |
+
...args: any[]
|
14642 |
+
): (path: StringRepresentable|StringRepresentable[]) => TResult;
|
14643 |
+
}
|
14644 |
+
|
14645 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14646 |
+
/**
|
14647 |
+
* @see _.methodOf
|
14648 |
+
*/
|
14649 |
+
methodOf<TResult>(
|
14650 |
+
...args: any[]
|
14651 |
+
): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
|
14652 |
+
}
|
14653 |
+
|
14654 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14655 |
+
/**
|
14656 |
+
* @see _.methodOf
|
14657 |
+
*/
|
14658 |
+
methodOf<TResult>(
|
14659 |
+
...args: any[]
|
14660 |
+
): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
|
14661 |
+
}
|
14662 |
+
|
14663 |
+
//_.mixin
|
14664 |
+
interface MixinOptions {
|
14665 |
+
chain?: boolean;
|
14666 |
+
}
|
14667 |
+
|
14668 |
+
interface LoDashStatic {
|
14669 |
+
/**
|
14670 |
+
* Adds all own enumerable function properties of a source object to the destination object. If object is a
|
14671 |
+
* function then methods are added to its prototype as well.
|
14672 |
+
*
|
14673 |
+
* Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying
|
14674 |
+
* the original.
|
14675 |
+
*
|
14676 |
+
* @param object The destination object.
|
14677 |
+
* @param source The object of functions to add.
|
14678 |
+
* @param options The options object.
|
14679 |
+
* @param options.chain Specify whether the functions added are chainable.
|
14680 |
+
* @return Returns object.
|
14681 |
+
*/
|
14682 |
+
mixin<TResult, TObject>(
|
14683 |
+
object: TObject,
|
14684 |
+
source: Dictionary<Function>,
|
14685 |
+
options?: MixinOptions
|
14686 |
+
): TResult;
|
14687 |
+
|
14688 |
+
/**
|
14689 |
+
* @see _.mixin
|
14690 |
+
*/
|
14691 |
+
mixin<TResult>(
|
14692 |
+
source: Dictionary<Function>,
|
14693 |
+
options?: MixinOptions
|
14694 |
+
): TResult;
|
14695 |
+
}
|
14696 |
+
|
14697 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14698 |
+
/**
|
14699 |
+
* @see _.mixin
|
14700 |
+
*/
|
14701 |
+
mixin<TResult>(
|
14702 |
+
source: Dictionary<Function>,
|
14703 |
+
options?: MixinOptions
|
14704 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
14705 |
+
|
14706 |
+
/**
|
14707 |
+
* @see _.mixin
|
14708 |
+
*/
|
14709 |
+
mixin<TResult>(
|
14710 |
+
options?: MixinOptions
|
14711 |
+
): LoDashImplicitObjectWrapper<TResult>;
|
14712 |
+
}
|
14713 |
+
|
14714 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14715 |
+
/**
|
14716 |
+
* @see _.mixin
|
14717 |
+
*/
|
14718 |
+
mixin<TResult>(
|
14719 |
+
source: Dictionary<Function>,
|
14720 |
+
options?: MixinOptions
|
14721 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
14722 |
+
|
14723 |
+
/**
|
14724 |
+
* @see _.mixin
|
14725 |
+
*/
|
14726 |
+
mixin<TResult>(
|
14727 |
+
options?: MixinOptions
|
14728 |
+
): LoDashExplicitObjectWrapper<TResult>;
|
14729 |
+
}
|
14730 |
+
|
14731 |
+
//_.noConflict
|
14732 |
+
interface LoDashStatic {
|
14733 |
+
/**
|
14734 |
+
* Reverts the _ variable to its previous value and returns a reference to the lodash function.
|
14735 |
+
*
|
14736 |
+
* @return Returns the lodash function.
|
14737 |
+
*/
|
14738 |
+
noConflict(): typeof _;
|
14739 |
+
}
|
14740 |
+
|
14741 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
14742 |
+
/**
|
14743 |
+
* @see _.noConflict
|
14744 |
+
*/
|
14745 |
+
noConflict(): typeof _;
|
14746 |
+
}
|
14747 |
+
|
14748 |
+
//_.noop
|
14749 |
+
interface LoDashStatic {
|
14750 |
+
/**
|
14751 |
+
* A no-operation function that returns undefined regardless of the arguments it receives.
|
14752 |
+
*
|
14753 |
+
* @return undefined
|
14754 |
+
*/
|
14755 |
+
noop(...args: any[]): void;
|
14756 |
+
}
|
14757 |
+
|
14758 |
+
interface LoDashImplicitWrapperBase<T, TWrapper> {
|
14759 |
+
/**
|
14760 |
+
* @see _.noop
|
14761 |
+
*/
|
14762 |
+
noop(...args: any[]): void;
|
14763 |
+
}
|
14764 |
+
|
14765 |
+
interface LoDashExplicitWrapperBase<T, TWrapper> {
|
14766 |
+
/**
|
14767 |
+
* @see _.noop
|
14768 |
+
*/
|
14769 |
+
noop(...args: any[]): _.LoDashExplicitWrapper<void>;
|
14770 |
+
}
|
14771 |
+
|
14772 |
+
//_.property
|
14773 |
+
interface LoDashStatic {
|
14774 |
+
/**
|
14775 |
+
* Creates a function that returns the property value at path on a given object.
|
14776 |
+
*
|
14777 |
+
* @param path The path of the property to get.
|
14778 |
+
* @return Returns the new function.
|
14779 |
+
*/
|
14780 |
+
property<TObj, TResult>(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult;
|
14781 |
+
}
|
14782 |
+
|
14783 |
+
interface LoDashImplicitWrapper<T> {
|
14784 |
+
/**
|
14785 |
+
* @see _.property
|
14786 |
+
*/
|
14787 |
+
property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
|
14788 |
+
}
|
14789 |
+
|
14790 |
+
interface LoDashImplicitArrayWrapper<T> {
|
14791 |
+
/**
|
14792 |
+
* @see _.property
|
14793 |
+
*/
|
14794 |
+
property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
|
14795 |
+
}
|
14796 |
+
|
14797 |
+
interface LoDashExplicitWrapper<T> {
|
14798 |
+
/**
|
14799 |
+
* @see _.property
|
14800 |
+
*/
|
14801 |
+
property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
|
14802 |
+
}
|
14803 |
+
|
14804 |
+
interface LoDashExplicitArrayWrapper<T> {
|
14805 |
+
/**
|
14806 |
+
* @see _.property
|
14807 |
+
*/
|
14808 |
+
property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
|
14809 |
+
}
|
14810 |
+
|
14811 |
+
//_.propertyOf
|
14812 |
+
interface LoDashStatic {
|
14813 |
+
/**
|
14814 |
+
* The opposite of _.property; this method creates a function that returns the property value at a given path
|
14815 |
+
* on object.
|
14816 |
+
*
|
14817 |
+
* @param object The object to query.
|
14818 |
+
* @return Returns the new function.
|
14819 |
+
*/
|
14820 |
+
propertyOf<T extends {}>(object: T): (path: string|string[]) => any;
|
14821 |
+
}
|
14822 |
+
|
14823 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14824 |
+
/**
|
14825 |
+
* @see _.propertyOf
|
14826 |
+
*/
|
14827 |
+
propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
|
14828 |
+
}
|
14829 |
+
|
14830 |
+
interface LoDashExplicitObjectWrapper<T> {
|
14831 |
+
/**
|
14832 |
+
* @see _.propertyOf
|
14833 |
+
*/
|
14834 |
+
propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
|
14835 |
+
}
|
14836 |
+
|
14837 |
+
//_.range
|
14838 |
+
interface LoDashStatic {
|
14839 |
+
/**
|
14840 |
+
* Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
|
14841 |
+
* If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length
|
14842 |
+
* range is created unless a negative step is specified.
|
14843 |
+
*
|
14844 |
+
* @param start The start of the range.
|
14845 |
+
* @param end The end of the range.
|
14846 |
+
* @param step The value to increment or decrement by.
|
14847 |
+
* @return Returns a new range array.
|
14848 |
+
*/
|
14849 |
+
range(
|
14850 |
+
start: number,
|
14851 |
+
end: number,
|
14852 |
+
step?: number
|
14853 |
+
): number[];
|
14854 |
+
|
14855 |
+
/**
|
14856 |
+
* @see _.range
|
14857 |
+
*/
|
14858 |
+
range(
|
14859 |
+
end: number,
|
14860 |
+
step?: number
|
14861 |
+
): number[];
|
14862 |
+
}
|
14863 |
+
|
14864 |
+
interface LoDashImplicitWrapper<T> {
|
14865 |
+
/**
|
14866 |
+
* @see _.range
|
14867 |
+
*/
|
14868 |
+
range(
|
14869 |
+
end?: number,
|
14870 |
+
step?: number
|
14871 |
+
): LoDashImplicitArrayWrapper<number>;
|
14872 |
+
}
|
14873 |
+
|
14874 |
+
interface LoDashExplicitWrapper<T> {
|
14875 |
+
/**
|
14876 |
+
* @see _.range
|
14877 |
+
*/
|
14878 |
+
range(
|
14879 |
+
end?: number,
|
14880 |
+
step?: number
|
14881 |
+
): LoDashExplicitArrayWrapper<number>;
|
14882 |
+
}
|
14883 |
+
|
14884 |
+
//_.runInContext
|
14885 |
+
interface LoDashStatic {
|
14886 |
+
/**
|
14887 |
+
* Create a new pristine lodash function using the given context object.
|
14888 |
+
*
|
14889 |
+
* @param context The context object.
|
14890 |
+
* @return Returns a new lodash function.
|
14891 |
+
*/
|
14892 |
+
runInContext(context?: Object): typeof _;
|
14893 |
+
}
|
14894 |
+
|
14895 |
+
interface LoDashImplicitObjectWrapper<T> {
|
14896 |
+
/**
|
14897 |
+
* @see _.runInContext
|
14898 |
+
*/
|
14899 |
+
runInContext(): typeof _;
|
14900 |
+
}
|
14901 |
+
|
14902 |
+
//_.times
|
14903 |
+
interface LoDashStatic {
|
14904 |
+
/**
|
14905 |
+
* Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee is
|
14906 |
+
* bound to thisArg and invoked with one argument; (index).
|
14907 |
+
*
|
14908 |
+
* @param n The number of times to invoke iteratee.
|
14909 |
+
* @param iteratee The function invoked per iteration.
|
14910 |
+
* @param thisArg The this binding of iteratee.
|
14911 |
+
* @return Returns the array of results.
|
14912 |
+
*/
|
14913 |
+
times<TResult>(
|
14914 |
+
n: number,
|
14915 |
+
iteratee: (num: number) => TResult,
|
14916 |
+
thisArg?: any
|
14917 |
+
): TResult[];
|
14918 |
+
|
14919 |
+
/**
|
14920 |
+
* @see _.times
|
14921 |
+
*/
|
14922 |
+
times(n: number): number[];
|
14923 |
+
}
|
14924 |
+
|
14925 |
+
interface LoDashImplicitWrapper<T> {
|
14926 |
+
/**
|
14927 |
+
* @see _.times
|
14928 |
+
*/
|
14929 |
+
times<TResult>(
|
14930 |
+
iteratee: (num: number) => TResult,
|
14931 |
+
thisArgs?: any
|
14932 |
+
): LoDashImplicitArrayWrapper<TResult>;
|
14933 |
+
|
14934 |
+
/**
|
14935 |
+
* @see _.times
|
14936 |
+
*/
|
14937 |
+
times(): LoDashImplicitArrayWrapper<number>;
|
14938 |
+
}
|
14939 |
+
|
14940 |
+
interface LoDashExplicitWrapper<T> {
|
14941 |
+
/**
|
14942 |
+
* @see _.times
|
14943 |
+
*/
|
14944 |
+
times<TResult>(
|
14945 |
+
iteratee: (num: number) => TResult,
|
14946 |
+
thisArgs?: any
|
14947 |
+
): LoDashExplicitArrayWrapper<TResult>;
|
14948 |
+
|
14949 |
+
/**
|
14950 |
+
* @see _.times
|
14951 |
+
*/
|
14952 |
+
times(): LoDashExplicitArrayWrapper<number>;
|
14953 |
+
}
|
14954 |
+
|
14955 |
+
//_.uniqueId
|
14956 |
+
interface LoDashStatic {
|
14957 |
+
/**
|
14958 |
+
* Generates a unique ID. If prefix is provided the ID is appended to it.
|
14959 |
+
*
|
14960 |
+
* @param prefix The value to prefix the ID with.
|
14961 |
+
* @return Returns the unique ID.
|
14962 |
+
*/
|
14963 |
+
uniqueId(prefix?: string): string;
|
14964 |
+
}
|
14965 |
+
|
14966 |
+
interface LoDashImplicitWrapper<T> {
|
14967 |
+
/**
|
14968 |
+
* @see _.uniqueId
|
14969 |
+
*/
|
14970 |
+
uniqueId(): string;
|
14971 |
+
}
|
14972 |
+
|
14973 |
+
interface LoDashExplicitWrapper<T> {
|
14974 |
+
/**
|
14975 |
+
* @see _.uniqueId
|
14976 |
+
*/
|
14977 |
+
uniqueId(): LoDashExplicitWrapper<string>;
|
14978 |
+
}
|
14979 |
+
|
14980 |
+
interface ListIterator<T, TResult> {
|
14981 |
+
(value: T, index: number, collection: List<T>): TResult;
|
14982 |
+
}
|
14983 |
+
|
14984 |
+
interface DictionaryIterator<T, TResult> {
|
14985 |
+
(value: T, key?: string, collection?: Dictionary<T>): TResult;
|
14986 |
+
}
|
14987 |
+
|
14988 |
+
interface NumericDictionaryIterator<T, TResult> {
|
14989 |
+
(value: T, key?: number, collection?: Dictionary<T>): TResult;
|
14990 |
+
}
|
14991 |
+
|
14992 |
+
interface ObjectIterator<T, TResult> {
|
14993 |
+
(element: T, key?: string, collection?: any): TResult;
|
14994 |
+
}
|
14995 |
+
|
14996 |
+
interface StringIterator<TResult> {
|
14997 |
+
(char: string, index?: number, string?: string): TResult;
|
14998 |
+
}
|
14999 |
+
|
15000 |
+
interface MemoVoidIterator<T, TResult> {
|
15001 |
+
(prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void;
|
15002 |
+
}
|
15003 |
+
interface MemoIterator<T, TResult> {
|
15004 |
+
(prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult;
|
15005 |
+
}
|
15006 |
+
|
15007 |
+
interface MemoVoidArrayIterator<T, TResult> {
|
15008 |
+
(acc: TResult, curr: T, index?: number, arr?: T[]): void;
|
15009 |
+
}
|
15010 |
+
interface MemoVoidDictionaryIterator<T, TResult> {
|
15011 |
+
(acc: TResult, curr: T, key?: string, dict?: Dictionary<T>): void;
|
15012 |
+
}
|
15013 |
+
|
15014 |
+
//interface Collection<T> {}
|
15015 |
+
|
15016 |
+
// Common interface between Arrays and jQuery objects
|
15017 |
+
interface List<T> {
|
15018 |
+
[index: number]: T;
|
15019 |
+
length: number;
|
15020 |
+
}
|
15021 |
+
|
15022 |
+
interface Dictionary<T> {
|
15023 |
+
[index: string]: T;
|
15024 |
+
}
|
15025 |
+
|
15026 |
+
interface NumericDictionary<T> {
|
15027 |
+
[index: number]: T;
|
15028 |
+
}
|
15029 |
+
|
15030 |
+
interface StringRepresentable {
|
15031 |
+
toString(): string;
|
15032 |
+
}
|
15033 |
+
|
15034 |
+
interface Cancelable {
|
15035 |
+
cancel(): void;
|
15036 |
+
}
|
15037 |
+
}
|
15038 |
+
|
15039 |
+
declare module "lodash" {
|
15040 |
+
export = _;
|
15041 |
+
}
|
js/menu-editor.js
CHANGED
@@ -38,8 +38,6 @@
|
|
38 |
* @property {string|null} wsEditorData.selectedActor
|
39 |
*
|
40 |
* @property {object} wsEditorData.actors
|
41 |
-
* @property {object} wsEditorData.roles
|
42 |
-
* @property {object} wsEditorData.users
|
43 |
* @property {string[]} wsEditorData.visibleUsers
|
44 |
*
|
45 |
* @property {object} wsEditorData.postTypes
|
@@ -69,299 +67,7 @@ jQuery.each(['grant_access', 'hidden_from_actor'], function(unused, key) {
|
|
69 |
}
|
70 |
});
|
71 |
|
72 |
-
|
73 |
-
'use strict';
|
74 |
-
|
75 |
-
/**
|
76 |
-
* A user.
|
77 |
-
*
|
78 |
-
* @typedef {Object} AmeUserActor
|
79 |
-
*
|
80 |
-
* @property {string} user_login
|
81 |
-
* @property {string} display_name
|
82 |
-
*
|
83 |
-
* @property {Object} capabilities A dictionary of ["capability" => boolean].
|
84 |
-
* @property {string[]} roles
|
85 |
-
* @property {boolean} is_super_admin
|
86 |
-
*/
|
87 |
-
|
88 |
-
var me = {};
|
89 |
-
/**
|
90 |
-
* @type {Object.<String, AmeUserActor>}
|
91 |
-
*/
|
92 |
-
users = users || {};
|
93 |
-
|
94 |
-
var defaultCapabilities = {},
|
95 |
-
grantedCapabilities = {},
|
96 |
-
|
97 |
-
emptyObject = {},
|
98 |
-
cachedContextList = [emptyObject, grantedCapabilities, defaultCapabilities];
|
99 |
-
|
100 |
-
me.setRoles = function(newRoles) {
|
101 |
-
roles = newRoles;
|
102 |
-
_.forEach(roles, function(role, name) {
|
103 |
-
defaultCapabilities['role:' + name] = role.capabilities;
|
104 |
-
});
|
105 |
-
};
|
106 |
-
|
107 |
-
me.addUsers = function(newUsers) {
|
108 |
-
_.forEach(newUsers, function(user) {
|
109 |
-
users[user.user_login] = user;
|
110 |
-
defaultCapabilities['user:' + user.user_login] = user.capabilities;
|
111 |
-
});
|
112 |
-
};
|
113 |
-
|
114 |
-
me.getUsers = function() {
|
115 |
-
return users;
|
116 |
-
};
|
117 |
-
|
118 |
-
me.setRoles(roles);
|
119 |
-
me.addUsers(users);
|
120 |
-
|
121 |
-
function parseActorString(actor) {
|
122 |
-
var separator = actor.indexOf(':');
|
123 |
-
if (separator === -1) {
|
124 |
-
throw {
|
125 |
-
name: 'InvalidActorException',
|
126 |
-
message: "Actor string does not contain a colon.",
|
127 |
-
value: actor
|
128 |
-
};
|
129 |
-
}
|
130 |
-
|
131 |
-
return {
|
132 |
-
'type': actor.substring(0, separator),
|
133 |
-
'id': actor.substring(separator + 1)
|
134 |
-
};
|
135 |
-
}
|
136 |
-
|
137 |
-
function actorHasCap(actor, capability, contextList) {
|
138 |
-
//Check for explicit settings first.
|
139 |
-
var result = null, actorValue, len = contextList.length;
|
140 |
-
for (var i = 0; i < len; i++) {
|
141 |
-
if (contextList[i].hasOwnProperty(actor)) {
|
142 |
-
actorValue = contextList[i][actor];
|
143 |
-
if (typeof actorValue === 'boolean') {
|
144 |
-
return actorValue;
|
145 |
-
} else if (actorValue.hasOwnProperty(capability)) {
|
146 |
-
result = actorValue[capability];
|
147 |
-
return (typeof result === 'boolean') ? result : result[0];
|
148 |
-
}
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
//Super admins have access to everything by default, unless specifically denied.
|
153 |
-
if (actor === 'special:super_admin') {
|
154 |
-
return (capability !== 'do_not_allow');
|
155 |
-
}
|
156 |
-
|
157 |
-
//Roles only have the capabilities that they actually have.
|
158 |
-
if (actor.lastIndexOf('role:', 0) === 0) {
|
159 |
-
return false;
|
160 |
-
}
|
161 |
-
|
162 |
-
//Users can have a capability through their roles or the "super admin" flag.
|
163 |
-
if (actor.lastIndexOf('user:', 0) === 0) {
|
164 |
-
var user = users[actor.substr('user:'.length)];
|
165 |
-
if (user.is_super_admin) {
|
166 |
-
return actorHasCap('special:super_admin', capability, contextList);
|
167 |
-
}
|
168 |
-
|
169 |
-
//Check if any of the user's roles have the capability.
|
170 |
-
result = false;
|
171 |
-
for(var index = 0; index < user.roles.length; index++) {
|
172 |
-
result = result || actorHasCap('role:' + user.roles[index], capability, contextList);
|
173 |
-
}
|
174 |
-
return result;
|
175 |
-
|
176 |
-
} else {
|
177 |
-
throw {
|
178 |
-
name: 'InvalidActorTypeException',
|
179 |
-
message: "The specified actor type is not supported",
|
180 |
-
value: actor
|
181 |
-
};
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
me.hasCap = function(actor, capability, context) {
|
186 |
-
cachedContextList[0] = context || emptyObject;
|
187 |
-
return actorHasCap(actor, capability, cachedContextList);
|
188 |
-
};
|
189 |
-
|
190 |
-
me.hasCapByDefault = function(actor, capability) {
|
191 |
-
return actorHasCap(actor, capability, [defaultCapabilities]);
|
192 |
-
};
|
193 |
-
|
194 |
-
/**
|
195 |
-
*
|
196 |
-
* @param {string} login
|
197 |
-
* @param {boolean} skipLoginActor
|
198 |
-
* @returns {Array} Caution: Do not modify the returned array. Returns a reference to an internal array.
|
199 |
-
*/
|
200 |
-
me.getUserActors = function(login, skipLoginActor) {
|
201 |
-
if (!users.hasOwnProperty(login)) {
|
202 |
-
throw {
|
203 |
-
name: 'UnknownUserException',
|
204 |
-
message: 'Can not get actors of an unknown user',
|
205 |
-
value: login
|
206 |
-
};
|
207 |
-
}
|
208 |
-
|
209 |
-
//Check the cache first.
|
210 |
-
var user = users[login];
|
211 |
-
if (skipLoginActor && user.hasOwnProperty('actorsWithoutSelf')) {
|
212 |
-
return user.actorsWithoutSelf;
|
213 |
-
}
|
214 |
-
if (!skipLoginActor && user.hasOwnProperty('actors')) {
|
215 |
-
return user.actors;
|
216 |
-
}
|
217 |
-
|
218 |
-
//Generate the list and cache it.
|
219 |
-
var actors = [], actorsWithoutSelf = [];
|
220 |
-
actors.push('user:' + login);
|
221 |
-
if (user.is_super_admin) {
|
222 |
-
actorsWithoutSelf.push('special:super_admin');
|
223 |
-
}
|
224 |
-
for (var i = 0; i < user.roles.length; i++) {
|
225 |
-
actorsWithoutSelf.push('role:' + user.roles[i]);
|
226 |
-
}
|
227 |
-
actors = actors.concat(actorsWithoutSelf);
|
228 |
-
|
229 |
-
user.actors = actors;
|
230 |
-
user.actorsWithoutSelf = actorsWithoutSelf;
|
231 |
-
|
232 |
-
return skipLoginActor ? actorsWithoutSelf : actors;
|
233 |
-
};
|
234 |
-
|
235 |
-
me.getUser = function(login) {
|
236 |
-
if (!users.hasOwnProperty(login)) {
|
237 |
-
throw {
|
238 |
-
name: 'UnknownUserException',
|
239 |
-
message: 'User not found',
|
240 |
-
value: login
|
241 |
-
};
|
242 |
-
}
|
243 |
-
return users[login];
|
244 |
-
};
|
245 |
-
|
246 |
-
me.roleExists = function(roleId) {
|
247 |
-
return (typeof roleId === 'string') && roles.hasOwnProperty(roleId);
|
248 |
-
};
|
249 |
-
|
250 |
-
/**
|
251 |
-
* Compare the specificity of two actors.
|
252 |
-
*
|
253 |
-
* Returns 1 if the first actor is more specific than the second, 0 if they're both
|
254 |
-
* equally specific, and -1 if the second actor is more specific.
|
255 |
-
*
|
256 |
-
* @param {String} actor1
|
257 |
-
* @param {String} actor2
|
258 |
-
* @return {Number}
|
259 |
-
*/
|
260 |
-
me.compareActorSpecificity = function(actor1, actor2) {
|
261 |
-
var delta = me.getActorSpecificity(actor1) - me.getActorSpecificity(actor2);
|
262 |
-
if (delta !== 0) {
|
263 |
-
delta = (delta > 0) ? 1 : -1;
|
264 |
-
}
|
265 |
-
return delta;
|
266 |
-
};
|
267 |
-
|
268 |
-
me.getActorSpecificity = function(actorString) {
|
269 |
-
var actor = parseActorString(actorString);
|
270 |
-
var specificity = 0;
|
271 |
-
switch(actor.type) {
|
272 |
-
case 'role':
|
273 |
-
specificity = 1;
|
274 |
-
break;
|
275 |
-
case 'special':
|
276 |
-
specificity = 2;
|
277 |
-
break;
|
278 |
-
case 'user':
|
279 |
-
specificity = 10;
|
280 |
-
break;
|
281 |
-
default:
|
282 |
-
specificity = 0;
|
283 |
-
}
|
284 |
-
return specificity;
|
285 |
-
};
|
286 |
-
|
287 |
-
me.setCap = function(actor, capability, hasCap, sourceType, sourceName) {
|
288 |
-
me.setCapInContext(grantedCapabilities, actor, capability, hasCap, sourceType, sourceName);
|
289 |
-
};
|
290 |
-
|
291 |
-
/**
|
292 |
-
* Grant or deny a capability to an actor.
|
293 |
-
*
|
294 |
-
* @param {Object} context
|
295 |
-
* @param {string} actor
|
296 |
-
* @param {string} capability
|
297 |
-
* @param {boolean} hasCap
|
298 |
-
* @param {string} [sourceType]
|
299 |
-
* @param {string} [sourceName]
|
300 |
-
*/
|
301 |
-
me.setCapInContext = function(context, actor, capability, hasCap, sourceType, sourceName) {
|
302 |
-
var grant = sourceType ? [hasCap, sourceType, sourceName || null] : hasCap;
|
303 |
-
_.set(context, [actor, capability], grant);
|
304 |
-
};
|
305 |
-
|
306 |
-
me.resetCap = function(actor, capability) {
|
307 |
-
me.resetCapInContext(grantedCapabilities, actor, capability);
|
308 |
-
};
|
309 |
-
|
310 |
-
me.resetCapInContext = function(context, actor, capability) {
|
311 |
-
if (_.has(context, [actor, capability])) {
|
312 |
-
delete context[actor][capability];
|
313 |
-
}
|
314 |
-
};
|
315 |
-
|
316 |
-
me.setGrantedCapabilities = function(newGrants) {
|
317 |
-
grantedCapabilities = _.cloneDeep(newGrants);
|
318 |
-
cachedContextList[1] = grantedCapabilities;
|
319 |
-
};
|
320 |
-
|
321 |
-
me.getGrantedCapabilities = function() {
|
322 |
-
return grantedCapabilities;
|
323 |
-
};
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Remove redundant granted capabilities.
|
327 |
-
*
|
328 |
-
* For example, if user "jane" has been granted the "edit_posts" capability both directly and via the Editor role,
|
329 |
-
* the direct grant is redundant. We can remove it. Jane will still have "edit_posts" because she's an editor.
|
330 |
-
*/
|
331 |
-
me.pruneGrantedCapabilities = function(actorType) {
|
332 |
-
actorType = actorType || null;
|
333 |
-
var pruned = _.cloneDeep(grantedCapabilities),
|
334 |
-
context = [pruned, defaultCapabilities];
|
335 |
-
|
336 |
-
var actorKeys = _(pruned).keys().filter(function(actor) {
|
337 |
-
var parsed = parseActorString(actor);
|
338 |
-
//Skip users that are not loaded.
|
339 |
-
if (parsed.type === 'user' && !users.hasOwnProperty(actor.id)) {
|
340 |
-
return false;
|
341 |
-
}
|
342 |
-
return !(actorType && parsed.type !== actorType);
|
343 |
-
}).value();
|
344 |
-
|
345 |
-
_.forEach(actorKeys, function(actor) {
|
346 |
-
_.forEach(_.keys(pruned[actor]), function(capability) {
|
347 |
-
var grant = pruned[actor][capability];
|
348 |
-
delete pruned[actor][capability];
|
349 |
-
|
350 |
-
var hasCap = _.isArray(grant) ? grant[0] : grant,
|
351 |
-
hasCapWhenPruned = actorHasCap(actor, capability, context);
|
352 |
-
|
353 |
-
if (hasCap !== hasCapWhenPruned) {
|
354 |
-
pruned[actor][capability] = grant; //Restore.
|
355 |
-
}
|
356 |
-
});
|
357 |
-
});
|
358 |
-
|
359 |
-
me.setGrantedCapabilities(pruned);
|
360 |
-
return pruned;
|
361 |
-
};
|
362 |
-
|
363 |
-
return me;
|
364 |
-
})(wsEditorData.roles, wsEditorData.users, wsAmeLodash);
|
365 |
|
366 |
/**
|
367 |
* A utility for retrieving post and page titles.
|
@@ -437,7 +143,7 @@ window.AmeEditorApi = AmeEditorApi;
|
|
437 |
(function ($, _){
|
438 |
'use strict';
|
439 |
|
440 |
-
var
|
441 |
|
442 |
var itemTemplates = {
|
443 |
templates: wsEditorData.itemTemplates,
|
@@ -682,7 +388,7 @@ function buildMenuItem(itemData, isTopLevel) {
|
|
682 |
//the editors themselves are created later, when the user tries to access them
|
683 |
//for the first time).
|
684 |
var contents = [];
|
685 |
-
var menuTitle = (
|
686 |
if (menuTitle === '') {
|
687 |
menuTitle = ' ';
|
688 |
}
|
@@ -1181,6 +887,7 @@ var knownMenuFields = {
|
|
1181 |
AmeEditorApi.getItemDisplayUrl = function(menuItem) {
|
1182 |
var url = getFieldValue(menuItem, 'file', '');
|
1183 |
if (menuItem.template_id !== '') {
|
|
|
1184 |
var defaultUrl = itemTemplates.getDefaultValue(menuItem.template_id, 'url');
|
1185 |
if (defaultUrl) {
|
1186 |
url = defaultUrl;
|
@@ -1334,7 +1041,7 @@ function buildEditboxField(entry, field_name, field_settings){
|
|
1334 |
* Get the parent menu of a menu item.
|
1335 |
*
|
1336 |
* @param containerNode A DOM element as a jQuery object.
|
1337 |
-
* @return {
|
1338 |
*/
|
1339 |
function getParentMenuNode(containerNode) {
|
1340 |
var submenu = containerNode.closest('.ws_submenu', '#ws_menu_editor'),
|
@@ -1349,8 +1056,8 @@ function getParentMenuNode(containerNode) {
|
|
1349 |
/**
|
1350 |
* Get all submenu items of a menu item.
|
1351 |
*
|
1352 |
-
* @param {
|
1353 |
-
* @return {
|
1354 |
*/
|
1355 |
function getSubmenuItemNodes(containerNode) {
|
1356 |
var subMenuId = containerNode.data('submenu_id');
|
@@ -1384,9 +1091,9 @@ function walkMenuTree(containerNode, callback) {
|
|
1384 |
function updateActorAccessUi(containerNode) {
|
1385 |
//Update the permissions checkbox & UI
|
1386 |
var menuItem = containerNode.data('menu_item');
|
1387 |
-
if (selectedActor !== null) {
|
1388 |
-
var hasAccess = actorCanAccessMenu(menuItem, selectedActor);
|
1389 |
-
var hasCustomPermissions = actorHasCustomPermissions(menuItem, selectedActor);
|
1390 |
|
1391 |
var isOverrideActive = !hasAccess && getFieldValue(menuItem, 'restrict_access_to_items', false);
|
1392 |
|
@@ -1398,7 +1105,7 @@ function updateActorAccessUi(containerNode) {
|
|
1398 |
if (
|
1399 |
parentItem
|
1400 |
&& getFieldValue(parentItem, 'restrict_access_to_items', false)
|
1401 |
-
&& !actorCanAccessMenu(parentItem, selectedActor)
|
1402 |
) {
|
1403 |
hasAccess = false;
|
1404 |
isOverrideActive = true;
|
@@ -1423,7 +1130,7 @@ function updateActorAccessUi(containerNode) {
|
|
1423 |
if ( !item ) { //Skip placeholder items created by drag & drop operations.
|
1424 |
return true;
|
1425 |
}
|
1426 |
-
var hasSubmenuAccess = actorCanAccessMenu(item, selectedActor);
|
1427 |
if (hasSubmenuAccess !== hasAccess) {
|
1428 |
differentPermissions = true;
|
1429 |
return false;
|
@@ -1455,7 +1162,7 @@ function updateActorAccessUi(containerNode) {
|
|
1455 |
}
|
1456 |
|
1457 |
//Update the "hidden" flag.
|
1458 |
-
setMenuFlag(containerNode, 'hidden', itemHasHiddenFlag(menuItem, selectedActor));
|
1459 |
}
|
1460 |
|
1461 |
/**
|
@@ -1481,7 +1188,7 @@ function updateParentAccessUi(containerNode) {
|
|
1481 |
/**
|
1482 |
* Update an edit widget with the current menu item settings.
|
1483 |
*
|
1484 |
-
* @param containerNode
|
1485 |
*/
|
1486 |
function updateItemEditor(containerNode) {
|
1487 |
var menuItem = containerNode.data('menu_item');
|
@@ -1502,7 +1209,7 @@ function updateItemEditor(containerNode) {
|
|
1502 |
var input = field.find('.ws_field_value').first();
|
1503 |
|
1504 |
var hasADefaultValue = itemTemplates.hasDefaultValue(menuItem.template_id, fieldName);
|
1505 |
-
var defaultValue =
|
1506 |
var isDefault = hasADefaultValue && ((typeof menuItem[fieldName] === 'undefined') || (menuItem[fieldName] === null));
|
1507 |
|
1508 |
if (fieldName === 'access_level') {
|
@@ -1551,27 +1258,12 @@ function isEmptyObject(obj) {
|
|
1551 |
* @param {Object} entry
|
1552 |
* @param {string} fieldName
|
1553 |
* @param {*} [defaultValue]
|
1554 |
-
* @param {
|
1555 |
* @return {*}
|
1556 |
*/
|
1557 |
function getFieldValue(entry, fieldName, defaultValue, containerNode){
|
1558 |
if ( (typeof entry[fieldName] === 'undefined') || (entry[fieldName] === null) ) {
|
1559 |
-
|
1560 |
-
//By default, a submenu item has the same icon as its parent.
|
1561 |
-
if ((fieldName === 'icon_url') && containerNode && (wsEditorData.submenuIconsEnabled !== 'never')) {
|
1562 |
-
var parentContainerNode = getParentMenuNode(containerNode),
|
1563 |
-
parentMenuItem = parentContainerNode.data('menu_item');
|
1564 |
-
if (parentMenuItem) {
|
1565 |
-
return getFieldValue(parentMenuItem, fieldName, defaultValue, parentContainerNode);
|
1566 |
-
}
|
1567 |
-
}
|
1568 |
-
|
1569 |
-
var hasDefault = (typeof entry.defaults !== 'undefined') && (typeof entry.defaults[fieldName] !== 'undefined');
|
1570 |
-
if (hasDefault){
|
1571 |
-
return entry.defaults[fieldName];
|
1572 |
-
} else {
|
1573 |
-
return defaultValue;
|
1574 |
-
}
|
1575 |
} else {
|
1576 |
return entry[fieldName];
|
1577 |
}
|
@@ -1579,6 +1271,48 @@ function getFieldValue(entry, fieldName, defaultValue, containerNode){
|
|
1579 |
|
1580 |
AmeEditorApi.getFieldValue = getFieldValue;
|
1581 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1582 |
/*
|
1583 |
* Make a menu container sortable
|
1584 |
*/
|
@@ -1658,7 +1392,7 @@ function readMenuTreeState(){
|
|
1658 |
var menu = readItemState(containerNode, menuPosition++);
|
1659 |
|
1660 |
//Attach the current menu to the main structure.
|
1661 |
-
var filename = (menu
|
1662 |
|
1663 |
//Give unclickable items unique keys.
|
1664 |
if (menu.template_id === wsEditorData.unclickableTemplateId) {
|
@@ -1684,7 +1418,7 @@ function readMenuTreeState(){
|
|
1684 |
itemsByFilename[filename] = containerNode;
|
1685 |
});
|
1686 |
|
1687 |
-
AmeCapabilityManager.
|
1688 |
|
1689 |
return {
|
1690 |
tree: tree,
|
@@ -1852,8 +1586,8 @@ function itemHasHiddenFlag(menuItem, actor) {
|
|
1852 |
isHidden = menuItem.hidden_from_actor[actor];
|
1853 |
} else {
|
1854 |
//Otherwise the item is hidden only if it is hidden from all of the user's roles.
|
1855 |
-
userLogin = selectedActor.substr(userPrefix.length);
|
1856 |
-
userActors = AmeCapabilityManager.
|
1857 |
for (var i = 0; i < userActors.length; i++) {
|
1858 |
if (menuItem.hidden_from_actor.hasOwnProperty(userActors[i]) && menuItem.hidden_from_actor[userActors[i]]) {
|
1859 |
isHidden = true;
|
@@ -1876,7 +1610,7 @@ function itemHasHiddenFlag(menuItem, actor) {
|
|
1876 |
*
|
1877 |
* Applies to the selected actor, or all actors if no actor is selected.
|
1878 |
*
|
1879 |
-
* @param {
|
1880 |
* @param {boolean} [isHidden] Optional. True = hide the menu, false = show the menu.
|
1881 |
*/
|
1882 |
function toggleItemHiddenFlag(selection, isHidden) {
|
@@ -1884,24 +1618,24 @@ function toggleItemHiddenFlag(selection, isHidden) {
|
|
1884 |
|
1885 |
//By default, invert the current state.
|
1886 |
if (typeof isHidden === 'undefined') {
|
1887 |
-
isHidden = !itemHasHiddenFlag(menuItem, selectedActor);
|
1888 |
}
|
1889 |
|
1890 |
//Mark the menu as hidden/visible
|
1891 |
-
if (selectedActor === null) {
|
1892 |
//For ALL roles and users.
|
1893 |
menuItem.hidden = isHidden;
|
1894 |
menuItem.hidden_from_actor = {};
|
1895 |
} else {
|
1896 |
//Just for the current role.
|
1897 |
if (isHidden) {
|
1898 |
-
menuItem.hidden_from_actor[selectedActor] = true;
|
1899 |
} else {
|
1900 |
-
if (selectedActor.indexOf('user:') === 0) {
|
1901 |
//User-specific exception. Lets you can hide a menu from all admins but leave it visible to yourself.
|
1902 |
-
menuItem.hidden_from_actor[selectedActor] = false;
|
1903 |
} else {
|
1904 |
-
delete menuItem.hidden_from_actor[selectedActor];
|
1905 |
}
|
1906 |
}
|
1907 |
|
@@ -1910,7 +1644,7 @@ function toggleItemHiddenFlag(selection, isHidden) {
|
|
1910 |
if (!isHidden && menuItem.hidden) {
|
1911 |
menuItem.hidden = false;
|
1912 |
$.each(wsEditorData.actors, function(otherActor) {
|
1913 |
-
if (otherActor !== selectedActor) {
|
1914 |
menuItem.hidden_from_actor[otherActor] = true;
|
1915 |
}
|
1916 |
});
|
@@ -1978,38 +1712,6 @@ function setActorAccess(containerNode, actor, allowAccess) {
|
|
1978 |
}
|
1979 |
}
|
1980 |
|
1981 |
-
function setSelectedActor(actor) {
|
1982 |
-
//Check if the specified actor really exists. The actor ID
|
1983 |
-
//could be invalid if it was supplied by the user.
|
1984 |
-
if (actor !== null) {
|
1985 |
-
var newSelectedItem = $('a[href$="#'+ actor +'"]');
|
1986 |
-
if (newSelectedItem.length === 0) {
|
1987 |
-
return;
|
1988 |
-
}
|
1989 |
-
}
|
1990 |
-
|
1991 |
-
selectedActor = actor;
|
1992 |
-
|
1993 |
-
//Highlight the actor.
|
1994 |
-
var actorSelector = $('#ws_actor_selector');
|
1995 |
-
$('.current', actorSelector).removeClass('current');
|
1996 |
-
|
1997 |
-
if (selectedActor === null) {
|
1998 |
-
$('a.ws_no_actor').addClass('current');
|
1999 |
-
} else {
|
2000 |
-
newSelectedItem.addClass('current');
|
2001 |
-
}
|
2002 |
-
|
2003 |
-
//There are some UI elements that can be visible or hidden depending on whether an actor is selected.
|
2004 |
-
var editorNode = $('#ws_menu_editor');
|
2005 |
-
editorNode.toggleClass('ws_is_actor_view', (selectedActor !== null));
|
2006 |
-
|
2007 |
-
//Update the menu item states to indicate whether they're accessible.
|
2008 |
-
editorNode.find('.ws_container').each(function() {
|
2009 |
-
updateActorAccessUi($(this));
|
2010 |
-
});
|
2011 |
-
}
|
2012 |
-
|
2013 |
/**
|
2014 |
* Make a menu item inaccessible to everyone except a particular actor.
|
2015 |
*
|
@@ -2030,7 +1732,7 @@ function denyAccessForAllExcept(menuItem, actor) {
|
|
2030 |
|
2031 |
$.each(wsEditorData.actors, function(otherActor) {
|
2032 |
//If the input actor is more or equally specific...
|
2033 |
-
if ((actor === null) || (
|
2034 |
menuItem.grant_access[otherActor] = false;
|
2035 |
}
|
2036 |
});
|
@@ -2053,7 +1755,12 @@ var ws_paste_count = 0;
|
|
2053 |
var colorPresets = {},
|
2054 |
wasPresetDropdownPopulated = false;
|
2055 |
|
2056 |
-
|
|
|
|
|
|
|
|
|
|
|
2057 |
//Some editor elements are only available in the Pro version.
|
2058 |
if (wsEditorData.wsMenuEditorPro) {
|
2059 |
knownMenuFields.open_in.visible = true;
|
@@ -2229,7 +1936,7 @@ $(document).ready(function(){
|
|
2229 |
|
2230 |
var oldValue = menuItem[fieldName];
|
2231 |
var value = getInputValue(input);
|
2232 |
-
var defaultValue =
|
2233 |
var hasADefaultValue = (defaultValue !== null);
|
2234 |
|
2235 |
//Some fields/templates have no default values.
|
@@ -2279,7 +1986,7 @@ $(document).ready(function(){
|
|
2279 |
|
2280 |
//Allow/forbid items in actor-specific views
|
2281 |
menuEditorNode.on('click', 'input.ws_actor_access_checkbox', function() {
|
2282 |
-
if (selectedActor === null) {
|
2283 |
return;
|
2284 |
}
|
2285 |
|
@@ -2292,11 +1999,11 @@ $(document).ready(function(){
|
|
2292 |
updateItemEditor(containerNode); //Resets the checkbox back to the old value.
|
2293 |
confirmDashboardHiding(function(ok) {
|
2294 |
if (ok) {
|
2295 |
-
setActorAccessForTreeAndUpdateUi(containerNode, selectedActor, checked);
|
2296 |
}
|
2297 |
});
|
2298 |
} else {
|
2299 |
-
setActorAccessForTreeAndUpdateUi(containerNode, selectedActor, checked);
|
2300 |
}
|
2301 |
});
|
2302 |
|
@@ -2447,7 +2154,7 @@ $(document).ready(function(){
|
|
2447 |
AmeItemAccessEditor.open({
|
2448 |
menuItem: menuItem,
|
2449 |
containerNode: containerNode,
|
2450 |
-
selectedActor: selectedActor,
|
2451 |
itemHasSubmenus: (!!(containerNode.data('submenu_id')) &&
|
2452 |
$('#' + containerNode.data('submenu_id')).find('.ws_item').length > 0)
|
2453 |
});
|
@@ -2996,7 +2703,8 @@ $(document).ready(function(){
|
|
2996 |
}
|
2997 |
|
2998 |
var colorDialogState = {
|
2999 |
-
menuItem: null
|
|
|
3000 |
};
|
3001 |
|
3002 |
var menuColorVariables = [
|
@@ -3036,9 +2744,8 @@ $(document).ready(function(){
|
|
3036 |
$(this).text(showAdvancedColors ? 'Hide advanced options' : 'Show advanced options');
|
3037 |
});
|
3038 |
|
3039 |
-
//"Edit.." color schemes.
|
3040 |
var colorPickersInitialized = false;
|
3041 |
-
|
3042 |
//Initializing the color pickers takes a while, so we only do it when needed instead of on document ready.
|
3043 |
if ( !colorPickersInitialized ) {
|
3044 |
menuColorDialog.find('.ame-color-picker').wpColorPicker({
|
@@ -3049,34 +2756,63 @@ $(document).ready(function(){
|
|
3049 |
colorPickersInitialized = true;
|
3050 |
}
|
3051 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3052 |
var containerNode = $(this).parents('.ws_container').first();
|
3053 |
var menuItem = containerNode.data('menu_item');
|
3054 |
|
3055 |
colorDialogState.containerNode = containerNode;
|
3056 |
colorDialogState.menuItem = menuItem;
|
|
|
3057 |
|
3058 |
-
|
3059 |
-
var
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3063 |
menuItem.colors = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
3064 |
}
|
|
|
3065 |
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3072 |
|
3073 |
-
//Add menu title to the dialog caption.
|
3074 |
-
var title = getFieldValue(menuItem, 'menu_title', null);
|
3075 |
-
menuColorDialog.dialog(
|
3076 |
-
'option',
|
3077 |
-
'title',
|
3078 |
-
title ? ('Colors: ' + title.substring(0, 30)) : 'Colors'
|
3079 |
-
);
|
3080 |
menuColorDialog.dialog('open');
|
3081 |
});
|
3082 |
|
@@ -3123,15 +2859,28 @@ $(document).ready(function(){
|
|
3123 |
//The "Save Changes" button in the color dialog.
|
3124 |
$('#ws-ame-save-menu-colors').click(function() {
|
3125 |
menuColorDialog.dialog('close');
|
3126 |
-
|
3127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3128 |
}
|
3129 |
-
var menuItem = colorDialogState.menuItem;
|
3130 |
-
menuItem.colors = getColorSettingsFromDialog();
|
3131 |
-
updateItemEditor(colorDialogState.containerNode);
|
3132 |
|
3133 |
colorDialogState.containerNode = null;
|
3134 |
colorDialogState.menuItem = null;
|
|
|
3135 |
});
|
3136 |
|
3137 |
//The "Apply to All" button in the same dialog.
|
@@ -3140,12 +2889,18 @@ $(document).ready(function(){
|
|
3140 |
return;
|
3141 |
}
|
3142 |
|
|
|
3143 |
var newColors = getColorSettingsFromDialog();
|
|
|
|
|
|
|
|
|
|
|
3144 |
$('#ws_menu_box').find('.ws_menu').each(function() {
|
3145 |
var containerNode = $(this),
|
3146 |
menuItem = containerNode.data('menu_item');
|
3147 |
if (!menuItem.separator) {
|
3148 |
-
menuItem.colors =
|
3149 |
updateItemEditor(containerNode);
|
3150 |
}
|
3151 |
});
|
@@ -3185,6 +2940,10 @@ $(document).ready(function(){
|
|
3185 |
//Add them all to the dropdown.
|
3186 |
var newOptions = jQuery([]);
|
3187 |
$.each(presetNames, function(unused, name) {
|
|
|
|
|
|
|
|
|
3188 |
newOptions = newOptions.add($('<option>', {
|
3189 |
val: name,
|
3190 |
text: name
|
@@ -3205,7 +2964,7 @@ $(document).ready(function(){
|
|
3205 |
var dropdown = $(this),
|
3206 |
presetName = dropdown.val();
|
3207 |
|
3208 |
-
colorPresetDeleteButton.toggleClass('hidden', (
|
3209 |
|
3210 |
if ((presetName === '[save_preset]') && menuColorDialog.dialog('isOpen')) {
|
3211 |
//Create a new preset.
|
@@ -3232,7 +2991,7 @@ $(document).ready(function(){
|
|
3232 |
|
3233 |
colorPresetDeleteButton.click(function() {
|
3234 |
var presetName = $('#ame-menu-color-presets').val();
|
3235 |
-
if ((
|
3236 |
return false;
|
3237 |
}
|
3238 |
if (!confirm('Are you sure you want to delete the preset "' + presetName + '"?')) {
|
@@ -3279,7 +3038,7 @@ $(document).ready(function(){
|
|
3279 |
return result;
|
3280 |
}
|
3281 |
|
3282 |
-
if (selectedActor === null) {
|
3283 |
//Hide from everyone except Super Admin and the current user.
|
3284 |
var menuItem = selection.data('menu_item'),
|
3285 |
validActors = _.keys(wsEditorData.actors),
|
@@ -3357,12 +3116,27 @@ $(document).ready(function(){
|
|
3357 |
}
|
3358 |
|
3359 |
function hideRecursively(containerNode, exceptActor) {
|
|
|
|
|
|
|
|
|
|
|
3360 |
applyCallbackRecursively(containerNode, function(menuItem) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3361 |
denyAccessForAllExcept(menuItem, exceptActor);
|
3362 |
});
|
3363 |
updateParentAccessUi(containerNode);
|
3364 |
}
|
3365 |
|
|
|
3366 |
if (hide === 'all') {
|
3367 |
if (wsEditorData.wsMenuEditorPro) {
|
3368 |
hideRecursively(selection, null);
|
@@ -3401,7 +3175,7 @@ $(document).ready(function(){
|
|
3401 |
/**
|
3402 |
* Check if it's possible to delete a menu item.
|
3403 |
*
|
3404 |
-
* @param {
|
3405 |
* @returns {boolean}
|
3406 |
*/
|
3407 |
function canDeleteItem(containerNode) {
|
@@ -3436,7 +3210,7 @@ $(document).ready(function(){
|
|
3436 |
* Attempt to delete a menu item. Will check if the item can actually be deleted and ask the user for confirmation.
|
3437 |
* UI callback.
|
3438 |
*
|
3439 |
-
* @param {
|
3440 |
*/
|
3441 |
function tryDeleteItem(selection) {
|
3442 |
var menuItem = selection.data('menu_item');
|
@@ -3448,7 +3222,7 @@ $(document).ready(function(){
|
|
3448 |
} else {
|
3449 |
//Non-custom items can not be deleted, but they can be hidden. Ask the user if they want to do that.
|
3450 |
menuDeletionDialog.find('#ws-ame-menu-type-desc').text(
|
3451 |
-
|
3452 |
);
|
3453 |
menuDeletionDialog.data('selected_menu', selection);
|
3454 |
|
@@ -3547,9 +3321,9 @@ $(document).ready(function(){
|
|
3547 |
|
3548 |
//Paste the menu after the specified one, or at the end of the list.
|
3549 |
if (afterMenu) {
|
3550 |
-
outputTopMenu(menu, afterMenu);
|
3551 |
} else {
|
3552 |
-
outputTopMenu(menu);
|
3553 |
}
|
3554 |
}
|
3555 |
|
@@ -3587,8 +3361,8 @@ $(document).ready(function(){
|
|
3587 |
});
|
3588 |
|
3589 |
//Make it accessible only to the current actor if one is selected.
|
3590 |
-
if (selectedActor !== null) {
|
3591 |
-
denyAccessForAllExcept(menu, selectedActor);
|
3592 |
}
|
3593 |
|
3594 |
//Insert the new menu
|
@@ -3634,18 +3408,18 @@ $(document).ready(function(){
|
|
3634 |
$('#ws_toggle_all_menus').click(function(event) {
|
3635 |
event.preventDefault();
|
3636 |
|
3637 |
-
if ( selectedActor === null ) {
|
3638 |
alert("This button enables/disables all menus for the selected role. To use it, click a role and then click this button again.");
|
3639 |
return;
|
3640 |
}
|
3641 |
|
3642 |
var topMenuNodes = $('.ws_menu', '#ws_menu_box');
|
3643 |
//Look at the first menu's permissions and set everything to the opposite.
|
3644 |
-
var allow = ! actorCanAccessMenu(topMenuNodes.eq(0).data('menu_item'), selectedActor);
|
3645 |
|
3646 |
topMenuNodes.each(function() {
|
3647 |
var containerNode = $(this);
|
3648 |
-
setActorAccessForTreeAndUpdateUi(containerNode, selectedActor, allow);
|
3649 |
});
|
3650 |
});
|
3651 |
|
@@ -3675,8 +3449,8 @@ $(document).ready(function(){
|
|
3675 |
});
|
3676 |
|
3677 |
//Pre-select the current actor as the destination.
|
3678 |
-
if (selectedActor !== null) {
|
3679 |
-
destinationActorList.val(selectedActor);
|
3680 |
}
|
3681 |
|
3682 |
//Restore the previous source selection.
|
@@ -3720,10 +3494,10 @@ $(document).ready(function(){
|
|
3720 |
|
3721 |
//If the user is currently looking at the destination actor, force the UI to refresh
|
3722 |
//so that they can see the new permissions.
|
3723 |
-
if (selectedActor === destinationActor) {
|
3724 |
//This is a bit of a hack, but right now there's no better way to refresh all items at once.
|
3725 |
-
setSelectedActor(null);
|
3726 |
-
setSelectedActor(destinationActor);
|
3727 |
}
|
3728 |
|
3729 |
//All done.
|
@@ -3872,7 +3646,7 @@ $(document).ready(function(){
|
|
3872 |
});
|
3873 |
|
3874 |
//Paste item
|
3875 |
-
function pasteItem(item) {
|
3876 |
//We're pasting this item into a sub-menu, so it can't have a sub-menu of its own.
|
3877 |
//Instead, any sub-menu items belonging to this item will be pasted after the item.
|
3878 |
var newItems = [];
|
@@ -3885,23 +3659,24 @@ $(document).ready(function(){
|
|
3885 |
|
3886 |
newItems.unshift(buildMenuItem(item, false));
|
3887 |
|
|
|
|
|
3888 |
//Get the selected menu
|
3889 |
-
var
|
3890 |
-
var selection = visibleSubmenu.find('.ws_active');
|
3891 |
for(var i = 0; i < newItems.length; i++) {
|
3892 |
if (selection.length > 0) {
|
3893 |
//If an item is selected add the pasted items after it
|
3894 |
selection.after(newItems[i]);
|
3895 |
} else {
|
3896 |
//Otherwise add the pasted items at the end
|
3897 |
-
|
3898 |
}
|
3899 |
|
3900 |
updateItemEditor(newItems[i]);
|
3901 |
newItems[i].show();
|
3902 |
}
|
3903 |
|
3904 |
-
updateParentAccessUi(
|
3905 |
}
|
3906 |
|
3907 |
$('#ws_paste_item').click(function (event) {
|
@@ -3942,8 +3717,8 @@ $(document).ready(function(){
|
|
3942 |
});
|
3943 |
|
3944 |
//Make it accessible to only the currently selected actor.
|
3945 |
-
if (selectedActor !== null) {
|
3946 |
-
denyAccessForAllExcept(entry, selectedActor);
|
3947 |
}
|
3948 |
|
3949 |
var menu = buildMenuItem(entry);
|
@@ -4026,8 +3801,7 @@ $(document).ready(function(){
|
|
4026 |
var data = encodeMenuAsJSON(tree);
|
4027 |
$('#ws_data').val(data);
|
4028 |
$('#ws_data_length').val(data.length);
|
4029 |
-
$('#ws_selected_actor').val(selectedActor === null ? '' : selectedActor);
|
4030 |
-
$('#ws_visible_users_json').val($.toJSON(wsEditorData.visibleUsers || []));
|
4031 |
$('#ws_main_form').submit();
|
4032 |
});
|
4033 |
|
@@ -4249,7 +4023,26 @@ $(document).ready(function(){
|
|
4249 |
|
4250 |
'drop' : (function(event, ui){
|
4251 |
var droppedItemData = readItemState(ui.draggable);
|
4252 |
-
pasteMenu(droppedItemData);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4253 |
if ( !event.ctrlKey ) {
|
4254 |
ui.draggable.remove();
|
4255 |
}
|
@@ -4352,124 +4145,50 @@ $(document).ready(function(){
|
|
4352 |
Actor views
|
4353 |
******************************************************************/
|
4354 |
|
4355 |
-
var actorSelector = $('#ws_actor_selector');
|
4356 |
-
|
4357 |
-
function rebuildActorIndex() {
|
4358 |
-
var actors = {};
|
4359 |
-
//Include all roles.
|
4360 |
-
_.forEach(wsEditorData.roles, function(role, id) {
|
4361 |
-
actors['role:' + id] = role.name;
|
4362 |
-
});
|
4363 |
-
//Include the Super Admin (multisite only).
|
4364 |
-
if (wsEditorData.users[wsEditorData.currentUserLogin].is_super_admin) {
|
4365 |
-
actors['special:super_admin'] = 'Super Admin';
|
4366 |
-
}
|
4367 |
-
//Include the current user.
|
4368 |
-
actors['user:' + wsEditorData.currentUserLogin] = 'Current user (' + wsEditorData.currentUserLogin + ')';
|
4369 |
-
|
4370 |
-
//Include other visible users.
|
4371 |
-
_(_.get(wsEditorData, 'visibleUsers', []))
|
4372 |
-
.without(wsEditorData.currentUserLogin)
|
4373 |
-
.sortBy()
|
4374 |
-
.forEach(function(login) {
|
4375 |
-
var user = AmeCapabilityManager.getUser(login);
|
4376 |
-
actors['user:' + login] = user.display_name + ' (' + login + ')';
|
4377 |
-
})
|
4378 |
-
.value();
|
4379 |
-
|
4380 |
-
//Keep the same object, but replace all keys/values.
|
4381 |
-
_.forEach(_.keys(wsEditorData.actors), function(oldActor) {
|
4382 |
-
delete wsEditorData.actors[oldActor];
|
4383 |
-
});
|
4384 |
-
_.assign(wsEditorData.actors, actors);
|
4385 |
-
}
|
4386 |
-
|
4387 |
-
|
4388 |
-
function populateActorSelector() {
|
4389 |
-
if (!wsEditorData.wsMenuEditorPro) {
|
4390 |
-
return;
|
4391 |
-
}
|
4392 |
-
|
4393 |
-
rebuildActorIndex();
|
4394 |
-
|
4395 |
-
//Build the list of available actors.
|
4396 |
-
actorSelector.empty();
|
4397 |
-
actorSelector.append('<li><a href="#" class="current ws_actor_option ws_no_actor" data-text="All">All</a></li>');
|
4398 |
-
|
4399 |
-
for(var actor in wsEditorData.actors) {
|
4400 |
-
if (!wsEditorData.actors.hasOwnProperty(actor)) {
|
4401 |
-
continue;
|
4402 |
-
}
|
4403 |
-
actorSelector.append(
|
4404 |
-
$('<li></li>').append(
|
4405 |
-
$('<a></a>')
|
4406 |
-
.attr('href', '#' + actor)
|
4407 |
-
.attr('data-text', wsEditorData.actors[actor])
|
4408 |
-
.text(wsEditorData.actors[actor])
|
4409 |
-
.addClass('ws_actor_option')
|
4410 |
-
)
|
4411 |
-
);
|
4412 |
-
}
|
4413 |
-
|
4414 |
-
var moreUsersText = 'Choose users\u2026';
|
4415 |
-
actorSelector.append(
|
4416 |
-
$('<li>').append(
|
4417 |
-
$('<a></a>')
|
4418 |
-
.attr('id', 'ws_show_more_users')
|
4419 |
-
.attr('href', '#more-users')
|
4420 |
-
.attr('data-text', moreUsersText)
|
4421 |
-
.text(moreUsersText)
|
4422 |
-
)
|
4423 |
-
);
|
4424 |
-
|
4425 |
-
actorSelector.show();
|
4426 |
-
|
4427 |
-
if (selectedActor && !wsEditorData.actors.hasOwnProperty(selectedActor)) {
|
4428 |
-
selectedActor = null;
|
4429 |
-
}
|
4430 |
-
setSelectedActor(selectedActor);
|
4431 |
-
}
|
4432 |
-
|
4433 |
-
AmeEditorApi.populateActorSelector = populateActorSelector;
|
4434 |
-
|
4435 |
if (wsEditorData.wsMenuEditorPro) {
|
4436 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4437 |
|
4438 |
if (wsEditorData.hasOwnProperty('selectedActor') && wsEditorData.selectedActor) {
|
4439 |
-
setSelectedActor(wsEditorData.selectedActor);
|
4440 |
} else {
|
4441 |
-
setSelectedActor(null);
|
4442 |
}
|
4443 |
}
|
4444 |
|
4445 |
-
|
4446 |
-
|
4447 |
-
if (actor === '') {
|
4448 |
-
actor = null;
|
4449 |
-
}
|
4450 |
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
|
4455 |
-
|
4456 |
-
event.preventDefault();
|
4457 |
-
AmeVisibleUserDialog.open({
|
4458 |
-
currentUserLogin : wsEditorData.currentUserLogin,
|
4459 |
-
users : AmeCapabilityManager.getUsers(),
|
4460 |
-
visibleUsers : _.get(wsEditorData, 'visibleUsers', []),
|
4461 |
-
|
4462 |
-
save: function(userDetails, selectedUsers) {
|
4463 |
-
AmeCapabilityManager.addUsers(userDetails);
|
4464 |
-
wsEditorData.visibleUsers = selectedUsers;
|
4465 |
-
populateActorSelector();
|
4466 |
-
}
|
4467 |
-
});
|
4468 |
-
});
|
4469 |
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4473 |
|
4474 |
})(jQuery, wsAmeLodash);
|
4475 |
|
38 |
* @property {string|null} wsEditorData.selectedActor
|
39 |
*
|
40 |
* @property {object} wsEditorData.actors
|
|
|
|
|
41 |
* @property {string[]} wsEditorData.visibleUsers
|
42 |
*
|
43 |
* @property {object} wsEditorData.postTypes
|
67 |
}
|
68 |
});
|
69 |
|
70 |
+
AmeCapabilityManager = AmeActors;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
/**
|
73 |
* A utility for retrieving post and page titles.
|
143 |
(function ($, _){
|
144 |
'use strict';
|
145 |
|
146 |
+
var actorSelectorWidget = new AmeActorSelector(AmeActors, wsEditorData.wsMenuEditorPro);
|
147 |
|
148 |
var itemTemplates = {
|
149 |
templates: wsEditorData.itemTemplates,
|
388 |
//the editors themselves are created later, when the user tries to access them
|
389 |
//for the first time).
|
390 |
var contents = [];
|
391 |
+
var menuTitle = getFieldValue(itemData, 'menu_title', '');
|
392 |
if (menuTitle === '') {
|
393 |
menuTitle = ' ';
|
394 |
}
|
887 |
AmeEditorApi.getItemDisplayUrl = function(menuItem) {
|
888 |
var url = getFieldValue(menuItem, 'file', '');
|
889 |
if (menuItem.template_id !== '') {
|
890 |
+
//Use the template URL. It's a preset that can't be overridden.
|
891 |
var defaultUrl = itemTemplates.getDefaultValue(menuItem.template_id, 'url');
|
892 |
if (defaultUrl) {
|
893 |
url = defaultUrl;
|
1041 |
* Get the parent menu of a menu item.
|
1042 |
*
|
1043 |
* @param containerNode A DOM element as a jQuery object.
|
1044 |
+
* @return {JQuery} Parent container node, or an empty jQuery set.
|
1045 |
*/
|
1046 |
function getParentMenuNode(containerNode) {
|
1047 |
var submenu = containerNode.closest('.ws_submenu', '#ws_menu_editor'),
|
1056 |
/**
|
1057 |
* Get all submenu items of a menu item.
|
1058 |
*
|
1059 |
+
* @param {JQuery} containerNode
|
1060 |
+
* @return {JQuery} A list of submenu item container nodes, or an empty set.
|
1061 |
*/
|
1062 |
function getSubmenuItemNodes(containerNode) {
|
1063 |
var subMenuId = containerNode.data('submenu_id');
|
1091 |
function updateActorAccessUi(containerNode) {
|
1092 |
//Update the permissions checkbox & UI
|
1093 |
var menuItem = containerNode.data('menu_item');
|
1094 |
+
if (actorSelectorWidget.selectedActor !== null) {
|
1095 |
+
var hasAccess = actorCanAccessMenu(menuItem, actorSelectorWidget.selectedActor);
|
1096 |
+
var hasCustomPermissions = actorHasCustomPermissions(menuItem, actorSelectorWidget.selectedActor);
|
1097 |
|
1098 |
var isOverrideActive = !hasAccess && getFieldValue(menuItem, 'restrict_access_to_items', false);
|
1099 |
|
1105 |
if (
|
1106 |
parentItem
|
1107 |
&& getFieldValue(parentItem, 'restrict_access_to_items', false)
|
1108 |
+
&& !actorCanAccessMenu(parentItem, actorSelectorWidget.selectedActor)
|
1109 |
) {
|
1110 |
hasAccess = false;
|
1111 |
isOverrideActive = true;
|
1130 |
if ( !item ) { //Skip placeholder items created by drag & drop operations.
|
1131 |
return true;
|
1132 |
}
|
1133 |
+
var hasSubmenuAccess = actorCanAccessMenu(item, actorSelectorWidget.selectedActor);
|
1134 |
if (hasSubmenuAccess !== hasAccess) {
|
1135 |
differentPermissions = true;
|
1136 |
return false;
|
1162 |
}
|
1163 |
|
1164 |
//Update the "hidden" flag.
|
1165 |
+
setMenuFlag(containerNode, 'hidden', itemHasHiddenFlag(menuItem, actorSelectorWidget.selectedActor));
|
1166 |
}
|
1167 |
|
1168 |
/**
|
1188 |
/**
|
1189 |
* Update an edit widget with the current menu item settings.
|
1190 |
*
|
1191 |
+
* @param {JQuery} containerNode
|
1192 |
*/
|
1193 |
function updateItemEditor(containerNode) {
|
1194 |
var menuItem = containerNode.data('menu_item');
|
1209 |
var input = field.find('.ws_field_value').first();
|
1210 |
|
1211 |
var hasADefaultValue = itemTemplates.hasDefaultValue(menuItem.template_id, fieldName);
|
1212 |
+
var defaultValue = getDefaultValue(menuItem, fieldName, null, containerNode);
|
1213 |
var isDefault = hasADefaultValue && ((typeof menuItem[fieldName] === 'undefined') || (menuItem[fieldName] === null));
|
1214 |
|
1215 |
if (fieldName === 'access_level') {
|
1258 |
* @param {Object} entry
|
1259 |
* @param {string} fieldName
|
1260 |
* @param {*} [defaultValue]
|
1261 |
+
* @param {JQuery} [containerNode]
|
1262 |
* @return {*}
|
1263 |
*/
|
1264 |
function getFieldValue(entry, fieldName, defaultValue, containerNode){
|
1265 |
if ( (typeof entry[fieldName] === 'undefined') || (entry[fieldName] === null) ) {
|
1266 |
+
return getDefaultValue(entry, fieldName, defaultValue, containerNode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1267 |
} else {
|
1268 |
return entry[fieldName];
|
1269 |
}
|
1271 |
|
1272 |
AmeEditorApi.getFieldValue = getFieldValue;
|
1273 |
|
1274 |
+
/**
|
1275 |
+
* Get the default value of a menu field.
|
1276 |
+
*
|
1277 |
+
* @param {Object} entry
|
1278 |
+
* @param {String} fieldName
|
1279 |
+
* @param {*} [defaultValue]
|
1280 |
+
* @param {JQuery} [containerNode]
|
1281 |
+
* @returns {*}
|
1282 |
+
*/
|
1283 |
+
function getDefaultValue(entry, fieldName, defaultValue, containerNode) {
|
1284 |
+
//By default, a submenu item has the same icon as its parent.
|
1285 |
+
if ((fieldName === 'icon_url') && containerNode && (wsEditorData.submenuIconsEnabled !== 'never')) {
|
1286 |
+
var parentContainerNode = getParentMenuNode(containerNode),
|
1287 |
+
parentMenuItem = parentContainerNode.data('menu_item');
|
1288 |
+
if (parentMenuItem) {
|
1289 |
+
return getFieldValue(parentMenuItem, fieldName, defaultValue, parentContainerNode);
|
1290 |
+
}
|
1291 |
+
}
|
1292 |
+
|
1293 |
+
if (typeof defaultValue === 'undefined') {
|
1294 |
+
defaultValue = null;
|
1295 |
+
}
|
1296 |
+
|
1297 |
+
//Known templates take precedence.
|
1298 |
+
if ((entry.template_id === '') || (typeof itemTemplates.templates[entry.template_id] !== 'undefined')) {
|
1299 |
+
var templateDefault = itemTemplates.getDefaultValue(entry.template_id, fieldName);
|
1300 |
+
return (templateDefault !== null) ? templateDefault : defaultValue;
|
1301 |
+
}
|
1302 |
+
|
1303 |
+
if (fieldName === 'template_id') {
|
1304 |
+
return null;
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
//Separators can have their own defaults, independent of templates.
|
1308 |
+
var hasDefault = (typeof entry.defaults !== 'undefined') && (typeof entry.defaults[fieldName] !== 'undefined');
|
1309 |
+
if (hasDefault){
|
1310 |
+
return entry.defaults[fieldName];
|
1311 |
+
}
|
1312 |
+
|
1313 |
+
return defaultValue;
|
1314 |
+
}
|
1315 |
+
|
1316 |
/*
|
1317 |
* Make a menu container sortable
|
1318 |
*/
|
1392 |
var menu = readItemState(containerNode, menuPosition++);
|
1393 |
|
1394 |
//Attach the current menu to the main structure.
|
1395 |
+
var filename = getFieldValue(menu, 'file');
|
1396 |
|
1397 |
//Give unclickable items unique keys.
|
1398 |
if (menu.template_id === wsEditorData.unclickableTemplateId) {
|
1418 |
itemsByFilename[filename] = containerNode;
|
1419 |
});
|
1420 |
|
1421 |
+
AmeCapabilityManager.pruneGrantedUserCapabilities();
|
1422 |
|
1423 |
return {
|
1424 |
tree: tree,
|
1586 |
isHidden = menuItem.hidden_from_actor[actor];
|
1587 |
} else {
|
1588 |
//Otherwise the item is hidden only if it is hidden from all of the user's roles.
|
1589 |
+
userLogin = actorSelectorWidget.selectedActor.substr(userPrefix.length);
|
1590 |
+
userActors = AmeCapabilityManager.getGroupActorsFor(userLogin);
|
1591 |
for (var i = 0; i < userActors.length; i++) {
|
1592 |
if (menuItem.hidden_from_actor.hasOwnProperty(userActors[i]) && menuItem.hidden_from_actor[userActors[i]]) {
|
1593 |
isHidden = true;
|
1610 |
*
|
1611 |
* Applies to the selected actor, or all actors if no actor is selected.
|
1612 |
*
|
1613 |
+
* @param {JQuery} selection A menu container node.
|
1614 |
* @param {boolean} [isHidden] Optional. True = hide the menu, false = show the menu.
|
1615 |
*/
|
1616 |
function toggleItemHiddenFlag(selection, isHidden) {
|
1618 |
|
1619 |
//By default, invert the current state.
|
1620 |
if (typeof isHidden === 'undefined') {
|
1621 |
+
isHidden = !itemHasHiddenFlag(menuItem, actorSelectorWidget.selectedActor);
|
1622 |
}
|
1623 |
|
1624 |
//Mark the menu as hidden/visible
|
1625 |
+
if (actorSelectorWidget.selectedActor === null) {
|
1626 |
//For ALL roles and users.
|
1627 |
menuItem.hidden = isHidden;
|
1628 |
menuItem.hidden_from_actor = {};
|
1629 |
} else {
|
1630 |
//Just for the current role.
|
1631 |
if (isHidden) {
|
1632 |
+
menuItem.hidden_from_actor[actorSelectorWidget.selectedActor] = true;
|
1633 |
} else {
|
1634 |
+
if (actorSelectorWidget.selectedActor.indexOf('user:') === 0) {
|
1635 |
//User-specific exception. Lets you can hide a menu from all admins but leave it visible to yourself.
|
1636 |
+
menuItem.hidden_from_actor[actorSelectorWidget.selectedActor] = false;
|
1637 |
} else {
|
1638 |
+
delete menuItem.hidden_from_actor[actorSelectorWidget.selectedActor];
|
1639 |
}
|
1640 |
}
|
1641 |
|
1644 |
if (!isHidden && menuItem.hidden) {
|
1645 |
menuItem.hidden = false;
|
1646 |
$.each(wsEditorData.actors, function(otherActor) {
|
1647 |
+
if (otherActor !== actorSelectorWidget.selectedActor) {
|
1648 |
menuItem.hidden_from_actor[otherActor] = true;
|
1649 |
}
|
1650 |
});
|
1712 |
}
|
1713 |
}
|
1714 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1715 |
/**
|
1716 |
* Make a menu item inaccessible to everyone except a particular actor.
|
1717 |
*
|
1732 |
|
1733 |
$.each(wsEditorData.actors, function(otherActor) {
|
1734 |
//If the input actor is more or equally specific...
|
1735 |
+
if ((actor === null) || (AmeActorManager.compareActorSpecificity(actor, otherActor) >= 0)) {
|
1736 |
menuItem.grant_access[otherActor] = false;
|
1737 |
}
|
1738 |
});
|
1755 |
var colorPresets = {},
|
1756 |
wasPresetDropdownPopulated = false;
|
1757 |
|
1758 |
+
//Combined DOM-ready event handler.
|
1759 |
+
var isDomReadyDone = false;
|
1760 |
+
|
1761 |
+
function ameOnDomReady() {
|
1762 |
+
isDomReadyDone = true;
|
1763 |
+
|
1764 |
//Some editor elements are only available in the Pro version.
|
1765 |
if (wsEditorData.wsMenuEditorPro) {
|
1766 |
knownMenuFields.open_in.visible = true;
|
1936 |
|
1937 |
var oldValue = menuItem[fieldName];
|
1938 |
var value = getInputValue(input);
|
1939 |
+
var defaultValue = getDefaultValue(menuItem, fieldName, null, containerNode);
|
1940 |
var hasADefaultValue = (defaultValue !== null);
|
1941 |
|
1942 |
//Some fields/templates have no default values.
|
1986 |
|
1987 |
//Allow/forbid items in actor-specific views
|
1988 |
menuEditorNode.on('click', 'input.ws_actor_access_checkbox', function() {
|
1989 |
+
if (actorSelectorWidget.selectedActor === null) {
|
1990 |
return;
|
1991 |
}
|
1992 |
|
1999 |
updateItemEditor(containerNode); //Resets the checkbox back to the old value.
|
2000 |
confirmDashboardHiding(function(ok) {
|
2001 |
if (ok) {
|
2002 |
+
setActorAccessForTreeAndUpdateUi(containerNode, actorSelectorWidget.selectedActor, checked);
|
2003 |
}
|
2004 |
});
|
2005 |
} else {
|
2006 |
+
setActorAccessForTreeAndUpdateUi(containerNode, actorSelectorWidget.selectedActor, checked);
|
2007 |
}
|
2008 |
});
|
2009 |
|
2154 |
AmeItemAccessEditor.open({
|
2155 |
menuItem: menuItem,
|
2156 |
containerNode: containerNode,
|
2157 |
+
selectedActor: actorSelectorWidget.selectedActor,
|
2158 |
itemHasSubmenus: (!!(containerNode.data('submenu_id')) &&
|
2159 |
$('#' + containerNode.data('submenu_id')).find('.ws_item').length > 0)
|
2160 |
});
|
2703 |
}
|
2704 |
|
2705 |
var colorDialogState = {
|
2706 |
+
menuItem: null,
|
2707 |
+
editingGlobalColors: false
|
2708 |
};
|
2709 |
|
2710 |
var menuColorVariables = [
|
2744 |
$(this).text(showAdvancedColors ? 'Hide advanced options' : 'Show advanced options');
|
2745 |
});
|
2746 |
|
|
|
2747 |
var colorPickersInitialized = false;
|
2748 |
+
function setUpColorDialog(dialogTitle) {
|
2749 |
//Initializing the color pickers takes a while, so we only do it when needed instead of on document ready.
|
2750 |
if ( !colorPickersInitialized ) {
|
2751 |
menuColorDialog.find('.ame-color-picker').wpColorPicker({
|
2756 |
colorPickersInitialized = true;
|
2757 |
}
|
2758 |
|
2759 |
+
//Populate presets and deselect the previously selected option.
|
2760 |
+
colorPresetDropdown.val('');
|
2761 |
+
if (!wasPresetDropdownPopulated) {
|
2762 |
+
populatePresetDropdown();
|
2763 |
+
wasPresetDropdownPopulated = true;
|
2764 |
+
}
|
2765 |
+
|
2766 |
+
//Update the dialog title.
|
2767 |
+
menuColorDialog.dialog('option', 'title', dialogTitle);
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
//"Edit.." color schemes.
|
2771 |
+
menuEditorNode.on('click', '.ws_open_color_editor, .ws_color_scheme_display', function() {
|
2772 |
var containerNode = $(this).parents('.ws_container').first();
|
2773 |
var menuItem = containerNode.data('menu_item');
|
2774 |
|
2775 |
colorDialogState.containerNode = containerNode;
|
2776 |
colorDialogState.menuItem = menuItem;
|
2777 |
+
colorDialogState.editingGlobalColors = false;
|
2778 |
|
2779 |
+
//Add menu title to the dialog caption.
|
2780 |
+
var title = getFieldValue(menuItem, 'menu_title', null);
|
2781 |
+
setUpColorDialog(title ? ('Colors: ' + title.substring(0, 30)) : 'Colors');
|
2782 |
+
|
2783 |
+
//Show the [global] preset only if the user has set it up.
|
2784 |
+
var globalPresetExists = colorPresets.hasOwnProperty('[global]');
|
2785 |
+
menuColorDialog.find('#ame-global-colors-preset').toggle(globalPresetExists);
|
2786 |
+
|
2787 |
+
var colors = getFieldValue(menuItem, 'colors', {}),
|
2788 |
+
colorsToDisplay = colors || {};
|
2789 |
+
if (_.isEmpty(colors)) {
|
2790 |
+
//Normalization. No custom colors = use default colors, and null is used to indicate default settings.
|
2791 |
menuItem.colors = null;
|
2792 |
+
//If no custom colors, select and display the global preset.
|
2793 |
+
if (globalPresetExists) {
|
2794 |
+
colorsToDisplay = colorPresets['[global]'];
|
2795 |
+
colorPresetDropdown.val('[global]');
|
2796 |
+
colorPresetDeleteButton.hide();
|
2797 |
+
}
|
2798 |
}
|
2799 |
+
displayColorSettingsInDialog(colorsToDisplay);
|
2800 |
|
2801 |
+
menuColorDialog.dialog('open');
|
2802 |
+
});
|
2803 |
+
|
2804 |
+
//The "Colors" button in the main sidebar.
|
2805 |
+
$('#ws_edit_global_colors').click(function() {
|
2806 |
+
colorDialogState.editingGlobalColors = true;
|
2807 |
+
colorDialogState.menuItem = null;
|
2808 |
+
colorDialogState.containerNode = null;
|
2809 |
+
|
2810 |
+
setUpColorDialog('Default menu colors');
|
2811 |
+
displayColorSettingsInDialog(_.get(colorPresets, '[global]', {}));
|
2812 |
+
|
2813 |
+
//Hide the [global] preset. We'll be editing it.
|
2814 |
+
menuColorDialog.find('#ame-global-colors-preset').hide();
|
2815 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2816 |
menuColorDialog.dialog('open');
|
2817 |
});
|
2818 |
|
2859 |
//The "Save Changes" button in the color dialog.
|
2860 |
$('#ws-ame-save-menu-colors').click(function() {
|
2861 |
menuColorDialog.dialog('close');
|
2862 |
+
var colors = getColorSettingsFromDialog();
|
2863 |
+
|
2864 |
+
if ( colorDialogState.editingGlobalColors ) {
|
2865 |
+
if (colors === null) {
|
2866 |
+
delete colorPresets['[global]'];
|
2867 |
+
} else {
|
2868 |
+
colorPresets['[global]'] = colors;
|
2869 |
+
}
|
2870 |
+
} else if ( colorDialogState.menuItem ) {
|
2871 |
+
var menuItem = colorDialogState.menuItem;
|
2872 |
+
//If colors match the global settings, reset them to null. Using the [global] preset is the default.
|
2873 |
+
if (_.has(colorPresets, '[global]') && _.isEqual(colors, colorPresets['[global]'])) {
|
2874 |
+
menuItem.colors = null;
|
2875 |
+
} else {
|
2876 |
+
menuItem.colors = colors;
|
2877 |
+
}
|
2878 |
+
updateItemEditor(colorDialogState.containerNode);
|
2879 |
}
|
|
|
|
|
|
|
2880 |
|
2881 |
colorDialogState.containerNode = null;
|
2882 |
colorDialogState.menuItem = null;
|
2883 |
+
colorDialogState.editingGlobalColors = false;
|
2884 |
});
|
2885 |
|
2886 |
//The "Apply to All" button in the same dialog.
|
2889 |
return;
|
2890 |
}
|
2891 |
|
2892 |
+
//Set this as the global preset and remove custom settings from all items.
|
2893 |
var newColors = getColorSettingsFromDialog();
|
2894 |
+
if (newColors === null) {
|
2895 |
+
delete colorPresets['[global]'];
|
2896 |
+
} else {
|
2897 |
+
colorPresets['[global]'] = newColors;
|
2898 |
+
}
|
2899 |
$('#ws_menu_box').find('.ws_menu').each(function() {
|
2900 |
var containerNode = $(this),
|
2901 |
menuItem = containerNode.data('menu_item');
|
2902 |
if (!menuItem.separator) {
|
2903 |
+
menuItem.colors = null;
|
2904 |
updateItemEditor(containerNode);
|
2905 |
}
|
2906 |
});
|
2940 |
//Add them all to the dropdown.
|
2941 |
var newOptions = jQuery([]);
|
2942 |
$.each(presetNames, function(unused, name) {
|
2943 |
+
if (name === '[global]') {
|
2944 |
+
return;
|
2945 |
+
}
|
2946 |
+
|
2947 |
newOptions = newOptions.add($('<option>', {
|
2948 |
val: name,
|
2949 |
text: name
|
2964 |
var dropdown = $(this),
|
2965 |
presetName = dropdown.val();
|
2966 |
|
2967 |
+
colorPresetDeleteButton.toggleClass('hidden', _.includes(['[save_preset]', '[global]', '', null], presetName));
|
2968 |
|
2969 |
if ((presetName === '[save_preset]') && menuColorDialog.dialog('isOpen')) {
|
2970 |
//Create a new preset.
|
2991 |
|
2992 |
colorPresetDeleteButton.click(function() {
|
2993 |
var presetName = $('#ame-menu-color-presets').val();
|
2994 |
+
if ( _.includes(['[save_preset]', '[global]', '', null], presetName) ) {
|
2995 |
return false;
|
2996 |
}
|
2997 |
if (!confirm('Are you sure you want to delete the preset "' + presetName + '"?')) {
|
3038 |
return result;
|
3039 |
}
|
3040 |
|
3041 |
+
if (actorSelectorWidget.selectedActor === null) {
|
3042 |
//Hide from everyone except Super Admin and the current user.
|
3043 |
var menuItem = selection.data('menu_item'),
|
3044 |
validActors = _.keys(wsEditorData.actors),
|
3116 |
}
|
3117 |
|
3118 |
function hideRecursively(containerNode, exceptActor) {
|
3119 |
+
var otherActors = _(actorSelectorWidget.getVisibleActors())
|
3120 |
+
.pluck('id')
|
3121 |
+
.without(exceptActor)
|
3122 |
+
.value();
|
3123 |
+
|
3124 |
applyCallbackRecursively(containerNode, function(menuItem) {
|
3125 |
+
//Remember which actors had access to this item so that it
|
3126 |
+
//can be un-hidden by the toolbar button.
|
3127 |
+
var actorsWithAccess = _.filter(otherActors, function(actor) {
|
3128 |
+
return actorCanAccessMenu(menuItem, actor);
|
3129 |
+
});
|
3130 |
+
if ((actorsWithAccess.length) > 0) {
|
3131 |
+
menuItem.had_access_before_hiding = actorsWithAccess;
|
3132 |
+
}
|
3133 |
+
|
3134 |
denyAccessForAllExcept(menuItem, exceptActor);
|
3135 |
});
|
3136 |
updateParentAccessUi(containerNode);
|
3137 |
}
|
3138 |
|
3139 |
+
//TODO: Write had_access_before_hiding so that it can be un-hidden using the toolbar button.
|
3140 |
if (hide === 'all') {
|
3141 |
if (wsEditorData.wsMenuEditorPro) {
|
3142 |
hideRecursively(selection, null);
|
3175 |
/**
|
3176 |
* Check if it's possible to delete a menu item.
|
3177 |
*
|
3178 |
+
* @param {JQuery} containerNode
|
3179 |
* @returns {boolean}
|
3180 |
*/
|
3181 |
function canDeleteItem(containerNode) {
|
3210 |
* Attempt to delete a menu item. Will check if the item can actually be deleted and ask the user for confirmation.
|
3211 |
* UI callback.
|
3212 |
*
|
3213 |
+
* @param {JQuery} selection The selected menu item (DOM node).
|
3214 |
*/
|
3215 |
function tryDeleteItem(selection) {
|
3216 |
var menuItem = selection.data('menu_item');
|
3222 |
} else {
|
3223 |
//Non-custom items can not be deleted, but they can be hidden. Ask the user if they want to do that.
|
3224 |
menuDeletionDialog.find('#ws-ame-menu-type-desc').text(
|
3225 |
+
getDefaultValue(menuItem, 'is_plugin_page') ? 'an item added by another plugin' : 'a built-in menu item'
|
3226 |
);
|
3227 |
menuDeletionDialog.data('selected_menu', selection);
|
3228 |
|
3321 |
|
3322 |
//Paste the menu after the specified one, or at the end of the list.
|
3323 |
if (afterMenu) {
|
3324 |
+
return outputTopMenu(menu, afterMenu);
|
3325 |
} else {
|
3326 |
+
return outputTopMenu(menu);
|
3327 |
}
|
3328 |
}
|
3329 |
|
3361 |
});
|
3362 |
|
3363 |
//Make it accessible only to the current actor if one is selected.
|
3364 |
+
if (actorSelectorWidget.selectedActor !== null) {
|
3365 |
+
denyAccessForAllExcept(menu, actorSelectorWidget.selectedActor);
|
3366 |
}
|
3367 |
|
3368 |
//Insert the new menu
|
3408 |
$('#ws_toggle_all_menus').click(function(event) {
|
3409 |
event.preventDefault();
|
3410 |
|
3411 |
+
if ( actorSelectorWidget.selectedActor === null ) {
|
3412 |
alert("This button enables/disables all menus for the selected role. To use it, click a role and then click this button again.");
|
3413 |
return;
|
3414 |
}
|
3415 |
|
3416 |
var topMenuNodes = $('.ws_menu', '#ws_menu_box');
|
3417 |
//Look at the first menu's permissions and set everything to the opposite.
|
3418 |
+
var allow = ! actorCanAccessMenu(topMenuNodes.eq(0).data('menu_item'), actorSelectorWidget.selectedActor);
|
3419 |
|
3420 |
topMenuNodes.each(function() {
|
3421 |
var containerNode = $(this);
|
3422 |
+
setActorAccessForTreeAndUpdateUi(containerNode, actorSelectorWidget.selectedActor, allow);
|
3423 |
});
|
3424 |
});
|
3425 |
|
3449 |
});
|
3450 |
|
3451 |
//Pre-select the current actor as the destination.
|
3452 |
+
if (actorSelectorWidget.selectedActor !== null) {
|
3453 |
+
destinationActorList.val(actorSelectorWidget.selectedActor);
|
3454 |
}
|
3455 |
|
3456 |
//Restore the previous source selection.
|
3494 |
|
3495 |
//If the user is currently looking at the destination actor, force the UI to refresh
|
3496 |
//so that they can see the new permissions.
|
3497 |
+
if (actorSelectorWidget.selectedActor === destinationActor) {
|
3498 |
//This is a bit of a hack, but right now there's no better way to refresh all items at once.
|
3499 |
+
actorSelectorWidget.setSelectedActor(null);
|
3500 |
+
actorSelectorWidget.setSelectedActor(destinationActor);
|
3501 |
}
|
3502 |
|
3503 |
//All done.
|
3646 |
});
|
3647 |
|
3648 |
//Paste item
|
3649 |
+
function pasteItem(item, targetSubmenu) {
|
3650 |
//We're pasting this item into a sub-menu, so it can't have a sub-menu of its own.
|
3651 |
//Instead, any sub-menu items belonging to this item will be pasted after the item.
|
3652 |
var newItems = [];
|
3659 |
|
3660 |
newItems.unshift(buildMenuItem(item, false));
|
3661 |
|
3662 |
+
//Paste into the currently visible submenu by default.
|
3663 |
+
targetSubmenu = targetSubmenu || $('#ws_submenu_box').find('.ws_submenu:visible');
|
3664 |
//Get the selected menu
|
3665 |
+
var selection = targetSubmenu.find('.ws_active');
|
|
|
3666 |
for(var i = 0; i < newItems.length; i++) {
|
3667 |
if (selection.length > 0) {
|
3668 |
//If an item is selected add the pasted items after it
|
3669 |
selection.after(newItems[i]);
|
3670 |
} else {
|
3671 |
//Otherwise add the pasted items at the end
|
3672 |
+
targetSubmenu.append(newItems[i]);
|
3673 |
}
|
3674 |
|
3675 |
updateItemEditor(newItems[i]);
|
3676 |
newItems[i].show();
|
3677 |
}
|
3678 |
|
3679 |
+
updateParentAccessUi(targetSubmenu);
|
3680 |
}
|
3681 |
|
3682 |
$('#ws_paste_item').click(function (event) {
|
3717 |
});
|
3718 |
|
3719 |
//Make it accessible to only the currently selected actor.
|
3720 |
+
if (actorSelectorWidget.selectedActor !== null) {
|
3721 |
+
denyAccessForAllExcept(entry, actorSelectorWidget.selectedActor);
|
3722 |
}
|
3723 |
|
3724 |
var menu = buildMenuItem(entry);
|
3801 |
var data = encodeMenuAsJSON(tree);
|
3802 |
$('#ws_data').val(data);
|
3803 |
$('#ws_data_length').val(data.length);
|
3804 |
+
$('#ws_selected_actor').val(actorSelectorWidget.selectedActor === null ? '' : actorSelectorWidget.selectedActor);
|
|
|
3805 |
$('#ws_main_form').submit();
|
3806 |
});
|
3807 |
|
4023 |
|
4024 |
'drop' : (function(event, ui){
|
4025 |
var droppedItemData = readItemState(ui.draggable);
|
4026 |
+
var newItemNodes = pasteMenu(droppedItemData);
|
4027 |
+
|
4028 |
+
//If the item was originally a top level menu, also move its original submenu items.
|
4029 |
+
if (getFieldValue(droppedItemData, 'parent') === null) {
|
4030 |
+
var droppedItemFile = getFieldValue(droppedItemData, 'file');
|
4031 |
+
var nearbyItems = $(ui.draggable).siblings('.ws_item');
|
4032 |
+
nearbyItems.each(function() {
|
4033 |
+
var containerNode = $(this),
|
4034 |
+
submenuItem = containerNode.data('menu_item');
|
4035 |
+
|
4036 |
+
//Was this item originally a child of the dragged menu?
|
4037 |
+
if (getFieldValue(submenuItem, 'parent') === droppedItemFile) {
|
4038 |
+
pasteItem(submenuItem, newItemNodes.submenu);
|
4039 |
+
if ( !event.ctrlKey ) {
|
4040 |
+
containerNode.remove();
|
4041 |
+
}
|
4042 |
+
}
|
4043 |
+
});
|
4044 |
+
}
|
4045 |
+
|
4046 |
if ( !event.ctrlKey ) {
|
4047 |
ui.draggable.remove();
|
4048 |
}
|
4145 |
Actor views
|
4146 |
******************************************************************/
|
4147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4148 |
if (wsEditorData.wsMenuEditorPro) {
|
4149 |
+
actorSelectorWidget.onChange(function() {
|
4150 |
+
//There are some UI elements that can be visible or hidden depending on whether an actor is selected.
|
4151 |
+
var editorNode = $('#ws_menu_editor');
|
4152 |
+
editorNode.toggleClass('ws_is_actor_view', (actorSelectorWidget.selectedActor !== null));
|
4153 |
+
|
4154 |
+
//Update the menu item states to indicate whether they're accessible.
|
4155 |
+
editorNode.find('.ws_container').each(function() {
|
4156 |
+
updateActorAccessUi($(this));
|
4157 |
+
});
|
4158 |
+
});
|
4159 |
|
4160 |
if (wsEditorData.hasOwnProperty('selectedActor') && wsEditorData.selectedActor) {
|
4161 |
+
actorSelectorWidget.setSelectedActor(wsEditorData.selectedActor);
|
4162 |
} else {
|
4163 |
+
actorSelectorWidget.setSelectedActor(null);
|
4164 |
}
|
4165 |
}
|
4166 |
|
4167 |
+
//Finally, show the menu
|
4168 |
+
loadMenuConfiguration(customMenu);
|
|
|
|
|
|
|
4169 |
|
4170 |
+
//... and make the UI visible now that it's fully rendered.
|
4171 |
+
menuEditorNode.css('visibility', 'visible');
|
4172 |
+
}
|
4173 |
|
4174 |
+
$(document).ready(ameOnDomReady);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4175 |
|
4176 |
+
//Compatibility workaround: If another plugin or theme throws an exception in its jQuery.ready() handler,
|
4177 |
+
//our callback might never get run. As a backup, set a timer and manually check if the DOM is ready.
|
4178 |
+
var domCheckAttempts = 0,
|
4179 |
+
maxDomCheckAttempts = 30;
|
4180 |
+
var domCheckIntervalId = window.setInterval(function () {
|
4181 |
+
if (isDomReadyDone || (domCheckAttempts >= maxDomCheckAttempts)) {
|
4182 |
+
window.clearInterval(domCheckIntervalId);
|
4183 |
+
return;
|
4184 |
+
}
|
4185 |
+
domCheckAttempts++;
|
4186 |
+
|
4187 |
+
if ($ && $.isReady) {
|
4188 |
+
isDomReadyDone = true;
|
4189 |
+
ameOnDomReady();
|
4190 |
+
}
|
4191 |
+
}, 1000);
|
4192 |
|
4193 |
})(jQuery, wsAmeLodash);
|
4194 |
|
menu-editor.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Admin Menu Editor
|
4 |
Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
|
5 |
Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
|
6 |
-
Version: 1.
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
@@ -12,6 +12,10 @@ if ( include(dirname(__FILE__) . '/includes/version-conflict-check.php') ) {
|
|
12 |
return;
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
15 |
//Are we running in the Dashboard?
|
16 |
if ( is_admin() ) {
|
17 |
|
3 |
Plugin Name: Admin Menu Editor
|
4 |
Plugin URI: http://w-shadow.com/blog/2008/12/20/admin-menu-editor-for-wordpress/
|
5 |
Description: Lets you directly edit the WordPress admin menu. You can re-order, hide or rename existing menus, add custom menus and more.
|
6 |
+
Version: 1.6
|
7 |
Author: Janis Elsts
|
8 |
Author URI: http://w-shadow.com/blog/
|
9 |
*/
|
12 |
return;
|
13 |
}
|
14 |
|
15 |
+
if ( !defined('AME_ROOT_DIR') ) {
|
16 |
+
define('AME_ROOT_DIR', dirname(__FILE__));
|
17 |
+
}
|
18 |
+
|
19 |
//Are we running in the Dashboard?
|
20 |
if ( is_admin() ) {
|
21 |
|
modules/actor-selector/actor-selector-template.php
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="ws_actor_selector_container">
|
2 |
+
<ul id="ws_actor_selector" class="subsubsub" style="display: none;">
|
3 |
+
<!-- Contents will be generated by JS -->
|
4 |
+
</ul>
|
5 |
+
<div class="clear"></div>
|
6 |
+
</div>
|
modules/actor-selector/actor-selector.js
ADDED
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/// <reference path="../../js/jquery.d.ts" />
|
2 |
+
/// <reference path="../../js/jquery-json.d.ts" />
|
3 |
+
/// <reference path="../../js/actor-manager.ts" />
|
4 |
+
var AmeActorSelector = (function () {
|
5 |
+
function AmeActorSelector(actorManager, isProVersion, currentUserLogin, visibleUsers, ajaxParams) {
|
6 |
+
var _this = this;
|
7 |
+
this.selectedActor = null;
|
8 |
+
this.visibleUsers = [];
|
9 |
+
this.subscribers = [];
|
10 |
+
this.isProVersion = false;
|
11 |
+
this.cachedVisibleActors = null;
|
12 |
+
this.actorManager = actorManager;
|
13 |
+
if (typeof currentUserLogin !== 'undefined') {
|
14 |
+
this.currentUserLogin = currentUserLogin;
|
15 |
+
}
|
16 |
+
else {
|
17 |
+
this.currentUserLogin = wsAmeActorSelectorData.currentUserLogin;
|
18 |
+
}
|
19 |
+
if (typeof visibleUsers !== 'undefined') {
|
20 |
+
this.visibleUsers = visibleUsers;
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
this.visibleUsers = wsAmeActorSelectorData.visibleUsers;
|
24 |
+
}
|
25 |
+
if (typeof isProVersion !== 'undefined') {
|
26 |
+
this.isProVersion = isProVersion;
|
27 |
+
}
|
28 |
+
if (ajaxParams) {
|
29 |
+
this.ajaxParams = ajaxParams;
|
30 |
+
}
|
31 |
+
else {
|
32 |
+
this.ajaxParams = wsAmeActorSelectorData;
|
33 |
+
}
|
34 |
+
//Discard any users that don't exist / were not loaded by the actor manager.
|
35 |
+
var _ = AmeActorSelector._;
|
36 |
+
this.visibleUsers = _.intersection(this.visibleUsers, _.keys(actorManager.getUsers()));
|
37 |
+
if (jQuery.isReady) {
|
38 |
+
this.initDOM();
|
39 |
+
}
|
40 |
+
else {
|
41 |
+
jQuery(function () {
|
42 |
+
_this.initDOM();
|
43 |
+
});
|
44 |
+
}
|
45 |
+
}
|
46 |
+
AmeActorSelector.prototype.initDOM = function () {
|
47 |
+
var _this = this;
|
48 |
+
this.selectorNode = jQuery('#ws_actor_selector');
|
49 |
+
this.populateActorSelector();
|
50 |
+
//Don't show the selector in the free version.
|
51 |
+
if (!this.isProVersion) {
|
52 |
+
this.selectorNode.hide();
|
53 |
+
return;
|
54 |
+
}
|
55 |
+
//Select an actor on click.
|
56 |
+
this.selectorNode.on('click', 'li a.ws_actor_option', function (event) {
|
57 |
+
var actor = jQuery(event.target).attr('href').substring(1);
|
58 |
+
if (actor === '') {
|
59 |
+
actor = null;
|
60 |
+
}
|
61 |
+
_this.setSelectedActor(actor);
|
62 |
+
event.preventDefault();
|
63 |
+
});
|
64 |
+
//Display the user selection dialog when the user clicks "Choose users".
|
65 |
+
this.selectorNode.on('click', '#ws_show_more_users', function (event) {
|
66 |
+
event.preventDefault();
|
67 |
+
AmeVisibleUserDialog.open({
|
68 |
+
currentUserLogin: _this.currentUserLogin,
|
69 |
+
users: _this.actorManager.getUsers(),
|
70 |
+
visibleUsers: _this.visibleUsers,
|
71 |
+
save: function (userDetails, selectedUsers) {
|
72 |
+
_this.actorManager.addUsers(userDetails);
|
73 |
+
_this.visibleUsers = selectedUsers;
|
74 |
+
//The user list has changed, so clear the cache.
|
75 |
+
_this.cachedVisibleActors = null;
|
76 |
+
//Display the new actor list.
|
77 |
+
_this.populateActorSelector();
|
78 |
+
//Save the user list via AJAX.
|
79 |
+
_this.saveVisibleUsers();
|
80 |
+
}
|
81 |
+
});
|
82 |
+
});
|
83 |
+
};
|
84 |
+
AmeActorSelector.prototype.setSelectedActor = function (actorId) {
|
85 |
+
if ((actorId !== null) && !this.actorManager.actorExists(actorId)) {
|
86 |
+
return;
|
87 |
+
}
|
88 |
+
var previousSelection = this.selectedActor;
|
89 |
+
this.selectedActor = actorId;
|
90 |
+
this.highlightSelectedActor();
|
91 |
+
//Notify subscribers that the selection has changed.
|
92 |
+
if (this.selectedActor !== previousSelection) {
|
93 |
+
for (var i = 0; i < this.subscribers.length; i++) {
|
94 |
+
this.subscribers[i](this.selectedActor, previousSelection);
|
95 |
+
}
|
96 |
+
}
|
97 |
+
};
|
98 |
+
AmeActorSelector.prototype.onChange = function (callback) {
|
99 |
+
this.subscribers.push(callback);
|
100 |
+
};
|
101 |
+
AmeActorSelector.prototype.highlightSelectedActor = function () {
|
102 |
+
//Deselect the previous item.
|
103 |
+
this.selectorNode.find('.current').removeClass('current');
|
104 |
+
//Select the new one or "All".
|
105 |
+
var selector;
|
106 |
+
if (this.selectedActor === null) {
|
107 |
+
selector = 'a.ws_no_actor';
|
108 |
+
}
|
109 |
+
else {
|
110 |
+
selector = 'a[href$="#' + this.selectedActor + '"]';
|
111 |
+
}
|
112 |
+
this.selectorNode.find(selector).addClass('current');
|
113 |
+
};
|
114 |
+
AmeActorSelector.prototype.populateActorSelector = function () {
|
115 |
+
var actorSelector = this.selectorNode, $ = jQuery;
|
116 |
+
var isSelectedActorVisible = false;
|
117 |
+
//Build the list of available actors.
|
118 |
+
actorSelector.empty();
|
119 |
+
actorSelector.append('<li><a href="#" class="current ws_actor_option ws_no_actor" data-text="All">All</a></li>');
|
120 |
+
var visibleActors = this.getVisibleActors();
|
121 |
+
for (var i = 0; i < visibleActors.length; i++) {
|
122 |
+
var actor = visibleActors[i];
|
123 |
+
var name_1 = actor.displayName;
|
124 |
+
if (actor instanceof AmeUser) {
|
125 |
+
if (actor.userLogin === this.currentUserLogin) {
|
126 |
+
name_1 = 'Current user (' + actor.userLogin + ')';
|
127 |
+
}
|
128 |
+
else {
|
129 |
+
name_1 = actor.displayName + ' (' + actor.userLogin + ')';
|
130 |
+
}
|
131 |
+
}
|
132 |
+
actorSelector.append($('<li></li>').append($('<a></a>')
|
133 |
+
.attr('href', '#' + actor.id)
|
134 |
+
.attr('data-text', name_1)
|
135 |
+
.text(name_1)
|
136 |
+
.addClass('ws_actor_option')));
|
137 |
+
isSelectedActorVisible = (actor.id === this.selectedActor) || isSelectedActorVisible;
|
138 |
+
}
|
139 |
+
if (this.isProVersion) {
|
140 |
+
var moreUsersText = 'Choose users\u2026';
|
141 |
+
actorSelector.append($('<li>').append($('<a></a>')
|
142 |
+
.attr('id', 'ws_show_more_users')
|
143 |
+
.attr('href', '#more-users')
|
144 |
+
.attr('data-text', moreUsersText)
|
145 |
+
.text(moreUsersText)));
|
146 |
+
}
|
147 |
+
if (this.isProVersion) {
|
148 |
+
actorSelector.show();
|
149 |
+
}
|
150 |
+
//If the selected actor is no longer on the list, select "All" instead.
|
151 |
+
if ((this.selectedActor !== null) && !isSelectedActorVisible) {
|
152 |
+
this.setSelectedActor(null);
|
153 |
+
}
|
154 |
+
this.highlightSelectedActor();
|
155 |
+
};
|
156 |
+
AmeActorSelector.prototype.getVisibleActors = function () {
|
157 |
+
var _this = this;
|
158 |
+
if (this.cachedVisibleActors) {
|
159 |
+
return this.cachedVisibleActors;
|
160 |
+
}
|
161 |
+
var _ = AmeActorSelector._;
|
162 |
+
var actors = [];
|
163 |
+
//Include all roles.
|
164 |
+
//Idea: Sort roles either alphabetically or by typical privilege level (admin, editor, author, ...).
|
165 |
+
_.forEach(this.actorManager.getRoles(), function (role) {
|
166 |
+
actors.push(role);
|
167 |
+
});
|
168 |
+
//Include the Super Admin (multisite only).
|
169 |
+
if (this.actorManager.getUser(this.currentUserLogin).isSuperAdmin) {
|
170 |
+
actors.push(this.actorManager.getSuperAdmin());
|
171 |
+
}
|
172 |
+
//Include the current user.
|
173 |
+
actors.push(this.actorManager.getUser(this.currentUserLogin));
|
174 |
+
//Include other visible users.
|
175 |
+
_(this.visibleUsers)
|
176 |
+
.without(this.currentUserLogin)
|
177 |
+
.sortBy()
|
178 |
+
.forEach(function (login) {
|
179 |
+
var user = _this.actorManager.getUser(login);
|
180 |
+
actors.push(user);
|
181 |
+
})
|
182 |
+
.value();
|
183 |
+
this.cachedVisibleActors = actors;
|
184 |
+
return actors;
|
185 |
+
};
|
186 |
+
AmeActorSelector.prototype.saveVisibleUsers = function () {
|
187 |
+
jQuery.post(this.ajaxParams.adminAjaxUrl, {
|
188 |
+
'action': this.ajaxParams.ajaxUpdateAction,
|
189 |
+
'_ajax_nonce': this.ajaxParams.ajaxUpdateNonce,
|
190 |
+
'visible_users': jQuery.toJSON(this.visibleUsers)
|
191 |
+
});
|
192 |
+
};
|
193 |
+
AmeActorSelector._ = wsAmeLodash;
|
194 |
+
return AmeActorSelector;
|
195 |
+
}());
|
196 |
+
//# sourceMappingURL=actor-selector.js.map
|
modules/actor-selector/actor-selector.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class ameActorSelector {
|
3 |
+
const ajaxUpdateAction = 'ws_ame_set_visible_users';
|
4 |
+
|
5 |
+
/**
|
6 |
+
* @var WPMenuEditor
|
7 |
+
*/
|
8 |
+
private $menuEditor;
|
9 |
+
|
10 |
+
public function __construct($menuEditor) {
|
11 |
+
$this->menuEditor = $menuEditor;
|
12 |
+
|
13 |
+
add_action('wp_ajax_' . self::ajaxUpdateAction, array($this, 'ajaxSetVisibleUsers'));
|
14 |
+
add_action('admin_menu_editor-register_scripts', array($this, 'registerScripts'));
|
15 |
+
}
|
16 |
+
|
17 |
+
public function registerScripts() {
|
18 |
+
$isProVersion = apply_filters('admin_menu_editor_is_pro', false);
|
19 |
+
$dependencies = array('ame-actor-manager', 'ame-lodash', 'jquery');
|
20 |
+
if ( $isProVersion || wp_script_is('ame-visible-users', 'registered') ) {
|
21 |
+
$dependencies[] = 'ame-visible-users';
|
22 |
+
}
|
23 |
+
|
24 |
+
wp_register_auto_versioned_script(
|
25 |
+
'ame-actor-selector',
|
26 |
+
plugins_url('modules/actor-selector/actor-selector.js', $this->menuEditor->plugin_file),
|
27 |
+
$dependencies
|
28 |
+
);
|
29 |
+
|
30 |
+
$currentUser = wp_get_current_user();
|
31 |
+
wp_localize_script(
|
32 |
+
'ame-actor-selector',
|
33 |
+
'wsAmeActorSelectorData',
|
34 |
+
array(
|
35 |
+
'visibleUsers' => $this->menuEditor->get_plugin_option('visible_users'),
|
36 |
+
'currentUserLogin' => $currentUser->get('user_login'),
|
37 |
+
'isProVersion' => apply_filters('admin_menu_editor_is_pro', false),
|
38 |
+
|
39 |
+
'ajaxUpdateAction' => self::ajaxUpdateAction,
|
40 |
+
'ajaxUpdateNonce' => wp_create_nonce(self::ajaxUpdateAction),
|
41 |
+
'adminAjaxUrl' => admin_url('admin-ajax.php'),
|
42 |
+
)
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
public function ajaxSetVisibleUsers() {
|
47 |
+
if ( !check_ajax_referer(self::ajaxUpdateAction, false, false) ){
|
48 |
+
die(__("Access denied. Invalid nonce.", 'admin-menu-editor'));
|
49 |
+
}
|
50 |
+
if ( !$this->menuEditor->current_user_can_edit_menu() ) {
|
51 |
+
die(__("You don't have permission to use Admin Menu Editor Pro.", 'admin-menu-editor'));
|
52 |
+
}
|
53 |
+
|
54 |
+
$post = $this->menuEditor->get_post_params();
|
55 |
+
$visibleUsers = json_decode(strval($post['visible_users']));
|
56 |
+
$visibleUsers = array_unique(array_map('strval', $visibleUsers));
|
57 |
+
|
58 |
+
$this->menuEditor->set_plugin_option('visible_users', $visibleUsers);
|
59 |
+
die('OK');
|
60 |
+
}
|
61 |
+
}
|
modules/actor-selector/actor-selector.ts
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/// <reference path="../../js/jquery.d.ts" />
|
2 |
+
/// <reference path="../../js/jquery-json.d.ts" />
|
3 |
+
/// <reference path="../../js/actor-manager.ts" />
|
4 |
+
|
5 |
+
declare var wsAmeLodash: _.LoDashStatic;
|
6 |
+
declare var AmeVisibleUserDialog: any;
|
7 |
+
//Created using wp_localize_script.
|
8 |
+
declare var wsAmeActorSelectorData: {
|
9 |
+
visibleUsers: string[],
|
10 |
+
currentUserLogin: string,
|
11 |
+
|
12 |
+
ajaxUpdateAction: string,
|
13 |
+
ajaxUpdateNonce: string,
|
14 |
+
adminAjaxUrl: string,
|
15 |
+
};
|
16 |
+
|
17 |
+
interface SelectedActorChangedCallback {
|
18 |
+
(newSelectedActor: string, oldSelectedActor: string): void
|
19 |
+
}
|
20 |
+
interface SaveVisibleActorAjaxParams {
|
21 |
+
ajaxUpdateAction: string,
|
22 |
+
ajaxUpdateNonce: string,
|
23 |
+
adminAjaxUrl: string,
|
24 |
+
}
|
25 |
+
|
26 |
+
class AmeActorSelector {
|
27 |
+
private static _ = wsAmeLodash;
|
28 |
+
|
29 |
+
public selectedActor: string = null;
|
30 |
+
|
31 |
+
private visibleUsers: string[] = [];
|
32 |
+
private subscribers: SelectedActorChangedCallback[] = [];
|
33 |
+
private actorManager: AmeActorManager;
|
34 |
+
private currentUserLogin: string;
|
35 |
+
private isProVersion: boolean = false;
|
36 |
+
private ajaxParams: SaveVisibleActorAjaxParams;
|
37 |
+
|
38 |
+
private cachedVisibleActors: AmeBaseActor[] = null;
|
39 |
+
|
40 |
+
private selectorNode;
|
41 |
+
|
42 |
+
constructor(actorManager: AmeActorManager, isProVersion?: boolean, currentUserLogin?: string, visibleUsers?: string[], ajaxParams?: SaveVisibleActorAjaxParams) {
|
43 |
+
this.actorManager = actorManager;
|
44 |
+
|
45 |
+
if (typeof currentUserLogin !== 'undefined') {
|
46 |
+
this.currentUserLogin = currentUserLogin;
|
47 |
+
} else {
|
48 |
+
this.currentUserLogin = wsAmeActorSelectorData.currentUserLogin;
|
49 |
+
}
|
50 |
+
if (typeof visibleUsers !== 'undefined') {
|
51 |
+
this.visibleUsers = visibleUsers;
|
52 |
+
} else {
|
53 |
+
this.visibleUsers = wsAmeActorSelectorData.visibleUsers;
|
54 |
+
}
|
55 |
+
if (typeof isProVersion !== 'undefined') {
|
56 |
+
this.isProVersion = isProVersion;
|
57 |
+
}
|
58 |
+
|
59 |
+
if (ajaxParams) {
|
60 |
+
this.ajaxParams = ajaxParams;
|
61 |
+
} else {
|
62 |
+
this.ajaxParams = wsAmeActorSelectorData;
|
63 |
+
}
|
64 |
+
|
65 |
+
//Discard any users that don't exist / were not loaded by the actor manager.
|
66 |
+
const _ = AmeActorSelector._;
|
67 |
+
this.visibleUsers = _.intersection(this.visibleUsers, _.keys(actorManager.getUsers()));
|
68 |
+
|
69 |
+
if (jQuery.isReady) {
|
70 |
+
this.initDOM();
|
71 |
+
} else {
|
72 |
+
jQuery(() => {
|
73 |
+
this.initDOM();
|
74 |
+
});
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
private initDOM() {
|
79 |
+
this.selectorNode = jQuery('#ws_actor_selector');
|
80 |
+
this.populateActorSelector();
|
81 |
+
|
82 |
+
//Don't show the selector in the free version.
|
83 |
+
if (!this.isProVersion) {
|
84 |
+
this.selectorNode.hide();
|
85 |
+
return;
|
86 |
+
}
|
87 |
+
|
88 |
+
//Select an actor on click.
|
89 |
+
this.selectorNode.on('click', 'li a.ws_actor_option', (event) => {
|
90 |
+
var actor = jQuery(event.target).attr('href').substring(1);
|
91 |
+
if (actor === '') {
|
92 |
+
actor = null;
|
93 |
+
}
|
94 |
+
|
95 |
+
this.setSelectedActor(actor);
|
96 |
+
event.preventDefault();
|
97 |
+
});
|
98 |
+
|
99 |
+
//Display the user selection dialog when the user clicks "Choose users".
|
100 |
+
this.selectorNode.on('click', '#ws_show_more_users', (event) => {
|
101 |
+
event.preventDefault();
|
102 |
+
AmeVisibleUserDialog.open({
|
103 |
+
currentUserLogin: this.currentUserLogin,
|
104 |
+
users: this.actorManager.getUsers(),
|
105 |
+
visibleUsers: this.visibleUsers,
|
106 |
+
|
107 |
+
save: (userDetails, selectedUsers) => {
|
108 |
+
this.actorManager.addUsers(userDetails);
|
109 |
+
this.visibleUsers = selectedUsers;
|
110 |
+
//The user list has changed, so clear the cache.
|
111 |
+
this.cachedVisibleActors = null;
|
112 |
+
//Display the new actor list.
|
113 |
+
this.populateActorSelector();
|
114 |
+
|
115 |
+
//Save the user list via AJAX.
|
116 |
+
this.saveVisibleUsers();
|
117 |
+
}
|
118 |
+
});
|
119 |
+
});
|
120 |
+
}
|
121 |
+
|
122 |
+
setSelectedActor(actorId: string) {
|
123 |
+
if ((actorId !== null) && !this.actorManager.actorExists(actorId)) {
|
124 |
+
return;
|
125 |
+
}
|
126 |
+
|
127 |
+
var previousSelection = this.selectedActor;
|
128 |
+
this.selectedActor = actorId;
|
129 |
+
this.highlightSelectedActor();
|
130 |
+
|
131 |
+
//Notify subscribers that the selection has changed.
|
132 |
+
if (this.selectedActor !== previousSelection) {
|
133 |
+
for (var i = 0; i < this.subscribers.length; i++) {
|
134 |
+
this.subscribers[i](this.selectedActor, previousSelection);
|
135 |
+
}
|
136 |
+
}
|
137 |
+
}
|
138 |
+
|
139 |
+
onChange(callback: SelectedActorChangedCallback) {
|
140 |
+
this.subscribers.push(callback);
|
141 |
+
}
|
142 |
+
|
143 |
+
private highlightSelectedActor() {
|
144 |
+
//Deselect the previous item.
|
145 |
+
this.selectorNode.find('.current').removeClass('current');
|
146 |
+
|
147 |
+
//Select the new one or "All".
|
148 |
+
var selector;
|
149 |
+
if (this.selectedActor === null) {
|
150 |
+
selector = 'a.ws_no_actor';
|
151 |
+
} else {
|
152 |
+
selector = 'a[href$="#' + this.selectedActor + '"]';
|
153 |
+
}
|
154 |
+
this.selectorNode.find(selector).addClass('current');
|
155 |
+
}
|
156 |
+
|
157 |
+
private populateActorSelector() {
|
158 |
+
const actorSelector = this.selectorNode,
|
159 |
+
$ = jQuery;
|
160 |
+
var isSelectedActorVisible = false;
|
161 |
+
|
162 |
+
//Build the list of available actors.
|
163 |
+
actorSelector.empty();
|
164 |
+
actorSelector.append('<li><a href="#" class="current ws_actor_option ws_no_actor" data-text="All">All</a></li>');
|
165 |
+
|
166 |
+
var visibleActors = this.getVisibleActors();
|
167 |
+
for (let i = 0; i < visibleActors.length; i++) {
|
168 |
+
const actor = visibleActors[i];
|
169 |
+
|
170 |
+
let name = actor.displayName;
|
171 |
+
if (actor instanceof AmeUser) {
|
172 |
+
if (actor.userLogin === this.currentUserLogin) {
|
173 |
+
name = 'Current user (' + actor.userLogin + ')';
|
174 |
+
} else {
|
175 |
+
name = actor.displayName + ' (' + actor.userLogin + ')';
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
actorSelector.append(
|
180 |
+
$('<li></li>').append(
|
181 |
+
$('<a></a>')
|
182 |
+
.attr('href', '#' + actor.id)
|
183 |
+
.attr('data-text', name)
|
184 |
+
.text(name)
|
185 |
+
.addClass('ws_actor_option')
|
186 |
+
)
|
187 |
+
);
|
188 |
+
isSelectedActorVisible = (actor.id === this.selectedActor) || isSelectedActorVisible;
|
189 |
+
}
|
190 |
+
|
191 |
+
if (this.isProVersion) {
|
192 |
+
var moreUsersText = 'Choose users\u2026';
|
193 |
+
actorSelector.append(
|
194 |
+
$('<li>').append(
|
195 |
+
$('<a></a>')
|
196 |
+
.attr('id', 'ws_show_more_users')
|
197 |
+
.attr('href', '#more-users')
|
198 |
+
.attr('data-text', moreUsersText)
|
199 |
+
.text(moreUsersText)
|
200 |
+
)
|
201 |
+
);
|
202 |
+
}
|
203 |
+
|
204 |
+
if (this.isProVersion) {
|
205 |
+
actorSelector.show();
|
206 |
+
}
|
207 |
+
|
208 |
+
//If the selected actor is no longer on the list, select "All" instead.
|
209 |
+
if ((this.selectedActor !== null) && !isSelectedActorVisible) {
|
210 |
+
this.setSelectedActor(null);
|
211 |
+
}
|
212 |
+
|
213 |
+
this.highlightSelectedActor();
|
214 |
+
}
|
215 |
+
|
216 |
+
getVisibleActors(): AmeBaseActor[] {
|
217 |
+
if (this.cachedVisibleActors) {
|
218 |
+
return this.cachedVisibleActors;
|
219 |
+
}
|
220 |
+
|
221 |
+
const _ = AmeActorSelector._;
|
222 |
+
var actors = [];
|
223 |
+
|
224 |
+
//Include all roles.
|
225 |
+
//Idea: Sort roles either alphabetically or by typical privilege level (admin, editor, author, ...).
|
226 |
+
_.forEach(this.actorManager.getRoles(), function (role) {
|
227 |
+
actors.push(role);
|
228 |
+
});
|
229 |
+
//Include the Super Admin (multisite only).
|
230 |
+
if (this.actorManager.getUser(this.currentUserLogin).isSuperAdmin) {
|
231 |
+
actors.push(this.actorManager.getSuperAdmin());
|
232 |
+
}
|
233 |
+
//Include the current user.
|
234 |
+
actors.push(this.actorManager.getUser(this.currentUserLogin));
|
235 |
+
|
236 |
+
//Include other visible users.
|
237 |
+
_(this.visibleUsers)
|
238 |
+
.without(this.currentUserLogin)
|
239 |
+
.sortBy()
|
240 |
+
.forEach((login) => {
|
241 |
+
var user = this.actorManager.getUser(login);
|
242 |
+
actors.push(user);
|
243 |
+
})
|
244 |
+
.value();
|
245 |
+
|
246 |
+
this.cachedVisibleActors = actors;
|
247 |
+
return actors;
|
248 |
+
}
|
249 |
+
|
250 |
+
private saveVisibleUsers() {
|
251 |
+
jQuery.post(
|
252 |
+
this.ajaxParams.adminAjaxUrl,
|
253 |
+
{
|
254 |
+
'action' : this.ajaxParams.ajaxUpdateAction,
|
255 |
+
'_ajax_nonce' : this.ajaxParams.ajaxUpdateNonce,
|
256 |
+
'visible_users' : jQuery.toJSON(this.visibleUsers)
|
257 |
+
}
|
258 |
+
);
|
259 |
+
}
|
260 |
+
}
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: whiteshadow
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
|
4 |
Tags: admin, dashboard, menu, security, wpmu
|
5 |
Requires at least: 4.1
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
|
10 |
|
@@ -63,6 +63,21 @@ Plugins installed in the `mu-plugins` directory are treated as "always on", so y
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 1.5 =
|
67 |
* Added "Keep this menu open" checkbox. This setting keeps a top level menu expanded even if it is not the current menu.
|
68 |
* Added sort buttons to the top level menu toolbar.
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A6P9S6CE3SRSW
|
4 |
Tags: admin, dashboard, menu, security, wpmu
|
5 |
Requires at least: 4.1
|
6 |
+
Tested up to: 4.5
|
7 |
+
Stable tag: 1.6
|
8 |
|
9 |
Lets you edit the WordPress admin menu. You can re-order, hide or rename menus, add custom menus and more.
|
10 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 1.6 =
|
67 |
+
* Improved PHP 7 support.
|
68 |
+
* Added a few more menu icons.
|
69 |
+
* Added tabs to the settings page: "Admin Menu" and "Settings". These tabs replace the heading buttons that were previously used to switch between the menu editor and general plugin settings.
|
70 |
+
* Added basic support for the special "customize" and "delete_site" meta capabilities.
|
71 |
+
* Fixed a bug that prevented menu items with an empty slug (i.e. no URL) from showing up.
|
72 |
+
* Fixed a bug where collapsing menu properties would flag the "Icon URL" field as having a custom value even if you hadn't actually changed it.
|
73 |
+
* Fixed a rare WPML conflict that sometimes caused the admin menu to use a mix of different languages.
|
74 |
+
* Improved compatibility with buggy plugins and themes that throw JavaScript errors in their DOM-ready handlers.
|
75 |
+
* Renamed jquery.cookie.js to jquery.biscuit.js as a workaround for servers with overly aggressive ModSecurity configuration. Apparently, some servers block access to any URL that contains the text ".cookie".
|
76 |
+
* Added a compatibility workaround for the DW Question & Answer plugin. The hidden "Welcome", "Changelog" and "Credits" menu items should no longer show up when you activate AME.
|
77 |
+
* Added locking to reduce the risk of triggering a race condition when saving menu settings.
|
78 |
+
* Removed the non-functional "Embed WP page" option.
|
79 |
+
* Tested up to WordPress 4.5-RC1.
|
80 |
+
|
81 |
= 1.5 =
|
82 |
* Added "Keep this menu open" checkbox. This setting keeps a top level menu expanded even if it is not the current menu.
|
83 |
* Added sort buttons to the top level menu toolbar.
|