Showing preview only (289K chars total). Download the full file or copy to clipboard to get everything.
Repository: inloop/apk-method-count
Branch: gh-pages
Commit: 634e0cde71e0
Files: 21
Total size: 278.6 KB
Directory structure:
gitextract_2ehdrf35/
├── .gitattributes
├── .gitignore
├── LICENSE
├── README.md
├── _references.ts
├── css/
│ └── main.css
├── index.html
├── js/
│ ├── libs/
│ │ ├── filereader.js
│ │ └── jdataview.js
│ ├── main.js
│ └── ts/
│ ├── defs/
│ │ ├── bootstrap.d.ts
│ │ ├── filereader.d.ts
│ │ ├── jdataview.d.ts
│ │ ├── jquery.d.ts
│ │ ├── jszip.d.ts
│ │ └── various.d.ts
│ ├── dexdefs.ts
│ ├── dexformat.ts
│ ├── main.ts
│ └── model.ts
└── tsconfig.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
js/main.js -diff
js/main.js.map -diff
================================================
FILE: .gitignore
================================================
.idea/*
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================
[](https://android-arsenal.com/details/1/1567)
APK method count
============
#### [Deprecated - use official [APK analyzer](https://developer.android.com/studio/build/apk-analyzer.html)]
*Output per-package method counts. Supports [multidex](https://developer.android.com/tools/building/multidex.html).*

Also you can now view per-class method counts for more detailed analysis. Inline classes are showed in this format: *ParentClass$InlineClass*. Anonymous classes are in this format: *(anon-cls-ID)*.

It's written in TypeScript, If you want contribute - create a pull request or create an issue (If you have an idea or have you found an issue).
### License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: _references.ts
================================================
///<reference path="js/ts/main.ts"/>
================================================
FILE: css/main.css
================================================
body {
background: #f5f5f5;
}
footer {
margin-top: 8px;
margin-bottom: 8px;
color: darkgray;
text-align: center;
}
footer small a {
color: #7AA7CF;
}
#main-container {
position: relative;
background: #ffffff;
box-shadow: 0 1px 16px silver;
}
.node-info {
font-style: italic;
display: none;
margin: 0;
padding: 0;
}
.drag {
background-color: lightblue;
}
.info-items td {
vertical-align: top;
}
.info-items td:first-child {
width: 90px;
}
.extra-info i {
margin-left: 8px;
}
#header {
background: #BDBDBD;
color: #424242;
padding: 16px;
margin-left: -15px;
margin-right: -15px;
margin-bottom: 15px;
}
#header h3 {
margin: 0;
}
#dropzone {
height: 450px;
width: 100%;
font-size: 1.2em;
cursor: pointer;
text-align: center;
display: table;
table-layout: fixed;
}
#dropzone .panel-body {
display: table-cell;
vertical-align: middle;
}
#output-box {
display: none;
margin-bottom: 20px;
}
#button-box {
position: absolute;
right: 40px;
}
.modal .modal-body {
max-height: 500px;
overflow-y: auto;
}
.class-part {
color: #797979;
}
.class-last-part {
}
#package-detail tbody tr td {
max-width: 450px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Animated loading icon */
.glyphicon-refresh-animate {
-animation: spin .7s infinite linear;
-webkit-animation: spin2 .7s infinite linear;
}
@-webkit-keyframes spin2 {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
/* Tree (based on http://jsfiddle.net/jayhilwig/hv8vU/) */
.tree {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #fbfbfb;
border: 1px solid #999;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05)
}
.tree li {
list-style-type: none;
margin: 0;
padding: 10px 5px 0 5px;
position: relative
}
.tree li::before, .tree li::after {
content: '';
left: -20px;
position: absolute;
right: auto
}
.tree li::before {
border-left: 1px solid #999;
bottom: 50px;
height: 100%;
top: 0;
width: 1px
}
.tree li::after {
border-top: 1px solid #999;
height: 20px;
top: 25px;
width: 25px
}
.tree li span {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border: 1px solid #999;
border-radius: 5px;
display: inline-block;
padding: 3px 8px;
text-decoration: none
}
.tree li.parent_li > span {
cursor: pointer
}
.tree > ul > li::before, .tree > ul > li::after {
border: 0
}
.tree li:last-child::before {
height: 30px
}
.tree li.parent_li > span:hover, .tree li.parent_li > span:hover + ul li span:not(.badge) {
background: #eee;
border: 1px solid #94a0b4;
color: #000
}
================================================
FILE: index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<meta charset="utf-8">
<meta name="description" content="APK method count">
<meta name="keywords" content="apk,dex,limit,methods,count,packages,classes">
<meta name="author" content="Juraj Novák">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>APK method count</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">
<link rel="image_src" href="img/icon.png" />
<link rel="icon" type="image/png" href="img/icon.png"/>
</head>
<body>
<img src="img/icon.png" style="display: none;"/>
<div id="main-container" class="container">
<div id="header">
<img src="img/logo.svg" class="img-responsive pull-left" style="margin-right: 16px;" />
<h3>APK method count</h3>
<p>output per-package method counts</p>
</div>
<div id="compat-error" class="alert alert-danger" style="display: none">
<div class="clearfix">
<img src="img/seriously.png" class="img-responsive pull-left"/>
<p>Sorry but your browser does not support some of new HTML5 features! Try using latest version of Google Chrome or
Firefox.</p>
</div>
</div>
<div class="panel panel-info" id="dropzone">
<div id="drop-text" class="panel-body">
<b>Drop file here</b> to load content or click on this box to open file dialog.<br/>
<div class="nouploadinfo small">No file will be uploaded - uses only JavaScript HTML5 FileReader.<br /><br /></div>
</div>
<div id="drop-loading" class="panel-body" style="display: none">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span> <b>Processing file ...</b>
</div>
</div>
<div class="alert alert-info box" id="success-box" style="display: none">
<b>Total methods count: </b><span id="method-count-total"></span> <span id="method-count-multidex"></span>
</div>
<div id="output-box">
<div id="button-box" class="btn-group">
<button type="button" class="btn btn-default btn-sm" id="expand-collapse-btn">Expand</button>
<button type="button" class="btn btn-primary btn-sm" id="download-btn">Download</button>
</div>
<div id="package-tree" class="tree well">
</div>
</div>
<div class="alert alert-danger box" style="display: none"></div>
<div class="alert alert-warning box" style="display: none"></div>
<div class="alert alert-info box" style="display: none"></div>
</div>
<div id="package-detail" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title"></h4>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th>Class</th>
<th>Methods</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="container">
<footer>
<a href="https://yuraj11.github.io">© 2024 Juraj Novák</a><br>
<small>| <a href="https://github.com/inloop/apk-method-count">Fork me on GitHub</a> |</small>
</footer>
</div>
<input type="file" id="dropzone-dialog" style="opacity: 0;display:none">
<script src="js/libs/jquery-1.11.3.min.js"></script>
<script src="js/libs/bootstrap.min.js"></script>
<script src="js/libs/filereader.js"></script>
<script src="js/libs/filesaver.min.js"></script>
<script src="js/libs/jszip.min.js"></script>
<script src="js/libs/jdataview.js"></script>
<script src="js/main.js?v=5"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-59852117-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
================================================
FILE: js/libs/filereader.js
================================================
/*!
FileReader.js - v0.99
A lightweight wrapper for common FileReader usage.
Copyright 2014 Brian Grinstead - MIT License.
See http://github.com/bgrins/filereader.js for documentation.
*/
(function(window, document) {
var FileReader = window.FileReader;
var FileReaderSyncSupport = false;
var workerScript = "self.addEventListener('message', function(e) { var data=e.data; try { var reader = new FileReaderSync; postMessage({ result: reader[data.readAs](data.file), extra: data.extra, file: data.file})} catch(e){ postMessage({ result:'error', extra:data.extra, file:data.file}); } }, false);";
var syncDetectionScript = "onmessage = function(e) { postMessage(!!FileReaderSync); };";
var fileReaderEvents = ['loadstart', 'progress', 'load', 'abort', 'error', 'loadend'];
var sync = false;
var FileReaderJS = window.FileReaderJS = {
enabled: false,
setupInput: setupInput,
setupDrop: setupDrop,
setupClipboard: setupClipboard,
setSync: function (value) {
sync = value;
if (sync && !FileReaderSyncSupport) {
checkFileReaderSyncSupport();
}
},
getSync: function() {
return sync && FileReaderSyncSupport;
},
output: [],
opts: {
dragClass: "drag",
accept: false,
readAsDefault: 'DataURL',
readAsMap: {
},
on: {
loadstart: noop,
progress: noop,
load: noop,
abort: noop,
error: noop,
loadend: noop,
skip: noop,
groupstart: noop,
groupend: noop,
beforestart: noop
}
}
};
// Setup jQuery plugin (if available)
if (typeof(jQuery) !== "undefined") {
jQuery.fn.fileReaderJS = function(opts) {
return this.each(function() {
if (jQuery(this).is("input")) {
setupInput(this, opts);
}
else {
setupDrop(this, opts);
}
});
};
jQuery.fn.fileClipboard = function(opts) {
return this.each(function() {
setupClipboard(this, opts);
});
};
}
// Not all browsers support the FileReader interface. Return with the enabled bit = false.
if (!FileReader) {
return;
}
// makeWorker is a little wrapper for generating web workers from strings
function makeWorker(script) {
var URL = window.URL || window.webkitURL;
var Blob = window.Blob;
var Worker = window.Worker;
if (!URL || !Blob || !Worker || !script) {
return null;
}
var blob = new Blob([script]);
var worker = new Worker(URL.createObjectURL(blob));
return worker;
}
// setupClipboard: bind to clipboard events (intended for document.body)
function setupClipboard(element, opts) {
if (!FileReaderJS.enabled) {
return;
}
var instanceOptions = extend(extend({}, FileReaderJS.opts), opts);
element.addEventListener("paste", onpaste, false);
function onpaste(e) {
var files = [];
var clipboardData = e.clipboardData || {};
var items = clipboardData.items || [];
for (var i = 0; i < items.length; i++) {
var file = items[i].getAsFile();
if (file) {
// Create a fake file name for images from clipboard, since this data doesn't get sent
var matches = new RegExp("/\(.*\)").exec(file.type);
if (!file.name && matches) {
var extension = matches[1];
file.name = "clipboard" + i + "." + extension;
}
files.push(file);
}
}
if (files.length) {
processFileList(e, files, instanceOptions);
e.preventDefault();
e.stopPropagation();
}
}
}
// setupInput: bind the 'change' event to an input[type=file]
function setupInput(input, opts) {
if (!FileReaderJS.enabled) {
return;
}
var instanceOptions = extend(extend({}, FileReaderJS.opts), opts);
input.addEventListener("change", inputChange, false);
input.addEventListener("drop", inputDrop, false);
function inputChange(e) {
processFileList(e, input.files, instanceOptions);
}
function inputDrop(e) {
e.stopPropagation();
e.preventDefault();
processFileList(e, e.dataTransfer.files, instanceOptions);
}
}
// setupDrop: bind the 'drop' event for a DOM element
function setupDrop(dropbox, opts) {
if (!FileReaderJS.enabled) {
return;
}
var instanceOptions = extend(extend({}, FileReaderJS.opts), opts);
var dragClass = instanceOptions.dragClass;
var initializedOnBody = false;
// Bind drag events to the dropbox to add the class while dragging, and accept the drop data transfer.
dropbox.addEventListener("dragenter", onlyWithFiles(dragenter), false);
dropbox.addEventListener("dragleave", onlyWithFiles(dragleave), false);
dropbox.addEventListener("dragover", onlyWithFiles(dragover), false);
dropbox.addEventListener("drop", onlyWithFiles(drop), false);
// Bind to body to prevent the dropbox events from firing when it was initialized on the page.
document.body.addEventListener("dragstart", bodydragstart, true);
document.body.addEventListener("dragend", bodydragend, true);
document.body.addEventListener("drop", bodydrop, false);
function bodydragend(e) {
initializedOnBody = false;
}
function bodydragstart(e) {
initializedOnBody = true;
}
function bodydrop(e) {
if (e.dataTransfer.files && e.dataTransfer.files.length ){
e.stopPropagation();
e.preventDefault();
}
}
function onlyWithFiles(fn) {
return function() {
if (!initializedOnBody) {
fn.apply(this, arguments);
}
};
}
function drop(e) {
e.stopPropagation();
e.preventDefault();
if (dragClass) {
removeClass(dropbox, dragClass);
}
processFileList(e, e.dataTransfer.files, instanceOptions);
}
function dragenter(e) {
e.stopPropagation();
e.preventDefault();
if (dragClass) {
addClass(dropbox, dragClass);
}
}
function dragleave(e) {
if (dragClass) {
removeClass(dropbox, dragClass);
}
}
function dragover(e) {
e.stopPropagation();
e.preventDefault();
if (dragClass) {
addClass(dropbox, dragClass);
}
}
}
// setupCustomFileProperties: modify the file object with extra properties
function setupCustomFileProperties(files, groupID) {
for (var i = 0; i < files.length; i++) {
var file = files[i];
file.extra = {
nameNoExtension: file.name.substring(0, file.name.lastIndexOf('.')),
extension: file.name.substring(file.name.lastIndexOf('.') + 1),
fileID: i,
uniqueID: getUniqueID(),
groupID: groupID,
prettySize: prettySize(file.size)
};
}
}
// getReadAsMethod: return method name for 'readAs*' - http://www.w3.org/TR/FileAPI/#reading-a-file
function getReadAsMethod(type, readAsMap, readAsDefault) {
for (var r in readAsMap) {
if (type.match(new RegExp(r))) {
return 'readAs' + readAsMap[r];
}
}
return 'readAs' + readAsDefault;
}
// processFileList: read the files with FileReader, send off custom events.
function processFileList(e, files, opts) {
var filesLeft = files.length;
var group = {
groupID: getGroupID(),
files: files,
started: new Date()
};
function groupEnd() {
group.ended = new Date();
opts.on.groupend(group);
}
function groupFileDone() {
if (--filesLeft === 0) {
groupEnd();
}
}
FileReaderJS.output.push(group);
setupCustomFileProperties(files, group.groupID);
opts.on.groupstart(group);
// No files in group - end immediately
if (!files.length) {
groupEnd();
return;
}
var supportsSync = sync && FileReaderSyncSupport;
var syncWorker;
// Only initialize the synchronous worker if the option is enabled - to prevent the overhead
if (supportsSync) {
syncWorker = makeWorker(workerScript);
syncWorker.onmessage = function(e) {
var file = e.data.file;
var result = e.data.result;
// Workers seem to lose the custom property on the file object.
if (!file.extra) {
file.extra = e.data.extra;
}
file.extra.ended = new Date();
// Call error or load event depending on success of the read from the worker.
opts.on[result === "error" ? "error" : "load"]({ target: { result: result } }, file);
groupFileDone();
};
}
Array.prototype.forEach.call(files, function(file) {
file.extra.started = new Date();
if (opts.accept && !file.type.match(new RegExp(opts.accept))) {
opts.on.skip(file);
groupFileDone();
return;
}
if (opts.on.beforestart(file) === false) {
opts.on.skip(file);
groupFileDone();
return;
}
var readAs = getReadAsMethod(file.type, opts.readAsMap, opts.readAsDefault);
if (syncWorker) {
syncWorker.postMessage({
file: file,
extra: file.extra,
readAs: readAs
});
}
else {
var reader = new FileReader();
reader.originalEvent = e;
fileReaderEvents.forEach(function(eventName) {
reader['on' + eventName] = function(e) {
if (eventName == 'load' || eventName == 'error') {
file.extra.ended = new Date();
}
opts.on[eventName](e, file);
if (eventName == 'loadend') {
groupFileDone();
}
};
});
reader[readAs](file);
}
});
}
// checkFileReaderSyncSupport: Create a temporary worker and see if FileReaderSync exists
function checkFileReaderSyncSupport() {
var worker = makeWorker(syncDetectionScript);
if (worker) {
worker.onmessage =function(e) {
FileReaderSyncSupport = e.data;
};
worker.postMessage({});
}
}
// noop: do nothing
function noop() {
}
// extend: used to make deep copies of options object
function extend(destination, source) {
for (var property in source) {
if (source[property] && source[property].constructor &&
source[property].constructor === Object) {
destination[property] = destination[property] || {};
arguments.callee(destination[property], source[property]);
}
else {
destination[property] = source[property];
}
}
return destination;
}
// hasClass: does an element have the css class?
function hasClass(el, name) {
return new RegExp("(?:^|\\s+)" + name + "(?:\\s+|$)").test(el.className);
}
// addClass: add the css class for the element.
function addClass(el, name) {
if (!hasClass(el, name)) {
el.className = el.className ? [el.className, name].join(' ') : name;
}
}
// removeClass: remove the css class from the element.
function removeClass(el, name) {
if (hasClass(el, name)) {
var c = el.className;
el.className = c.replace(new RegExp("(?:^|\\s+)" + name + "(?:\\s+|$)", "g"), " ").replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
}
// prettySize: convert bytes to a more readable string.
function prettySize(bytes) {
var s = ['bytes', 'kb', 'MB', 'GB', 'TB', 'PB'];
var e = Math.floor(Math.log(bytes)/Math.log(1024));
return (bytes/Math.pow(1024, Math.floor(e))).toFixed(2)+" "+s[e];
}
// getGroupID: generate a unique int ID for groups.
var getGroupID = (function(id) {
return function() {
return id++;
};
})(0);
// getUniqueID: generate a unique int ID for files
var getUniqueID = (function(id) {
return function() {
return id++;
};
})(0);
// The interface is supported, bind the FileReaderJS callbacks
FileReaderJS.enabled = true;
})(this, document);
================================================
FILE: js/libs/jdataview.js
================================================
!function(a){var b=this;"object"==typeof exports?module.exports=a(b):"function"==typeof define&&define.amd?define([],function(){return a(b)}):b.jDataView=a(b)}(function(a){"use strict";function b(a,b){return"object"!=typeof a||null===a?!1:a.constructor===b||Object.prototype.toString.call(a)==="[object "+b.name+"]"}function c(a,c){return!c&&b(a,Array)?a:Array.prototype.slice.call(a)}function d(a,b){return void 0!==a?a:b}function e(a,c,f,g){if(e.is(a)){var h=a.slice(c,c+f);return h._littleEndian=d(g,h._littleEndian),h}if(!e.is(this))return new e(a,c,f,g);if(this.buffer=a=e.wrapBuffer(a),this._isArrayBuffer=j.ArrayBuffer&&b(a,ArrayBuffer),this._isPixelData=!0&&j.PixelData&&b(a,CanvasPixelArray),this._isDataView=j.DataView&&this._isArrayBuffer,this._isNodeBuffer=!1,!this._isArrayBuffer&&!this._isPixelData&&!b(a,Array))throw new TypeError("jDataView buffer has an incompatible type");this._littleEndian=!!g;var i="byteLength"in a?a.byteLength:a.length;this.byteOffset=c=d(c,0),this.byteLength=f=d(f,i-c),this._offset=this._bitOffset=0,this._isDataView?this._view=new DataView(a,c,f):this._checkBounds(c,f,i),this._engineAction=this._isDataView?this._dataViewAction:this._isArrayBuffer?this._arrayBufferAction:this._arrayAction}function f(a){for(var b=j.ArrayBuffer?Uint8Array:Array,c=new b(a.length),d=0,e=a.length;e>d;d++)c[d]=255&a.charCodeAt(d);return c}function g(a){return a>=0&&31>a?1<<a:g[a]||(g[a]=Math.pow(2,a))}function h(a,b){this.lo=a,this.hi=b}function i(){h.apply(this,arguments)}var j={NodeBuffer:!1,DataView:"DataView"in a,ArrayBuffer:"ArrayBuffer"in a,PixelData:!0&&"CanvasPixelArray"in a&&!("Uint8ClampedArray"in a)&&"document"in a},k=a.TextEncoder,l=a.TextDecoder;if(j.PixelData)var m=document.createElement("canvas").getContext("2d"),n=function(a,b){var c=m.createImageData((a+3)/4,1).data;if(c.byteLength=a,void 0!==b)for(var d=0;a>d;d++)c[d]=b[d];return c};var o={Int8:1,Int16:2,Int32:4,Uint8:1,Uint16:2,Uint32:4,Float32:4,Float64:8};e.wrapBuffer=function(a){switch(typeof a){case"number":if(j.ArrayBuffer)a=new Uint8Array(a).buffer;else if(j.PixelData)a=n(a);else{a=new Array(a);for(var d=0;d<a.length;d++)a[d]=0}return a;case"string":a=f(a);default:return"length"in a&&!(j.ArrayBuffer&&b(a,ArrayBuffer)||j.PixelData&&b(a,CanvasPixelArray))&&(j.ArrayBuffer?b(a,ArrayBuffer)||(a=new Uint8Array(a).buffer,b(a,ArrayBuffer)||(a=new Uint8Array(c(a,!0)).buffer)):a=j.PixelData?n(a.length,a):c(a)),a}},e.is=function(a){return a&&a.jDataView},e.from=function(){return new e(arguments)},e.Uint64=h,h.prototype={valueOf:function(){return this.lo+g(32)*this.hi},toString:function(){return Number.prototype.toString.apply(this.valueOf(),arguments)}},h.fromNumber=function(a){var b=Math.floor(a/g(32)),c=a-b*g(32);return new h(c,b)},e.Int64=i,i.prototype="create"in Object?Object.create(h.prototype):new h,i.prototype.valueOf=function(){return this.hi<g(31)?h.prototype.valueOf.apply(this,arguments):-(g(32)-this.lo+g(32)*(g(32)-1-this.hi))},i.fromNumber=function(a){var b,c;if(a>=0){var d=h.fromNumber(a);b=d.lo,c=d.hi}else c=Math.floor(a/g(32)),b=a-c*g(32),c+=g(32);return new i(b,c)};var p=e.prototype={compatibility:j,jDataView:!0,_checkBounds:function(a,b,c){if("number"!=typeof a)throw new TypeError("Offset is not a number.");if("number"!=typeof b)throw new TypeError("Size is not a number.");if(0>b)throw new RangeError("Length is negative.");if(0>a||a+b>d(c,this.byteLength))throw new RangeError("Offsets are out of bounds.")},_action:function(a,b,c,e,f){return this._engineAction(a,b,d(c,this._offset),d(e,this._littleEndian),f)},_dataViewAction:function(a,b,c,d,e){return this._offset=c+o[a],b?this._view["get"+a](c,d):this._view["set"+a](c,e,d)},_arrayBufferAction:function(b,c,e,f,g){var h,i=o[b],j=a[b+"Array"];if(f=d(f,this._littleEndian),1===i||(this.byteOffset+e)%i===0&&f)return h=new j(this.buffer,this.byteOffset+e,1),this._offset=e+i,c?h[0]:h[0]=g;var k=new Uint8Array(c?this.getBytes(i,e,f,!0):i);return h=new j(k.buffer,0,1),c?h[0]:(h[0]=g,void this._setBytes(e,k,f))},_arrayAction:function(a,b,c,d,e){return b?this["_get"+a](c,d):this["_set"+a](c,e,d)},_getBytes:function(a,b,e){e=d(e,this._littleEndian),b=d(b,this._offset),a=d(a,this.byteLength-b),this._checkBounds(b,a),b+=this.byteOffset,this._offset=b-this.byteOffset+a;var f=this._isArrayBuffer?new Uint8Array(this.buffer,b,a):(this.buffer.slice||Array.prototype.slice).call(this.buffer,b,b+a);return e||1>=a?f:c(f).reverse()},getBytes:function(a,b,e,f){var g=this._getBytes(a,b,d(e,!0));return f?c(g):g},_setBytes:function(a,b,e){var f=b.length;if(0!==f){if(e=d(e,this._littleEndian),a=d(a,this._offset),this._checkBounds(a,f),!e&&f>1&&(b=c(b,!0).reverse()),a+=this.byteOffset,this._isArrayBuffer)new Uint8Array(this.buffer,a,f).set(b);else for(var g=0;f>g;g++)this.buffer[a+g]=b[g];this._offset=a-this.byteOffset+f}},setBytes:function(a,b,c){this._setBytes(a,b,d(c,!0))},getString:function(a,b,c){var d=this._getBytes(a,b,!0);if(c="utf8"===c?"utf-8":c||"binary",l&&"binary"!==c)return new l(c).decode(this._isArrayBuffer?d:new Uint8Array(d));var e="";a=d.length;for(var f=0;a>f;f++)e+=String.fromCharCode(d[f]);return"utf-8"===c&&(e=decodeURIComponent(escape(e))),e},setString:function(a,b,c){c="utf8"===c?"utf-8":c||"binary";var d;k&&"binary"!==c?d=new k(c).encode(b):("utf-8"===c&&(b=unescape(encodeURIComponent(b))),d=f(b)),this._setBytes(a,d,!0)},getChar:function(a){return this.getString(1,a)},setChar:function(a,b){this.setString(a,b)},tell:function(){return this._offset},seek:function(a){return this._checkBounds(a,0),this._offset=a},skip:function(a){return this.seek(this._offset+a)},slice:function(a,b,c){function f(a,b){return 0>a?a+b:a}return a=f(a,this.byteLength),b=f(d(b,this.byteLength),this.byteLength),c?new e(this.getBytes(b-a,a,!0,!0),void 0,void 0,this._littleEndian):new e(this.buffer,this.byteOffset+a,b-a,this._littleEndian)},alignBy:function(a){return this._bitOffset=0,1!==d(a,1)?this.skip(a-(this._offset%a||a)):this._offset},_getFloat64:function(a,b){var c=this._getBytes(8,a,b),d=1-2*(c[7]>>7),e=((c[7]<<1&255)<<3|c[6]>>4)-1023,f=(15&c[6])*g(48)+c[5]*g(40)+c[4]*g(32)+c[3]*g(24)+c[2]*g(16)+c[1]*g(8)+c[0];return 1024===e?0!==f?0/0:1/0*d:-1023===e?d*f*g(-1074):d*(1+f*g(-52))*g(e)},_getFloat32:function(a,b){var c=this._getBytes(4,a,b),d=1-2*(c[3]>>7),e=(c[3]<<1&255|c[2]>>7)-127,f=(127&c[2])<<16|c[1]<<8|c[0];return 128===e?0!==f?0/0:1/0*d:-127===e?d*f*g(-149):d*(1+f*g(-23))*g(e)},_get64:function(a,b,c){c=d(c,this._littleEndian),b=d(b,this._offset);for(var e=c?[0,4]:[4,0],f=0;2>f;f++)e[f]=this.getUint32(b+e[f],c);return this._offset=b+8,new a(e[0],e[1])},getInt64:function(a,b){return this._get64(i,a,b)},getUint64:function(a,b){return this._get64(h,a,b)},_getInt32:function(a,b){var c=this._getBytes(4,a,b);return c[3]<<24|c[2]<<16|c[1]<<8|c[0]},_getUint32:function(a,b){return this._getInt32(a,b)>>>0},_getInt16:function(a,b){return this._getUint16(a,b)<<16>>16},_getUint16:function(a,b){var c=this._getBytes(2,a,b);return c[1]<<8|c[0]},_getInt8:function(a){return this._getUint8(a)<<24>>24},_getUint8:function(a){return this._getBytes(1,a)[0]},_getBitRangeData:function(a,b){var c=(d(b,this._offset)<<3)+this._bitOffset,e=c+a,f=c>>>3,g=e+7>>>3,h=this._getBytes(g-f,f,!0),i=0;(this._bitOffset=7&e)&&(this._bitOffset-=8);for(var j=0,k=h.length;k>j;j++)i=i<<8|h[j];return{start:f,bytes:h,wideValue:i}},getSigned:function(a,b){var c=32-a;return this.getUnsigned(a,b)<<c>>c},getUnsigned:function(a,b){var c=this._getBitRangeData(a,b).wideValue>>>-this._bitOffset;return 32>a?c&~(-1<<a):c},_setBinaryFloat:function(a,b,c,d,e){var f,h,i=0>b?1:0,j=~(-1<<d-1),k=1-j;0>b&&(b=-b),0===b?(f=0,h=0):isNaN(b)?(f=2*j+1,h=1):1/0===b?(f=2*j+1,h=0):(f=Math.floor(Math.log(b)/Math.LN2),f>=k&&j>=f?(h=Math.floor((b*g(-f)-1)*g(c)),f+=j):(h=Math.floor(b/g(k-c)),f=0));for(var l=[];c>=8;)l.push(h%256),h=Math.floor(h/256),c-=8;for(f=f<<c|h,d+=c;d>=8;)l.push(255&f),f>>>=8,d-=8;l.push(i<<d|f),this._setBytes(a,l,e)},_setFloat32:function(a,b,c){this._setBinaryFloat(a,b,23,8,c)},_setFloat64:function(a,b,c){this._setBinaryFloat(a,b,52,11,c)},_set64:function(a,b,c,e){"object"!=typeof c&&(c=a.fromNumber(c)),e=d(e,this._littleEndian),b=d(b,this._offset);var f=e?{lo:0,hi:4}:{lo:4,hi:0};for(var g in f)this.setUint32(b+f[g],c[g],e);this._offset=b+8},setInt64:function(a,b,c){this._set64(i,a,b,c)},setUint64:function(a,b,c){this._set64(h,a,b,c)},_setUint32:function(a,b,c){this._setBytes(a,[255&b,b>>>8&255,b>>>16&255,b>>>24],c)},_setUint16:function(a,b,c){this._setBytes(a,[255&b,b>>>8&255],c)},_setUint8:function(a,b){this._setBytes(a,[255&b])},setUnsigned:function(a,b,c){var d=this._getBitRangeData(c,a),e=d.wideValue,f=d.bytes;e&=~(~(-1<<c)<<-this._bitOffset),e|=(32>c?b&~(-1<<c):b)<<-this._bitOffset;for(var g=f.length-1;g>=0;g--)f[g]=255&e,e>>>=8;this._setBytes(d.start,f,!0)}};for(var q in o)!function(a){p["get"+a]=function(b,c){return this._action(a,!0,b,c)},p["set"+a]=function(b,c,d){this._action(a,!1,b,d,c)}}(q);p._setInt32=p._setUint32,p._setInt16=p._setUint16,p._setInt8=p._setUint8,p.setSigned=p.setUnsigned;for(var r in p)"set"===r.slice(0,3)&&!function(a){p["write"+a]=function(){Array.prototype.unshift.call(arguments,void 0),this["set"+a].apply(this,arguments)}}(r.slice(3));return e});
//# sourceMappingURL=jdataview.js.map
================================================
FILE: js/main.js
================================================
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
///<reference path="dexformat.ts"/>
var DexFormat;
(function (DexFormat) {
(function (AccessFlags) {
AccessFlags[AccessFlags["ACC_PUBLIC"] = 1] = "ACC_PUBLIC";
AccessFlags[AccessFlags["ACC_PRIVATE"] = 2] = "ACC_PRIVATE";
AccessFlags[AccessFlags["ACC_PROTECTED"] = 4] = "ACC_PROTECTED";
AccessFlags[AccessFlags["ACC_STATIC"] = 8] = "ACC_STATIC";
AccessFlags[AccessFlags["ACC_FINAL"] = 16] = "ACC_FINAL";
AccessFlags[AccessFlags["ACC_SYNCHRONIZED"] = 32] = "ACC_SYNCHRONIZED";
AccessFlags[AccessFlags["ACC_VOLATILE"] = 64] = "ACC_VOLATILE";
AccessFlags[AccessFlags["ACC_BRIDGE"] = 64] = "ACC_BRIDGE";
AccessFlags[AccessFlags["ACC_TRANSIENT"] = 128] = "ACC_TRANSIENT";
AccessFlags[AccessFlags["ACC_VARARGS"] = 128] = "ACC_VARARGS";
AccessFlags[AccessFlags["ACC_NATIVE"] = 256] = "ACC_NATIVE";
AccessFlags[AccessFlags["ACC_INTERFACE"] = 512] = "ACC_INTERFACE";
AccessFlags[AccessFlags["ACC_ABSTRACT"] = 1024] = "ACC_ABSTRACT";
AccessFlags[AccessFlags["ACC_STRICT"] = 2048] = "ACC_STRICT";
AccessFlags[AccessFlags["ACC_SYNTHETIC"] = 4096] = "ACC_SYNTHETIC";
AccessFlags[AccessFlags["ACC_ANNOTATION"] = 8192] = "ACC_ANNOTATION";
AccessFlags[AccessFlags["ACC_ENUM"] = 16384] = "ACC_ENUM";
AccessFlags[AccessFlags["ACC_CONSTRUCTOR"] = 65536] = "ACC_CONSTRUCTOR";
AccessFlags[AccessFlags["ACC_DECLARED_SYNCHRONIZED"] = 131072] = "ACC_DECLARED_SYNCHRONIZED";
})(DexFormat.AccessFlags || (DexFormat.AccessFlags = {}));
var AccessFlags = DexFormat.AccessFlags;
var BaseDef = (function () {
function BaseDef(reader) {
this.reader = reader;
}
BaseDef.NO_INDEX = 0xffffffff;
return BaseDef;
}());
var ClassBaseDef = (function (_super) {
__extends(ClassBaseDef, _super);
function ClassBaseDef() {
_super.apply(this, arguments);
}
ClassBaseDef.prototype.getClassData = function () {
return this.reader.getClass(this.classIdx);
};
ClassBaseDef.prototype.getClassType = function () {
return this.reader.getType(this.classIdx);
};
ClassBaseDef.prototype.getClassIdx = function () {
return this.classIdx;
};
return ClassBaseDef;
}(BaseDef));
var TypeDef = (function (_super) {
__extends(TypeDef, _super);
function TypeDef(reader, descriptorIdx) {
_super.call(this, reader);
this.descriptorIdx = descriptorIdx;
}
TypeDef.prototype.getDescriptor = function () {
return this.reader.getString(this.descriptorIdx);
};
TypeDef.prototype.setInternal = function (internal) {
this.internal = internal;
};
TypeDef.prototype.isInternal = function () {
return this.internal;
};
return TypeDef;
}(BaseDef));
DexFormat.TypeDef = TypeDef;
var ProtoDef = (function (_super) {
__extends(ProtoDef, _super);
function ProtoDef(reader, shortyIdx, returnTypeIdx, parametersOff) {
_super.call(this, reader);
this.shortyIdx = shortyIdx;
this.returnTypeIdx = returnTypeIdx;
this.parametersOff = parametersOff;
}
ProtoDef.prototype.getShorty = function () {
return this.reader.getString(this.shortyIdx);
};
ProtoDef.prototype.getParametersOff = function () {
return this.parametersOff;
};
ProtoDef.prototype.getReturnType = function () {
return this.reader.getType(this.returnTypeIdx);
};
return ProtoDef;
}(BaseDef));
DexFormat.ProtoDef = ProtoDef;
var FieldDef = (function (_super) {
__extends(FieldDef, _super);
function FieldDef(reader, classIdx, typeIdx, nameIdx) {
_super.call(this, reader);
this.classIdx = classIdx;
this.typeIdx = typeIdx;
this.nameIdx = nameIdx;
}
FieldDef.prototype.getName = function () {
return this.reader.getString(this.nameIdx);
};
FieldDef.prototype.getType = function () {
return this.reader.getType(this.typeIdx);
};
return FieldDef;
}(ClassBaseDef));
DexFormat.FieldDef = FieldDef;
var MethodDef = (function (_super) {
__extends(MethodDef, _super);
function MethodDef(reader, classIdx, protoIdx, nameIdx) {
_super.call(this, reader);
this.classIdx = classIdx;
this.protoIdx = protoIdx;
this.nameIdx = nameIdx;
}
MethodDef.prototype.getName = function () {
return this.reader.getString(this.nameIdx);
};
MethodDef.prototype.getProto = function () {
return this.reader.getProto(this.protoIdx);
};
return MethodDef;
}(ClassBaseDef));
DexFormat.MethodDef = MethodDef;
var ClassDef = (function (_super) {
__extends(ClassDef, _super);
function ClassDef(reader, classIdx, accessFlags, superclassIdx, interfacesOff, sourceFileIdx, annotationsOff, classDataOff, staticValuesOff) {
_super.call(this, reader);
this.classIdx = classIdx;
this.accessFlags = accessFlags;
this.superclassIdx = superclassIdx;
this.interfacesOff = interfacesOff;
this.sourceFileIdx = sourceFileIdx;
this.annotationsOff = annotationsOff;
this.classDataOff = classDataOff;
this.staticValuesOff = staticValuesOff;
}
ClassDef.prototype.getClassIdx = function () {
return this.classIdx;
};
ClassDef.prototype.isAccessFlag = function (flag) {
return (this.accessFlags & flag) == flag;
};
ClassDef.prototype.getSourceFileName = function () {
return this.reader.getString(this.sourceFileIdx);
};
ClassDef.prototype.getClassType = function () {
return this.reader.getType(this.classIdx);
};
ClassDef.prototype.getSuperclassType = function () {
if (this.superclassIdx == BaseDef.NO_INDEX) {
return null;
}
else {
return this.reader.getType(this.superclassIdx);
}
};
ClassDef.prototype.getInterfacesOff = function () {
return this.interfacesOff;
};
ClassDef.prototype.getAnnotationsOff = function () {
return this.annotationsOff;
};
ClassDef.prototype.getClassDataOff = function () {
return this.classDataOff;
};
ClassDef.prototype.getStaticValuesOff = function () {
return this.staticValuesOff;
};
return ClassDef;
}(BaseDef));
DexFormat.ClassDef = ClassDef;
})(DexFormat || (DexFormat = {}));
///<reference path="defs/jszip.d.ts"/>
///<reference path="defs/jdataview.d.ts"/>
///<reference path="defs/filereader.d.ts"/>
///<reference path="dexdefs.ts"/>
/**
* dexjs 0.4
* Written by Juraj Novak (inloop.eu)
* based on https://github.com/mihaip/dex-method-counts
* https://source.android.com/devices/tech/dalvik/dex-format.html
*/
var DexFormat;
(function (DexFormat) {
var MultiDexFileReader = (function () {
function MultiDexFileReader(inputFileStream) {
this.dexFiles = [];
var zip = new JSZip(inputFileStream);
var files = zip.file(MultiDexFileReader.CLASSES_FILENAME);
if (files.length == 0) {
throw new Error("APK does not contain .dex file(s).");
}
this.multidex = files.length > 1;
for (var i = 0; i < files.length; i++) {
var file = files[i];
var dexFileReader = new DexFileReader(file);
this.dexFiles.push(dexFileReader);
}
}
MultiDexFileReader.prototype.getMethodRefs = function () {
var res = [];
for (var i = 0; i < this.dexFiles.length; i++) {
var dexFile = this.dexFiles[i];
res = res.concat(dexFile.getMethodRefs());
}
return res;
};
MultiDexFileReader.prototype.isMultidex = function () {
return this.multidex;
};
MultiDexFileReader.CLASSES_FILENAME = /classes\d*\.dex/;
return MultiDexFileReader;
}());
DexFormat.MultiDexFileReader = MultiDexFileReader;
var DexFileReader = (function () {
function DexFileReader(file) {
this.strings = [];
this.types = [];
this.protos = [];
this.fields = [];
this.methods = [];
this.classes = [];
var dv = new jDataView(file.asArrayBuffer());
if (!DexFileReader.isValidDexFile(dv.getBytes(8))) {
throw new Error("APK not compatible.");
}
this.header = new DexHeader(dv);
this.loadStrings(dv);
this.loadTypes(dv);
this.loadProtos(dv);
this.loadFields(dv);
this.loadMethods(dv);
this.loadClasses(dv);
this.markInternalClasses();
}
DexFileReader.getClassNameOnly = function (typeName) {
var dotted = DexFileReader.descriptorToDot(typeName);
var start = dotted.lastIndexOf(".");
if (start < 0) {
return dotted;
}
else {
return dotted.substring(start + 1);
}
};
DexFileReader.getPackageNameOnly = function (typeName) {
var dotted = DexFileReader.descriptorToDot(typeName);
var end = dotted.lastIndexOf(".");
if (end < 0) {
return "";
}
else {
return dotted.substring(0, end);
}
};
DexFileReader.descriptorToDot = function (descr) {
var targetLen = descr.length;
var offset = 0;
var arrayDepth = 0;
/* strip leading [s; will be added to end */
while (targetLen > 1 && descr.charAt(offset) == '[') {
offset++;
targetLen--;
}
arrayDepth = offset;
if (targetLen == 1) {
descr = DexFileReader.getPrimitiveType(descr.charAt(offset));
offset = 0;
targetLen = descr.length;
}
else {
/* account for leading 'L' and trailing ';' */
if (targetLen >= 2 && descr.charAt(offset) == 'L' &&
descr.charAt(offset + targetLen - 1) == ';') {
targetLen -= 2; /* two fewer chars to copy */
offset++; /* skip the 'L' */
}
}
var buf = [];
/* copy class name over */
var i;
for (i = 0; i < targetLen; i++) {
var ch = descr.charAt(offset + i);
buf[i] = (ch == '/') ? '.' : ch;
}
/* add the appopriate number of brackets for arrays */
while (arrayDepth-- > 0) {
buf[i++] = '[';
buf[i++] = ']';
}
return buf.join("");
};
DexFileReader.isValidDexFile = function (bytes) {
for (var i = 0; i < bytes.length; i++) {
if (!(bytes[i] === DexFileReader.DEX_FILE_MAGIC[i] || bytes[i] === DexFileReader.DEX_FILE_MAGIC_API_13[i])) {
return false;
}
}
return true;
};
DexFileReader.prototype.markInternalClasses = function () {
for (var i = this.classes.length - 1; i >= 0; i--) {
this.classes[i].getClassType().setInternal(true);
}
for (var i = 0; i < this.types.length; i++) {
var className = this.types[i].getDescriptor();
if (className.length == 1) {
// primitive class
this.types[i].setInternal(true);
}
else if (className.charAt(0) == '[') {
this.types[i].setInternal(true);
}
}
};
DexFileReader.prototype.loadStrings = function (dv) {
var curStrings = [];
var offsets = [];
dv.seek(this.header.stringIdsOff);
for (var i = 0; i < this.header.stringIdsSize; i++) {
offsets[i] = dv.getInt32();
}
dv.seek(offsets[0]);
for (var i = 0; i < this.header.stringIdsSize; i++) {
dv.seek(offsets[i]);
curStrings[i] = dv.readStringUtf();
}
this.strings = this.strings.concat(curStrings);
};
DexFileReader.prototype.loadTypes = function (dv) {
var curTypes = [];
dv.seek(this.header.typeIdsOff);
for (var i = 0; i < this.header.typeIdsSize; i++) {
var descriptorIdx = dv.getInt32();
curTypes[i] = new DexFormat.TypeDef(this, descriptorIdx);
}
this.types = this.types.concat(curTypes);
};
DexFileReader.prototype.loadProtos = function (dv) {
var curProtos = [];
dv.seek(this.header.protoIdsOff);
for (var i = 0; i < this.header.protoIdsSize; i++) {
var shortyIdx = dv.getInt32();
var returnTypeIdx = dv.getInt32();
var parametersOff = dv.getInt32();
curProtos[i] = new DexFormat.ProtoDef(this, shortyIdx, returnTypeIdx, parametersOff);
}
/*for (var i = 0; i < this.header.protoIdsSize; i++) {
var offset = curProtos[i].parametersOff;
curProtos[i].types = [];
if (offset != 0) {
dv.seek(offset);
var size = dv.getInt32();
for (var j = 0; j < size; j++) {
curProtos[i].types[j] = dv.getInt16() & 0xffff;
}
}
}*/
this.protos = this.protos.concat(curProtos);
};
DexFileReader.prototype.loadFields = function (dv) {
var curFields = [];
dv.seek(this.header.fieldIdsOff);
for (var i = 0; i < this.header.fieldIdsSize; i++) {
var classIdx = dv.getInt16() & 0xffff;
var typeIdx = dv.getInt16() & 0xffff;
var nameIdx = dv.getInt32();
curFields[i] = new DexFormat.FieldDef(this, classIdx, typeIdx, nameIdx);
}
this.fields = this.fields.concat(curFields);
};
DexFileReader.prototype.loadMethods = function (dv) {
var curMethods = [];
dv.seek(this.header.methodIdsOff);
for (var i = 0; i < this.header.methodIdsSize; i++) {
var classIdx = dv.getInt16() & 0xffff;
var protoIdx = dv.getInt16() & 0xffff;
var nameIdx = dv.getInt32();
curMethods[i] = new DexFormat.MethodDef(this, classIdx, protoIdx, nameIdx);
}
this.methods = this.methods.concat(curMethods);
};
DexFileReader.prototype.loadClasses = function (dv) {
var curClasses = [];
dv.seek(this.header.classDefsOff);
for (var i = 0; i < this.header.classDefsSize; i++) {
var classIdx = dv.getInt32();
var accessFlags = dv.getInt32();
var superclassIdx = dv.getInt32();
var interfacesOff = dv.getInt32();
var sourceFileIdx = dv.getInt32();
var annotationsOff = dv.getInt32();
var classDataOff = dv.getInt32();
var staticValuesOff = dv.getInt32();
curClasses[i] = new DexFormat.ClassDef(this, classIdx, accessFlags, superclassIdx, interfacesOff, sourceFileIdx, annotationsOff, classDataOff, staticValuesOff);
}
this.classes = this.classes.concat(curClasses);
};
DexFileReader.getPrimitiveType = function (typeChar) {
switch (typeChar) {
case 'B': return "byte";
case 'C': return "char";
case 'D': return "double";
case 'F': return "float";
case 'I': return "int";
case 'J': return "long";
case 'S': return "short";
case 'V': return "void";
case 'Z': return "boolean";
default:
throw "Unexpected class char " + typeChar;
return "UNKNOWN";
}
};
DexFileReader.prototype.getMethodRefs = function () {
return this.methods;
};
DexFileReader.prototype.getString = function (idx) {
return this.strings[idx];
};
DexFileReader.prototype.getType = function (idx) {
return this.types[idx];
};
DexFileReader.prototype.getProto = function (idx) {
return this.protos[idx];
};
DexFileReader.prototype.getClass = function (idx) {
for (var i = 0; i < this.classes.length; i++) {
var searchIdx = this.classes[i].getClassIdx();
if (idx == searchIdx) {
return this.classes[i];
}
}
return null;
};
//Constants
DexFileReader.DEX_FILE_MAGIC = [0x64, 0x65, 0x78, 0x0a, 0x30, 0x33, 0x36, 0x00];
DexFileReader.DEX_FILE_MAGIC_API_13 = [0x64, 0x65, 0x78, 0x0a, 0x30, 0x33, 0x35, 0x00];
return DexFileReader;
}());
DexFormat.DexFileReader = DexFileReader;
var DexHeader = (function () {
function DexHeader(dv) {
//Read endian tag first
dv.seek(8 + 4 + 20 + 4 + 4);
this.endianTag = dv.getInt32();
if (this.endianTag === DexHeader.ENDIAN_CONSTANT) {
dv._littleEndian = false;
}
else if (this.endianTag === DexHeader.REVERSE_ENDIAN_CONSTANT) {
dv._littleEndian = true;
}
else {
throw new Error("APK read error (endianTag)!");
}
dv.seek(8 + 4 + 20);
this.fileSize = dv.getInt32();
this.headerSize = dv.getInt32();
this.endianTag = dv.getInt32();
this.linkSize = dv.getInt32();
this.linkOff = dv.getInt32();
this.mapOff = dv.getInt32();
this.stringIdsSize = dv.getInt32();
this.stringIdsOff = dv.getInt32();
this.typeIdsSize = dv.getInt32();
this.typeIdsOff = dv.getInt32();
this.protoIdsSize = dv.getInt32();
this.protoIdsOff = dv.getInt32();
this.fieldIdsSize = dv.getInt32();
this.fieldIdsOff = dv.getInt32();
this.methodIdsSize = dv.getInt32();
this.methodIdsOff = dv.getInt32();
this.classDefsSize = dv.getInt32();
this.classDefsOff = dv.getInt32();
this.dataSize = dv.getInt32();
this.dataOff = dv.getInt32();
}
DexHeader.ENDIAN_CONSTANT = 0x12345678;
DexHeader.REVERSE_ENDIAN_CONSTANT = 0x78563412;
return DexHeader;
}());
jDataView.prototype.readStringUtf = function () {
var len = this.readUnsignedLeb128();
return this.getString(len);
};
jDataView.prototype.readUnsignedLeb128 = function () {
var result = 0;
do {
var b = this.getUint8();
result = (result << 7) | (b & 0x7f);
} while (b < 0);
return result;
};
})(DexFormat || (DexFormat = {}));
///<reference path="main.ts"/>
var ApkMethodCount;
(function (ApkMethodCount) {
var MultiDexFileReader = DexFormat.MultiDexFileReader;
var Model = (function () {
function Model() {
}
Model.prototype.getCurrentTreemap = function () {
return this.currentTreemap;
};
Model.prototype.loadDexFile = function (arrayBuffer) {
var dexFile = new MultiDexFileReader(arrayBuffer);
var methodRefs = dexFile.getMethodRefs();
var treemap = [];
for (var i = 0; i < methodRefs.length; i++) {
var classData = methodRefs[i].getClassData();
var classType = methodRefs[i].getClassType();
var classDescriptor = classType.getDescriptor();
var packageName = DexFileReader.getPackageNameOnly(classDescriptor);
var packageNameParts = packageName.split(".");
//Empty package
if (packageNameParts.length == 1 && packageNameParts[0].length == 0) {
packageNameParts[0] = Model.EMPTY_PACKAGE_NAME;
}
//Build tree map of classes
var currentNode = treemap[packageNameParts[0]];
if (typeof currentNode === "undefined") {
currentNode = treemap[packageNameParts[0]] = {};
}
var classIdx = methodRefs[i].getClassIdx();
for (var j = 0; j < packageNameParts.length; j++) {
if (j >= 1) {
if (typeof currentNode[packageNameParts[j]] === "undefined") {
currentNode[packageNameParts[j]] = [];
}
currentNode = currentNode[packageNameParts[j]];
}
var metaNode;
if (typeof currentNode[ApkMethodCount.AppView.TREE_META_NODE] === "undefined") {
metaNode = currentNode[ApkMethodCount.AppView.TREE_META_NODE] = new PackageNodeMetaData();
}
else {
metaNode = currentNode[ApkMethodCount.AppView.TREE_META_NODE];
}
metaNode.incrementMethodCount();
//Save classes and their method counts
if (j >= Model.TREE_CLASS_LEVEL) {
metaNode.addClassAndIncrement(classIdx, new ClassDataWrapper(classType, classData));
}
}
}
//Save reference for later (showing package details)
this.currentTreemap = treemap;
return { tree: treemap, methodsCount: methodRefs.length, multidex: dexFile.isMultidex() };
};
Model.prototype.isInnerClassFromName = function (className) {
return className.match(Model.INNER_CLASS_REGEX) !== null;
};
Model.prototype.formatType = function (className, classData) {
var classDef = classData.getClassDef();
if (classDef != null) {
if (classDef.isAccessFlag(DexFormat.AccessFlags.ACC_INTERFACE)) {
return Model.ICON_INTERFACE;
}
else if (classDef.isAccessFlag(DexFormat.AccessFlags.ACC_ENUM)) {
return Model.ICON_ENUM;
}
else {
return Model.ICON_CLASS;
}
}
else if (className.lastIndexOf("[]") == className.length - 2) {
return Model.ICON_ENUM;
}
else {
return Model.ICON_REF;
}
};
Model.prototype.extractFileNameWithoutExt = function (filename) {
var dotIndex = filename.lastIndexOf(".");
if (dotIndex > -1) {
return filename.substr(0, dotIndex);
}
else {
return filename;
}
};
Model.EMPTY_PACKAGE_NAME = "(empty)";
Model.ICON_INTERFACE = "interface";
Model.ICON_CLASS = "class";
Model.ICON_ENUM = "enum";
Model.ICON_REF = "reference";
Model.INNER_CLASS_REGEX = /^\d+$/;
Model.START_LEVEL_VISIBLE = 1;
Model.TREE_CLASS_LEVEL = 1;
return Model;
}());
ApkMethodCount.Model = Model;
var ClassDataWrapper = (function () {
function ClassDataWrapper(classType, classDef) {
this.methodCount = 0;
this.classType = classType;
this.classDef = classDef;
}
ClassDataWrapper.prototype.incrementMethodCount = function () {
this.methodCount++;
};
ClassDataWrapper.prototype.getMethodCount = function () {
return this.methodCount;
};
ClassDataWrapper.prototype.getClassType = function () {
return this.classType;
};
ClassDataWrapper.prototype.getClassDef = function () {
return this.classDef;
};
return ClassDataWrapper;
}());
ApkMethodCount.ClassDataWrapper = ClassDataWrapper;
var PackageNodeMetaData = (function () {
function PackageNodeMetaData() {
this.classes = [];
this.count = 0;
}
PackageNodeMetaData.prototype.incrementMethodCount = function () {
this.count++;
};
PackageNodeMetaData.prototype.addClassAndIncrement = function (idx, classWrapper) {
if (typeof this.classes[idx] === "undefined") {
this.classes[idx] = classWrapper;
}
this.classes[idx].incrementMethodCount();
};
PackageNodeMetaData.prototype.getCount = function () {
return this.count;
};
PackageNodeMetaData.prototype.getClassWrapper = function (idx) {
return this.classes[idx];
};
PackageNodeMetaData.prototype.getSortedClasses = function () {
var _this = this;
return Object.keys(this.classes).sort(function (a, b) {
return _this.classes[b].getMethodCount() - _this.classes[a].getMethodCount();
});
};
return PackageNodeMetaData;
}());
ApkMethodCount.PackageNodeMetaData = PackageNodeMetaData;
})(ApkMethodCount || (ApkMethodCount = {}));
///<reference path="dexformat.ts"/>
///<reference path="defs/jquery.d.ts"/>
///<reference path="defs/bootstrap.d.ts"/>
///<reference path="defs/various.d.ts"/>
///<reference path="model.ts"/>
var ClassDef = DexFormat.ClassDef;
var TypeDef = DexFormat.TypeDef;
var DexFileReader = DexFormat.DexFileReader;
var ApkMethodCount;
(function (ApkMethodCount) {
var AppView = (function () {
function AppView() {
var _this = this;
this.generatedTreePlain = [];
this.lastFilename = "classes_stats";
this.treeView = $("#package-tree");
this.lastMouseOverNode = null;
this.nodeTraverse = [];
this.model = new ApkMethodCount.Model();
this.fileReaderOpts = {
readAsDefault: "ArrayBuffer", on: {
load: function (e, v) { return _this.onLoadFile(e, v); }
}
};
//Check If browser supports FileReader API
if (typeof FileReader === "undefined") {
$('#dropzone, #dropzone-dialog').hide();
$('#compat-error').show();
}
else {
$('#dropzone, #dropzone-dialog').fileReaderJS(this.fileReaderOpts);
}
//Bind event listeners
this.treeView.on("mouseleave", function () { return _this.resetLastMouseOverNode(); });
$("#expand-collapse-btn").on("click", function () { return _this.expandCollapseAll(); });
$("#download-btn").on("click", function () { return _this.download(); });
$("#dropzone").on("click", function () { return _this.dropzoneClick(); });
}
AppView.prototype.onLoadFile = function (e, file) {
var _this = this;
this.lastFilename = this.model.extractFileNameWithoutExt(file.name);
this.setIsLoading(true);
setTimeout(function () {
var errorText = $(".alert-danger.box");
try {
var data = _this.model.loadDexFile(e.target.result);
_this.renderPackages(data);
$("#output-box").fadeIn();
$(".nouploadinfo").hide();
$("#dropzone").delay(50).animate({ height: 50 }, 500);
$("#success-box").show();
errorText.hide();
}
catch (exception) {
console.log(exception);
_this.setIsLoading(false);
errorText.text("Not a valid APK!");
errorText.show();
$("#output-box").hide();
$("#success-box").hide();
}
}, 50);
};
AppView.prototype.setIsLoading = function (isLoading) {
var dropText = $("#drop-text");
var loading = $("#drop-loading");
if (isLoading) {
dropText.hide();
loading.show();
}
else {
dropText.show();
loading.hide();
}
};
AppView.prototype.renderPackages = function (data) {
var _this = this;
var treeBuilder = [];
this.generatedTreePlain = [];
this.generatedTreePlain.push("Total methods count: " + data.methodsCount);
this.generatedTreePlain.push("");
treeBuilder.push("<ul>");
this.recursiveRenderPackage(treeBuilder, data.tree, 0);
treeBuilder.push("</ul>");
this.treeView.empty();
this.treeView.append(treeBuilder.join(""));
this.updateTree();
$("#method-count-multidex").text(data.multidex ? "(multidex enabled)" : "");
$("#method-count-total").text(data.methodsCount);
$(".show-class-detail").on("click", function (e) {
_this.showPackageDetail($(e.currentTarget).data("package"));
});
this.setIsLoading(false);
};
AppView.prototype.recursiveRenderPackage = function (treeBuilder, node, level) {
//Sort current node by method counts
var sortedNode = Object.keys(node).sort(function (a, b) {
if (a == AppView.TREE_META_NODE || b == AppView.TREE_META_NODE)
return -1;
return node[b][AppView.TREE_META_NODE].getCount() - node[a][AppView.TREE_META_NODE].getCount();
});
for (var item in sortedNode) {
item = sortedNode[item];
if (item != AppView.TREE_META_NODE) {
var displayStyle = level <= ApkMethodCount.Model.START_LEVEL_VISIBLE ? "visible" : "none";
var nodeSign = "<i class='glyphicon " + (level == 0 ? AppView.MINUS_SIGN_GLYPHICON : AppView.PLUS_SIGN_GLYPHICON) + "'></i> ";
var hasChildren = Object.keys(node[item]).length > 1; //TREE_META_NODE ignore
var count = node[item][AppView.TREE_META_NODE].getCount();
var extraSpan = "";
var extraInfo = "";
if (level > 0) {
extraSpan = this.nodeTraverse.join(".") + "." + item;
extraInfo = "<p class='node-info extra-info'>" +
"<a title='Search using Google' href='https://www.google.com/search?q=\"" + extraSpan + "\"' target='_blank'>" +
"<i class='glyphicon glyphicon-search' aria-hidden='true'></i></a>" +
"<a title='Show classes' href='javascript:void(0)' class='show-class-detail' data-package='" + extraSpan + "'>" +
"<i class='glyphicon glyphicon glyphicon-signal' aria-hidden='true'></i></a></p>";
}
this.generatedTreePlain.push("\t".repeat(level) + item + " [" + count + "]");
treeBuilder.push("<li style='display: " + displayStyle + "'><span> " + (hasChildren ? nodeSign : "") + item +
" <span class='badge'>" + count + "</span></span> <p class='node-info'>" + extraSpan + "</p>" + extraInfo);
if (hasChildren) {
this.nodeTraverse.push(item);
treeBuilder.push("<ul>");
level++;
this.recursiveRenderPackage(treeBuilder, node[item], level);
level--;
treeBuilder.push("</ul>");
this.nodeTraverse.pop();
}
treeBuilder.push("</li>");
}
}
};
AppView.prototype.showPackageDetail = function (packagePath) {
var packageNameParts = packagePath.split(".");
var currentNode = null;
//Get classes for package
var currentTreeMap = this.model.getCurrentTreemap();
for (var i = 0; i < packageNameParts.length; i++) {
if (currentNode == null) {
currentNode = currentTreeMap[packageNameParts[i]];
}
else {
currentNode = currentNode[packageNameParts[i]];
}
}
var tableBody = $(".modal-body table tbody");
tableBody.empty();
//Sort by counts
var classes = [];
var sortedNode = currentNode[AppView.TREE_META_NODE].getSortedClasses();
for (var item in sortedNode) {
var data = currentNode[AppView.TREE_META_NODE].getClassWrapper(Number(sortedNode[item]));
var count = data.getMethodCount();
var classNameFull = data.getClassType().getDescriptor();
var className = DexFileReader.getClassNameOnly(classNameFull);
var classNameFullReadable = DexFileReader.descriptorToDot(classNameFull);
var typename = this.model.formatType(className, data);
var typeIcon = "<img src='img/types/" + typename + ".png' title='" + typename + "'/> ";
classes.push("<tr><td>" + typeIcon + "<span title='" + classNameFullReadable + "'>"
+ this.formatInnerClasses(className) + "</span></td><td>" + count + "</td></tr>");
}
$(".modal-body").animate({ scrollTop: 0 }, "fast");
tableBody.html(classes.join(""));
$("#package-detail .modal-title").html("Classes of <i>" + packagePath + "</i>");
$("#package-detail").modal();
};
AppView.prototype.formatInnerClasses = function (name) {
var split = name.split("$");
var formatted = "";
for (var i = 0; i < split.length; i++) {
if (i == split.length - 1) {
if (this.model.isInnerClassFromName(split[i])) {
formatted += "<span class='class-last-part'><i>(anon-cls-" + split[i] + ")</i></span>";
}
else {
formatted += "<span class='class-last-part'>" + split[i] + "</span>";
}
}
else {
formatted += "<span class='class-part'>" + split[i] + "$</span>";
}
}
return formatted;
};
AppView.prototype.resetLastMouseOverNode = function () {
if (this.lastMouseOverNode != null) {
this.lastMouseOverNode.css("display", "none");
this.lastMouseOverNode = null;
}
};
AppView.prototype.updateTree = function () {
var _this = this;
$('.tree li:has(ul)').addClass('parent_li').find(' > span');
$('.tree li.parent_li > span').on('click', function (e) {
var children = $(this).parent('li.parent_li').find(' > ul > li');
if (children.is(":visible")) {
children.hide('fast');
$(this).find(' > i').addClass(AppView.PLUS_SIGN_GLYPHICON).removeClass(AppView.MINUS_SIGN_GLYPHICON);
}
else {
children.show('fast');
$(this).find(' > i').addClass(AppView.MINUS_SIGN_GLYPHICON).removeClass(AppView.PLUS_SIGN_GLYPHICON);
}
e.stopPropagation();
});
$('.tree li > span').on('mouseenter', function (e) {
_this.resetLastMouseOverNode();
var nodeInfo = $(e.target).closest("li").find(".node-info"); //:first
nodeInfo.css("display", "inline-block");
_this.lastMouseOverNode = nodeInfo;
e.stopPropagation();
});
$(".node-info").on("click", function (e) {
_this.selectAll($(e.target)[0]);
e.stopPropagation();
});
};
AppView.prototype.selectAll = function (el) {
if (typeof window.getSelection != "undefined" && typeof document.createRange != "undefined") {
var range = document.createRange();
range.selectNodeContents(el);
var sel = window.getSelection();
sel.removeAllRanges();
sel.addRange(range);
}
else if (typeof document.selection != "undefined" && typeof document.body.createTextRange != "undefined") {
var textRange = document.body.createTextRange();
textRange.moveToElementText(el);
textRange.select();
}
};
AppView.prototype.dropzoneClick = function () {
$("#dropzone-dialog").click();
};
AppView.prototype.expandCollapseAll = function () {
var allChildrenSelector = $('.tree ul > li > ul');
var btn = $("#expand-collapse-btn");
if (btn.text() == AppView.TEXT_COLLAPSE) {
allChildrenSelector.find("li").hide();
btn.text(AppView.TEXT_EXPAND);
var s = $("." + AppView.MINUS_SIGN_GLYPHICON);
s.removeClass(AppView.MINUS_SIGN_GLYPHICON);
s.addClass(AppView.PLUS_SIGN_GLYPHICON);
}
else {
allChildrenSelector.find("li").show();
btn.text(AppView.TEXT_COLLAPSE);
var s = $("." + AppView.PLUS_SIGN_GLYPHICON);
s.removeClass(AppView.PLUS_SIGN_GLYPHICON);
s.addClass(AppView.MINUS_SIGN_GLYPHICON);
}
};
AppView.prototype.download = function () {
var blob = new Blob([this.generatedTreePlain.join("\n")], { type: "text/plain;charset=utf-8" });
saveAs(blob, this.lastFilename + ".txt");
};
//Used for saving classes and method counts in package tree
AppView.TREE_META_NODE = "__metadata";
AppView.PLUS_SIGN_GLYPHICON = "glyphicon-plus-sign";
AppView.MINUS_SIGN_GLYPHICON = "glyphicon-minus-sign";
AppView.TEXT_EXPAND = "Expand";
AppView.TEXT_COLLAPSE = "Collapse";
return AppView;
}());
ApkMethodCount.AppView = AppView;
String.prototype.repeat = function (num) {
return new Array(num + 1).join(this);
};
})(ApkMethodCount || (ApkMethodCount = {}));
new ApkMethodCount.AppView();
///<reference path="js/ts/main.ts"/>
//# sourceMappingURL=main.js.map
================================================
FILE: js/ts/defs/bootstrap.d.ts
================================================
// Type definitions for Bootstrap 3.3.5
// Project: http://twitter.github.com/bootstrap/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="jquery.d.ts"/>
interface ModalOptions {
backdrop?: boolean|string;
keyboard?: boolean;
show?: boolean;
remote?: string;
}
interface ModalOptionsBackdropString {
backdrop?: string; // for "static"
keyboard?: boolean;
show?: boolean;
remote?: string;
}
interface ScrollSpyOptions {
offset?: number;
target?: string;
}
interface TooltipOptions {
animation?: boolean;
html?: boolean;
placement?: string | Function;
selector?: string;
title?: string | Function;
trigger?: string;
template?: string;
delay?: number | Object;
container?: string | boolean;
viewport?: string | Function | Object;
}
interface PopoverOptions {
animation?: boolean;
html?: boolean;
placement?: string | Function;
selector?: string;
trigger?: string;
title?: string | Function;
template?: string;
content?: any;
delay?: number | Object;
container?: string | boolean;
viewport?: string | Function | Object;
}
interface CollapseOptions {
parent?: any;
toggle?: boolean;
}
interface CarouselOptions {
interval?: number;
pause?: string;
wrap?: boolean;
keybord?: boolean;
}
interface TypeaheadOptions {
source?: any;
items?: number;
minLength?: number;
matcher?: (item: any) => boolean;
sorter?: (items: any[]) => any[];
updater?: (item: any) => any;
highlighter?: (item: any) => string;
}
interface AffixOptions {
offset?: number | Function | Object;
target?: any;
}
interface JQuery {
modal(options?: ModalOptions): JQuery;
modal(options?: ModalOptionsBackdropString): JQuery;
modal(command: string): JQuery;
dropdown(): JQuery;
dropdown(command: string): JQuery;
scrollspy(command: string): JQuery;
scrollspy(options?: ScrollSpyOptions): JQuery;
tab(): JQuery;
tab(command: string): JQuery;
tooltip(options?: TooltipOptions): JQuery;
tooltip(command: string): JQuery;
popover(options?: PopoverOptions): JQuery;
popover(command: string): JQuery;
alert(): JQuery;
alert(command: string): JQuery;
button(): JQuery;
button(command: string): JQuery;
collapse(options?: CollapseOptions): JQuery;
collapse(command: string): JQuery;
carousel(options?: CarouselOptions): JQuery;
carousel(command: string): JQuery;
typeahead(options?: TypeaheadOptions): JQuery;
affix(options?: AffixOptions): JQuery;
}
declare module "bootstrap" {
}
================================================
FILE: js/ts/defs/filereader.d.ts
================================================
// Type definitions for jDataView
// Project: https://github.com/jDataView/jDataView
// Definitions by: Ingvar Stepanyan <https://github.com/RReverser>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare interface ReaderEvents {
progress?: (ev: any, file:File) => any;
load?: (ev: any, file:File) => any;
abort?: (ev: any, file:File) => any;
error?: (ev: any, file:File) => any;
loadend?: (ev: any, file:File) => any;
skip?: (ev: any, file:File) => any;
groupstart?: (ev: any, file:File) => any;
groupend?: (ev: any, file:File) => any;
beforestart?: (ev: any, file:File) => any;
}
declare interface FileReaderJSOpts {
dragClass?: string;
accept?: boolean;
readAsDefault?: string;
on?: ReaderEvents;
}
declare class FileReaderJS {
static setupClipboard(element:HTMLElement, opts:FileReaderJSOpts);
static setupDrop(element:HTMLElement, opts:FileReaderJSOpts);
static setupInput(element:HTMLElement, opts:FileReaderJSOpts);
static setSync(sync:boolean);
}
interface JQuery {
fileReaderJS(opts: FileReaderJSOpts): JQuery;
}
================================================
FILE: js/ts/defs/jdataview.d.ts
================================================
// Type definitions for jDataView
// Project: https://github.com/jDataView/jDataView
// Definitions by: Ingvar Stepanyan <https://github.com/RReverser>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare class jDataView implements DataView {
constructor(byteCount: number, offset?: number, length?: number, littleEndian?: boolean);
constructor(buffer: string, offset?: number, length?: number, littleEndian?: boolean);
constructor(buffer: jDataView.Bytes, offset?: number, length?: number, littleEndian?: boolean);
buffer: any;
byteOffset: number;
byteLength: number;
_littleEndian: boolean;
readStringUtf: Function;
readUnsignedLeb128: Function;
// 64 bit integers
getInt64(byteOffset?: number, littleEndian?: boolean): jDataView.Int64;
setInt64(byteOffset: number, value: jDataView.Int64, littleEndian?: boolean): void;
writeInt64(value: jDataView.Int64, littleEndian?: boolean): void;
getUint64(byteOffset?: number, littleEndian?: boolean): jDataView.Uint64;
setUint64(byteOffset: number, value: jDataView.Uint64, littleEndian?: boolean): void;
writeUint64(value: jDataView.Uint64, littleEndian?: boolean): void;
// Bitfields
getSigned(bitLength: number, byteOffset?: number): number;
setSigned(byteOffset: number, value: number, bitLength: number): void;
writeSigned(value: number, bitLength: number): void;
getUnsigned(bitLength: number, byteOffset?: number): number;
setUnsigned(byteOffset: number, value: number, bitLength: number): void;
writeUnsigned(value: number, bitLength: number): void;
// Internal utilities
wrapBuffer(string: string): jDataView.Buffer;
wrapBuffer(bytes: jDataView.Bytes): jDataView.Buffer;
wrapBuffer(byteCount: number): jDataView.Buffer;
createBuffer(...bytes: number[]): jDataView.Buffer;
// Operation control
seek(byteOffset: number): number;
tell(): number;
skip(byteLength: number): number;
slice(start: number, end?: number, forceCopy?: boolean): jDataView;
// Specification getters
getInt8(byteOffset?: number): number;
getUint8(byteOffset?: number): number;
getInt16(byteOffset?: number, littleEndian?: boolean): number;
getUint16(byteOffset?: number, littleEndian?: boolean): number;
getInt32(byteOffset?: number, littleEndian?: boolean): number;
getUint32(byteOffset?: number, littleEndian?: boolean): number;
getFloat32(byteOffset?: number, littleEndian?: boolean): number;
getFloat64(byteOffset?: number, littleEndian?: boolean): number;
// Specification setters
setInt8(byteOffset: number, value: number): void;
setUint8(byteOffset: number, value: number): void;
setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;
setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;
setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;
setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;
setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;
// Strings and Blobs
getChar(byteOffset?: number): string;
setChar(byteOffset: number, char: string): void;
writeChar(char: string): void;
getString(byteLength: number, byteOffset?: number, encoding?: string): string;
setString(byteOffset: number, chars: string, encoding?: string): void;
writeString(chars: string, encoding?: string): void;
getBytes(length: number, byteOffset?: number, littleEndian?: boolean, toArray?: boolean): number[];
setBytes(byteOffset: number, bytes: number[], littleEndian?: boolean): void;
writeBytes(bytes: number[], littleEndian?: boolean): void;
// writeXXX methods
writeInt8(value: number): void;
writeUint8(value: number): void;
writeInt16(value: number, littleEndian?: boolean): void;
writeUint16(value: number, littleEndian?: boolean): void;
writeInt32(value: number, littleEndian?: boolean): void;
writeUint32(value: number, littleEndian?: boolean): void;
writeFloat32(value: number, littleEndian?: boolean): void;
writeFloat64(value: number, littleEndian?: boolean): void;
}
declare module jDataView {
interface Bytes {
length: number;
[index: number]: number;
}
interface Buffer extends Bytes {
byteLength: number;
}
class Uint64 {
lo: number;
hi: number;
constructor(lo: number, hi: number);
valueOf(): number;
static fromNumber(number: number): Uint64;
}
class Int64 extends Uint64 {
static fromNumber(number: number): Int64;
}
}
================================================
FILE: js/ts/defs/jquery.d.ts
================================================
// Type definitions for jQuery 1.10.x / 2.0.x
// Project: http://jquery.com/
// 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>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/* *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
* Interface for the AJAX setting that will configure the AJAX request
*/
interface JQueryAjaxSettings {
/**
* 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.
*/
accepts?: any;
/**
* 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().
*/
async?: boolean;
/**
* 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.
*/
beforeSend? (jqXHR: JQueryXHR, settings: JQueryAjaxSettings): any;
/**
* 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.
*/
cache?: boolean;
/**
* 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.
*/
complete? (jqXHR: JQueryXHR, textStatus: string): any;
/**
* An object of string/regular-expression pairs that determine how jQuery will parse the response, given its content type. (version added: 1.5)
*/
contents?: { [key: string]: any; };
//According to jQuery.ajax source code, ajax's option actually allows contentType to set to "false"
// https://github.com/borisyankov/DefinitelyTyped/issues/742
/**
* 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.
*/
contentType?: any;
/**
* 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).
*/
context?: any;
/**
* 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)
*/
converters?: { [key: string]: any; };
/**
* 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)
*/
crossDomain?: boolean;
/**
* 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).
*/
data?: any;
/**
* 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.
*/
dataFilter? (data: any, ty: any): any;
/**
* 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).
*/
dataType?: string;
/**
* 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.
*/
error? (jqXHR: JQueryXHR, textStatus: string, errorThrown: string): any;
/**
* 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.
*/
global?: boolean;
/**
* 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)
*/
headers?: { [key: string]: any; };
/**
* 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.
*/
ifModified?: boolean;
/**
* 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)
*/
isLocal?: boolean;
/**
* 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" }
*/
jsonp?: any;
/**
* 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.
*/
jsonpCallback?: any;
/**
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
*/
method?: string;
/**
* A mime type to override the XHR mime type. (version added: 1.5.1)
*/
mimeType?: string;
/**
* A password to be used with XMLHttpRequest in response to an HTTP access authentication request.
*/
password?: string;
/**
* 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.
*/
processData?: boolean;
/**
* 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.
*/
scriptCharset?: string;
/**
* 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)
*/
statusCode?: { [key: string]: any; };
/**
* 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.
*/
success? (data: any, textStatus: string, jqXHR: JQueryXHR): any;
/**
* 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.
*/
timeout?: number;
/**
* Set this to true if you wish to use the traditional style of param serialization.
*/
traditional?: boolean;
/**
* 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.
*/
type?: string;
/**
* A string containing the URL to which the request is sent.
*/
url?: string;
/**
* A username to be used with XMLHttpRequest in response to an HTTP access authentication request.
*/
username?: string;
/**
* 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.
*/
xhr?: any;
/**
* 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)
*/
xhrFields?: { [key: string]: any; };
}
/**
* Interface for the jqXHR object
*/
interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
/**
* 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).
*/
overrideMimeType(mimeType: string): any;
/**
* Cancel the request.
*
* @param statusText A string passed as the textStatus parameter for the done callback. Default value: "canceled"
*/
abort(statusText?: string): void;
/**
* 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.
*/
then(doneCallback: (data: any, textStatus: string, jqXHR: JQueryXHR) => void, failCallback?: (jqXHR: JQueryXHR, textStatus: string, errorThrown: any) => void): JQueryPromise<any>;
/**
* Property containing the parsed response if the response Content-Type is json
*/
responseJSON?: any;
/**
* A function to be called if the request fails.
*/
error(xhr: JQueryXHR, textStatus: string, errorThrown: string): void;
}
/**
* Interface for the JQuery callback
*/
interface JQueryCallback {
/**
* Add a callback or a collection of callbacks to a callback list.
*
* @param callbacks A function, or array of functions, that are to be added to the callback list.
*/
add(callbacks: Function): JQueryCallback;
/**
* Add a callback or a collection of callbacks to a callback list.
*
* @param callbacks A function, or array of functions, that are to be added to the callback list.
*/
add(callbacks: Function[]): JQueryCallback;
/**
* Disable a callback list from doing anything more.
*/
disable(): JQueryCallback;
/**
* Determine if the callbacks list has been disabled.
*/
disabled(): boolean;
/**
* Remove all of the callbacks from a list.
*/
empty(): JQueryCallback;
/**
* Call all of the callbacks with the given arguments
*
* @param arguments The argument or list of arguments to pass back to the callback list.
*/
fire(...arguments: any[]): JQueryCallback;
/**
* Determine if the callbacks have already been called at least once.
*/
fired(): boolean;
/**
* Call all callbacks in a list with the given context and arguments.
*
* @param context A reference to the context in which the callbacks in the list should be fired.
* @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
*/
fireWith(context?: any, args?: any[]): JQueryCallback;
/**
* Determine whether a supplied callback is in a list
*
* @param callback The callback to search for.
*/
has(callback: Function): boolean;
/**
* Lock a callback list in its current state.
*/
lock(): JQueryCallback;
/**
* Determine if the callbacks list has been locked.
*/
locked(): boolean;
/**
* Remove a callback or a collection of callbacks from a callback list.
*
* @param callbacks A function, or array of functions, that are to be removed from the callback list.
*/
remove(callbacks: Function): JQueryCallback;
/**
* Remove a callback or a collection of callbacks from a callback list.
*
* @param callbacks A function, or array of functions, that are to be removed from the callback list.
*/
remove(callbacks: Function[]): JQueryCallback;
}
/**
* Allows jQuery Promises to interop with non-jQuery promises
*/
interface JQueryGenericPromise<T> {
/**
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
*
* @param doneFilter A function that is called when the Deferred is resolved.
* @param failFilter An optional function that is called when the Deferred is rejected.
*/
then<U>(doneFilter: (value?: T, ...values: any[]) => U|JQueryPromise<U>, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<U>;
/**
* Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.
*
* @param doneFilter A function that is called when the Deferred is resolved.
* @param failFilter An optional function that is called when the Deferred is rejected.
*/
then(doneFilter: (value?: T, ...values: any[]) => void, failFilter?: (...reasons: any[]) => any, progressFilter?: (...progression: any[]) => any): JQueryPromise<void>;
}
/**
* Interface for the JQuery promise/deferred callbacks
*/
interface JQueryPromiseCallback<T> {
(value?: T, ...args: any[]): void;
}
interface JQueryPromiseOperator<T, U> {
(callback1: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...callbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<U>;
}
/**
* Interface for the JQuery promise, part of callbacks
*/
interface JQueryPromise<T> extends JQueryGenericPromise<T> {
/**
* Determine the current state of a Deferred object.
*/
state(): string;
/**
* Add handlers to be called when the Deferred object is either resolved or rejected.
*
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
*/
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
/**
* Add handlers to be called when the Deferred object is resolved.
*
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
*/
done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryPromise<T>;
/**
* Add handlers to be called when the Deferred object is rejected.
*
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
*/
fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
/**
* Add handlers to be called when the Deferred object generates progress notifications.
*
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
*/
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryPromise<T>;
// Deprecated - given no typings
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
}
/**
* Interface for the JQuery deferred, part of callbacks
*/
interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
/**
* Determine the current state of a Deferred object.
*/
state(): string;
/**
* Add handlers to be called when the Deferred object is either resolved or rejected.
*
* @param alwaysCallbacks1 A function, or array of functions, that is called when the Deferred is resolved or rejected.
* @param alwaysCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.
*/
always(alwaysCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is resolved.
*
* @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved.
* @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.
*/
done(doneCallback1?: JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[], ...doneCallbackN: Array<JQueryPromiseCallback<T>|JQueryPromiseCallback<T>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object is rejected.
*
* @param failCallbacks1 A function, or array of functions, that are called when the Deferred is rejected.
* @param failCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.
*/
fail(failCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...failCallbacksN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Add handlers to be called when the Deferred object generates progress notifications.
*
* @param progressCallbacks A function, or array of functions, to be called when the Deferred generates progress notifications.
*/
progress(progressCallback1?: JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[], ...progressCallbackN: Array<JQueryPromiseCallback<any>|JQueryPromiseCallback<any>[]>): JQueryDeferred<T>;
/**
* Call the progressCallbacks on a Deferred object with the given args.
*
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notify(value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Call the progressCallbacks on a Deferred object with the given context and args.
*
* @param context Context passed to the progressCallbacks as the this object.
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notifyWith(context: any, value?: any[]): JQueryDeferred<T>;
/**
* Reject a Deferred object and call any failCallbacks with the given args.
*
* @param args Optional arguments that are passed to the failCallbacks.
*/
reject(value?: any, ...args: any[]): JQueryDeferred<T>;
/**
* Reject a Deferred object and call any failCallbacks with the given context and args.
*
* @param context Context passed to the failCallbacks as the this object.
* @param args An optional array of arguments that are passed to the failCallbacks.
*/
rejectWith(context: any, value?: any[]): JQueryDeferred<T>;
/**
* Resolve a Deferred object and call any doneCallbacks with the given args.
*
* @param value First argument passed to doneCallbacks.
* @param args Optional subsequent arguments that are passed to the doneCallbacks.
*/
resolve(value?: T, ...args: any[]): JQueryDeferred<T>;
/**
* Resolve a Deferred object and call any doneCallbacks with the given context and args.
*
* @param context Context passed to the doneCallbacks as the this object.
* @param args An optional array of arguments that are passed to the doneCallbacks.
*/
resolveWith(context: any, value?: T[]): JQueryDeferred<T>;
/**
* Return a Deferred's Promise object.
*
* @param target Object onto which the promise methods have to be attached
*/
promise(target?: any): JQueryPromise<T>;
// Deprecated - given no typings
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<any>;
}
/**
* Interface of the JQuery extension of the W3C event object
*/
interface BaseJQueryEventObject extends Event {
data: any;
delegateTarget: Element;
isDefaultPrevented(): boolean;
isImmediatePropagationStopped(): boolean;
isPropagationStopped(): boolean;
namespace: string;
originalEvent: Event;
preventDefault(): any;
relatedTarget: Element;
result: any;
stopImmediatePropagation(): void;
stopPropagation(): void;
target: Element;
pageX: number;
pageY: number;
which: number;
metaKey: boolean;
}
interface JQueryInputEventObject extends BaseJQueryEventObject {
altKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
shiftKey: boolean;
}
interface JQueryMouseEventObject extends JQueryInputEventObject {
button: number;
clientX: number;
clientY: number;
offsetX: number;
offsetY: number;
pageX: number;
pageY: number;
screenX: number;
screenY: number;
}
interface JQueryKeyEventObject extends JQueryInputEventObject {
char: any;
charCode: number;
key: any;
keyCode: number;
}
interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject{
}
/*
Collection of properties of the current browser
*/
interface JQuerySupport {
ajax?: boolean;
boxModel?: boolean;
changeBubbles?: boolean;
checkClone?: boolean;
checkOn?: boolean;
cors?: boolean;
cssFloat?: boolean;
hrefNormalized?: boolean;
htmlSerialize?: boolean;
leadingWhitespace?: boolean;
noCloneChecked?: boolean;
noCloneEvent?: boolean;
opacity?: boolean;
optDisabled?: boolean;
optSelected?: boolean;
scriptEval? (): boolean;
style?: boolean;
submitBubbles?: boolean;
tbody?: boolean;
}
interface JQueryParam {
/**
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
*
* @param obj An array or object to serialize.
*/
(obj: any): string;
/**
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
*
* @param obj An array or object to serialize.
* @param traditional A Boolean indicating whether to perform a traditional "shallow" serialization.
*/
(obj: any, traditional: boolean): string;
}
/**
* The interface used to construct jQuery events (with $.Event). It is
* defined separately instead of inline in JQueryStatic to allow
* overriding the construction function with specific strings
* returning specific event objects.
*/
interface JQueryEventConstructor {
(name: string, eventProperties?: any): JQueryEventObject;
new (name: string, eventProperties?: any): JQueryEventObject;
}
/**
* The interface used to specify coordinates.
*/
interface JQueryCoordinates {
left: number;
top: number;
}
/**
* Elements in the array returned by serializeArray()
*/
interface JQuerySerializeArrayElement {
name: string;
value: string;
}
interface JQueryAnimationOptions {
/**
* A string or number determining how long the animation will run.
*/
duration?: any;
/**
* A string indicating which easing function to use for the transition.
*/
easing?: string;
/**
* A function to call once the animation is complete.
*/
complete?: Function;
/**
* 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.
*/
step?: (now: number, tween: any) => any;
/**
* 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)
*/
progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
/**
* A function to call when the animation begins. (version added: 1.8)
*/
start?: (animation: JQueryPromise<any>) => any;
/**
* A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
*/
done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
*/
fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* 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)
*/
always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* 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.
*/
queue?: any;
/**
* A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
*/
specialEasing?: Object;
}
/**
* Static members of jQuery (those on $ and jQuery themselves)
*/
interface JQueryStatic {
/**
* Perform an asynchronous HTTP (Ajax) request.
*
* @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().
*/
ajax(settings: JQueryAjaxSettings): JQueryXHR;
/**
* Perform an asynchronous HTTP (Ajax) request.
*
* @param url A string containing the URL to which the request is sent.
* @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().
*/
ajax(url: string, settings?: JQueryAjaxSettings): JQueryXHR;
/**
* Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
*
* @param dataTypes An optional string containing one or more space-separated dataTypes
* @param handler A handler to set default values for future Ajax requests.
*/
ajaxPrefilter(dataTypes: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
/**
* Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
*
* @param handler A handler to set default values for future Ajax requests.
*/
ajaxPrefilter(handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void;
ajaxSettings: JQueryAjaxSettings;
/**
* Set default values for future Ajax requests. Its use is not recommended.
*
* @param options A set of key/value pairs that configure the default Ajax request. All options are optional.
*/
ajaxSetup(options: JQueryAjaxSettings): void;
/**
* Load data from the server using a HTTP GET request.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
*/
get(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
/**
* Load data from the server using a HTTP GET request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
*/
get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
/**
* Load JSON-encoded data from the server using a GET HTTP request.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds.
*/
getJSON(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
/**
* Load JSON-encoded data from the server using a GET HTTP request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds.
*/
getJSON(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
/**
* Load a JavaScript file from the server using a GET HTTP request, then execute it.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds.
*/
getScript(url: string, success?: (script: string, textStatus: string, jqXHR: JQueryXHR) => any): JQueryXHR;
/**
* Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
*/
param: JQueryParam;
/**
* Load data from the server using a HTTP POST request.
*
* @param url A string containing the URL to which the request is sent.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
*/
post(url: string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
/**
* Load data from the server using a HTTP POST request.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param success A callback function that is executed if the request succeeds. Required if dataType is provided, but can be null in that case.
* @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
*/
post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR;
/**
* A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
*
* @param flags An optional list of space-separated flags that change how the callback list behaves.
*/
Callbacks(flags?: string): JQueryCallback;
/**
* Holds or releases the execution of jQuery's ready event.
*
* @param hold Indicates whether the ready hold is being requested or released
*/
holdReady(hold: boolean): void;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param selector A string containing a selector expression
* @param context A DOM Element, Document, or jQuery to use as context
*/
(selector: string, context?: Element|JQuery): JQuery;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param element A DOM element to wrap in a jQuery object.
*/
(element: Element): JQuery;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param elementArray An array containing a set of DOM elements to wrap in a jQuery object.
*/
(elementArray: Element[]): JQuery;
/**
* Binds a function to be executed when the DOM has finished loading.
*
* @param callback A function to execute after the DOM is ready.
*/
(callback: (jQueryAlias?: JQueryStatic) => any): JQuery;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param object A plain object to wrap in a jQuery object.
*/
(object: {}): JQuery;
/**
* Accepts a string containing a CSS selector which is then used to match a set of elements.
*
* @param object An existing jQuery object to clone.
*/
(object: JQuery): JQuery;
/**
* Specify a function to execute when the DOM is fully loaded.
*/
(): JQuery;
/**
* Creates DOM elements on the fly from the provided string of raw HTML.
*
* @param html A string of HTML to create on the fly. Note that this parses HTML, not XML.
* @param ownerDocument A document in which the new elements will be created.
*/
(html: string, ownerDocument?: Document): JQuery;
/**
* Creates DOM elements on the fly from the provided string of raw HTML.
*
* @param html A string defining a single, standalone, HTML element (e.g. <div/> or <div></div>).
* @param attributes An object of attributes, events, and methods to call on the newly-created element.
*/
(html: string, attributes: Object): JQuery;
/**
* Relinquish jQuery's control of the $ variable.
*
* @param removeAll A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
*/
noConflict(removeAll?: boolean): Object;
/**
* Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
*
* @param deferreds One or more Deferred objects, or plain JavaScript objects.
*/
when<T>(...deferreds: Array<T|JQueryPromise<T>/* as JQueryDeferred<T> */>): JQueryPromise<T>;
/**
* Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.
*/
cssHooks: { [key: string]: any; };
cssNumber: any;
/**
* Store arbitrary data associated with the specified element. Returns the value that was set.
*
* @param element The DOM element to associate with the data.
* @param key A string naming the piece of data to set.
* @param value The new data value.
*/
data<T>(element: Element, key: string, value: T): T;
/**
* 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.
*
* @param element The DOM element to associate with the data.
* @param key A string naming the piece of data to set.
*/
data(element: Element, key: string): any;
/**
* 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.
*
* @param element The DOM element to associate with the data.
*/
data(element: Element): any;
/**
* Execute the next function on the queue for the matched element.
*
* @param element A DOM element from which to remove and execute a queued function.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
dequeue(element: Element, queueName?: string): void;
/**
* Determine whether an element has any jQuery data associated with it.
*
* @param element A DOM element to be checked for data.
*/
hasData(element: Element): boolean;
/**
* Show the queue of functions to be executed on the matched element.
*
* @param element A DOM element to inspect for an attached queue.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
queue(element: Element, queueName?: string): any[];
/**
* Manipulate the queue of functions to be executed on the matched element.
*
* @param element A DOM element where the array of queued functions is attached.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
* @param newQueue An array of functions to replace the current queue contents.
*/
queue(element: Element, queueName: string, newQueue: Function[]): JQuery;
/**
* Manipulate the queue of functions to be executed on the matched element.
*
* @param element A DOM element on which to add a queued function.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
* @param callback The new function to add to the queue.
*/
queue(element: Element, queueName: string, callback: Function): JQuery;
/**
* Remove a previously-stored piece of data.
*
* @param element A DOM element from which to remove data.
* @param name A string naming the piece of data to remove.
*/
removeData(element: Element, name?: string): JQuery;
/**
* 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.
*
* @param beforeStart A function that is called just before the constructor returns.
*/
Deferred<T>(beforeStart?: (deferred: JQueryDeferred<T>) => any): JQueryDeferred<T>;
/**
* Effects
*/
fx: {
tick: () => void;
/**
* The rate (in milliseconds) at which animations fire.
*/
interval: number;
stop: () => void;
speeds: { slow: number; fast: number; };
/**
* Globally disable all animations.
*/
off: boolean;
step: any;
};
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param fnction The function whose context will be changed.
* @param context The object to which the context (this) of the function should be set.
* @param additionalArguments Any number of arguments to be passed to the function referenced in the function argument.
*/
proxy(fnction: (...args: any[]) => any, context: Object, ...additionalArguments: any[]): any;
/**
* Takes a function and returns a new one that will always have a particular context.
*
* @param context The object to which the context (this) of the function should be set.
* @param name The name of the function whose context will be changed (should be a property of the context object).
* @param additionalArguments Any number of arguments to be passed to the function named in the name argument.
*/
proxy(context: Object, name: string, ...additionalArguments: any[]): any;
Event: JQueryEventConstructor;
/**
* Takes a string and throws an exception containing it.
*
* @param message The message to send out.
*/
error(message: any): JQuery;
expr: any;
fn: any; //TODO: Decide how we want to type this
isReady: boolean;
// Properties
support: JQuerySupport;
/**
* Check to see if a DOM element is a descendant of another DOM element.
*
* @param container The DOM element that may contain the other element.
* @param contained The DOM element that may be contained by (a descendant of) the other element.
*/
contains(container: Element, contained: Element): boolean;
/**
* 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.
*
* @param collection The object or array to iterate over.
* @param callback The function that will be executed on every object.
*/
each<T>(
collection: T[],
callback: (indexInArray: number, valueOfElement: T) => any
): any;
/**
* 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.
*
* @param collection The object or array to iterate over.
* @param callback The function that will be executed on every object.
*/
each(
collection: any,
callback: (indexInArray: any, valueOfElement: any) => any
): any;
/**
* Merge the contents of two or more objects together into the first object.
*
* @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.
* @param object1 An object containing additional properties to merge in.
* @param objectN Additional objects containing properties to merge in.
*/
extend(target: any, object1?: any, ...objectN: any[]): any;
/**
* Merge the contents of two or more objects together into the first object.
*
* @param deep If true, the merge becomes recursive (aka. deep copy).
* @param target The object to extend. It will receive the new properties.
* @param object1 An object containing additional properties to merge in.
* @param objectN Additional objects containing properties to merge in.
*/
extend(deep: boolean, target: any, object1?: any, ...objectN: any[]): any;
/**
* Execute some JavaScript code globally.
*
* @param code The JavaScript code to execute.
*/
globalEval(code: string): any;
/**
* Finds the elements of an array which satisfy a filter function. The original array is not affected.
*
* @param array The array to search through.
* @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.
* @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.
*/
grep<T>(array: T[], func: (elementOfArray: T, indexInArray: number) => boolean, invert?: boolean): T[];
/**
* Search for a specified value within an array and return its index (or -1 if not found).
*
* @param value The value to search for.
* @param array An array through which to search.
* @param fromIndex he index of the array at which to begin the search. The default is 0, which will search the whole array.
*/
inArray<T>(value: T, array: T[], fromIndex?: number): number;
/**
* Determine whether the argument is an array.
*
* @param obj Object to test whether or not it is an array.
*/
isArray(obj: any): boolean;
/**
* Check to see if an object is empty (contains no enumerable properties).
*
* @param obj The object that will be checked to see if it's empty.
*/
isEmptyObject(obj: any): boolean;
/**
* Determine if the argument passed is a Javascript function object.
*
* @param obj Object to test whether or not it is a function.
*/
isFunction(obj: any): boolean;
/**
* Determines whether its argument is a number.
*
* @param obj The value to be tested.
*/
isNumeric(value: any): boolean;
/**
* Check to see if an object is a plain object (created using "{}" or "new Object").
*
* @param obj The object that will be checked to see if it's a plain object.
*/
isPlainObject(obj: any): boolean;
/**
* Determine whether the argument is a window.
*
* @param obj Object to test whether or not it is a window.
*/
isWindow(obj: any): boolean;
/**
* Check to see if a DOM node is within an XML document (or is an XML document).
*
* @param node he DOM node that will be checked to see if it's in an XML document.
*/
isXMLDoc(node: Node): boolean;
/**
* Convert an array-like object into a true JavaScript array.
*
* @param obj Any object to turn into a native Array.
*/
makeArray(obj: any): any[];
/**
* Translate all items in an array or object to new array of items.
*
* @param array The Array to translate.
* @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.
*/
map<T, U>(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[];
/**
* Translate all items in an array or object to new array of items.
*
* @param arrayOrObject The Array or Object to translate.
* @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.
*/
map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any;
/**
* Merge the contents of two arrays together into the first array.
*
* @param first The first array to merge, the elements of second added.
* @param second The second array to merge into the first, unaltered.
*/
merge<T>(first: T[], second: T[]): T[];
/**
* An empty function.
*/
noop(): any;
/**
* Return a number representing the current time.
*/
now(): number;
/**
* Takes a well-formed JSON string and returns the resulting JavaScript object.
*
* @param json The JSON string to parse.
*/
parseJSON(json: string): any;
/**
* Parses a string into an XML document.
*
* @param data a well-formed XML string to be parsed
*/
parseXML(data: string): XMLDocument;
/**
* Remove the whitespace from the beginning and end of a string.
*
* @param str Remove the whitespace from the beginning and end of a string.
*/
trim(str: string): string;
/**
* Determine the internal JavaScript [[Class]] of an object.
*
* @param obj Object to get the internal JavaScript [[Class]] of.
*/
type(obj: any): string;
/**
* 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.
*
* @param array The Array of DOM elements.
*/
unique(array: Element[]): Element[];
/**
* Parses a string into an array of DOM nodes.
*
* @param data HTML string to be parsed
* @param context DOM element to serve as the context in which the HTML fragment will be created
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
*/
parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[];
/**
* Parses a string into an array of DOM nodes.
*
* @param data HTML string to be parsed
* @param context DOM element to serve as the context in which the HTML fragment will be created
* @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string
*/
parseHTML(data: string, context?: Document, keepScripts?: boolean): any[];
}
/**
* The jQuery instance members
*/
interface JQuery {
/**
* Register a handler to be called when Ajax requests complete. This is an AjaxEvent.
*
* @param handler The function to be invoked.
*/
ajaxComplete(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: any) => any): JQuery;
/**
* Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
*
* @param handler The function to be invoked.
*/
ajaxError(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxSettings: JQueryAjaxSettings, thrownError: any) => any): JQuery;
/**
* Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
*
* @param handler The function to be invoked.
*/
ajaxSend(handler: (event: JQueryEventObject, jqXHR: JQueryXHR, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
/**
* Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
*
* @param handler The function to be invoked.
*/
ajaxStart(handler: () => any): JQuery;
/**
* Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
*
* @param handler The function to be invoked.
*/
ajaxStop(handler: () => any): JQuery;
/**
* Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
*
* @param handler The function to be invoked.
*/
ajaxSuccess(handler: (event: JQueryEventObject, XMLHttpRequest: XMLHttpRequest, ajaxOptions: JQueryAjaxSettings) => any): JQuery;
/**
* Load data from the server and place the returned HTML into the matched element.
*
* @param url A string containing the URL to which the request is sent.
* @param data A plain object or string that is sent to the server with the request.
* @param complete A callback function that is executed when the request completes.
*/
load(url: string, data?: string|Object, complete?: (responseText: string, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any): JQuery;
/**
* Encode a set of form elements as a string for submission.
*/
serialize(): string;
/**
* Encode a set of form elements as an array of names and values.
*/
serializeArray(): JQuerySerializeArrayElement[];
/**
* Adds the specified class(es) to each of the set of matched elements.
*
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
*/
addClass(className: string): JQuery;
/**
* Adds the specified class(es) to each of the set of matched elements.
*
* @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.
*/
addClass(func: (index: number, className: string) => string): JQuery;
/**
* Add the previous set of elements on the stack to the current set, optionally filtered by a selector.
*/
addBack(selector?: string): JQuery;
/**
* Get the value of an attribute for the first element in the set of matched elements.
*
* @param attributeName The name of the attribute to get.
*/
attr(attributeName: string): string;
/**
* Set one or more attributes for the set of matched elements.
*
* @param attributeName The name of the attribute to set.
* @param value A value to set for the attribute.
*/
attr(attributeName: string, value: string|number): JQuery;
/**
* Set one or more attributes for the set of matched elements.
*
* @param attributeName The name of the attribute to set.
* @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.
*/
attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery;
/**
* Set one or more attributes for the set of matched elements.
*
* @param attributes An object of attribute-value pairs to set.
*/
attr(attributes: Object): JQuery;
/**
* Determine whether any of the matched elements are assigned the given class.
*
* @param className The class name to search for.
*/
hasClass(className: string): boolean;
/**
* Get the HTML contents of the first element in the set of matched elements.
*/
html(): string;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @param htmlString A string of HTML to set as the content of each matched element.
*/
html(htmlString: string): JQuery;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @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.
*/
html(func: (index: number, oldhtml: string) => string): JQuery;
/**
* Set the HTML contents of each element in the set of matched elements.
*
* @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.
*/
/**
* Get the value of a property for the first element in the set of matched elements.
*
* @param propertyName The name of the property to get.
*/
prop(propertyName: string): any;
/**
* Set one or more properties for the set of matched elements.
*
* @param propertyName The name of the property to set.
* @param value A value to set for the property.
*/
prop(propertyName: string, value: string|number|boolean): JQuery;
/**
* Set one or more properties for the set of matched elements.
*
* @param properties An object of property-value pairs to set.
*/
prop(properties: Object): JQuery;
/**
* Set one or more properties for the set of matched elements.
*
* @param propertyName The name of the property to set.
* @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.
*/
prop(propertyName: string, func: (index: number, oldPropertyValue: any) => any): JQuery;
/**
* Remove an attribute from each element in the set of matched elements.
*
* @param attributeName An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
*/
removeAttr(attributeName: string): JQuery;
/**
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
*
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
*/
removeClass(className?: string): JQuery;
/**
* Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
*
* @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.
*/
removeClass(func: (index: number, className: string) => string): JQuery;
/**
* Remove a property for the set of matched elements.
*
* @param propertyName The name of the property to remove.
*/
removeProp(propertyName: string): JQuery;
/**
* 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.
*
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
* @param swtch A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
*/
toggleClass(className: string, swtch?: boolean): JQuery;
/**
* 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.
*
* @param swtch A boolean value to determine whether the class should be added or removed.
*/
toggleClass(swtch?: boolean): JQuery;
/**
* 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.
*
* @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.
* @param swtch A boolean value to determine whether the class should be added or removed.
*/
toggleClass(func: (index: number, className: string, swtch: boolean) => string, swtch?: boolean): JQuery;
/**
* Get the current value of the first element in the set of matched elements.
*/
val(): any;
/**
* Set the value of each element in the set of matched elements.
*
* @param value A string of text, an array of strings or number corresponding to the value of each matched element to set as selected/checked.
*/
val(value: string|string[]|number): JQuery;
/**
* Set the value of each element in the set of matched elements.
*
* @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.
*/
val(func: (index: number, value: string) => string): JQuery;
/**
* Get the value of style properties for the first element in the set of matched elements.
*
* @param propertyName A CSS property.
*/
css(propertyName: string): string;
/**
* Set one or more CSS properties for the set of matched elements.
*
* @param propertyName A CSS property name.
* @param value A value to set for the property.
*/
css(propertyName: string, value: string|number): JQuery;
/**
* Set one or more CSS properties for the set of matched elements.
*
* @param propertyName A CSS property name.
* @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.
*/
css(propertyName: string, value: (index: number, value: string) => string|number): JQuery;
/**
* Set one or more CSS properties for the set of matched elements.
*
* @param properties An object of property-value pairs to set.
*/
css(properties: Object): JQuery;
/**
* Get the current computed height for the first element in the set of matched elements.
*/
height(): number;
/**
* Set the CSS height of every matched element.
*
* @param value An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
*/
height(value: number|string): JQuery;
/**
* Set the CSS height of every matched element.
*
* @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.
*/
height(func: (index: number, height: number) => number|string): JQuery;
/**
* Get the current computed height for the first element in the set of matched elements, including padding but not border.
*/
innerHeight(): number;
/**
* Sets the inner height on elements in the set of matched elements, including padding but not border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
innerHeight(height: number|string): JQuery;
/**
* Get the current computed width for the first element in the set of matched elements, including padding but not border.
*/
innerWidth(): number;
/**
* Sets the inner width on elements in the set of matched elements, including padding but not border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
innerWidth(width: number|string): JQuery;
/**
* Get the current coordinates of the first element in the set of matched elements, relative to the document.
*/
offset(): JQueryCoordinates;
/**
* An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
*
* @param coordinates An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
*/
offset(coordinates: JQueryCoordinates): JQuery;
/**
* An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
*
* @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.
*/
offset(func: (index: number, coords: JQueryCoordinates) => JQueryCoordinates): JQuery;
/**
* 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.
*
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
*/
outerHeight(includeMargin?: boolean): number;
/**
* Sets the outer height on elements in the set of matched elements, including padding and border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
outerHeight(height: number|string): JQuery;
/**
* Get the current computed width for the first element in the set of matched elements, including padding and border.
*
* @param includeMargin A Boolean indicating whether to include the element's margin in the calculation.
*/
outerWidth(includeMargin?: boolean): number;
/**
* Sets the outer width on elements in the set of matched elements, including padding and border.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
outerWidth(width: number|string): JQuery;
/**
* Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
*/
position(): JQueryCoordinates;
/**
* 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.
*/
scrollLeft(): number;
/**
* Set the current horizontal position of the scroll bar for each of the set of matched elements.
*
* @param value An integer indicating the new position to set the scroll bar to.
*/
scrollLeft(value: number): JQuery;
/**
* 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.
*/
scrollTop(): number;
/**
* Set the current vertical position of the scroll bar for each of the set of matched elements.
*
* @param value An integer indicating the new position to set the scroll bar to.
*/
scrollTop(value: number): JQuery;
/**
* Get the current computed width for the first element in the set of matched elements.
*/
width(): number;
/**
* Set the CSS width of each element in the set of matched elements.
*
* @param value An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
*/
width(value: number|string): JQuery;
/**
* Set the CSS width of each element in the set of matched elements.
*
* @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.
*/
width(func: (index: number, width: number) => number|string): JQuery;
/**
* Remove from the queue all items that have not yet been run.
*
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
clearQueue(queueName?: string): JQuery;
/**
* Store arbitrary data associated with the matched elements.
*
* @param key A string naming the piece of data to set.
* @param value The new data value; it can be any Javascript type including Array or Object.
*/
data(key: string, value: any): JQuery;
/**
* 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.
*
* @param key Name of the data stored.
*/
data(key: string): any;
/**
* Store arbitrary data associated with the matched elements.
*
* @param obj An object of key-value pairs of data to update.
*/
data(obj: { [key: string]: any; }): JQuery;
/**
* 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.
*/
data(): any;
/**
* Execute the next function on the queue for the matched elements.
*
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
dequeue(queueName?: string): JQuery;
/**
* Remove a previously-stored piece of data.
*
* @param name A string naming the piece of data to delete or space-separated string naming the pieces of data to delete.
*/
removeData(name: string): JQuery;
/**
* Remove a previously-stored piece of data.
*
* @param list An array of strings naming the pieces of data to delete.
*/
removeData(list: string[]): JQuery;
/**
* Remove all previously-stored piece of data.
*/
removeData(): JQuery;
/**
* Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
*
* @param type The type of queue that needs to be observed. (default: fx)
* @param target Object onto which the promise methods have to be attached
*/
promise(type?: string, target?: Object): JQueryPromise<any>;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: string|number, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition. (default: swing)
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: string|number, easing?: string, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param options A map of additional options to pass to the method.
*/
animate(properties: Object, options: JQueryAnimationOptions): JQuery;
/**
* Set a timer to delay execution of subsequent items in the queue.
*
* @param duration An integer indicating the number of milliseconds to delay execution of the next item in the queue.
* @param queueName A string containing the name of the queue. Defaults to fx, the standard effects queue.
*/
delay(duration: number, queueName?: string): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: number|string, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param options A map of additional options to pass to the method.
*/
fadeIn(options: JQueryAnimationOptions): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: number|string, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param options A map of additional options to pass to the method.
*/
fadeOut(options: JQueryAnimationOptions): JQuery;
/**
* Adjust the opacity of the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param opacity A number between 0 and 1 denoting the target opacity.
* @param complete A function to call once the animation is complete.
*/
fadeTo(duration: string|number, opacity: number, complete?: Function): JQuery;
/**
* Adjust the opacity of the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param opacity A number between 0 and 1 denoting the target opacity.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeTo(duration: string|number, opacity: number, easing?: string, complete?: Function): JQuery;
/**
* Display or hide the matched elements by animating their opacity.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeToggle(duration?: number|string, complete?: Function): JQuery;
/**
* Display or hide the matched elements by animating their opacity.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display or hide the matched elements by animating their opacity.
*
* @param options A map of additional options to pass to the method.
*/
fadeToggle(options: JQueryAnimationOptions): JQuery;
/**
* Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.
*
* @param queue The name of the queue in which to stop animations.
*/
finish(queue?: string): JQuery;
/**
* Hide the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
hide(duration?: number|string, complete?: Function): JQuery;
/**
* Hide the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
hide(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Hide the matched elements.
*
* @param options A map of additional options to pass to the method.
*/
hide(options: JQueryAnimationOptions): JQuery;
/**
* Display the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
show(duration?: number|string, complete?: Function): JQuery;
/**
* Display the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
show(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display the matched elements.
*
* @param options A map of additional options to pass to the method.
*/
show(options: JQueryAnimationOptions): JQuery;
/**
* Display the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
slideDown(duration?: number|string, complete?: Function): JQuery;
/**
* Display the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
slideDown(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display the matched elements with a sliding motion.
*
* @param options A map of additional options to pass to the method.
*/
slideDown(options: JQueryAnimationOptions): JQuery;
/**
* Display or hide the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
slideToggle(duration?: number|string, complete?: Function): JQuery;
/**
* Display or hide the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
slideToggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display or hide the matched elements with a sliding motion.
*
* @param options A map of additional options to pass to the method.
*/
slideToggle(options: JQueryAnimationOptions): JQuery;
/**
* Hide the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
slideUp(duration?: number|string, complete?: Function): JQuery;
/**
* Hide the matched elements with a sliding motion.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
slideUp(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Hide the matched elements with a sliding motion.
*
* @param options A map of additional options to pass to the method.
*/
slideUp(options: JQueryAnimationOptions): JQuery;
/**
* Stop the currently-running animation on the matched elements.
*
* @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
* @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
*/
stop(clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
/**
* Stop the currently-running animation on the matched elements.
*
* @param queue The name of the queue in which to stop animations.
* @param clearQueue A Boolean indicating whether to remove queued animation as well. Defaults to false.
* @param jumpToEnd A Boolean indicating whether to complete the current animation immediately. Defaults to false.
*/
stop(queue?: string, clearQueue?: boolean, jumpToEnd?: boolean): JQuery;
/**
* Display or hide the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
toggle(duration?: number|string, complete?: Function): JQuery;
/**
* Display or hide the matched elements.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
toggle(duration?: number|string, easing?: string, complete?: Function): JQuery;
/**
* Display or hide the matched elements.
*
* @param options A map of additional options to pass to the method.
*/
toggle(options: JQueryAnimationOptions): JQuery;
/**
* Display or hide the matched elements.
*
* @param showOrHide A Boolean indicating whether to show or hide the elements.
*/
toggle(showOrHide: boolean): JQuery;
/**
* Attach a handler to an event for the elements.
*
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
bind(eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Attach a handler to an event for the elements.
*
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
* @param handler A function to execute each time the event is triggered.
*/
bind(eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Attach a handler to an event for the elements.
*
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
* @param eventData An object containing data that will be passed to the event handler.
* @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.
*/
bind(eventType: string, eventData: any, preventBubble: boolean): JQuery;
/**
* Attach a handler to an event for the elements.
*
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
* @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.
*/
bind(eventType: string, preventBubble: boolean): JQuery;
/**
* Attach a handler to an event for the elements.
*
* @param events An object containing one or more DOM event types and functions to execute for them.
*/
bind(events: any): JQuery;
/**
* Trigger the "blur" event on an element
*/
blur(): JQuery;
/**
* Bind an event handler to the "blur" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
blur(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "blur" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
blur(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "change" event on an element.
*/
change(): JQuery;
/**
* Bind an event handler to the "change" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
change(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "change" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
change(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "click" event on an element.
*/
click(): JQuery;
/**
* Bind an event handler to the "click" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
*/
click(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "click" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
click(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "dblclick" event on an element.
*/
dblclick(): JQuery;
/**
* Bind an event handler to the "dblclick" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
dblclick(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "dblclick" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
dblclick(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
delegate(selector: any, eventType: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
delegate(selector: any, eventType: string, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "focus" event on an element.
*/
focus(): JQuery;
/**
* Bind an event handler to the "focus" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
focus(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "focus" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
focus(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "focusin" event on an element.
*/
focusin(): JQuery;
/**
* Bind an event handler to the "focusin" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
focusin(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "focusin" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
focusin(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "focusout" event on an element.
*/
focusout(): JQuery;
/**
* Bind an event handler to the "focusout" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
focusout(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "focusout" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
focusout(eventData: Object, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
*
* @param handlerIn A function to execute when the mouse pointer enters the element.
* @param handlerOut A function to execute when the mouse pointer leaves the element.
*/
hover(handlerIn: (eventObject: JQueryEventObject) => any, handlerOut: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
*
* @param handlerInOut A function to execute when the mouse pointer enters or leaves the element.
*/
hover(handlerInOut: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "keydown" event on an element.
*/
keydown(): JQuery;
/**
* Bind an event handler to the "keydown" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
keydown(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Bind an event handler to the "keydown" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
keydown(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Trigger the "keypress" event on an element.
*/
keypress(): JQuery;
/**
* Bind an event handler to the "keypress" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
keypress(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Bind an event handler to the "keypress" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
keypress(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Trigger the "keyup" event on an element.
*/
keyup(): JQuery;
/**
* Bind an event handler to the "keyup" JavaScript event
*
* @param handler A function to execute each time the event is triggered.
*/
keyup(handler: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Bind an event handler to the "keyup" JavaScript event
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute each time the event is triggered.
*/
keyup(eventData?: any, handler?: (eventObject: JQueryKeyEventObject) => any): JQuery;
/**
* Bind an event handler to the "load" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
load(handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Bind an event handler to the "load" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
load(eventData?: any, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Trigger the "mousedown" event on an element.
*/
mousedown(): JQuery;
/**
* Bind an event handler to the "mousedown" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
mousedown(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to the "mousedown" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mousedown(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mouseenter" event on an element.
*/
mouseenter(): JQuery;
/**
* Bind an event handler to be fired when the mouse enters an element.
*
* @param handler A function to execute when the event is triggered.
*/
mouseenter(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to be fired when the mouse enters an element.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mouseenter(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mouseleave" event on an element.
*/
mouseleave(): JQuery;
/**
* Bind an event handler to be fired when the mouse leaves an element.
*
* @param handler A function to execute when the event is triggered.
*/
mouseleave(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to be fired when the mouse leaves an element.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mouseleave(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mousemove" event on an element.
*/
mousemove(): JQuery;
/**
* Bind an event handler to the "mousemove" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
mousemove(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to the "mousemove" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mousemove(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mouseout" event on an element.
*/
mouseout(): JQuery;
/**
* Bind an event handler to the "mouseout" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
mouseout(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to the "mouseout" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mouseout(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mouseover" event on an element.
*/
mouseover(): JQuery;
/**
* Bind an event handler to the "mouseover" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
mouseover(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to the "mouseover" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mouseover(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Trigger the "mouseup" event on an element.
*/
mouseup(): JQuery;
/**
* Bind an event handler to the "mouseup" JavaScript event.
*
* @param handler A function to execute when the event is triggered.
*/
mouseup(handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Bind an event handler to the "mouseup" JavaScript event.
*
* @param eventData An object containing data that will be passed to the event handler.
* @param handler A function to execute when the event is triggered.
*/
mouseup(eventData: Object, handler: (eventObject: JQueryMouseEventObject) => any): JQuery;
/**
* Remove an event handler.
*/
off(): JQuery;
/**
* Remove an event handler.
*
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
* @param handler A handler function previously attached for the event(s), or the special value false.
*/
off(events: string, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Remove an event handler.
*
* @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
* @param handler A handler function previously attached for the event(s), or the special value false.
*/
off(events: string, handler: (eventObject: JQueryEventObject) => any): JQuery;
/**
* Remove an event handler.
*
* @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).
* @param selector A selector which should match the one originally passed to .on() when attaching event handlers.
*/
off(events: { [key: string]: any; }, selector?: string): JQuery;
/**
* Attach an event handler function for one or more events to the selected elements.
*
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
* @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).
*/
on(events: string, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
/**
* Attach an event handler function for one or more events to the selected elements.
*
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
* @param data Data to be passed to the handler in event.data when an event is triggered.
* @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.
*/
on(events: string, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery;
/**
* Attach an event handler function for one or more events to the selected elements.
*
* @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
* @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.
* @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.
*/
on(events: string, selector: string, handler: (eventObject: JQueryEventObject, ...even
gitextract_2ehdrf35/ ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── _references.ts ├── css/ │ └── main.css ├── index.html ├── js/ │ ├── libs/ │ │ ├── filereader.js │ │ └── jdataview.js │ ├── main.js │ └── ts/ │ ├── defs/ │ │ ├── bootstrap.d.ts │ │ ├── filereader.d.ts │ │ ├── jdataview.d.ts │ │ ├── jquery.d.ts │ │ ├── jszip.d.ts │ │ └── various.d.ts │ ├── dexdefs.ts │ ├── dexformat.ts │ ├── main.ts │ └── model.ts └── tsconfig.json
SYMBOL INDEX (181 symbols across 13 files)
FILE: js/libs/filereader.js
function makeWorker (line 80) | function makeWorker(script) {
function setupClipboard (line 95) | function setupClipboard(element, opts) {
function setupInput (line 134) | function setupInput(input, opts) {
function setupDrop (line 156) | function setupDrop(dropbox, opts) {
function setupCustomFileProperties (line 232) | function setupCustomFileProperties(files, groupID) {
function getReadAsMethod (line 247) | function getReadAsMethod(type, readAsMap, readAsDefault) {
function processFileList (line 257) | function processFileList(e, files, opts) {
function checkFileReaderSyncSupport (line 358) | function checkFileReaderSyncSupport() {
function noop (line 369) | function noop() {
function extend (line 374) | function extend(destination, source) {
function hasClass (line 389) | function hasClass(el, name) {
function addClass (line 394) | function addClass(el, name) {
function removeClass (line 401) | function removeClass(el, name) {
function prettySize (line 409) | function prettySize(bytes) {
FILE: js/libs/jdataview.js
function b (line 1) | function b(a,b){return"object"!=typeof a||null===a?!1:a.constructor===b|...
function c (line 1) | function c(a,c){return!c&&b(a,Array)?a:Array.prototype.slice.call(a)}
function d (line 1) | function d(a,b){return void 0!==a?a:b}
function e (line 1) | function e(a,c,f,g){if(e.is(a)){var h=a.slice(c,c+f);return h._littleEnd...
function f (line 1) | function f(a){for(var b=j.ArrayBuffer?Uint8Array:Array,c=new b(a.length)...
function g (line 1) | function g(a){return a>=0&&31>a?1<<a:g[a]||(g[a]=Math.pow(2,a))}
function h (line 1) | function h(a,b){this.lo=a,this.hi=b}
function i (line 1) | function i(){h.apply(this,arguments)}
function f (line 1) | function f(a,b){return 0>a?a+b:a}
FILE: js/main.js
function __ (line 3) | function __() { this.constructor = d; }
function BaseDef (line 32) | function BaseDef(reader) {
function ClassBaseDef (line 40) | function ClassBaseDef() {
function TypeDef (line 56) | function TypeDef(reader, descriptorIdx) {
function ProtoDef (line 74) | function ProtoDef(reader, shortyIdx, returnTypeIdx, parametersOff) {
function FieldDef (line 94) | function FieldDef(reader, classIdx, typeIdx, nameIdx) {
function MethodDef (line 111) | function MethodDef(reader, classIdx, protoIdx, nameIdx) {
function ClassDef (line 128) | function ClassDef(reader, classIdx, accessFlags, superclassIdx, interfac...
function MultiDexFileReader (line 188) | function MultiDexFileReader(inputFileStream) {
function DexFileReader (line 218) | function DexFileReader(file) {
function DexHeader (line 446) | function DexHeader(dv) {
function Model (line 503) | function Model() {
function ClassDataWrapper (line 597) | function ClassDataWrapper(classType, classDef) {
function PackageNodeMetaData (line 618) | function PackageNodeMetaData() {
function AppView (line 658) | function AppView() {
FILE: js/ts/defs/bootstrap.d.ts
type ModalOptions (line 9) | interface ModalOptions {
type ModalOptionsBackdropString (line 16) | interface ModalOptionsBackdropString {
type ScrollSpyOptions (line 23) | interface ScrollSpyOptions {
type TooltipOptions (line 28) | interface TooltipOptions {
type PopoverOptions (line 41) | interface PopoverOptions {
type CollapseOptions (line 55) | interface CollapseOptions {
type CarouselOptions (line 60) | interface CarouselOptions {
type TypeaheadOptions (line 67) | interface TypeaheadOptions {
type AffixOptions (line 77) | interface AffixOptions {
type JQuery (line 82) | interface JQuery {
FILE: js/ts/defs/filereader.d.ts
type ReaderEvents (line 6) | interface ReaderEvents {
type FileReaderJSOpts (line 18) | interface FileReaderJSOpts {
class FileReaderJS (line 25) | class FileReaderJS {
type JQuery (line 32) | interface JQuery {
FILE: js/ts/defs/jdataview.d.ts
class jDataView (line 6) | class jDataView implements DataView {
type Bytes (line 88) | interface Bytes {
type Buffer (line 93) | interface Buffer extends Bytes {
class Uint64 (line 97) | class Uint64 {
class Int64 (line 105) | class Int64 extends Uint64 {
FILE: js/ts/defs/jquery.d.ts
type JQueryAjaxSettings (line 25) | interface JQueryAjaxSettings {
type JQueryXHR (line 169) | interface JQueryXHR extends XMLHttpRequest, JQueryPromise<any> {
type JQueryCallback (line 197) | interface JQueryCallback {
type JQueryGenericPromise (line 280) | interface JQueryGenericPromise<T> {
type JQueryPromiseCallback (line 301) | interface JQueryPromiseCallback<T> {
type JQueryPromiseOperator (line 305) | interface JQueryPromiseOperator<T, U> {
type JQueryPromise (line 312) | interface JQueryPromise<T> extends JQueryGenericPromise<T> {
type JQueryDeferred (line 352) | interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
type BaseJQueryEventObject (line 444) | interface BaseJQueryEventObject extends Event {
type JQueryInputEventObject (line 464) | interface JQueryInputEventObject extends BaseJQueryEventObject {
type JQueryMouseEventObject (line 471) | interface JQueryMouseEventObject extends JQueryInputEventObject {
type JQueryKeyEventObject (line 483) | interface JQueryKeyEventObject extends JQueryInputEventObject {
type JQueryEventObject (line 490) | interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEv...
type JQuerySupport (line 497) | interface JQuerySupport {
type JQueryParam (line 519) | interface JQueryParam {
type JQueryEventConstructor (line 542) | interface JQueryEventConstructor {
type JQueryCoordinates (line 550) | interface JQueryCoordinates {
type JQuerySerializeArrayElement (line 558) | interface JQuerySerializeArrayElement {
type JQueryAnimationOptions (line 563) | interface JQueryAnimationOptions {
type JQueryStatic (line 613) | interface JQueryStatic {
type JQuery (line 1154) | interface JQuery {
FILE: js/ts/defs/jszip.d.ts
type JSZip (line 6) | interface JSZip {
type JSZipObject (line 83) | interface JSZipObject {
type JSZipFileOptions (line 97) | interface JSZipFileOptions {
type JSZipObjectOptions (line 107) | interface JSZipObjectOptions {
type JSZipGeneratorOptions (line 119) | interface JSZipGeneratorOptions {
type JSZipLoadOptions (line 129) | interface JSZipLoadOptions {
type JSZipSupport (line 136) | interface JSZipSupport {
type DEFLATE (line 143) | interface DEFLATE {
FILE: js/ts/defs/various.d.ts
type String (line 1) | interface String {
type HTMLElement (line 5) | interface HTMLElement {
type Document (line 9) | interface Document {
type LoadedDexData (line 13) | interface LoadedDexData {
FILE: js/ts/dexdefs.ts
type AccessFlags (line 5) | enum AccessFlags {
method constructor (line 16) | constructor(reader:DexFileReader) {
method getClassData (line 24) | public getClassData():ClassDef {
method getClassType (line 28) | public getClassType():TypeDef {
method getClassIdx (line 32) | public getClassIdx():number {
class TypeDef (line 37) | class TypeDef extends BaseDef {
method constructor (line 41) | constructor(reader:DexFileReader, descriptorIdx:number) {
method getDescriptor (line 46) | public getDescriptor():string {
method setInternal (line 50) | public setInternal(internal: boolean):void {
method isInternal (line 54) | public isInternal():boolean {
class ProtoDef (line 59) | class ProtoDef extends BaseDef {
method constructor (line 64) | constructor(reader:DexFileReader, shortyIdx:number, returnTypeIdx:numb...
method getShorty (line 71) | public getShorty():string {
method getParametersOff (line 75) | public getParametersOff():number {
method getReturnType (line 79) | public getReturnType():TypeDef {
class FieldDef (line 84) | class FieldDef extends ClassBaseDef {
method constructor (line 88) | constructor(reader:DexFileReader, classIdx:number, typeIdx:number, nam...
method getName (line 95) | public getName():string {
method getType (line 99) | public getType():TypeDef {
class MethodDef (line 104) | class MethodDef extends ClassBaseDef {
method constructor (line 108) | constructor(reader:DexFileReader, classIdx:number, protoIdx:number, na...
method getName (line 115) | public getName():string {
method getProto (line 119) | public getProto():ProtoDef {
class ClassDef (line 124) | class ClassDef extends BaseDef {
method constructor (line 134) | constructor(reader:DexFileReader, classIdx:number, accessFlags:number,...
method getClassIdx (line 147) | public getClassIdx():number {
method isAccessFlag (line 151) | public isAccessFlag(flag:AccessFlags):boolean {
method getSourceFileName (line 155) | public getSourceFileName():string {
method getClassType (line 159) | public getClassType():TypeDef {
method getSuperclassType (line 163) | public getSuperclassType():TypeDef {
method getInterfacesOff (line 171) | public getInterfacesOff():number {
method getAnnotationsOff (line 175) | public getAnnotationsOff():number {
method getClassDataOff (line 179) | public getClassDataOff():number {
method getStaticValuesOff (line 183) | public getStaticValuesOff():number {
FILE: js/ts/dexformat.ts
class MultiDexFileReader (line 14) | class MultiDexFileReader {
method constructor (line 20) | constructor(inputFileStream:ArrayBuffer) {
method getMethodRefs (line 34) | public getMethodRefs():MethodDef[] {
method isMultidex (line 43) | public isMultidex():boolean {
class DexFileReader (line 48) | class DexFileReader {
method constructor (line 62) | constructor(file:JSZipObject) {
method getClassNameOnly (line 80) | public static getClassNameOnly(typeName:string):string {
method getPackageNameOnly (line 90) | public static getPackageNameOnly(typeName:string):string {
method descriptorToDot (line 100) | public static descriptorToDot(descr:string):string {
method isValidDexFile (line 144) | private static isValidDexFile(bytes:number[]):boolean {
method markInternalClasses (line 153) | private markInternalClasses():void {
method loadStrings (line 170) | private loadStrings(dv:jDataView):void {
method loadTypes (line 187) | private loadTypes(dv:jDataView):void {
method loadProtos (line 197) | private loadProtos(dv:jDataView):void {
method loadFields (line 222) | private loadFields(dv:jDataView):void {
method loadMethods (line 234) | private loadMethods(dv:jDataView):void {
method loadClasses (line 246) | private loadClasses(dv:jDataView):void {
method getPrimitiveType (line 265) | private static getPrimitiveType(typeChar:string):string {
method getMethodRefs (line 282) | public getMethodRefs():MethodDef[] {
method getString (line 286) | public getString(idx:number):string {
method getType (line 290) | public getType(idx:number):TypeDef {
method getProto (line 294) | public getProto(idx:number):ProtoDef {
method getClass (line 298) | public getClass(idx:number):ClassDef {
class DexHeader (line 310) | class DexHeader {
method constructor (line 335) | constructor(dv:jDataView) {
FILE: js/ts/main.ts
class AppView (line 13) | class AppView {
method constructor (line 38) | constructor() {
method onLoadFile (line 54) | private onLoadFile(e:any, file:File):void {
method setIsLoading (line 78) | private setIsLoading(isLoading:boolean):void {
method renderPackages (line 90) | private renderPackages(data:LoadedDexData):void {
method recursiveRenderPackage (line 114) | private recursiveRenderPackage(treeBuilder:string[], node:any, level:n...
method showPackageDetail (line 157) | private showPackageDetail(packagePath:string):void {
method formatInnerClasses (line 198) | private formatInnerClasses(name:string):string {
method resetLastMouseOverNode (line 215) | private resetLastMouseOverNode():void {
method updateTree (line 222) | private updateTree():void {
method selectAll (line 251) | private selectAll(el:HTMLElement):void {
method dropzoneClick (line 265) | private dropzoneClick():void {
method expandCollapseAll (line 269) | private expandCollapseAll():void {
method download (line 290) | private download():void {
FILE: js/ts/model.ts
class Model (line 6) | class Model {
method getCurrentTreemap (line 20) | public getCurrentTreemap():ClassDataWrapper[] {
method loadDexFile (line 24) | public loadDexFile(arrayBuffer:ArrayBuffer):LoadedDexData {
method isInnerClassFromName (line 77) | public isInnerClassFromName(className:string):boolean {
method formatType (line 81) | public formatType(className:string, classData:ClassDataWrapper):string {
method extractFileNameWithoutExt (line 99) | public extractFileNameWithoutExt(filename:string):string {
class ClassDataWrapper (line 109) | class ClassDataWrapper {
method constructor (line 114) | constructor(classType:TypeDef, classDef:ClassDef) {
method incrementMethodCount (line 119) | public incrementMethodCount():void {
method getMethodCount (line 123) | public getMethodCount():number {
method getClassType (line 127) | public getClassType():TypeDef {
method getClassDef (line 131) | public getClassDef():ClassDef {
class PackageNodeMetaData (line 136) | class PackageNodeMetaData {
method incrementMethodCount (line 140) | public incrementMethodCount():void {
method addClassAndIncrement (line 144) | public addClassAndIncrement(idx:number, classWrapper:ClassDataWrapper)...
method getCount (line 151) | public getCount():number {
method getClassWrapper (line 155) | public getClassWrapper(idx:number):ClassDataWrapper {
method getSortedClasses (line 159) | public getSortedClasses():string[] {
Condensed preview — 21 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (294K chars).
[
{
"path": ".gitattributes",
"chars": 43,
"preview": "js/main.js -diff\njs/main.js.map -diff"
},
{
"path": ".gitignore",
"chars": 7,
"preview": ".idea/*"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 1383,
"preview": "[](https"
},
{
"path": "_references.ts",
"chars": 36,
"preview": "///<reference path=\"js/ts/main.ts\"/>"
},
{
"path": "css/main.css",
"chars": 3224,
"preview": "body {\n background: #f5f5f5;\n}\n\nfooter {\n margin-top: 8px;\n margin-bottom: 8px;\n color: darkgray;\n text-a"
},
{
"path": "index.html",
"chars": 4782,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"css/main.css\"/>\n <meta chars"
},
{
"path": "js/libs/filereader.js",
"chars": 13848,
"preview": "/*!\nFileReader.js - v0.99\nA lightweight wrapper for common FileReader usage.\nCopyright 2014 Brian Grinstead - MIT Licens"
},
{
"path": "js/libs/jdataview.js",
"chars": 9251,
"preview": "!function(a){var b=this;\"object\"==typeof exports?module.exports=a(b):\"function\"==typeof define&&define.amd?define([],fun"
},
{
"path": "js/main.js",
"chars": 40191,
"preview": "var __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"
},
{
"path": "js/ts/defs/bootstrap.d.ts",
"chars": 2737,
"preview": "// Type definitions for Bootstrap 3.3.5\n// Project: http://twitter.github.com/bootstrap/\n// Definitions by: Boris Yankov"
},
{
"path": "js/ts/defs/filereader.d.ts",
"chars": 1116,
"preview": "// Type definitions for jDataView\n// Project: https://github.com/jDataView/jDataView\n// Definitions by: Ingvar Stepanya"
},
{
"path": "js/ts/defs/jdataview.d.ts",
"chars": 4464,
"preview": "// Type definitions for jDataView\n// Project: https://github.com/jDataView/jDataView\n// Definitions by: Ingvar Stepanya"
},
{
"path": "js/ts/defs/jquery.d.ts",
"chars": 149651,
"preview": "// Type definitions for jQuery 1.10.x / 2.0.x\n// Project: http://jquery.com/\n// Definitions by: Boris Yankov <https://gi"
},
{
"path": "js/ts/defs/jszip.d.ts",
"chars": 4792,
"preview": "// Type definitions for JSZip\n// Project: http://stuk.github.com/jszip/\n// Definitions by: mzeiher <https://github.com/m"
},
{
"path": "js/ts/defs/various.d.ts",
"chars": 355,
"preview": "interface String {\n repeat(count:number): string;\n}\n\ninterface HTMLElement {\n createTextRange(): TextRange;\n}\n\nint"
},
{
"path": "js/ts/dexdefs.ts",
"chars": 5653,
"preview": "///<reference path=\"dexformat.ts\"/>\n\nnamespace DexFormat {\n\n export enum AccessFlags {\n ACC_PUBLIC = 0x1, ACC_"
},
{
"path": "js/ts/dexformat.ts",
"chars": 13503,
"preview": "///<reference path=\"defs/jszip.d.ts\"/>\n///<reference path=\"defs/jdataview.d.ts\"/>\n///<reference path=\"defs/filereader.d."
},
{
"path": "js/ts/main.ts",
"chars": 12913,
"preview": "///<reference path=\"dexformat.ts\"/>\n///<reference path=\"defs/jquery.d.ts\"/>\n///<reference path=\"defs/bootstrap.d.ts\"/>\n/"
},
{
"path": "js/ts/model.ts",
"chars": 5910,
"preview": "///<reference path=\"main.ts\"/>\n\nnamespace ApkMethodCount {\n\n import MultiDexFileReader = DexFormat.MultiDexFileReader"
},
{
"path": "tsconfig.json",
"chars": 80,
"preview": "{\n \"compilerOptions\": {\n \"sourceMap\": true,\n \"outFile\":\"js/main.js\"\n }\n}"
}
]
About this extraction
This page contains the full source code of the inloop/apk-method-count GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 21 files (278.6 KB), approximately 64.6k tokens, and a symbol index with 181 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.