admin_core 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +7 -0
  2. data/.gitattributes +2 -0
  3. data/.gitignore +53 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +27 -0
  6. data/CHANGELOG.md +15 -0
  7. data/Gemfile +3 -0
  8. data/README.md +48 -0
  9. data/Rakefile +31 -0
  10. data/admin_core.gemspec +32 -0
  11. data/client/.babelrc +19 -0
  12. data/client/.eslintignore +3 -0
  13. data/client/.eslintrc.yml +20 -0
  14. data/client/.flowconfig +7 -0
  15. data/client/.gitignore +64 -0
  16. data/client/README.md +3 -0
  17. data/client/admin-core.scss +8 -0
  18. data/client/flow-typed/npm/axios_v0.16.x.js +120 -0
  19. data/client/flow-typed/npm/classnames_v2.x.x.js +16 -0
  20. data/client/flow-typed/npm/lodash_v4.x.x.js +514 -0
  21. data/client/flow-typed/npm/react-router-dom_v4.x.x.js +166 -0
  22. data/client/flow-typed/npm/reactstrap_vx.x.x.js +536 -0
  23. data/client/package.json +60 -0
  24. data/client/src/.eslintrc.yml +23 -0
  25. data/client/src/AdminCore.jsx +44 -0
  26. data/client/src/components/Breadcrumb.jsx +18 -0
  27. data/client/src/components/Header.jsx +45 -0
  28. data/client/src/components/Pagination.jsx +72 -0
  29. data/client/src/components/ResourceFilters.jsx +87 -0
  30. data/client/src/components/ResourceForm.jsx +103 -0
  31. data/client/src/components/ResourcesCollection.jsx +41 -0
  32. data/client/src/components/Sidebar.jsx +90 -0
  33. data/client/src/decls.js +119 -0
  34. data/client/src/http-client.js +18 -0
  35. data/client/src/main.js +9 -0
  36. data/client/src/resource-field/BelongsTo.jsx +26 -0
  37. data/client/src/resource-field/Boolean.jsx +43 -0
  38. data/client/src/resource-field/Date.jsx +29 -0
  39. data/client/src/resource-field/DateTime.jsx +29 -0
  40. data/client/src/resource-field/Enum.jsx +34 -0
  41. data/client/src/resource-field/Number.jsx +28 -0
  42. data/client/src/resource-field/String.jsx +28 -0
  43. data/client/src/resource-field/Text.jsx +27 -0
  44. data/client/src/resource-field-renderer.js +45 -0
  45. data/client/src/resource-filter/Boolean.jsx +22 -0
  46. data/client/src/resource-filter/Number.jsx +45 -0
  47. data/client/src/resource-filter/String.jsx +46 -0
  48. data/client/src/resource-filter-renderer.js +17 -0
  49. data/client/src/resource-page/Base.js +36 -0
  50. data/client/src/resource-page/Edit.jsx +48 -0
  51. data/client/src/resource-page/Index.jsx +141 -0
  52. data/client/src/resource-page/New.jsx +48 -0
  53. data/client/src/resource-page/Show.jsx +116 -0
  54. data/client/webpack.config.js +26 -0
  55. data/client/yarn.lock +3816 -0
  56. data/lib/admin_core/base_controller.rb +114 -0
  57. data/lib/admin_core/base_resource_manager.rb +24 -0
  58. data/lib/admin_core/configuration.rb +20 -0
  59. data/lib/admin_core/engine.rb +6 -0
  60. data/lib/admin_core/errors.rb +17 -0
  61. data/lib/admin_core/resource_field/base.rb +69 -0
  62. data/lib/admin_core/resource_field/belongs_to.rb +38 -0
  63. data/lib/admin_core/resource_field/boolean.rb +18 -0
  64. data/lib/admin_core/resource_field/date.rb +18 -0
  65. data/lib/admin_core/resource_field/date_time.rb +18 -0
  66. data/lib/admin_core/resource_field/enum.rb +26 -0
  67. data/lib/admin_core/resource_field/number.rb +18 -0
  68. data/lib/admin_core/resource_field/string.rb +18 -0
  69. data/lib/admin_core/resource_field/text.rb +23 -0
  70. data/lib/admin_core/resource_field_builder.rb +48 -0
  71. data/lib/admin_core/resource_filter/base.rb +63 -0
  72. data/lib/admin_core/resource_filter/boolean.rb +17 -0
  73. data/lib/admin_core/resource_filter/number.rb +25 -0
  74. data/lib/admin_core/resource_filter/string.rb +27 -0
  75. data/lib/admin_core/resource_filter_builder.rb +37 -0
  76. data/lib/admin_core/resource_manager/buildable.rb +42 -0
  77. data/lib/admin_core/resource_manager/convert.rb +95 -0
  78. data/lib/admin_core/resource_manager/has_many_fields.rb +71 -0
  79. data/lib/admin_core/resource_manager/permission.rb +35 -0
  80. data/lib/admin_core/resource_manager/searchable.rb +57 -0
  81. data/lib/admin_core/resource_page/base.rb +17 -0
  82. data/lib/admin_core/resource_page/edit.rb +22 -0
  83. data/lib/admin_core/resource_page/index.rb +52 -0
  84. data/lib/admin_core/resource_page/new.rb +26 -0
  85. data/lib/admin_core/resource_page/show.rb +22 -0
  86. data/lib/admin_core/resource_router.rb +58 -0
  87. data/lib/admin_core/resource_search.rb +22 -0
  88. data/lib/admin_core/rspec/matchers.rb +18 -0
  89. data/lib/admin_core/rspec/resource_field_spec_helper.rb +54 -0
  90. data/lib/admin_core/version.rb +11 -0
  91. data/lib/admin_core/view_object/sidebar_dropdown.rb +21 -0
  92. data/lib/admin_core/view_object/sidebar_link.rb +24 -0
  93. data/lib/admin_core/view_object/sidebar_resource_link.rb +23 -0
  94. data/lib/admin_core/view_object/sidebar_title.rb +18 -0
  95. data/lib/admin_core.rb +69 -0
  96. data/lib/generators/admin_core/install_generator.rb +39 -0
  97. data/lib/generators/admin_core/resource_manager_generator.rb +166 -0
  98. data/lib/generators/admin_core/templates/admin-core.css +1 -0
  99. data/lib/generators/admin_core/templates/admin-core.js +38196 -0
  100. data/lib/generators/admin_core/templates/controller.rb.erb +4 -0
  101. data/lib/generators/admin_core/templates/initializer.rb.erb +3 -0
  102. data/lib/generators/admin_core/templates/resource_manager.rb.erb +33 -0
  103. data/lib/generators/admin_core/templates/view.html.erb +58 -0
  104. data/sample/.gitignore +21 -0
  105. data/sample/Gemfile +35 -0
  106. data/sample/Gemfile.lock +147 -0
  107. data/sample/README.md +24 -0
  108. data/sample/Rakefile +6 -0
  109. data/sample/app/assets/config/manifest.js +2 -0
  110. data/sample/app/assets/images/.keep +0 -0
  111. data/sample/app/assets/stylesheets/application.css +15 -0
  112. data/sample/app/controllers/admin/application_controller.rb +4 -0
  113. data/sample/app/controllers/admin/tweets_controller.rb +4 -0
  114. data/sample/app/controllers/admin/users_controller.rb +4 -0
  115. data/sample/app/controllers/application_controller.rb +3 -0
  116. data/sample/app/controllers/concerns/.keep +0 -0
  117. data/sample/app/helpers/application_helper.rb +2 -0
  118. data/sample/app/jobs/application_job.rb +2 -0
  119. data/sample/app/models/admin/tweet.rb +35 -0
  120. data/sample/app/models/admin/user.rb +41 -0
  121. data/sample/app/models/application_record.rb +3 -0
  122. data/sample/app/models/concerns/.keep +0 -0
  123. data/sample/app/models/tweet.rb +3 -0
  124. data/sample/app/models/user.rb +3 -0
  125. data/sample/app/views/admin/application.html.erb +64 -0
  126. data/sample/app/views/layouts/application.html.erb +13 -0
  127. data/sample/bin/bundle +3 -0
  128. data/sample/bin/rails +4 -0
  129. data/sample/bin/rake +4 -0
  130. data/sample/bin/setup +34 -0
  131. data/sample/bin/update +29 -0
  132. data/sample/config/application.rb +25 -0
  133. data/sample/config/boot.rb +3 -0
  134. data/sample/config/database.yml +25 -0
  135. data/sample/config/environment.rb +5 -0
  136. data/sample/config/environments/development.rb +42 -0
  137. data/sample/config/environments/production.rb +69 -0
  138. data/sample/config/environments/test.rb +36 -0
  139. data/sample/config/initializers/admin_core.rb +8 -0
  140. data/sample/config/initializers/application_controller_renderer.rb +6 -0
  141. data/sample/config/initializers/backtrace_silencers.rb +7 -0
  142. data/sample/config/initializers/cookies_serializer.rb +5 -0
  143. data/sample/config/initializers/filter_parameter_logging.rb +4 -0
  144. data/sample/config/initializers/inflections.rb +16 -0
  145. data/sample/config/initializers/mime_types.rb +4 -0
  146. data/sample/config/initializers/new_framework_defaults.rb +24 -0
  147. data/sample/config/initializers/session_store.rb +3 -0
  148. data/sample/config/initializers/wrap_parameters.rb +14 -0
  149. data/sample/config/locales/en.yml +23 -0
  150. data/sample/config/routes.rb +6 -0
  151. data/sample/config/secrets.yml +22 -0
  152. data/sample/config.ru +5 -0
  153. data/sample/db/migrate/20170417055257_create_users.rb +10 -0
  154. data/sample/db/migrate/20170417055412_create_tweets.rb +9 -0
  155. data/sample/db/schema.rb +31 -0
  156. data/sample/db/seeds.rb +7 -0
  157. data/sample/lib/assets/.keep +0 -0
  158. data/sample/lib/tasks/.keep +0 -0
  159. data/sample/log/.keep +0 -0
  160. data/sample/public/404.html +67 -0
  161. data/sample/public/422.html +67 -0
  162. data/sample/public/500.html +66 -0
  163. data/sample/public/apple-touch-icon-precomposed.png +0 -0
  164. data/sample/public/apple-touch-icon.png +0 -0
  165. data/sample/public/bundle.min.js +27 -0
  166. data/sample/public/bundle.min.js.map +1 -0
  167. data/sample/public/favicon.ico +0 -0
  168. data/sample/public/javascripts/admin-core.js +38196 -0
  169. data/sample/public/robots.txt +5 -0
  170. data/sample/public/stylesheets/admin-core.css +1 -0
  171. data/sample/tmp/.keep +0 -0
  172. data/sample/vendor/assets/stylesheets/.keep +0 -0
  173. metadata +368 -0
