├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPER.md ├── LICENSE ├── README.md ├── benchmark ├── benchmark.js └── benchmark_indexes.js ├── config ├── jasmine.json ├── karma.config.js ├── nycrc.json ├── nycrc.node.json ├── tsconfig.tslint.json ├── tsconfig.webpack.json ├── tslint.json └── webpack-config-creator.js ├── dist └── packages │ ├── fs-storage │ ├── lokidb.fs-storage.js │ ├── lokidb.fs-storage.js.map │ ├── lokidb.fs-storage.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── full-text-search-language-de │ ├── lokidb.full-text-search-language-de.js │ ├── lokidb.full-text-search-language-de.js.map │ ├── lokidb.full-text-search-language-de.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── full-text-search-language-en │ ├── lokidb.full-text-search-language-en.js │ ├── lokidb.full-text-search-language-en.js.map │ ├── lokidb.full-text-search-language-en.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── full-text-search-language │ ├── lokidb.full-text-search-language.js │ ├── lokidb.full-text-search-language.js.map │ ├── lokidb.full-text-search-language.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── full-text-search │ ├── lokidb.full-text-search.js │ ├── lokidb.full-text-search.js.map │ ├── lokidb.full-text-search.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── indexed-storage │ ├── lokidb.indexed-storage.js │ ├── lokidb.indexed-storage.js.map │ ├── lokidb.indexed-storage.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── local-storage │ ├── lokidb.local-storage.js │ ├── lokidb.local-storage.js.map │ ├── lokidb.local-storage.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── loki │ ├── lokidb.loki.js │ ├── lokidb.loki.js.map │ ├── lokidb.loki.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ ├── memory-storage │ ├── lokidb.memory-storage.js │ ├── lokidb.memory-storage.js.map │ ├── lokidb.memory-storage.min.js │ └── types │ │ ├── common │ │ ├── plugin.d.ts │ │ └── types.d.ts │ │ ├── fs-storage │ │ └── src │ │ │ ├── fs_storage.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-de │ │ └── src │ │ │ ├── german_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language-en │ │ └── src │ │ │ ├── english_analyzer.d.ts │ │ │ └── index.d.ts │ │ ├── full-text-search-language │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── language.d.ts │ │ ├── full-text-search │ │ └── src │ │ │ ├── analyzer │ │ │ ├── analyzer.d.ts │ │ │ ├── character_filter.d.ts │ │ │ ├── token_filter.d.ts │ │ │ └── tokenizer.d.ts │ │ │ ├── full_text_search.d.ts │ │ │ ├── fuzzy │ │ │ ├── automaton.d.ts │ │ │ ├── lev1t_parametric_description.d.ts │ │ │ ├── lev2t_parametric_description.d.ts │ │ │ ├── levenshtein_automata.d.ts │ │ │ ├── long.d.ts │ │ │ ├── parametric_description.d.ts │ │ │ └── run_automaton.d.ts │ │ │ ├── index.d.ts │ │ │ ├── index_searcher.d.ts │ │ │ ├── inverted_index.d.ts │ │ │ ├── query_types.d.ts │ │ │ └── scorer.d.ts │ │ ├── indexed-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── indexed_storage.d.ts │ │ ├── local-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── local_storage.d.ts │ │ ├── loki │ │ └── src │ │ │ ├── avl_index.d.ts │ │ │ ├── clone.d.ts │ │ │ ├── collection.d.ts │ │ │ ├── comparators.d.ts │ │ │ ├── dynamic_view.d.ts │ │ │ ├── event_emitter.d.ts │ │ │ ├── index.d.ts │ │ │ ├── loki.d.ts │ │ │ ├── operator_packages.d.ts │ │ │ ├── ranged_indexes.d.ts │ │ │ ├── result_set.d.ts │ │ │ └── unique_index.d.ts │ │ ├── memory-storage │ │ └── src │ │ │ ├── index.d.ts │ │ │ └── memory_storage.d.ts │ │ └── partitioning-adapter │ │ └── src │ │ ├── index.d.ts │ │ └── partitioning_adapter.d.ts │ └── partitioning-adapter │ ├── lokidb.partitioning-adapter.js │ ├── lokidb.partitioning-adapter.js.map │ ├── lokidb.partitioning-adapter.min.js │ └── types │ ├── common │ ├── plugin.d.ts │ └── types.d.ts │ ├── fs-storage │ └── src │ │ ├── fs_storage.d.ts │ │ └── index.d.ts │ ├── full-text-search-language-de │ └── src │ │ ├── german_analyzer.d.ts │ │ └── index.d.ts │ ├── full-text-search-language-en │ └── src │ │ ├── english_analyzer.d.ts │ │ └── index.d.ts │ ├── full-text-search-language │ └── src │ │ ├── index.d.ts │ │ └── language.d.ts │ ├── full-text-search │ └── src │ │ ├── analyzer │ │ ├── analyzer.d.ts │ │ ├── character_filter.d.ts │ │ ├── token_filter.d.ts │ │ └── tokenizer.d.ts │ │ ├── full_text_search.d.ts │ │ ├── fuzzy │ │ ├── automaton.d.ts │ │ ├── lev1t_parametric_description.d.ts │ │ ├── lev2t_parametric_description.d.ts │ │ ├── levenshtein_automata.d.ts │ │ ├── long.d.ts │ │ ├── parametric_description.d.ts │ │ └── run_automaton.d.ts │ │ ├── index.d.ts │ │ ├── index_searcher.d.ts │ │ ├── inverted_index.d.ts │ │ ├── query_types.d.ts │ │ └── scorer.d.ts │ ├── indexed-storage │ └── src │ │ ├── index.d.ts │ │ └── indexed_storage.d.ts │ ├── local-storage │ └── src │ │ ├── index.d.ts │ │ └── local_storage.d.ts │ ├── loki │ └── src │ │ ├── avl_index.d.ts │ │ ├── clone.d.ts │ │ ├── collection.d.ts │ │ ├── comparators.d.ts │ │ ├── dynamic_view.d.ts │ │ ├── event_emitter.d.ts │ │ ├── index.d.ts │ │ ├── loki.d.ts │ │ ├── operator_packages.d.ts │ │ ├── ranged_indexes.d.ts │ │ ├── result_set.d.ts │ │ └── unique_index.d.ts │ ├── memory-storage │ └── src │ │ ├── index.d.ts │ │ └── memory_storage.d.ts │ └── partitioning-adapter │ └── src │ ├── index.d.ts │ └── partitioning_adapter.d.ts ├── docs ├── comparators.md ├── css │ ├── codemirror │ │ ├── codemirror.css │ │ └── foldgutter.css │ └── javascript_editor.css ├── index.md ├── js │ ├── codemirror │ │ ├── addon │ │ │ ├── edit │ │ │ │ └── matchbrackets.js │ │ │ └── fold │ │ │ │ ├── brace-fold.js │ │ │ │ ├── foldcode.js │ │ │ │ └── foldgutter.js │ │ ├── lib │ │ │ └── codemirror.js │ │ └── mode │ │ │ └── javascript │ │ │ └── javascript.js │ ├── gitter.js │ └── javascript_editor.js ├── operator_packages.md └── ranged_indexes.md ├── integration ├── .gitignore ├── config │ ├── jasmine.json │ ├── karma.amd.config.js │ └── karma.browser.config.js ├── package.json ├── scripts │ └── install_lokidb.ts └── spec │ ├── generic │ ├── full-text-search-language-de.spec.js │ ├── full-text-search-language-en.spec.js │ ├── full-text-search-language.spec.js │ ├── full-text-search.spec.js │ ├── loki.spec.js │ ├── memory-storage.spec.js │ └── partitioning-adapter.spec.js │ ├── helper │ └── integration.helper.js │ ├── node │ └── node-storage.spec.js │ └── web │ ├── indexed-storage.spec.js │ └── local-storage.spec.js ├── mkdocs.yml ├── package-lock.json ├── package.json ├── packages ├── common │ ├── plugin.ts │ └── types.ts ├── fs-storage │ ├── package.json │ ├── spec │ │ └── node │ │ │ └── fs_storage.spec.ts │ ├── src │ │ ├── fs_storage.ts │ │ └── index.ts │ └── webpack.config.js ├── full-text-search-language-de │ ├── package.json │ ├── spec │ │ └── generic │ │ │ └── german_analyzer.spec.ts │ ├── src │ │ ├── german_analyzer.ts │ │ └── index.ts │ └── webpack.config.js ├── full-text-search-language-en │ ├── package.json │ ├── spec │ │ └── generic │ │ │ └── english_analyzer.spec.ts │ ├── src │ │ ├── english_analyzer.ts │ │ └── index.ts │ └── webpack.config.js ├── full-text-search-language │ ├── package.json │ ├── spec │ │ └── helper │ │ │ └── create_lanuage_test.helper.ts │ ├── src │ │ ├── index.ts │ │ └── language.ts │ └── webpack.config.js ├── full-text-search │ ├── package.json │ ├── spec │ │ ├── generic │ │ │ ├── analyzer │ │ │ │ ├── character_filter.spec.ts │ │ │ │ ├── token_filter.spec.ts │ │ │ │ └── tokenizer.spec.ts │ │ │ ├── full_text_search.spec.ts │ │ │ ├── inverted_index.spec.ts │ │ │ └── search │ │ │ │ ├── fuzzy.spec.ts │ │ │ │ └── wildcard.spec.ts │ │ └── node │ │ │ ├── MOCK_DATA.ts │ │ │ ├── QUERIES.ts │ │ │ └── elasticsearch.spec.ts │ ├── src │ │ ├── analyzer │ │ │ ├── analyzer.ts │ │ │ ├── character_filter.ts │ │ │ ├── token_filter.ts │ │ │ └── tokenizer.ts │ │ ├── full_text_search.ts │ │ ├── fuzzy │ │ │ ├── automaton.ts │ │ │ ├── lev1t_parametric_description.ts │ │ │ ├── lev2t_parametric_description.ts │ │ │ ├── levenshtein_automata.ts │ │ │ ├── long.ts │ │ │ ├── parametric_description.ts │ │ │ └── run_automaton.ts │ │ ├── index.ts │ │ ├── index_searcher.ts │ │ ├── inverted_index.ts │ │ ├── query_types.ts │ │ └── scorer.ts │ └── webpack.config.js ├── indexed-storage │ ├── package.json │ ├── spec │ │ └── web │ │ │ └── indexed_storage.spec.ts │ ├── src │ │ ├── index.ts │ │ └── indexed_storage.ts │ └── webpack.config.js ├── local-storage │ ├── package.json │ ├── spec │ │ └── web │ │ │ └── local_storage.spec.ts │ ├── src │ │ ├── index.ts │ │ └── local_storage.ts │ └── webpack.config.js ├── loki │ ├── package.json │ ├── spec │ │ └── generic │ │ │ ├── avl-index.spec.ts │ │ │ ├── changesApi.spec.ts │ │ │ ├── cloning.spec.ts │ │ │ ├── collection.spec.ts │ │ │ ├── comparators.spec.ts │ │ │ ├── dynamic_view.spec.ts │ │ │ ├── eventEmitter.spec.ts │ │ │ ├── joins.spec.ts │ │ │ ├── operator_packages.spec.ts │ │ │ ├── ops.spec.ts │ │ │ ├── persistence.spec.ts │ │ │ ├── remove.spec.ts │ │ │ ├── sortingIndexing.spec.ts │ │ │ ├── stage.spec.ts │ │ │ ├── stats.spec.ts │ │ │ ├── test.spec.ts │ │ │ ├── transforms.spec.ts │ │ │ ├── typed.spec.ts │ │ │ └── unique.spec.ts │ ├── src │ │ ├── avl_index.ts │ │ ├── clone.ts │ │ ├── collection.ts │ │ ├── comparators.ts │ │ ├── dynamic_view.ts │ │ ├── event_emitter.ts │ │ ├── index.ts │ │ ├── loki.ts │ │ ├── operator_packages.ts │ │ ├── ranged_indexes.ts │ │ ├── result_set.ts │ │ ├── uml.png │ │ └── unique_index.ts │ └── webpack.config.js ├── memory-storage │ ├── package.json │ ├── spec │ │ └── generic │ │ │ └── memory_storage.spec.ts │ ├── src │ │ ├── index.ts │ │ └── memory_storage.ts │ └── webpack.config.js └── partitioning-adapter │ ├── package.json │ ├── spec │ └── generic │ │ └── partitioning.spec.ts │ ├── src │ ├── index.ts │ └── partitioning_adapter.ts │ └── webpack.config.js ├── scripts ├── build.ts ├── common.ts └── deploy.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 2 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .idea/ 3 | 4 | # NODE 5 | node_modules/ 6 | 7 | # Tests 8 | coverage/ 9 | .nyc_output 10 | 11 | # Typescript 12 | .ts/ 13 | 14 | # Build artifacts 15 | build/ 16 | dist/packages-dist/ 17 | packages/**/*.html 18 | site/ 19 | docs/api/ 20 | 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - "3.5" 4 | node_js: 5 | - "10" 6 | 7 | dist: trusty 8 | sudo: required 9 | 10 | env: 11 | global: 12 | - GIT_NAME: Travis CI 13 | - GIT_EMAIL: builds@travis-ci.org 14 | - GIT_BRANCH: master 15 | 16 | services: 17 | - elasticsearch 18 | 19 | addons: 20 | chrome: stable 21 | 22 | before_install: 23 | - pip3 install mkdocs 24 | - pip3 install mkdocs-material 25 | 26 | script: 27 | - npm install 28 | - PATH=${PATH}:\.\/node_modules\/\.bin/ 29 | - npm run lint 30 | - npm test 31 | - codecov 32 | - npm run docs 33 | - mkdocs build 34 | - npm run build 35 | - npm run build -- --dist 36 | - npm install --prefix integration 37 | - npm run test:integration 38 | 39 | after_success: 40 | - npm run deploy 41 | -------------------------------------------------------------------------------- /config/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "packages/*/spec", 3 | "spec_files": [ 4 | "generic/**/*.spec.[jt]s", 5 | "node/**/*.spec.[jt]s" 6 | ], 7 | "helpers": [ 8 | "../../../node_modules/ts-node/register/index.js", 9 | "../../../node_modules/jasmine-expect/index.js", 10 | "../../common/spec/helper/**/*helper.[jt]s", 11 | "helper/**/*.[jt]s" 12 | ], 13 | "stopSpecOnExpectationFailure": false, 14 | "random": false 15 | } 16 | -------------------------------------------------------------------------------- /config/nycrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "reporter": [ 3 | "text-summary", 4 | "html" 5 | ], 6 | "report-dir": "./coverage/", 7 | "temp-directory": "./coverage/" 8 | } 9 | -------------------------------------------------------------------------------- /config/nycrc.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension": [ 3 | ".ts" 4 | ], 5 | "reporter": [ 6 | "text-summary", 7 | "json" 8 | ], 9 | "exclude": [ 10 | "**/*.helper.[jt]s", 11 | "**/*.spec.[jt]s", 12 | "**/spec/**/*.[jt]s" 13 | ], 14 | "report-dir": "./coverage/node/" 15 | } 16 | -------------------------------------------------------------------------------- /config/tsconfig.tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "../types/", 5 | "sourceMap": true, 6 | "declaration": true, 7 | "moduleResolution": "classic", 8 | "strictPropertyInitialization": true, 9 | "alwaysStrict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "suppressImplicitAnyIndexErrors": true, 15 | "target": "es6", 16 | "lib": [ 17 | "es2017" 18 | ], 19 | "typeRoots": [ 20 | "node_modules/@types" 21 | ], 22 | "types": [ 23 | "jasmine", 24 | "jasmine-expect", 25 | "node" 26 | ] 27 | }, 28 | "include": [ 29 | "../packages/**/*.ts" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /config/tsconfig.webpack.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "../types/", 5 | "sourceMap": true, 6 | "declaration": true, 7 | "moduleResolution": "classic", 8 | "strictPropertyInitialization": true, 9 | "alwaysStrict": true, 10 | "noImplicitAny": true, 11 | "noImplicitReturns": true, 12 | "noUnusedLocals": true, 13 | "noUnusedParameters": true, 14 | "suppressImplicitAnyIndexErrors": true, 15 | "target": "es6", 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ], 20 | "typeRoots": [ 21 | "node_modules/@types" 22 | ], 23 | "types": [ 24 | "jasmine", 25 | "jasmine-expect", 26 | "node" 27 | ] 28 | }, 29 | "include": [ 30 | "../packages/*/src/**/*.ts" 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /config/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "../node_modules/vrsource-tslint-rules/rules", 4 | "../node_modules/tslint-eslint-rules/dist/rules" 5 | ], 6 | "extends": [ 7 | "tslint-eslint-rules" 8 | ], 9 | "rules": { 10 | "no-console": [true, "log"], 11 | "no-duplicate-imports": true, 12 | "no-duplicate-variable": true, 13 | "no-jasmine-focus": true, 14 | "no-var-keyword": true, 15 | "semicolon": [true], 16 | "variable-name": [true, "ban-keywords"], 17 | "no-inner-declarations": [true, "function"], 18 | "quotemark": [true, "double"], 19 | "eofline": true, 20 | "ter-indent": [true, 2, { 21 | "SwitchCase": 1 22 | }], 23 | "whitespace": [true, "check-branch", "check-decl", "check-operator", "check-module", "check-separator", 24 | "check-rest-spread", "check-type", "check-type", "check-typecast", "check-type-operator", "check-preblock"], 25 | "no-trailing-whitespace": true 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/loki/src/unique_index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UniqueIndex { 2 | private _field; 3 | private _lokiMap; 4 | private _valMap; 5 | /** 6 | * Constructs an unique index object. 7 | * @param {string} propertyField - the property field to index 8 | */ 9 | constructor(propertyField: string); 10 | /** 11 | * Sets a document's unique index. 12 | * @param {number} id loki id to associate with value 13 | * @param {*} value value to associate with id 14 | */ 15 | set(id: number, value: any): void; 16 | /** 17 | * Returns the $loki id of an unique value. 18 | * @param {*} value the value to retrieve a loki id match for 19 | */ 20 | get(value: any): number; 21 | /** 22 | * Updates a document's unique index. 23 | * @param {number} id (loki) id of document to update the value to 24 | * @param {*} value value to associate with loki id 25 | */ 26 | update(id: number, value: any): void; 27 | /** 28 | * Removes an unique index. 29 | * @param {number} id (loki) id to remove from index 30 | */ 31 | remove(id: number): void; 32 | /** 33 | * Clears the unique index. 34 | */ 35 | clear(): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/fs-storage/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-de/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language-en/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search-language/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/loki/src/unique_index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UniqueIndex { 2 | private _field; 3 | private _lokiMap; 4 | private _valMap; 5 | /** 6 | * Constructs an unique index object. 7 | * @param {string} propertyField - the property field to index 8 | */ 9 | constructor(propertyField: string); 10 | /** 11 | * Sets a document's unique index. 12 | * @param {number} id loki id to associate with value 13 | * @param {*} value value to associate with id 14 | */ 15 | set(id: number, value: any): void; 16 | /** 17 | * Returns the $loki id of an unique value. 18 | * @param {*} value the value to retrieve a loki id match for 19 | */ 20 | get(value: any): number; 21 | /** 22 | * Updates a document's unique index. 23 | * @param {number} id (loki) id of document to update the value to 24 | * @param {*} value value to associate with loki id 25 | */ 26 | update(id: number, value: any): void; 27 | /** 28 | * Removes an unique index. 29 | * @param {number} id (loki) id to remove from index 30 | */ 31 | remove(id: number): void; 32 | /** 33 | * Clears the unique index. 34 | */ 35 | clear(): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/full-text-search/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/loki/src/unique_index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UniqueIndex { 2 | private _field; 3 | private _lokiMap; 4 | private _valMap; 5 | /** 6 | * Constructs an unique index object. 7 | * @param {string} propertyField - the property field to index 8 | */ 9 | constructor(propertyField: string); 10 | /** 11 | * Sets a document's unique index. 12 | * @param {number} id loki id to associate with value 13 | * @param {*} value value to associate with id 14 | */ 15 | set(id: number, value: any): void; 16 | /** 17 | * Returns the $loki id of an unique value. 18 | * @param {*} value the value to retrieve a loki id match for 19 | */ 20 | get(value: any): number; 21 | /** 22 | * Updates a document's unique index. 23 | * @param {number} id (loki) id of document to update the value to 24 | * @param {*} value value to associate with loki id 25 | */ 26 | update(id: number, value: any): void; 27 | /** 28 | * Removes an unique index. 29 | * @param {number} id (loki) id to remove from index 30 | */ 31 | remove(id: number): void; 32 | /** 33 | * Clears the unique index. 34 | */ 35 | clear(): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/indexed-storage/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/loki/src/unique_index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UniqueIndex { 2 | private _field; 3 | private _lokiMap; 4 | private _valMap; 5 | /** 6 | * Constructs an unique index object. 7 | * @param {string} propertyField - the property field to index 8 | */ 9 | constructor(propertyField: string); 10 | /** 11 | * Sets a document's unique index. 12 | * @param {number} id loki id to associate with value 13 | * @param {*} value value to associate with id 14 | */ 15 | set(id: number, value: any): void; 16 | /** 17 | * Returns the $loki id of an unique value. 18 | * @param {*} value the value to retrieve a loki id match for 19 | */ 20 | get(value: any): number; 21 | /** 22 | * Updates a document's unique index. 23 | * @param {number} id (loki) id of document to update the value to 24 | * @param {*} value value to associate with loki id 25 | */ 26 | update(id: number, value: any): void; 27 | /** 28 | * Removes an unique index. 29 | * @param {number} id (loki) id to remove from index 30 | */ 31 | remove(id: number): void; 32 | /** 33 | * Clears the unique index. 34 | */ 35 | clear(): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/local-storage/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/loki/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/loki/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/analyzer/analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { CharacterFilter } from "./character_filter"; 2 | import { Tokenizer, whitespaceTokenizer } from "./tokenizer"; 3 | import { lowercaseTokenFilter, TokenFilter } from "./token_filter"; 4 | /** 5 | * A analyzer converts a string into tokens which are added to the inverted index for searching. 6 | */ 7 | export interface Analyzer { 8 | /** 9 | * The character filters of the analyzer. 10 | */ 11 | char_filter?: CharacterFilter[]; 12 | /** 13 | * The tokenizer of the analyzer. 14 | */ 15 | tokenizer: Tokenizer; 16 | /** 17 | * The token filters of the analyzer. 18 | */ 19 | token_filter?: TokenFilter[]; 20 | } 21 | /** 22 | * Analyzes a given string. 23 | * @param {Analyzer} analyzer - the analyzer 24 | * @param {string} str - the string 25 | * @returns {string[]} - the tokens 26 | */ 27 | export declare function analyze(analyzer: Analyzer, str: string): string[]; 28 | /** 29 | * An analyzer with the whitespace tokenizer and the lowercase token filter. 30 | */ 31 | export declare class StandardAnalyzer implements Analyzer { 32 | tokenizer: typeof whitespaceTokenizer; 33 | token_filter: (typeof lowercaseTokenFilter)[]; 34 | } 35 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/loki/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/loki/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/loki/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/loki/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/loki/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/loki/types/loki/src/unique_index.d.ts: -------------------------------------------------------------------------------- 1 | export declare class UniqueIndex { 2 | private _field; 3 | private _lokiMap; 4 | private _valMap; 5 | /** 6 | * Constructs an unique index object. 7 | * @param {string} propertyField - the property field to index 8 | */ 9 | constructor(propertyField: string); 10 | /** 11 | * Sets a document's unique index. 12 | * @param {number} id loki id to associate with value 13 | * @param {*} value value to associate with id 14 | */ 15 | set(id: number, value: any): void; 16 | /** 17 | * Returns the $loki id of an unique value. 18 | * @param {*} value the value to retrieve a loki id match for 19 | */ 20 | get(value: any): number; 21 | /** 22 | * Updates a document's unique index. 23 | * @param {number} id (loki) id of document to update the value to 24 | * @param {*} value value to associate with loki id 25 | */ 26 | update(id: number, value: any): void; 27 | /** 28 | * Removes an unique index. 29 | * @param {number} id (loki) id to remove from index 30 | */ 31 | remove(id: number): void; 32 | /** 33 | * Clears the unique index. 34 | */ 35 | clear(): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/loki/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/loki/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/memory-storage/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/common/plugin.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | export declare const PLUGINS: void; 5 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/common/types.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | export interface StorageAdapter { 6 | loadDatabase(dbname: string): Promise; 7 | saveDatabase?(dbname: string, serialization: string): Promise; 8 | deleteDatabase?(dbname: string): Promise; 9 | mode?: string; 10 | exportDatabase?(dbname: string, dbref: Loki): Promise; 11 | } 12 | export declare type Doc = T & { 13 | $loki: number; 14 | meta?: { 15 | created: number; 16 | revision: number; 17 | version: number; 18 | updated?: number; 19 | }; 20 | }; 21 | export interface Dict { 22 | [index: string]: T; 23 | [index: number]: T; 24 | } 25 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/fs-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | export { FSStorage }; 3 | export default FSStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search-language-de/src/german_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class GermanAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search-language-de/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export { GermanAnalyzer }; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search-language-en/src/english_analyzer.d.ts: -------------------------------------------------------------------------------- 1 | import { Analyzer } from "../../full-text-search/src/analyzer/analyzer"; 2 | export declare class EnglishAnalyzer implements Analyzer { 3 | tokenizer: (str: string) => string[]; 4 | token_filter: ((token: string) => string)[]; 5 | } 6 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search-language-en/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export { EnglishAnalyzer }; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search-language/src/index.d.ts: -------------------------------------------------------------------------------- 1 | export { generateStopWordFilter, generateTrimmer, Among, SnowballProgram } from "./language"; 2 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/analyzer/character_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export declare type CharacterFilter = (value: string) => string; 5 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/analyzer/token_filter.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export declare type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | /** 6 | * Converts a token to lowercase. 7 | * @param {string} token - the token 8 | * @returns {string} - the lowercased token 9 | */ 10 | export declare function lowercaseTokenFilter(token: string): string; 11 | /** 12 | * Converts a token to uppercase. 13 | * @param {string} token - the token 14 | * @returns {string} - the uppercased token 15 | */ 16 | export declare function uppercaseTokenFilter(token: string): string; 17 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/analyzer/tokenizer.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export declare type Tokenizer = (value: string) => string[]; 5 | /** 6 | * Splits a string at whitespace characters into tokens. 7 | * @param {string} value - the string 8 | * @returns {string[]} - the tokens 9 | */ 10 | export declare function whitespaceTokenizer(value: string): string[]; 11 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/automaton.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Transition with dest, min and max. 3 | * @hidden 4 | */ 5 | export declare type Transition = [number, number, number]; 6 | /** 7 | * @type {number} 8 | * @hidden 9 | */ 10 | export declare const MIN_CODE_POINT = 0; 11 | /** 12 | * @type {number} 13 | * @hidden 14 | */ 15 | export declare const MAX_CODE_POINT = 1114111; 16 | /** 17 | * From org/apache/lucene/util/automaton/Automaton.java 18 | * @hidden 19 | */ 20 | export declare class Automaton { 21 | private _stateTransitions; 22 | private _accept; 23 | private _nextState; 24 | private _currState; 25 | private _transitions; 26 | constructor(); 27 | isAccept(n: number): boolean; 28 | createState(): number; 29 | setAccept(state: number, accept: boolean): void; 30 | finishState(): void; 31 | private _finishCurrentState(); 32 | getStartPoints(): number[]; 33 | step(state: number, label: number): number; 34 | getNumStates(): number; 35 | addTransition(source: number, dest: number, min: number, max: number): void; 36 | } 37 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/lev1t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev1TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev1TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/lev2t_parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { ParametricDescription } from "./parametric_description"; 2 | /** 3 | * From org/apache/lucene/util/automaton/Lev2TParametricDescription.java 4 | * @hidden 5 | */ 6 | export declare class Lev2TParametricDescription extends ParametricDescription { 7 | constructor(w: number); 8 | transition(absState: number, position: number, vector: number): number; 9 | } 10 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/levenshtein_automata.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java 4 | * @hidden 5 | */ 6 | export declare class LevenshteinAutomata { 7 | private _word; 8 | private _numRanges; 9 | private _rangeLower; 10 | private _rangeUpper; 11 | private _description; 12 | private _alphabet; 13 | private _editDistance; 14 | constructor(input: number[], editDistance: number); 15 | /** 16 | * Transforms the NDFA to a DFA. 17 | * @returns {Automaton} 18 | */ 19 | toAutomaton(): Automaton; 20 | private _getVector(x, pos, end); 21 | } 22 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/long.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Class supports 64Bit integer operations. 3 | * A cut-down version of dcodeIO/long.js. 4 | * @hidden 5 | */ 6 | export declare class Long { 7 | private _low; 8 | private _high; 9 | constructor(low?: number, high?: number); 10 | /** 11 | * Returns this long with bits arithmetically shifted to the right by the given amount. 12 | * @param {number} numBits - number of bits 13 | * @returns {Long} the long 14 | */ 15 | shiftRight(numBits: number): Long; 16 | /** 17 | * Returns this long with bits arithmetically shifted to the left by the given amount. 18 | * @param {number} numBits - number of bits 19 | * @returns {Long} the long 20 | */ 21 | shiftLeft(numBits: number): Long; 22 | /** 23 | * Returns the bitwise AND of this Long and the specified. 24 | * @param {Long} other - the other Long 25 | * @returns {Long} the long 26 | */ 27 | and(other: Long): Long; 28 | /** 29 | * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. 30 | * @returns {number} 31 | */ 32 | toInt(): number; 33 | } 34 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/parametric_description.d.ts: -------------------------------------------------------------------------------- 1 | import { Long } from "./long"; 2 | /** 3 | * From org/apache/lucene/util/automaton/LevenshteinAutomata.java#ParametricDescription 4 | * @hidden 5 | */ 6 | export declare class ParametricDescription { 7 | protected _w: number; 8 | private _n; 9 | private _minErrors; 10 | constructor(w: number, n: number, minErrors: number[]); 11 | /** 12 | * Return the number of states needed to compute a Levenshtein DFA 13 | */ 14 | size(): number; 15 | /** 16 | * Returns true if the state in any Levenshtein DFA is an accept state (final state). 17 | */ 18 | isAccept(absState: number): boolean; 19 | /** 20 | * Returns the position in the input word for a given state. 21 | * This is the minimal boundary for the state. 22 | */ 23 | getPosition(absState: number): number; 24 | static unpack(data: Long[], index: number, bitsPerValue: number): number; 25 | } 26 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/fuzzy/run_automaton.d.ts: -------------------------------------------------------------------------------- 1 | import { Automaton } from "./automaton"; 2 | /** 3 | * From org/apache/lucene/util/automaton/RunAutomaton.java 4 | * @hidden 5 | */ 6 | export declare class RunAutomaton { 7 | private _points; 8 | private _accept; 9 | private _transitions; 10 | private _classmap; 11 | constructor(automaton: Automaton); 12 | getCharClass(c: number): number; 13 | step(state: number, c: number): number; 14 | isAccept(state: number): boolean; 15 | } 16 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | export { FullTextSearch, analyze, StandardAnalyzer, whitespaceTokenizer, lowercaseTokenFilter, uppercaseTokenFilter }; 6 | export default FullTextSearch; 7 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/full-text-search/src/index_searcher.d.ts: -------------------------------------------------------------------------------- 1 | import { Scorer } from "./scorer"; 2 | import { InvertedIndex } from "./inverted_index"; 3 | import { Query } from "./query_types"; 4 | import { Dict } from "../../common/types"; 5 | /** 6 | * @hidden 7 | */ 8 | export declare class IndexSearcher { 9 | private _invIdxs; 10 | private _docs; 11 | private _scorer; 12 | /** 13 | * Constructs an index searcher. 14 | * @param {Dict} invIdxs - the inverted indexes 15 | * @param {Set} docs - the ids of the documents 16 | */ 17 | constructor(invIdxs: Dict, docs: Set); 18 | search(query: Query): Scorer.ScoreResults; 19 | setDirty(): void; 20 | private _recursive(query, doScoring); 21 | private _getUnique(queries, doScoring, queryResults); 22 | private _getAll(queries, doScoring, queryResults?); 23 | } 24 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/indexed-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | export { IndexedStorage }; 3 | export default IndexedStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/local-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | export { LocalStorage }; 3 | export default LocalStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/loki/src/clone.d.ts: -------------------------------------------------------------------------------- 1 | export declare type CloneMethod = "parse-stringify" | "deep" | "shallow" | "shallow-recurse"; 2 | /** 3 | * @hidden 4 | */ 5 | export declare function clone(data: T, method?: CloneMethod): T; 6 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/loki/src/comparators.d.ts: -------------------------------------------------------------------------------- 1 | export interface ILokiComparer { 2 | (a: T, b: T): -1 | 0 | 1; 3 | } 4 | export interface IComparatorMap { 5 | [name: string]: ILokiComparer; 6 | } 7 | /** Map/Register of named ILokiComparer functions returning -1, 0, 1 for lt/eq/gt assertions for two passed parameters */ 8 | export declare let ComparatorMap: IComparatorMap; 9 | /** Typescript-friendly factory for strongly typed 'js' comparators */ 10 | export declare function CreateJavascriptComparator(): ILokiComparer; 11 | /** Typescript-friendly factory for strongly typed 'abstract js' comparators */ 12 | export declare function CreateAbstractJavascriptComparator(): ILokiComparer; 13 | /** 14 | * Comparator which attempts to deal with deal with dates at comparator level. 15 | * Should work for dates in any of the object, string, and number formats 16 | */ 17 | export declare function CreateAbstractDateJavascriptComparator(): ILokiComparer; 18 | /** Typescript-friendly factory for strongly typed 'loki' comparators */ 19 | export declare function CreateLokiComparator(): ILokiComparer; 20 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/loki/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | export { Loki, Collection }; 4 | export default Loki; 5 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/loki/src/ranged_indexes.d.ts: -------------------------------------------------------------------------------- 1 | import { ILokiComparer } from "./comparators"; 2 | export declare type RangedValueOperator = "$gt" | "$gte" | "$lt" | "$lte" | "$eq" | "$neq" | "$between"; 3 | export interface IRangedIndexRequest { 4 | op: RangedValueOperator; 5 | val: T; 6 | high?: T; 7 | } 8 | /** Defines interface which all loki ranged indexes need to implement */ 9 | export interface IRangedIndex { 10 | insert(id: number, val: T): void; 11 | update(id: number, val: T): void; 12 | remove(id: number): void; 13 | restore(tree: any): void; 14 | backup(): IRangedIndex; 15 | rangeRequest(range?: IRangedIndexRequest): number[]; 16 | validateIndex(): boolean; 17 | } 18 | /** Hash Interface for global ranged index factory map*/ 19 | export interface IRangedIndexFactoryMap { 20 | [name: string]: (name: string, comparator: ILokiComparer) => IRangedIndex; 21 | } 22 | /** Map/Register of named factory functions returning IRangedIndex instances */ 23 | export declare let RangedIndexFactoryMap: IRangedIndexFactoryMap; 24 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/memory-storage/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | export { MemoryStorage }; 3 | export default MemoryStorage; 4 | -------------------------------------------------------------------------------- /dist/packages/partitioning-adapter/types/partitioning-adapter/src/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | export { PartitioningAdapter }; 3 | export default PartitioningAdapter; 4 | -------------------------------------------------------------------------------- /docs/css/codemirror/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /docs/css/javascript_editor.css: -------------------------------------------------------------------------------- 1 | .jse-editor { 2 | display: block; 3 | position: relative; 4 | border: 1px solid #d5d5d5; 5 | font-size: 91.1%; 6 | } 7 | 8 | .jse-button { 9 | margin: 5px; 10 | flex: 1; 11 | font-size: 12px; 12 | } 13 | 14 | .jse-output { 15 | padding: 10px 10px 10px 15px; 16 | font-size: 11px; 17 | font-family: monaco, monospace; 18 | max-height: 15em; 19 | border-top: 1px solid #d5d5d5; 20 | background: transparent; 21 | overflow-y: scroll; 22 | } 23 | 24 | .jse-output span { 25 | display: block; 26 | } 27 | 28 | .jse-output-log { 29 | } 30 | 31 | .jse-output-error { 32 | color: red; 33 | } 34 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/LokiJS-Forge/LokiDB.svg?branch=master)](https://travis-ci.org/LokiJS-Forge/LokiDB) 2 | [![Coverage Status](https://coveralls.io/repos/github/LokiJS-Forge/LokiDB/badge.svg?branch=feature%2Fadd_build_system)](https://coveralls.io/github/LokiJS-Forge/LokiDB?branch=feature%2Fadd_build_system) 3 | 4 | 5 | # Welcome to LokiDB 6 | - Javascript Quickstart 7 | - Typescript Quickstart 8 | 9 | # API Reference 10 | - [Check it out](api/index.html). 11 | 12 | # Topics 13 | - Query Examples 14 | - Persistence 15 | - CollectionTransforms 16 | - [Understanding Comparators](./comparators.md) 17 | - [LokiOperatorPackage](./operator_packages.md) 18 | - [Loki Ranged Indexes](./ranged_indexes.md) 19 | 20 | # Getting Started 21 | 22 | ```javascript 23 | 24 | ``` -------------------------------------------------------------------------------- /docs/js/gitter.js: -------------------------------------------------------------------------------- 1 | ((window.gitter = {}).chat = {}).options = { 2 | room: 'techfort/LokiJS' 3 | }; 4 | $.getScript('https://sidecar.gitter.im/dist/sidecar.v1.js', function() { }); 5 | -------------------------------------------------------------------------------- /integration/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | package-lock.json 4 | -------------------------------------------------------------------------------- /integration/config/jasmine.json: -------------------------------------------------------------------------------- 1 | { 2 | "spec_dir": "integration", 3 | "spec_files": [ 4 | "spec/generic/*.spec.js", 5 | "spec/node/*.spec.js" 6 | ], 7 | "helpers": [ 8 | "spec/helper/*.helper.js", 9 | "../node_modules/jasmine-expect/index.js" 10 | ], 11 | "stopSpecOnExpectationFailure": false, 12 | "random": false 13 | } 14 | -------------------------------------------------------------------------------- /integration/config/karma.amd.config.js: -------------------------------------------------------------------------------- 1 | /* global process, require, module, require */ 2 | module.exports = function (config) { 3 | const configuration = { 4 | frameworks: ["jasmine", "jasmine-matchers"], 5 | browsers: ["ChromeHeadless"], 6 | basePath: "../", 7 | files: [ 8 | {pattern: "node_modules/requirejs/require.js", watched: false}, 9 | {pattern: "spec/helper/*.helper.js", watched: false}, 10 | {pattern: "spec/generic/*.spec.js", watched: false}, 11 | {pattern: "spec/web/*.spec.js", watched: false}, 12 | {pattern: "node_modules/@lokidb/**/lokidb.*.js", watched: false, included: false, served: true, nocache: true} 13 | ], 14 | reporters: ["progress"], 15 | mime: { 16 | "text/x-typescript": ["js"] 17 | }, 18 | plugins: [ 19 | "karma-chrome-launcher", 20 | "karma-jasmine", 21 | "karma-jasmine-matchers", 22 | ], 23 | }; 24 | 25 | config.set(configuration); 26 | }; 27 | -------------------------------------------------------------------------------- /integration/config/karma.browser.config.js: -------------------------------------------------------------------------------- 1 | /* global process, require, module, require */ 2 | module.exports = function (config) { 3 | const configuration = { 4 | frameworks: ["jasmine", "jasmine-matchers"], 5 | browsers: ["ChromeHeadless"], 6 | basePath: "../", 7 | files: [ 8 | {pattern: "spec/helper/*.helper.js", watched: false}, 9 | {pattern: "spec/generic/*.spec.js", watched: false}, 10 | {pattern: "spec/web/*.spec.js", watched: false}, 11 | {pattern: "node_modules/@lokidb/**/lokidb.*.js", watched: false, included: false, served: true, nocache: true} 12 | ], 13 | reporters: ["progress"], 14 | mime: { 15 | "text/x-typescript": ["js"] 16 | }, 17 | plugins: [ 18 | "karma-chrome-launcher", 19 | "karma-jasmine", 20 | "karma-jasmine-matchers", 21 | ], 22 | }; 23 | 24 | config.set(configuration); 25 | }; 26 | -------------------------------------------------------------------------------- /integration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/integration", 3 | "version": "1.0.0", 4 | "description": "Internal integration environment.", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "scripts": { 11 | "postinstall": "../node_modules/.bin/ts-node -P ../tsconfig.json scripts/install_lokidb.ts" 12 | }, 13 | "devDependencies": { 14 | "requirejs": "^2.3.5" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /integration/scripts/install_lokidb.ts: -------------------------------------------------------------------------------- 1 | import * as process from "process"; 2 | import {copy, makeDir} from "../../scripts/common"; 3 | 4 | makeDir("node_modules/@lokidb"); 5 | copy("../dist/packages-dist/*", "node_modules/@lokidb/", true); 6 | 7 | process.exit(0); 8 | -------------------------------------------------------------------------------- /integration/spec/generic/full-text-search-language-de.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("full-text-search-language-de", 2 | ["full-text-search-language"], 3 | { 4 | "GermanAnalyzer": (GermanAnalyzer) => { 5 | const ga = new GermanAnalyzer(); 6 | expect(ga).toHaveMember("tokenizer"); 7 | expect(ga).toHaveMember("token_filter"); 8 | }, 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /integration/spec/generic/full-text-search-language-en.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("full-text-search-language-en", 2 | ["full-text-search-language"], 3 | { 4 | "EnglishAnalyzer": (EnglishAnalyzer) => { 5 | const ea = new EnglishAnalyzer(); 6 | expect(ea).toHaveMember("tokenizer"); 7 | expect(ea).toHaveMember("token_filter"); 8 | }, 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /integration/spec/generic/full-text-search-language.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("full-text-search-language", 2 | [], 3 | { 4 | "generateStopWordFilter": (generateStopWordFilter) => { 5 | expect(generateStopWordFilter).toBeFunction(); 6 | }, 7 | "generateTrimmer": (generateTrimmer) => { 8 | expect(generateTrimmer).toBeFunction(); 9 | }, 10 | "Among": (Among) => { 11 | const among = new Among("1", 1, 1); 12 | expect(among).toHaveMember("s"); 13 | expect(among).toHaveMember("method"); 14 | }, 15 | "SnowballProgram": (SnowballProgram) => { 16 | const sp = new SnowballProgram(); 17 | expect(sp).toHaveMethod("setCurrent"); 18 | expect(sp).toHaveMethod("getCurrent"); 19 | } 20 | } 21 | ); 22 | -------------------------------------------------------------------------------- /integration/spec/generic/full-text-search.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("full-text-search", 2 | [], 3 | { 4 | "FullTextSearch": (FullTextSearch) => { 5 | expect(FullTextSearch.Analyzer).toBeDefined(); 6 | expect(FullTextSearch.Tokenizer).toBeDefined(); 7 | expect(FullTextSearch.TokenFilter).toBeDefined(); 8 | 9 | const fts = new FullTextSearch(); 10 | expect(fts).toHaveMethod("search"); 11 | expect(fts).toHaveMethod("removeDocument"); 12 | }, 13 | "analyze": (analyze) => { 14 | expect(analyze).toBeFunction(); 15 | }, 16 | "StandardAnalyzer": (StandardAnalyzer) => { 17 | const sa = new StandardAnalyzer(); 18 | expect(sa).toHaveMember("tokenizer"); 19 | expect(sa).toHaveMember("token_filter"); 20 | }, 21 | "whitespaceTokenizer": (whitespaceTokenizer) => { 22 | expect(whitespaceTokenizer).toBeFunction(); 23 | }, 24 | "lowercaseTokenFilter": (lowercaseTokenFilter) => { 25 | expect(lowercaseTokenFilter).toBeFunction(); 26 | }, 27 | "uppercaseTokenFilter": (uppercaseTokenFilter) => { 28 | expect(uppercaseTokenFilter).toBeFunction(); 29 | } 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /integration/spec/generic/loki.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("loki", 2 | [], 3 | { 4 | "Loki": (Loki) => { 5 | expect(Loki.Collection).toBeDefined(); 6 | 7 | const loki = new Loki(); 8 | expect(loki).toHaveMethod("initializePersistence"); 9 | expect(loki).toHaveMethod("addCollection"); 10 | }, 11 | "Collection": (Collection) => { 12 | const coll = new Collection(); 13 | expect(coll).toHaveMethod("insert"); 14 | expect(coll).toHaveMethod("find"); 15 | } 16 | } 17 | ); 18 | -------------------------------------------------------------------------------- /integration/spec/generic/memory-storage.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("memory-storage", 2 | [], 3 | { 4 | "MemoryStorage": (MemoryStorage) => { 5 | const ms = new MemoryStorage(); 6 | expect(ms).toHaveMember("loadDatabase"); 7 | expect(ms).toHaveMember("saveDatabase"); 8 | } 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /integration/spec/generic/partitioning-adapter.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("partitioning-adapter", 2 | [], 3 | { 4 | "PartitioningAdapter": (PartitioningAdapter) => { 5 | const ms = new PartitioningAdapter({}); 6 | expect(ms).toHaveMember("loadDatabase"); 7 | expect(ms).toHaveMember("exportDatabase"); 8 | } 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /integration/spec/node/node-storage.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("fs-storage", 2 | [], 3 | { 4 | "FSStorage": (FSStorage) => { 5 | const ms = new FSStorage(); 6 | expect(ms).toHaveMember("loadDatabase"); 7 | expect(ms).toHaveMember("saveDatabase"); 8 | } 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /integration/spec/web/indexed-storage.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("indexed-storage", 2 | [], 3 | { 4 | "IndexedStorage": (IndexedStorage) => { 5 | const is = new IndexedStorage(); 6 | expect(is).toHaveMember("loadDatabase"); 7 | expect(is).toHaveMember("saveDatabase"); 8 | expect(is).toHaveMember("getDatabaseList"); 9 | } 10 | } 11 | ); 12 | -------------------------------------------------------------------------------- /integration/spec/web/local-storage.spec.js: -------------------------------------------------------------------------------- 1 | test_integration("local-storage", 2 | [], 3 | { 4 | "LocalStorage": (LocalStorage) => { 5 | const ls = new LocalStorage(); 6 | expect(ls).toHaveMember("loadDatabase"); 7 | expect(ls).toHaveMember("saveDatabase"); 8 | }, 9 | } 10 | ); 11 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | copyright: Copyright © 2017 2 | 3 | site_name: LokiDB 4 | repo_url: https://github.com/LokiJS-Forge/LokiDB 5 | repo_name: GitHub 6 | 7 | extra_css: 8 | - css/codemirror/codemirror.css 9 | - css/codemirror/foldgutter.css 10 | - css/javascript_editor.css 11 | 12 | extra_javascript: 13 | - js/gitter.js 14 | - js/javascript_editor.js 15 | - js/codemirror/lib/codemirror.js 16 | - js/codemirror/addon/fold/brace-fold.js 17 | - js/codemirror/addon/fold/foldcode.js 18 | - js/codemirror/addon/fold/foldgutter.js 19 | - js/codemirror/addon/edit/matchbrackets.js 20 | - js/codemirror/mode/javascript/javascript.js 21 | 22 | 23 | theme: readthedocs 24 | -------------------------------------------------------------------------------- /packages/common/plugin.ts: -------------------------------------------------------------------------------- 1 | function getGlobal(): any { 2 | let glob; 3 | (function (global) { 4 | glob = global; 5 | })(global !== undefined && global || this); 6 | return glob; 7 | } 8 | 9 | 10 | function create(): void { 11 | const global = getGlobal(); 12 | const sym = Symbol.for("LOKI") as any; 13 | if (global[sym] === undefined) { 14 | global[sym] = { 15 | }; 16 | } 17 | return global[sym]; 18 | } 19 | 20 | /** 21 | * @hidden 22 | */ 23 | export const PLUGINS = create(); 24 | -------------------------------------------------------------------------------- /packages/common/types.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @hidden 3 | */ 4 | import { Loki } from "../loki/src/loki"; 5 | 6 | export interface StorageAdapter { 7 | loadDatabase(dbname: string): Promise; 8 | 9 | saveDatabase?(dbname: string, serialization: string): Promise; 10 | 11 | deleteDatabase?(dbname: string): Promise; 12 | 13 | mode?: string; 14 | 15 | exportDatabase?(dbname: string, dbref: Loki): Promise; 16 | } 17 | 18 | export type Doc = T & { 19 | $loki: number; 20 | meta?: { 21 | created: number; 22 | revision: number; 23 | version: number, 24 | updated?: number; 25 | }; 26 | }; 27 | 28 | export interface Dict { 29 | [index: string]: T; 30 | 31 | [index: number]: T; 32 | } 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /packages/fs-storage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/fs-storage", 3 | "description": "A persistence adapter which persists to node fs module storage.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.fs-storage.js", 11 | "types": "./types/fs-storage/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/fs-storage/src/index.ts: -------------------------------------------------------------------------------- 1 | import { FSStorage } from "./fs_storage"; 2 | 3 | export {FSStorage}; 4 | export default FSStorage; 5 | -------------------------------------------------------------------------------- /packages/fs-storage/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "fs_storage.ts"), 7 | filename: "lokidb.fs-storage.js", 8 | library: "@lokidb/fs-storage", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki", 11 | "fs": "fs" 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/full-text-search-language-de/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/full-text-search-language-de", 3 | "description": "A german language analyzer.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.full-text-search-language-de.js", 11 | "types": "./types/full-text-search-language-de/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/full-text-search": "0", 14 | "@lokidb/full-text-search-language": "0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/full-text-search-language-de/src/index.ts: -------------------------------------------------------------------------------- 1 | import { GermanAnalyzer } from "./german_analyzer"; 2 | export {GermanAnalyzer}; 3 | export default GermanAnalyzer; 4 | -------------------------------------------------------------------------------- /packages/full-text-search-language-de/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.full-text-search-language-de.js", 8 | library: "@lokidb/full-text-search-language-de", 9 | externals: { 10 | "../../full-text-search-language/src/language": "@lokidb/full-text-search-language", 11 | "../../full-text-search/src/index": "@lokidb/full-text-search" 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/full-text-search-language-en/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/full-text-search-language-en", 3 | "description": "An English language analyzer.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.full-text-search-language-en.js", 11 | "types": "./types/full-text-search-language-en/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/full-text-search": "0", 14 | "@lokidb/full-text-search-language": "0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/full-text-search-language-en/src/index.ts: -------------------------------------------------------------------------------- 1 | import { EnglishAnalyzer } from "./english_analyzer"; 2 | export {EnglishAnalyzer}; 3 | export default EnglishAnalyzer; 4 | -------------------------------------------------------------------------------- /packages/full-text-search-language-en/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.full-text-search-language-en.js", 8 | library: "@lokidb/full-text-search-language-en", 9 | externals: { 10 | "../../full-text-search-language/src/language": "@lokidb/full-text-search-language", 11 | "../../full-text-search/src/index": "@lokidb/full-text-search" 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/full-text-search-language/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/full-text-search-language", 3 | "description": "A language analyzer utility package.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.full-text-search-language.js", 11 | "types": "./types/full-text-search-language/src/index.d.ts" 12 | } 13 | -------------------------------------------------------------------------------- /packages/full-text-search-language/src/index.ts: -------------------------------------------------------------------------------- 1 | export {generateStopWordFilter, generateTrimmer, Among, SnowballProgram} from "./language"; 2 | -------------------------------------------------------------------------------- /packages/full-text-search-language/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.full-text-search-language.js", 8 | library: "@lokidb/full-text-search-language" 9 | }); 10 | -------------------------------------------------------------------------------- /packages/full-text-search/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/full-text-search", 3 | "description": "A full-text search engine.", 4 | "author": "Various authors", 5 | "license": "Apache-2.0", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.full-text-search.js", 11 | "types": "./types/full-text-search/src/index.d.ts", 12 | "optionalDependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/full-text-search/spec/generic/analyzer/character_filter.spec.ts: -------------------------------------------------------------------------------- 1 | /* global describe, it, expect */ 2 | 3 | describe("character filter", () => { 4 | 5 | }); 6 | -------------------------------------------------------------------------------- /packages/full-text-search/spec/generic/analyzer/token_filter.spec.ts: -------------------------------------------------------------------------------- 1 | /* global describe, it, expect */ 2 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "../../../src/analyzer/token_filter"; 3 | 4 | describe("token filter", () => { 5 | 6 | it("lowercaseTokenFilter", () => { 7 | expect(lowercaseTokenFilter("")).toEqual(""); 8 | expect(lowercaseTokenFilter("Abc")).toEqual("abc"); 9 | expect(lowercaseTokenFilter("c'eEf.")).toEqual("c'eef."); 10 | expect(lowercaseTokenFilter("def")).toEqual("def"); 11 | expect(lowercaseTokenFilter("12.3")).toEqual("12.3"); 12 | }); 13 | 14 | it("uppercaseTokenFilter", () => { 15 | expect(uppercaseTokenFilter("")).toEqual(""); 16 | expect(uppercaseTokenFilter("Abc")).toEqual("ABC"); 17 | expect(uppercaseTokenFilter("c'eEf.")).toEqual("C'EEF."); 18 | expect(uppercaseTokenFilter("DEF")).toEqual("DEF"); 19 | expect(uppercaseTokenFilter("12.3")).toEqual("12.3"); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/full-text-search/spec/generic/analyzer/tokenizer.spec.ts: -------------------------------------------------------------------------------- 1 | /* global describe, it, expect */ 2 | import { whitespaceTokenizer } from "../../../src/analyzer/tokenizer"; 3 | 4 | describe("tokenizer", () => { 5 | 6 | it("whitespaceTokenizer", () => { 7 | expect(whitespaceTokenizer("")).toEqual([""]); 8 | expect(whitespaceTokenizer("abc d'ef 123.")).toEqual(["abc", "d'ef", "123."]); 9 | }); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/full-text-search/src/analyzer/character_filter.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A character filter is used to preprocess a string before it is passed to a tokenizer. 3 | */ 4 | export type CharacterFilter = (value: string) => string; 5 | 6 | 7 | -------------------------------------------------------------------------------- /packages/full-text-search/src/analyzer/token_filter.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A token filter takes tokens from a tokenizer and modify, delete or add tokens. 3 | */ 4 | export type TokenFilter = (value: string, index: number, array: string[]) => string; 5 | 6 | /** 7 | * Converts a token to lowercase. 8 | * @param {string} token - the token 9 | * @returns {string} - the lowercased token 10 | */ 11 | export function lowercaseTokenFilter(token: string): string { 12 | return token.toLowerCase(); 13 | } 14 | 15 | /** 16 | * Converts a token to uppercase. 17 | * @param {string} token - the token 18 | * @returns {string} - the uppercased token 19 | */ 20 | export function uppercaseTokenFilter(token: string): string { 21 | return token.toUpperCase(); 22 | } 23 | -------------------------------------------------------------------------------- /packages/full-text-search/src/analyzer/tokenizer.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * A tokenizer splits a string into individual tokens. 3 | */ 4 | export type Tokenizer = (value: string) => string[]; 5 | 6 | /** 7 | * Splits a string at whitespace characters into tokens. 8 | * @param {string} value - the string 9 | * @returns {string[]} - the tokens 10 | */ 11 | export function whitespaceTokenizer(value: string): string[] { 12 | return value.split(/[\s]+/); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /packages/full-text-search/src/index.ts: -------------------------------------------------------------------------------- 1 | import { FullTextSearch } from "./full_text_search"; 2 | import { analyze, StandardAnalyzer } from "./analyzer/analyzer"; 3 | import { whitespaceTokenizer } from "./analyzer/tokenizer"; 4 | import { lowercaseTokenFilter, uppercaseTokenFilter } from "./analyzer/token_filter"; 5 | 6 | FullTextSearch["Analyzer"] = {}; 7 | FullTextSearch["Analyzer"]["analyze"] = analyze; 8 | FullTextSearch["Analyzer"]["StandardAnalyzer"] = StandardAnalyzer; 9 | FullTextSearch["Tokenizer"] = {}; 10 | FullTextSearch["Tokenizer"]["whitespaceTokenizer"] = whitespaceTokenizer; 11 | FullTextSearch["TokenFilter"] = {}; 12 | FullTextSearch["TokenFilter"]["lowercaseTokenFilter"] = lowercaseTokenFilter; 13 | FullTextSearch["TokenFilter"]["uppercaseTokenFilter"] = uppercaseTokenFilter; 14 | 15 | export {FullTextSearch, 16 | analyze, StandardAnalyzer, 17 | whitespaceTokenizer, 18 | lowercaseTokenFilter, uppercaseTokenFilter 19 | }; 20 | export default FullTextSearch; 21 | -------------------------------------------------------------------------------- /packages/full-text-search/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.full-text-search.js", 8 | library: "@lokidb/full-text-search", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki" 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/indexed-storage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/indexed-storage", 3 | "description": "A persistence adapter which persists to web browser's indexed db storage.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.indexed-storage.js", 11 | "types": "./types/indexed-storage/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/indexed-storage/src/index.ts: -------------------------------------------------------------------------------- 1 | import { IndexedStorage } from "./indexed_storage"; 2 | 3 | export {IndexedStorage}; 4 | export default IndexedStorage; 5 | -------------------------------------------------------------------------------- /packages/indexed-storage/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.indexed-storage.js", 8 | library: "@lokidb/indexed-storage", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki" 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/local-storage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/local-storage", 3 | "description": "A persistence adapter which persists to web browser's local storage.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.local-storage.js", 11 | "types": "./types/local-storage/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/local-storage/src/index.ts: -------------------------------------------------------------------------------- 1 | import { LocalStorage } from "./local_storage"; 2 | 3 | export {LocalStorage}; 4 | export default LocalStorage; 5 | -------------------------------------------------------------------------------- /packages/local-storage/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.local-storage.js", 8 | library: "@lokidb/local-storage", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki" 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/loki/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/loki", 3 | "description": "Fast document oriented javascript in-memory database", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.loki.js", 11 | "types": "./types/loki/src/index.d.ts" 12 | } 13 | -------------------------------------------------------------------------------- /packages/loki/spec/generic/eventEmitter.spec.ts: -------------------------------------------------------------------------------- 1 | /* global describe, beforeEach, it, expect */ 2 | import { Loki } from "../../src/loki"; 3 | 4 | describe("eventEmitter", () => { 5 | let db: Loki; 6 | let users; 7 | 8 | beforeEach(() => { 9 | db = new Loki("test"); 10 | users = db.addCollection("users", { 11 | asyncListeners: false 12 | }); 13 | 14 | users.insert({ 15 | name: "joe" 16 | }); 17 | }); 18 | 19 | it("async", function testAsync() { 20 | expect(db["_asyncListeners"]).toBe(false); 21 | }); 22 | 23 | it("emit", () => { 24 | const index = db.on("test", function test(obj: number) { 25 | expect(obj).toEqual(42); 26 | }); 27 | 28 | db["emit"]("test", 42); 29 | db.removeListener("test", index); 30 | 31 | expect(db["_events"]["test"].length).toEqual(0); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /packages/loki/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Loki } from "./loki"; 2 | import { Collection } from "./collection"; 3 | 4 | Loki["Collection"] = Collection; 5 | 6 | export {Loki, Collection}; 7 | export default Loki; 8 | -------------------------------------------------------------------------------- /packages/loki/src/uml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LokiJS-Forge/LokiDB/ccc45527b2e9ce639987cf46c8ff53c7bb8a406a/packages/loki/src/uml.png -------------------------------------------------------------------------------- /packages/loki/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.loki.js", 8 | library: "@lokidb/loki", 9 | }); 10 | -------------------------------------------------------------------------------- /packages/memory-storage/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/memory-storage", 3 | "description": "A persistence adapter which persists to memory.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.memory-storage.js", 11 | "types": "./types/memory-storage/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/memory-storage/src/index.ts: -------------------------------------------------------------------------------- 1 | import { MemoryStorage } from "./memory_storage"; 2 | 3 | export {MemoryStorage}; 4 | export default MemoryStorage; 5 | -------------------------------------------------------------------------------- /packages/memory-storage/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.memory-storage.js", 8 | library: "@lokidb/memory-storage", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki" 11 | }, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/partitioning-adapter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@lokidb/partitioning-adapter", 3 | "description": "An adapter for adapters. Converts a non reference mode adapter into a reference mode adapter which can perform destructuring and partitioning.", 4 | "author": "Various authors", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/LokiJS-Forge/LokiDB.git" 9 | }, 10 | "main": "lokidb.partitioning-adapter.js", 11 | "types": "./types/partitioning-adapter/src/index.d.ts", 12 | "dependencies": { 13 | "@lokidb/loki": "0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/partitioning-adapter/src/index.ts: -------------------------------------------------------------------------------- 1 | import { PartitioningAdapter } from "./partitioning_adapter"; 2 | 3 | export {PartitioningAdapter}; 4 | export default PartitioningAdapter; 5 | -------------------------------------------------------------------------------- /packages/partitioning-adapter/webpack.config.js: -------------------------------------------------------------------------------- 1 | /* global __dirname, module, require */ 2 | const path = require("path"); 3 | const webpackConigCreator = require('../../config/webpack-config-creator.js'); 4 | 5 | module.exports = webpackConigCreator({ 6 | entry: path.join(__dirname, "src", "index.ts"), 7 | filename: "lokidb.partitioning-adapter.js", 8 | library: "@lokidb/partitioning-adapter", 9 | externals: { 10 | "../../loki/src/loki": "@lokidb/loki" 11 | }, 12 | }); 13 | --------------------------------------------------------------------------------