var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var typedoc; (function (typedoc) { typedoc.$html = $('html'); var services = []; var components = []; typedoc.$document = $(document); typedoc.$window = $(window); typedoc.$body = $('body'); function registerService(constructor, name, priority) { if (priority === void 0) { priority = 0; } services.push({ constructor: constructor, name: name, priority: priority, instance: null }); services.sort(function (a, b) { return a.priority - b.priority; }); } typedoc.registerService = registerService; function registerComponent(constructor, selector, priority, namespace) { if (priority === void 0) { priority = 0; } if (namespace === void 0) { namespace = '*'; } components.push({ selector: selector, constructor: constructor, priority: priority, namespace: namespace }); components.sort(function (a, b) { return a.priority - b.priority; }); } typedoc.registerComponent = registerComponent; if (typeof Backbone != 'undefined') { typedoc['Events'] = (function () { var res = function () { }; _.extend(res.prototype, Backbone.Events); return res; })(); } var Application = (function (_super) { __extends(Application, _super); function Application() { var _this = _super.call(this) || this; _this.createServices(); _this.createComponents(typedoc.$body); return _this; } Application.prototype.createServices = function () { _(services).forEach(function (c) { c.instance = new c.constructor(); typedoc[c.name] = c.instance; }); }; Application.prototype.createComponents = function ($context, namespace) { if (namespace === void 0) { namespace = 'default'; } var result = []; _(components).forEach(function (c) { if (c.namespace != namespace && c.namespace != '*') { return; } $context.find(c.selector).each(function (m, el) { var $el = $(el), instance; if (instance = $el.data('component')) { if (_(result).indexOf(instance) == -1) { result.push(instance); } } else { instance = new c.constructor({ el: el }); $el.data('component', instance); result.push(instance); } }); }); return result; }; return Application; }(typedoc.Events)); typedoc.Application = Application; })(typedoc || (typedoc = {})); var typedoc; (function (typedoc) { var FilterItem = (function () { function FilterItem(key, value) { this.key = key; this.value = value; this.defaultValue = value; this.initialize(); if (window.localStorage[this.key]) { this.setValue(this.fromLocalStorage(window.localStorage[this.key])); } } FilterItem.prototype.initialize = function () { }; FilterItem.prototype.handleValueChange = function (oldValue, newValue) { }; FilterItem.prototype.fromLocalStorage = function (value) { return value; }; FilterItem.prototype.toLocalStorage = function (value) { return value; }; FilterItem.prototype.setValue = function (value) { if (this.value == value) return; var oldValue = this.value; this.value = value; window.localStorage[this.key] = this.toLocalStorage(value); this.handleValueChange(oldValue, value); }; return FilterItem; }()); var FilterItemCheckbox = (function (_super) { __extends(FilterItemCheckbox, _super); function FilterItemCheckbox() { return _super !== null && _super.apply(this, arguments) || this; } FilterItemCheckbox.prototype.initialize = function () { var _this = this; this.$checkbox = $('#tsd-filter-' + this.key); this.$checkbox.on('change', function () { _this.setValue(_this.$checkbox.prop('checked')); }); }; FilterItemCheckbox.prototype.handleValueChange = function (oldValue, newValue) { this.$checkbox.prop('checked', this.value); typedoc.$html.toggleClass('toggle-' + this.key, this.value != this.defaultValue); }; FilterItemCheckbox.prototype.fromLocalStorage = function (value) { return value == 'true'; }; FilterItemCheckbox.prototype.toLocalStorage = function (value) { return value ? 'true' : 'false'; }; return FilterItemCheckbox; }(FilterItem)); var FilterItemSelect = (function (_super) { __extends(FilterItemSelect, _super); function FilterItemSelect() { return _super !== null && _super.apply(this, arguments) || this; } FilterItemSelect.prototype.initialize = function () { var _this = this; typedoc.$html.addClass('toggle-' + this.key + this.value); this.$select = $('#tsd-filter-' + this.key); this.$select.on(typedoc.pointerDown + ' mouseover', function () { _this.$select.addClass('active'); }).on('mouseleave', function () { _this.$select.removeClass('active'); }).on(typedoc.pointerUp, 'li', function (e) { _this.$select.removeClass('active'); _this.setValue($(e.target).attr('data-value')); }); typedoc.$document.on(typedoc.pointerDown, function (e) { var $path = $(e.target).parents().addBack(); if ($path.is(_this.$select)) return; _this.$select.removeClass('active'); }); }; FilterItemSelect.prototype.handleValueChange = function (oldValue, newValue) { this.$select.find('li.selected').removeClass('selected'); this.$select.find('.tsd-select-label').text(this.$select.find('li[data-value="' + newValue + '"]').addClass('selected').text()); typedoc.$html.removeClass('toggle-' + oldValue); typedoc.$html.addClass('toggle-' + newValue); }; return FilterItemSelect; }(FilterItem)); var Filter = (function (_super) { __extends(Filter, _super); function Filter(options) { var _this = _super.call(this, options) || this; _this.optionVisibility = new FilterItemSelect('visibility', 'private'); _this.optionInherited = new FilterItemCheckbox('inherited', true); _this.optionExternals = new FilterItemCheckbox('externals', true); _this.optionOnlyExported = new FilterItemCheckbox('only-exported', false); return _this; } Filter.isSupported = function () { try { return typeof window.localStorage != 'undefined'; } catch (e) { return false; } }; return Filter; }(Backbone.View)); if (Filter.isSupported()) { typedoc.registerComponent(Filter, '#tsd-filter'); } else { typedoc.$html.addClass('no-filter'); } })(typedoc || (typedoc = {})); var typedoc; (function (typedoc) { var MenuHighlight = (function (_super) { __extends(MenuHighlight, _super); function MenuHighlight(options) { var _this = _super.call(this, options) || this; _this.index = 0; _this.listenTo(typedoc.viewport, 'resize', _this.onResize); _this.listenTo(typedoc.viewport, 'scroll', _this.onScroll); _this.createAnchors(); return _this; } MenuHighlight.prototype.createAnchors = function () { var _this = this; this.index = 0; this.anchors = [{ position: 0 }]; var base = window.location.href; if (base.indexOf('#') != -1) { base = base.substr(0, base.indexOf('#')); } this.$el.find('a').each(function (index, el) { var href = el.href; if (href.indexOf('#') == -1) return; if (href.substr(0, base.length) != base) return; var hash = href.substr(href.indexOf('#') + 1); var $anchor = $('a.tsd-anchor[name=' + hash + ']'); if ($anchor.length == 0) return; _this.anchors.push({ $link: $(el.parentNode), $anchor: $anchor, position: 0 }); }); this.onResize(); }; MenuHighlight.prototype.onResize = function () { var anchor; for (var index = 1, count = this.anchors.length; index < count; index++) { anchor = this.anchors[index]; anchor.position = anchor.$anchor.offset().top; } this.anchors.sort(function (a, b) { return a.position - b.position; }); this.onScroll(typedoc.viewport.scrollTop); }; MenuHighlight.prototype.onScroll = function (scrollTop) { var anchors = this.anchors; var index = this.index; var count = anchors.length - 1; scrollTop += 5; while (index > 0 && anchors[index].position > scrollTop) { index -= 1; } while (index < count && anchors[index + 1].position < scrollTop) { index += 1; } if (this.index != index) { if (this.index > 0) this.anchors[this.index].$link.removeClass('focus'); this.index = index; if (this.index > 0) this.anchors[this.index].$link.addClass('focus'); } }; return MenuHighlight; }(Backbone.View)); typedoc.MenuHighlight = MenuHighlight; typedoc.registerComponent(MenuHighlight, '.menu-highlight'); })(typedoc || (typedoc = {})); var typedoc; (function (typedoc) { var hasPositionSticky = typedoc.$html.hasClass('csspositionsticky'); var StickyMode; (function (StickyMode) { StickyMode[StickyMode["None"] = 0] = "None"; StickyMode[StickyMode["Secondary"] = 1] = "Secondary"; StickyMode[StickyMode["Current"] = 2] = "Current"; })(StickyMode || (StickyMode = {})); var MenuSticky = (function (_super) { __extends(MenuSticky, _super); function MenuSticky(options) { var _this = _super.call(this, options) || this; _this.state = ''; _this.stickyMode = StickyMode.None; _this.$current = _this.$el.find('> ul.current'); _this.$navigation = _this.$el.parents('.menu-sticky-wrap'); _this.$container = _this.$el.parents('.row'); _this.listenTo(typedoc.viewport, 'resize', _this.onResize); if (!hasPositionSticky) { _this.listenTo(typedoc.viewport, 'scroll', _this.onScroll); } _this.onResize(typedoc.viewport.width, typedoc.viewport.height); return _this; } MenuSticky.prototype.setState = function (state) { if (this.state == state) return; if (this.state != '') this.$navigation.removeClass(this.state); this.state = state; if (this.state != '') this.$navigation.addClass(this.state); }; MenuSticky.prototype.onResize = function (width, height) { this.stickyMode = StickyMode.None; this.setState(''); var containerTop = this.$container.offset().top; var containerHeight = this.$container.height(); var bottom = containerTop + containerHeight; if (this.$navigation.height() < containerHeight) { var elHeight = this.$el.height(); var elTop = this.$el.offset().top; if (this.$current.length) { var currentHeight = this.$current.height(); var currentTop = this.$current.offset().top; this.$navigation.css('top', containerTop - currentTop + 20); if (currentHeight < height) { this.stickyMode = StickyMode.Current; this.stickyTop = currentTop; this.stickyBottom = bottom - elHeight + (currentTop - elTop) - 20; } } if (elHeight < height) { this.$navigation.css('top', containerTop - elTop + 20); this.stickyMode = StickyMode.Secondary; this.stickyTop = elTop; this.stickyBottom = bottom - elHeight - 20; } } if (!hasPositionSticky) { this.$navigation.css('left', this.$navigation.offset().left); this.onScroll(typedoc.viewport.scrollTop); } else { if (this.stickyMode == StickyMode.Current) { this.setState('sticky-current'); } else if (this.stickyMode == StickyMode.Secondary) { this.setState('sticky'); } else { this.setState(''); } } }; MenuSticky.prototype.onScroll = function (scrollTop) { if (this.stickyMode == StickyMode.Current) { if (scrollTop > this.stickyBottom) { this.setState('sticky-bottom'); } else { this.setState(scrollTop + 20 > this.stickyTop ? 'sticky-current' : ''); } } else if (this.stickyMode == StickyMode.Secondary) { if (scrollTop > this.stickyBottom) { this.setState('sticky-bottom'); } else { this.setState(scrollTop + 20 > this.stickyTop ? 'sticky' : ''); } } }; return MenuSticky; }(Backbone.View)); typedoc.MenuSticky = MenuSticky; typedoc.registerComponent(MenuSticky, '.menu-sticky'); })(typedoc || (typedoc = {})); var typedoc; (function (typedoc) { var search; (function (search) { var SearchLoadingState; (function (SearchLoadingState) { SearchLoadingState[SearchLoadingState["Idle"] = 0] = "Idle"; SearchLoadingState[SearchLoadingState["Loading"] = 1] = "Loading"; SearchLoadingState[SearchLoadingState["Ready"] = 2] = "Ready"; SearchLoadingState[SearchLoadingState["Failure"] = 3] = "Failure"; })(SearchLoadingState || (SearchLoadingState = {})); var $el = $('#tsd-search'); var $field = $('#tsd-search-field'); var $results = $('.results'); var base = $el.attr('data-base') + '/'; var query = ''; var loadingState = SearchLoadingState.Idle; var hasFocus = false; var preventPress = false; var index; function createIndex() { index = new lunr.Index(); index.pipeline.add(lunr.trimmer); index.field('name', { boost: 10 }); index.field('parent'); index.ref('id'); var rows = search.data.rows; var pos = 0; var length = rows.length; function batch() { var cycles = 0; while (cycles++ < 100) { index.add(rows[pos]); if (++pos == length) { return setLoadingState(SearchLoadingState.Ready); } } setTimeout(batch, 10); } batch(); } function loadIndex() { if (loadingState != SearchLoadingState.Idle) return; setTimeout(function () { if (loadingState == SearchLoadingState.Idle) { setLoadingState(SearchLoadingState.Loading); } }, 500); if (typeof search.data != 'undefined') { createIndex(); } else { $.get($el.attr('data-index')) .done(function (source) { eval(source); createIndex(); }).fail(function () { setLoadingState(SearchLoadingState.Failure); }); } } function updateResults() { if (loadingState != SearchLoadingState.Ready) return; $results.empty(); var res = index.search(query); for (var i = 0, c = Math.min(10, res.length); i < c; i++) { var row = search.data.rows[res[i].ref]; var name = row.name; if (row.parent) name = '' + row.parent + '.' + name; $results.append('