@@ -0,0 +1,514 @@
1
+ // flow-typed signature: a7d253bb465906a2d746884b23c74257
2
+ // flow-typed version: df11ef698b/lodash_v4.x.x/flow_>=v0.38.x
3
+
4
+ declare module 'lodash' {
5
+ declare type TemplateSettings = {
6
+ escape?: RegExp,
7
+ evaluate?: RegExp,
8
+ imports?: Object,
9
+ interpolate?: RegExp,
10
+ variable?: string,
11
+ };
12
+
13
+ declare type TruncateOptions = {
14
+ length?: number,
15
+ omission?: string,
16
+ separator?: RegExp|string,
17
+ };
18
+
19
+ declare type DebounceOptions = {
20
+ leading?: bool,
21
+ maxWait?: number,
22
+ trailing?: bool,
23
+ };
24
+
25
+ declare type ThrottleOptions = {
26
+ leading?: bool,
27
+ trailing?: bool,
28
+ };
29
+
30
+ declare type NestedArray<T> = Array<Array<T>>;
31
+
32
+ declare type matchesIterateeShorthand = Object;
33
+ declare type matchesPropertyIterateeShorthand = [string, any];
34
+ declare type propertyIterateeShorthand = string;
35
+
36
+ declare type OPredicate<A, O> =
37
+ | ((value: A, key: string, object: O) => any)
38
+ | matchesIterateeShorthand
39
+ | matchesPropertyIterateeShorthand
40
+ | propertyIterateeShorthand;
41
+
42
+ declare type OIterateeWithResult<V, O, R> = Object|string|((value: V, key: string, object: O) => R);
43
+ declare type OIteratee<O> = OIterateeWithResult<any, O, any>;
44
+ declare type OFlatMapIteratee<T, U> = OIterateeWithResult<any, T, Array<U>>;
45
+
46
+ declare type Predicate<T> =
47
+ | ((value: T, index: number, array: Array<T>) => any)
48
+ | matchesIterateeShorthand
49
+ | matchesPropertyIterateeShorthand
50
+ | propertyIterateeShorthand;
51
+
52
+ declare type _ValueOnlyIteratee<T> = (value: T) => mixed;
53
+ declare type ValueOnlyIteratee<T> = _ValueOnlyIteratee<T>|string;
54
+ declare type _Iteratee<T> = (item: T, index: number, array: ?Array<T>) => mixed;
55
+ declare type Iteratee<T> = _Iteratee<T>|Object|string;
56
+ declare type FlatMapIteratee<T, U> = ((item: T, index: number, array: ?Array<T>) => Array<U>)|Object|string;
57
+ declare type Comparator<T> = (item: T, item2: T) => bool;
58
+
59
+ declare type MapIterator<T,U> =
60
+ | ((item: T, index: number, array: Array<T>) => U)
61
+ | propertyIterateeShorthand;
62
+
63
+ declare type OMapIterator<T,O,U> =
64
+ | ((item: T, key: string, object: O) => U)
65
+ | propertyIterateeShorthand;
66
+
67
+ declare class Lodash {
68
+ // Array
69
+ chunk<T>(array: ?Array<T>, size?: number): Array<Array<T>>;
70
+ compact<T,N:?T>(array: Array<N>): Array<T>;
71
+ concat<T>(base: Array<T>, ...elements: Array<any>): Array<T|any>;
72
+ difference<T>(array: ?Array<T>, values?: Array<T>): Array<T>;
73
+ differenceBy<T>(array: ?Array<T>, values: Array<T>, iteratee: ValueOnlyIteratee<T>): T[];
74
+ differenceWith<T>(array: T[], values: T[], comparator?: Comparator<T>): T[];
75
+ drop<T>(array: ?Array<T>, n?: number): Array<T>;
76
+ dropRight<T>(array: ?Array<T>, n?: number): Array<T>;
77
+ dropRightWhile<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
78
+ dropWhile<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
79
+ fill<T, U>(array: ?Array<T>, value: U, start?: number, end?: number): Array<T|U>;
80
+ findIndex<T>(array: ?Array<T>, predicate?: Predicate<T>): number;
81
+ findLastIndex<T>(array: ?Array<T>, predicate?: Predicate<T>): number;
82
+ // alias of _.head
83
+ first<T>(array: ?Array<T>): T;
84
+ flatten<T,X>(array: Array<Array<T>|X>): Array<T|X>;
85
+ flattenDeep<T>(array: any[]): Array<T>;
86
+ flattenDepth(array: any[], depth?: number): any[];
87
+ fromPairs<T>(pairs: Array<T>): Object;
88
+ head<T>(array: ?Array<T>): T;
89
+ indexOf<T>(array: ?Array<T>, value: T, fromIndex?: number): number;
90
+ initial<T>(array: ?Array<T>): Array<T>;
91
+ intersection<T>(...arrays: Array<Array<T>>): Array<T>;
92
+ //Workaround until (...parameter: T, parameter2: U) works
93
+ intersectionBy<T>(a1: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
94
+ intersectionBy<T>(a1: Array<T>, a2: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
95
+ intersectionBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
96
+ intersectionBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
97
+ //Workaround until (...parameter: T, parameter2: U) works
98
+ intersectionWith<T>(a1: Array<T>, comparator: Comparator<T>): Array<T>;
99
+ intersectionWith<T>(a1: Array<T>, a2: Array<T>, comparator: Comparator<T>): Array<T>;
100
+ intersectionWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, comparator: Comparator<T>): Array<T>;
101
+ intersectionWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, comparator: Comparator<T>): Array<T>;
102
+ join<T>(array: ?Array<T>, separator?: string): string;
103
+ last<T>(array: ?Array<T>): T;
104
+ lastIndexOf<T>(array: ?Array<T>, value: T, fromIndex?: number): number;
105
+ nth<T>(array: T[], n?: number): T;
106
+ pull<T>(array: ?Array<T>, ...values?: Array<T>): Array<T>;
107
+ pullAll<T>(array: ?Array<T>, values: Array<T>): Array<T>;
108
+ pullAllBy<T>(array: ?Array<T>, values: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
109
+ pullAllWith<T>(array?: T[], values: T[], comparator?: Function): T[];
110
+ pullAt<T>(array: ?Array<T>, ...indexed?: Array<number>): Array<T>;
111
+ pullAt<T>(array: ?Array<T>, indexed?: Array<number>): Array<T>;
112
+ remove<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
113
+ reverse<T>(array: ?Array<T>): Array<T>;
114
+ slice<T>(array: ?Array<T>, start?: number, end?: number): Array<T>;
115
+ sortedIndex<T>(array: ?Array<T>, value: T): number;
116
+ sortedIndexBy<T>(array: ?Array<T>, value: T, iteratee?: ValueOnlyIteratee<T>): number;
117
+ sortedIndexOf<T>(array: ?Array<T>, value: T): number;
118
+ sortedLastIndex<T>(array: ?Array<T>, value: T): number;
119
+ sortedLastIndexBy<T>(array: ?Array<T>, value: T, iteratee?: ValueOnlyIteratee<T>): number;
120
+ sortedLastIndexOf<T>(array: ?Array<T>, value: T): number;
121
+ sortedUniq<T>(array: ?Array<T>): Array<T>;
122
+ sortedUniqBy<T>(array: ?Array<T>, iteratee?: (value: T) => mixed): Array<T>;
123
+ tail<T>(array: ?Array<T>): Array<T>;
124
+ take<T>(array: ?Array<T>, n?: number): Array<T>;
125
+ takeRight<T>(array: ?Array<T>, n?: number): Array<T>;
126
+ takeRightWhile<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
127
+ takeWhile<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
128
+ union<T>(...arrays?: Array<Array<T>>): Array<T>;
129
+ //Workaround until (...parameter: T, parameter2: U) works
130
+ unionBy<T>(a1: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
131
+ unionBy<T>(a1: Array<T>, a2: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
132
+ unionBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
133
+ unionBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
134
+ //Workaround until (...parameter: T, parameter2: U) works
135
+ unionWith<T>(a1: Array<T>, comparator?: Comparator<T>): Array<T>;
136
+ unionWith<T>(a1: Array<T>, a2: Array<T>, comparator?: Comparator<T>): Array<T>;
137
+ unionWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, comparator?: Comparator<T>): Array<T>;
138
+ unionWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, comparator?: Comparator<T>): Array<T>;
139
+ uniq<T>(array: ?Array<T>): Array<T>;
140
+ uniqBy<T>(array: ?Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
141
+ uniqWith<T>(array: ?Array<T>, comparator?: Comparator<T>): Array<T>;
142
+ unzip<T>(array: ?Array<T>): Array<T>;
143
+ unzipWith<T>(array: ?Array<T>, iteratee?: Iteratee<T>): Array<T>;
144
+ without<T>(array: ?Array<T>, ...values?: Array<T>): Array<T>;
145
+ xor<T>(...array: Array<Array<T>>): Array<T>;
146
+ //Workaround until (...parameter: T, parameter2: U) works
147
+ xorBy<T>(a1: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
148
+ xorBy<T>(a1: Array<T>, a2: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
149
+ xorBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
150
+ xorBy<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, iteratee?: ValueOnlyIteratee<T>): Array<T>;
151
+ //Workaround until (...parameter: T, parameter2: U) works
152
+ xorWith<T>(a1: Array<T>, comparator?: Comparator<T>): Array<T>;
153
+ xorWith<T>(a1: Array<T>, a2: Array<T>, comparator?: Comparator<T>): Array<T>;
154
+ xorWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, comparator?: Comparator<T>): Array<T>;
155
+ xorWith<T>(a1: Array<T>, a2: Array<T>, a3: Array<T>, a4: Array<T>, comparator?: Comparator<T>): Array<T>;
156
+ zip<A, B>(a1: A[], a2: B[]): Array<[A, B]>;
157
+ zip<A, B, C>(a1: A[], a2: B[], a3: C[]): Array<[A, B, C]>;
158
+ zip<A, B, C, D>(a1: A[], a2: B[], a3: C[], a4: D[]): Array<[A, B, C, D]>;
159
+ zip<A, B, C, D, E>(a1: A[], a2: B[], a3: C[], a4: D[], a5: E[]): Array<[A, B, C, D, E]>;
160
+
161
+ zipObject(props?: Array<any>, values?: Array<any>): Object;
162
+ zipObjectDeep(props?: any[], values?: any): Object;
163
+ //Workaround until (...parameter: T, parameter2: U) works
164
+ zipWith<T>(a1: NestedArray<T>, iteratee?: Iteratee<T>): Array<T>;
165
+ zipWith<T>(a1: NestedArray<T>, a2: NestedArray<T>, iteratee?: Iteratee<T>): Array<T>;
166
+ zipWith<T>(a1: NestedArray<T>, a2: NestedArray<T>, a3: NestedArray<T>, iteratee?: Iteratee<T>): Array<T>;
167
+ zipWith<T>(a1: NestedArray<T>, a2: NestedArray<T>, a3: NestedArray<T>, a4: NestedArray<T>, iteratee?: Iteratee<T>): Array<T>;
168
+
169
+ // Collection
170
+ countBy<T>(array: ?Array<T>, iteratee?: ValueOnlyIteratee<T>): Object;
171
+ countBy<T: Object>(object: T, iteratee?: ValueOnlyIteratee<T>): Object;
172
+ // alias of _.forEach
173
+ each<T>(array: ?Array<T>, iteratee?: Iteratee<T>): Array<T>;
174
+ each<T: Object>(object: T, iteratee?: OIteratee<T>): T;
175
+ // alias of _.forEachRight
176
+ eachRight<T>(array: ?Array<T>, iteratee?: Iteratee<T>): Array<T>;
177
+ eachRight<T: Object>(object: T, iteratee?: OIteratee<T>): T;
178
+ every<T>(array: ?Array<T>, iteratee?: Iteratee<T>): bool;
179
+ every<T: Object>(object: T, iteratee?: OIteratee<T>): bool;
180
+ filter<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
181
+ filter<A, T: {[id: string]: A}>(object: T, predicate?: OPredicate<A, T>): Array<A>;
182
+ find<T>(array: ?Array<T>, predicate?: Predicate<T>): T|void;
183
+ find<V, A, T: {[id: string]: A}>(object: T, predicate?: OPredicate<A, T>): V;
184
+ findLast<T>(array: ?Array<T>, predicate?: Predicate<T>): T|void;
185
+ findLast<V, A, T: {[id: string]: A}>(object: T, predicate?: OPredicate<A, T>): V;
186
+ flatMap<T, U>(array: ?Array<T>, iteratee?: FlatMapIteratee<T, U>): Array<U>;
187
+ flatMap<T: Object, U>(object: T, iteratee?: OFlatMapIteratee<T, U>): Array<U>;
188
+ flatMapDeep<T, U>(array: ?Array<T>, iteratee?: FlatMapIteratee<T, U>): Array<U>;
189
+ flatMapDeep<T: Object, U>(object: T, iteratee?: OFlatMapIteratee<T, U>): Array<U>;
190
+ flatMapDepth<T, U>(array: ?Array<T>, iteratee?: FlatMapIteratee<T, U>, depth?: number): Array<U>;
191
+ flatMapDepth<T: Object, U>(object: T, iteratee?: OFlatMapIteratee<T, U>, depth?: number): Array<U>;
192
+ forEach<T>(array: ?Array<T>, iteratee?: Iteratee<T>): Array<T>;
193
+ forEach<T: Object>(object: T, iteratee?: OIteratee<T>): T;
194
+ forEachRight<T>(array: ?Array<T>, iteratee?: Iteratee<T>): Array<T>;
195
+ forEachRight<T: Object>(object: T, iteratee?: OIteratee<T>): T;
196
+ groupBy<V, T>(array: ?Array<T>, iteratee?: ValueOnlyIteratee<T>): {[key: V]: ?Array<T>};
197
+ groupBy<V, A, T: {[id: string]: A}>(object: T, iteratee?: ValueOnlyIteratee<A>): {[key: V]: ?Array<A>};
198
+ includes<T>(array: ?Array<T>, value: T, fromIndex?: number): bool;
199
+ includes<T: Object>(object: T, value: any, fromIndex?: number): bool;
200
+ includes(str: string, value: string, fromIndex?: number): bool;
201
+ invokeMap<T>(array: ?Array<T>, path: ((value: T) => Array<string>|string)|Array<string>|string, ...args?: Array<any>): Array<any>;
202
+ invokeMap<T: Object>(object: T, path: ((value: any) => Array<string>|string)|Array<string>|string, ...args?: Array<any>): Array<any>;
203
+ keyBy<T, V>(array: ?Array<T>, iteratee?: ValueOnlyIteratee<T>): {[key: V]: ?T};
204
+ keyBy<V, A, T: {[id: string]: A}>(object: T, iteratee?: ValueOnlyIteratee<A>): {[key: V]: ?A};
205
+ map<T, U>(array: ?Array<T>, iteratee?: MapIterator<T, U>): Array<U>;
206
+ map<V, T: Object, U>(object: ?T, iteratee?: OMapIterator<V, T, U>): Array<U>;
207
+ map(str: ?string, iteratee?: (char: string, index: number, str: string) => any): string;
208
+ orderBy<T>(array: ?Array<T>, iteratees?: Array<Iteratee<T>>|string, orders?: Array<'asc'|'desc'>|string): Array<T>;
209
+ orderBy<V, T: Object>(object: T, iteratees?: Array<OIteratee<*>>|string, orders?: Array<'asc'|'desc'>|string): Array<V>;
210
+ partition<T>(array: ?Array<T>, predicate?: Predicate<T>): NestedArray<T>;
211
+ partition<V, A, T: {[id: string]: A}>(object: T, predicate?: OPredicate<A, T>): NestedArray<V>;
212
+ reduce<T, U>(array: ?Array<T>, iteratee?: (accumulator: U, value: T, index: number, array: ?Array<T>) => U, accumulator?: U): U;
213
+ reduce<T: Object, U>(object: T, iteratee?: (accumulator: U, value: any, key: string, object: T) => U, accumulator?: U): U;
214
+ reduceRight<T, U>(array: ?Array<T>, iteratee?: (accumulator: U, value: T, index: number, array: ?Array<T>) => U, accumulator?: U): U;
215
+ reduceRight<T: Object, U>(object: T, iteratee?: (accumulator: U, value: any, key: string, object: T) => U, accumulator?: U): U;
216
+ reject<T>(array: ?Array<T>, predicate?: Predicate<T>): Array<T>;
217
+ reject<V: Object, A, T: {[id: string]: A}>(object: T, predicate?: OPredicate<A, T>): Array<V>;
218
+ sample<T>(array: ?Array<T>): T;
219
+ sample<V, T: Object>(object: T): V;
220
+ sampleSize<T>(array: ?Array<T>, n?: number): Array<T>;
221
+ sampleSize<V, T: Object>(object: T, n?: number): Array<V>;
222
+ shuffle<T>(array: ?Array<T>): Array<T>;
223
+ shuffle<V, T: Object>(object: T): Array<V>;
224
+ size(collection: Array<any>|Object): number;
225
+ some<T>(array: ?Array<T>, predicate?: Predicate<T>): bool;
226
+ some<A, T: {[id: string]: A}>(object?: ?T, predicate?: OPredicate<A, T>): bool;
227
+ sortBy<T>(array: ?Array<T>, ...iteratees?: Array<Iteratee<T>>): Array<T>;
228
+ sortBy<T>(array: ?Array<T>, iteratees?: Array<Iteratee<T>>): Array<T>;
229
+ sortBy<V, T: Object>(object: T, ...iteratees?: Array<OIteratee<T>>): Array<V>;
230
+ sortBy<V, T: Object>(object: T, iteratees?: Array<OIteratee<T>>): Array<V>;
231
+
232
+ // Date
233
+ now(): number;
234
+
235
+ // Function
236
+ after(n: number, fn: Function): Function;
237
+ ary(func: Function, n?: number): Function;
238
+ before(n: number, fn: Function): Function;
239
+ bind(func: Function, thisArg: any, ...partials: Array<any>): Function;
240
+ bindKey(obj: Object, key: string, ...partials: Array<any>): Function;
241
+ curry(func: Function, arity?: number): Function;
242
+ curryRight(func: Function, arity?: number): Function;
243
+ debounce(func: Function, wait?: number, options?: DebounceOptions): Function;
244
+ defer(func: Function, ...args?: Array<any>): number;
245
+ delay(func: Function, wait: number, ...args?: Array<any>): number;
246
+ flip(func: Function): Function;
247
+ memoize(func: Function, resolver?: Function): Function;
248
+ negate(predicate: Function): Function;
249
+ once(func: Function): Function;
250
+ overArgs(func: Function, ...transforms: Array<Function>): Function;
251
+ overArgs(func: Function, transforms: Array<Function>): Function;
252
+ partial(func: Function, ...partials: any[]): Function;
253
+ partialRight(func: Function, ...partials: Array<any>): Function;
254
+ partialRight(func: Function, partials: Array<any>): Function;
255
+ rearg(func: Function, ...indexes: Array<number>): Function;
256
+ rearg(func: Function, indexes: Array<number>): Function;
257
+ rest(func: Function, start?: number): Function;
258
+ spread(func: Function): Function;
259
+ throttle(func: Function, wait?: number, options?: ThrottleOptions): Function;
260
+ unary(func: Function): Function;
261
+ wrap(value: any, wrapper: Function): Function;
262
+
263
+ // Lang
264
+ castArray(value: *): any[];
265
+ clone<T>(value: T): T;
266
+ cloneDeep<T>(value: T): T;
267
+ cloneDeepWith<T, U>(value: T, customizer?: ?(value: T, key: number|string, object: T, stack: any) => U): U;
268
+ cloneWith<T, U>(value: T, customizer?: ?(value: T, key: number|string, object: T, stack: any) => U): U;
269
+ conformsTo<T:{[key:string]:mixed}>(source: T, predicates: T&{[key:string]:(x:any)=>boolean}): boolean;
270
+ eq(value: any, other: any): bool;
271
+ gt(value: any, other: any): bool;
272
+ gte(value: any, other: any): bool;
273
+ isArguments(value: any): bool;
274
+ isArray(value: any): bool;
275
+ isArrayBuffer(value: any): bool;
276
+ isArrayLike(value: any): bool;
277
+ isArrayLikeObject(value: any): bool;
278
+ isBoolean(value: any): bool;
279
+ isBuffer(value: any): bool;
280
+ isDate(value: any): bool;
281
+ isElement(value: any): bool;
282
+ isEmpty(value: any): bool;
283
+ isEqual(value: any, other: any): bool;
284
+ isEqualWith<T, U>(value: T, other: U, customizer?: (objValue: any, otherValue: any, key: number|string, object: T, other: U, stack: any) => bool|void): bool;
285
+ isError(value: any): bool;
286
+ isFinite(value: any): bool;
287
+ isFunction(value: Function): true;
288
+ isFunction(value: number|string|void|null|Object): false;
289
+ isInteger(value: any): bool;
290
+ isLength(value: any): bool;
291
+ isMap(value: any): bool;
292
+ isMatch(object?: ?Object, source: Object): bool;
293
+ isMatchWith<T: Object, U: Object>(object: T, source: U, customizer?: (objValue: any, srcValue: any, key: number|string, object: T, source: U) => bool|void): bool;
294
+ isNaN(value: any): bool;
295
+ isNative(value: any): bool;
296
+ isNil(value: any): bool;
297
+ isNull(value: any): bool;
298
+ isNumber(value: any): bool;
299
+ isObject(value: any): bool;
300
+ isObjectLike(value: any): bool;
301
+ isPlainObject(value: any): bool;
302
+ isRegExp(value: any): bool;
303
+ isSafeInteger(value: any): bool;
304
+ isSet(value: any): bool;
305
+ isString(value: string): true;
306
+ isString(value: number|Function|void|null|Object|Array<any>): false;
307
+ isSymbol(value: any): bool;
308
+ isTypedArray(value: any): bool;
309
+ isUndefined(value: any): bool;
310
+ isWeakMap(value: any): bool;
311
+ isWeakSet(value: any): bool;
312
+ lt(value: any, other: any): bool;
313
+ lte(value: any, other: any): bool;
314
+ toArray(value: any): Array<any>;
315
+ toFinite(value: any): number;
316
+ toInteger(value: any): number;
317
+ toLength(value: any): number;
318
+ toNumber(value: any): number;
319
+ toPlainObject(value: any): Object;
320
+ toSafeInteger(value: any): number;
321
+ toString(value: any): string;
322
+
323
+ // Math
324
+ add(augend: number, addend: number): number;
325
+ ceil(number: number, precision?: number): number;
326
+ divide(dividend: number, divisor: number): number;
327
+ floor(number: number, precision?: number): number;
328
+ max<T>(array: ?Array<T>): T;
329
+ maxBy<T>(array: ?Array<T>, iteratee?: Iteratee<T>): T;
330
+ mean(array: Array<*>): number;
331
+ meanBy<T>(array: Array<T>, iteratee?: Iteratee<T>): number;
332
+ min<T>(array: ?Array<T>): T;
333
+ minBy<T>(array: ?Array<T>, iteratee?: Iteratee<T>): T;
334
+ multiply(multiplier: number, multiplicand: number): number;
335
+ round(number: number, precision?: number): number;
336
+ subtract(minuend: number, subtrahend: number): number;
337
+ sum(array: Array<*>): number;
338
+ sumBy<T>(array: Array<T>, iteratee?: Iteratee<T>): number;
339
+
340
+ // number
341
+ clamp(number: number, lower?: number, upper: number): number;
342
+ inRange(number: number, start?: number, end: number): bool;
343
+ random(lower?: number, upper?: number, floating?: bool): number;
344
+
345
+ // Object
346
+ assign(object?: ?Object, ...sources?: Array<Object>): Object;
347
+ assignIn<A, B>(a: A, b: B): A & B;
348
+ assignIn<A, B, C>(a: A, b: B, c: C): A & B & C;
349
+ assignIn<A, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D;
350
+ assignIn<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E;
351
+ assignInWith<T: Object, A: Object>(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object;
352
+ assignInWith<T: Object, A: Object, B: Object>(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object;
353
+ assignInWith<T: Object, A: Object, B: Object, C: Object>(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object;
354
+ assignInWith<T: Object, A: Object, B: Object, C: Object, D: Object>(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object;
355
+ assignWith<T: Object, A: Object>(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object;
356
+ assignWith<T: Object, A: Object, B: Object>(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object;
357
+ assignWith<T: Object, A: Object, B: Object, C: Object>(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object;
358
+ assignWith<T: Object, A: Object, B: Object, C: Object, D: Object>(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object;
359
+ at(object?: ?Object, ...paths: Array<string>): Array<any>;
360
+ at(object?: ?Object, paths: Array<string>): Array<any>;
361
+ create<T>(prototype: T, properties?: Object): $Supertype<T>;
362
+ defaults(object?: ?Object, ...sources?: Array<Object>): Object;
363
+ defaultsDeep(object?: ?Object, ...sources?: Array<Object>): Object;
364
+ // alias for _.toPairs
365
+ entries(object?: ?Object): NestedArray<any>;
366
+ // alias for _.toPairsIn
367
+ entriesIn(object?: ?Object): NestedArray<any>;
368
+ // alias for _.assignIn
369
+ extend<A, B>(a: A, b: B): A & B;
370
+ extend<A, B, C>(a: A, b: B, c: C): A & B & C;
371
+ extend<A, B, C, D>(a: A, b: B, c: C, d: D): A & B & C & D;
372
+ extend<A, B, C, D, E>(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E;
373
+ // alias for _.assignInWith
374
+ extendWith<T: Object, A: Object>(object: T, s1: A, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object;
375
+ extendWith<T: Object, A: Object, B: Object>(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object;
376
+ extendWith<T: Object, A: Object, B: Object, C: Object>(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object;
377
+ extendWith<T: Object, A: Object, B: Object, C: Object, D: Object>(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object;
378
+ findKey<A, T: {[id: string]: A}>(object?: ?T, predicate?: OPredicate<A, T>): string|void;
379
+ findLastKey<A, T: {[id: string]: A}>(object?: ?T, predicate?: OPredicate<A, T>): string|void;
380
+ forIn(object?: ?Object, iteratee?: OIteratee<*>): Object;
381
+ forInRight(object?: ?Object, iteratee?: OIteratee<*>): Object;
382
+ forOwn(object?: ?Object, iteratee?: OIteratee<*>): Object;
383
+ forOwnRight(object?: ?Object, iteratee?: OIteratee<*>): Object;
384
+ functions(object?: ?Object): Array<string>;
385
+ functionsIn(object?: ?Object): Array<string>;
386
+ get(object?: ?Object, path?: ?Array<string>|string, defaultValue?: any): any;
387
+ has(object?: ?Object, path?: ?Array<string>|string): bool;
388
+ hasIn(object?: ?Object, path?: ?Array<string>|string): bool;
389
+ invert(object?: ?Object, multiVal?: bool): Object;
390
+ invertBy(object: ?Object, iteratee?: Function): Object;
391
+ invoke(object?: ?Object, path?: ?Array<string>|string, ...args?: Array<any>): any;
392
+ keys(object?: ?Object): Array<string>;
393
+ keysIn(object?: ?Object): Array<string>;
394
+ mapKeys(object?: ?Object, iteratee?: OIteratee<*>): Object;
395
+ mapValues(object?: ?Object, iteratee?: OIteratee<*>): Object;
396
+ merge(object?: ?Object, ...sources?: Array<?Object>): Object;
397
+ mergeWith<T: Object, A: Object>(object: T, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A) => any|void): Object;
398
+ mergeWith<T: Object, A: Object, B: Object>(object: T, s1: A, s2: B, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B) => any|void): Object;
399
+ mergeWith<T: Object, A: Object, B: Object, C: Object>(object: T, s1: A, s2: B, s3: C, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C) => any|void): Object;
400
+ mergeWith<T: Object, A: Object, B: Object, C: Object, D: Object>(object: T, s1: A, s2: B, s3: C, s4: D, customizer?: (objValue: any, srcValue: any, key: string, object: T, source: A|B|C|D) => any|void): Object;
401
+ omit(object?: ?Object, ...props: Array<string>): Object;
402
+ omit(object?: ?Object, props: Array<string>): Object;
403
+ omitBy<A, T: {[id: string]: A}>(object?: ?T, predicate?: OPredicate<A, T>): Object;
404
+ pick(object?: ?Object, ...props: Array<string>): Object;
405
+ pick(object?: ?Object, props: Array<string>): Object;
406
+ pickBy<A, T: {[id: string]: A}>(object?: ?T, predicate?: OPredicate<A, T>): Object;
407
+ result(object?: ?Object, path?: ?Array<string>|string, defaultValue?: any): any;
408
+ set(object?: ?Object, path?: ?Array<string>|string, value: any): Object;
409
+ setWith<T>(object: T, path?: ?Array<string>|string, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any): Object;
410
+ toPairs(object?: ?Object|Array<*>): NestedArray<any>;
411
+ toPairsIn(object?: ?Object): NestedArray<any>;
412
+ transform(collection: Object|Array<any>, iteratee?: OIteratee<*>, accumulator?: any): any;
413
+ unset(object?: ?Object, path?: ?Array<string>|string): bool;
414
+ update(object: Object, path: string[]|string, updater: Function): Object;
415
+ updateWith(object: Object, path: string[]|string, updater: Function, customizer?: Function): Object;
416
+ values(object?: ?Object): Array<any>;
417
+ valuesIn(object?: ?Object): Array<any>;
418
+
419
+ // Seq
420
+ // harder to read, but this is _()
421
+ (value: any): any;
422
+ chain<T>(value: T): any;
423
+ tap<T>(value: T, interceptor: (value:T)=>any): T;
424
+ thru<T1,T2>(value: T1, interceptor: (value:T1)=>T2): T2;
425
+ // TODO: _.prototype.*
426
+
427
+ // String
428
+ camelCase(string?: ?string): string;
429
+ capitalize(string?: string): string;
430
+ deburr(string?: string): string;
431
+ endsWith(string?: string, target?: string, position?: number): bool;
432
+ escape(string?: string): string;
433
+ escapeRegExp(string?: string): string;
434
+ kebabCase(string?: string): string;
435
+ lowerCase(string?: string): string;
436
+ lowerFirst(string?: string): string;
437
+ pad(string?: string, length?: number, chars?: string): string;
438
+ padEnd(string?: string, length?: number, chars?: string): string;
439
+ padStart(string?: string, length?: number, chars?: string): string;
440
+ parseInt(string: string, radix?: number): number;
441
+ repeat(string?: string, n?: number): string;
442
+ replace(string?: string, pattern: RegExp|string, replacement: ((string: string) => string)|string): string;
443
+ snakeCase(string?: string): string;
444
+ split(string?: string, separator: RegExp|string, limit?: number): Array<string>;
445
+ startCase(string?: string): string;
446
+ startsWith(string?: string, target?: string, position?: number): bool;
447
+ template(string?: string, options?: TemplateSettings): Function;
448
+ toLower(string?: string): string;
449
+ toUpper(string?: string): string;
450
+ trim(string?: string, chars?: string): string;
451
+ trimEnd(string?: string, chars?: string): string;
452
+ trimStart(string?: string, chars?: string): string;
453
+ truncate(string?: string, options?: TruncateOptions): string;
454
+ unescape(string?: string): string;
455
+ upperCase(string?: string): string;
456
+ upperFirst(string?: string): string;
457
+ words(string?: string, pattern?: RegExp|string): Array<string>;
458
+
459
+ // Util
460
+ attempt(func: Function): any;
461
+ bindAll(object?: ?Object, methodNames: Array<string>): Object;
462
+ bindAll(object?: ?Object, ...methodNames: Array<string>): Object;
463
+ cond(pairs: NestedArray<Function>): Function;
464
+ conforms(source: Object): Function;
465
+ constant<T>(value: T): () => T;
466
+ defaultTo<T1:string|boolean|Object,T2>(value: T1, default: T2): T1;
467
+ // NaN is a number instead of its own type, otherwise it would behave like null/void
468
+ defaultTo<T1:number,T2>(value: T1, default: T2): T1|T2;
469
+ defaultTo<T1:void|null,T2>(value: T1, default: T2): T2;
470
+ flow(...funcs?: Array<Function>): Function;
471
+ flow(funcs?: Array<Function>): Function;
472
+ flowRight(...funcs?: Array<Function>): Function;
473
+ flowRight(funcs?: Array<Function>): Function;
474
+ identity<T>(value: T): T;
475
+ iteratee(func?: any): Function;
476
+ matches(source: Object): Function;
477
+ matchesProperty(path?: ?Array<string>|string, srcValue: any): Function;
478
+ method(path?: ?Array<string>|string, ...args?: Array<any>): Function;
479
+ methodOf(object?: ?Object, ...args?: Array<any>): Function;
480
+ mixin<T: Function|Object>(object?: T, source: Object, options?: { chain: bool }): T;
481
+ noConflict(): Lodash;
482
+ noop(): void;
483
+ nthArg(n?: number): Function;
484
+ over(...iteratees: Array<Function>): Function;
485
+ over(iteratees: Array<Function>): Function;
486
+ overEvery(...predicates: Array<Function>): Function;
487
+ overEvery(predicates: Array<Function>): Function;
488
+ overSome(...predicates: Array<Function>): Function;
489
+ overSome(predicates: Array<Function>): Function;
490
+ property(path?: ?Array<string>|string): Function;
491
+ propertyOf(object?: ?Object): Function;
492
+ range(start: number, end: number, step?: number): Array<number>;
493
+ range(end: number, step?: number): Array<number>;
494
+ rangeRight(start: number, end: number, step?: number): Array<number>;
495
+ rangeRight(end: number, step?: number): Array<number>;
496
+ runInContext(context?: Object): Function;
497
+
498
+ stubArray(): Array<*>;
499
+ stubFalse(): false;
500
+ stubObject(): {};
501
+ stubString(): '';
502
+ stubTrue(): true;
503
+ times(n: number, ...rest: Array<void>): Array<number>;
504
+ times<T>(n: number, iteratee: ((i: number) => T)): Array<T>;
505
+ toPath(value: any): Array<string>;
506
+ uniqueId(prefix?: string): string;
507
+
508
+ // Properties
509
+ VERSION: string;
510
+ templateSettings: TemplateSettings;
511
+ }
512
+
513
+ declare var exports: Lodash;
514
+ }