mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
Merge branch 'master' into oja/node/correct-unhandled-rejection-reason-param-4
This commit is contained in:
+25
-1
@@ -576,11 +576,17 @@
|
||||
"sourceRepoURL": "https://github.com/fastify/fastify-jwt",
|
||||
"asOfVersion": "0.8.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "fastify-multipart",
|
||||
"typingsPackageName": "fastify-multipart",
|
||||
"sourceRepoURL": "https://github.com/fastify/fastify-multipart",
|
||||
"asOfVersion": "0.7.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "fastify-static",
|
||||
"typingsPackageName": "fastify-static",
|
||||
"sourceRepoURL": "https://github.com/fastify/fastify-static",
|
||||
"asOfVersion": "2.2.0"
|
||||
"asOfVersion": "2.2.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "fecha",
|
||||
@@ -720,6 +726,12 @@
|
||||
"sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "i18next-xhr-backend",
|
||||
"typingsPackageName": "i18next-xhr-backend",
|
||||
"sourceRepoURL": "https://github.com/i18next/i18next-xhr-backend",
|
||||
"asOfVersion": "1.4.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "iconv-lite",
|
||||
"typingsPackageName": "iconv-lite",
|
||||
@@ -1278,6 +1290,12 @@
|
||||
"sourceRepoURL": "https://github.com/i18next/react-i18next",
|
||||
"asOfVersion": "8.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "React Icons",
|
||||
"typingsPackageName": "react-icons",
|
||||
"sourceRepoURL": "https://www.npmjs.com/package/react-icons",
|
||||
"asOfVersion": "3.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-monaco-editor",
|
||||
"typingsPackageName": "react-monaco-editor",
|
||||
@@ -1626,6 +1644,12 @@
|
||||
"sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html",
|
||||
"asOfVersion": "2.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "terser",
|
||||
"typingsPackageName": "terser",
|
||||
"sourceRepoURL": "https://github.com/terser-js/terser",
|
||||
"asOfVersion": "3.12.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "timezonecomplete",
|
||||
"typingsPackageName": "timezonecomplete",
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for abs 1.3
|
||||
// Project: https://github.com/IonicaBizau/node-abs
|
||||
// Project: https://github.com/ionicabizau/abs
|
||||
// Definitions by: Aya Morisawa <https://github.com/AyaMorisawa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Acorn 4.0
|
||||
// Project: https://github.com/marijnh/acorn
|
||||
// Project: https://github.com/acornjs/acorn
|
||||
// Definitions by: RReverser <https://github.com/RReverser>, e-cloud <https://github.com/e-cloud>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for ActiveStorage 5.2
|
||||
// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascipt
|
||||
// Project: https://github.com/rails/rails/tree/master/activestorage/app/javascript, http://rubyonrails.org
|
||||
// Definitions by: Cameron Bothner <https://github.com/cbothner>
|
||||
// Definitions: https://github.com/cbothner/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Access 14.0 Object Library - Access 14.0
|
||||
// Type definitions for non-npm package Microsoft Access 14.0 Object Library - Access 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/dn142571.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft ActiveX Data Objects 6.0 Library - ADODB 6.1
|
||||
// Type definitions for non-npm package Microsoft ActiveX Data Objects 6.0 Library - ADODB 6.1
|
||||
// Project: https://msdn.microsoft.com/en-us/library/jj249010.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft ADO Extensions 6.0 for DDL and Security - ADOX 6.0
|
||||
// Type definitions for non-npm package Microsoft ADO Extensions 6.0 for DDL and Security - ADOX 6.0
|
||||
// Project: https://docs.microsoft.com/en-us/sql/ado/reference/adox-api/adox-object-model
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Office 16.0 Access Database Engine Object Library - DAO 16.0
|
||||
// Type definitions for non-npm package Microsoft Office 16.0 Access Database Engine Object Library - DAO 16.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/dn124645.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DiskQuotaTypeLibrary 1.0
|
||||
// Type definitions for non-npm package DiskQuotaTypeLibrary 1.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Excel 14.0 Object Library - Excel 14.0
|
||||
// Type definitions for non-npm package Microsoft Excel 14.0 Object Library - Excel 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/fp179694.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Fax Service Extended COM Type Library - FAXCOMEXLib 1.0
|
||||
// Type definitions for non-npm package Microsoft Fax Service Extended COM Type Library - FAXCOMEXLib 1.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684513(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft InfoPath 3.0 Type Library - InfoPath 3.0
|
||||
// Type definitions for non-npm package Microsoft InfoPath 3.0 Type Library - InfoPath 3.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/jj602751.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Javascript Automation interop 0.0
|
||||
// Type definitions for non-npm package Javascript Automation interop 0.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/ff521046(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Windows Script Host Runtime Object Model 0.0
|
||||
// Type definitions for non-npm package Windows Script Host Runtime Object Model 0.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for LibreOffice 5.3
|
||||
// Type definitions for non-npm package LibreOffice 5.3
|
||||
// Project: https://api.libreoffice.org/
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Forms 2.0 Object Library - MSForms 2.0
|
||||
// Type definitions for non-npm package Microsoft Forms 2.0 Object Library - MSForms 2.0
|
||||
// Project: https://msdn.microsoft.com/VBA/Language-Reference-VBA/articles/reference-microsoft-forms
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft HTML Object Library - MSHTML 4.0
|
||||
// Type definitions for non-npm package Microsoft HTML Object Library - MSHTML 4.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft XML, v6.0 - MSXML2 6.0
|
||||
// Type definitions for non-npm package Microsoft XML, v6.0 - MSXML2 6.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/ms763742.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Office 16.0 Object Library - Office 16.0
|
||||
// Type definitions for non-npm package Microsoft Office 16.0 Object Library - Office 16.0
|
||||
// Project: https://msdn.microsoft.com/VBA/Office-Shared-VBA/articles/office-vba-object-library-reference
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Outlook 14.0 Object Library - Outlook 14.0
|
||||
// Type definitions for non-npm package Microsoft Outlook 14.0 Object Library - Outlook 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/vba/vba-outlook
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft PowerPoint 14.0 Object Library - PowerPoint 14.0
|
||||
// Type definitions for non-npm package Microsoft PowerPoint 14.0 Object Library - PowerPoint 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/fp161225.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Scripting Runtime 1.0
|
||||
// Type definitions for non-npm package Microsoft Scripting Runtime 1.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/bstcxhf7(v=vs.84).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Internet Controls - SHDocVw 1.1
|
||||
// Type definitions for non-npm package Microsoft Internet Controls - SHDocVw 1.1
|
||||
// Project: https://msdn.microsoft.com/en-us/library/aa752040(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Shell Controls And Automation - Shell32 1.0
|
||||
// Type definitions for non-npm package Microsoft Shell Controls And Automation - Shell32 1.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for OLE Automation - stdole 2.0
|
||||
// Type definitions for non-npm package OLE Automation - stdole 2.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/hh272953.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Visual Basic for Applications Extensibility 5.3 - VBIDE 14.0
|
||||
// Type definitions for non-npm package Microsoft Visual Basic for Applications Extensibility 5.3 - VBIDE 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/collections-visual-basic-add-in-model
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Windows Image Acquisition 2.0
|
||||
// Type definitions for non-npm package Windows Image Acquisition 2.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/ms630368(v=vs.85).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Microsoft Word 14.0 Object Library - Word 14.0
|
||||
// Type definitions for non-npm package Microsoft Word 14.0 Object Library - Word 14.0
|
||||
// Project: https://msdn.microsoft.com/en-us/library/fp179696.aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for adlib 3.0
|
||||
// Project: https://github.com/Esri/adlib
|
||||
// Project: https://github.com/Esri/adlib, https://arcgis.github.io/ember-arcgis-adlib-service
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Mike Tschudi <https://github.com/MikeTschudi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import * as Ajv from "ajv";
|
||||
|
||||
import ajvMergePatch = require("ajv-merge-patch");
|
||||
|
||||
const ajv = new Ajv();
|
||||
|
||||
ajvMergePatch(ajv); // $ExpectType void
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for ajv-merge-patch 4.1
|
||||
// Project: https://github.com/epoberezkin/ajv-merge-patch#readme
|
||||
// Definitions by: Zhu Zijia <https://github.com/littlepiggy03>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { Ajv } from "ajv";
|
||||
|
||||
declare function ajvMergePatch(ajv: Ajv): void;
|
||||
|
||||
export = ajvMergePatch;
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"ajv": ">=4.1.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ajv-merge-patch-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Alexa SDK for Node.js 1.1
|
||||
// Project: https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs
|
||||
// Project: https://github.com/alexa/alexa-skill-sdk-for-nodejs
|
||||
// Definitions by: Pete Beegle <https://github.com/petebeegle>
|
||||
// Huw <https://github.com/hoo29>
|
||||
// pascalwhoop <https://github.com/pascalwhoop>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for alexa-voice-service 0.0
|
||||
// Project: https://github.com/miguelmota/alexa-voice-service.js
|
||||
// Project: https://github.com/miguelmota/alexa-voice-service
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
@@ -0,0 +1,325 @@
|
||||
import * as algoliasearch from 'algoliasearch';
|
||||
import * as algoliasearchHelper from 'algoliasearch-helper';
|
||||
// tslint:disable-next-line:no-duplicate-imports
|
||||
import { SearchResults, SearchParameters } from 'algoliasearch-helper';
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#module:algoliasearchHelper
|
||||
|
||||
const client = algoliasearch('latency', '6be0576ff61c053d5f9a3225e2a90f76');
|
||||
const helper = algoliasearchHelper(client, 'bestbuy', {
|
||||
facets: ['shipping'],
|
||||
disjunctiveFacets: ['category']
|
||||
});
|
||||
helper.on('result', (result) => {
|
||||
console.log(result);
|
||||
});
|
||||
helper.toggleRefine('Movies & TV Shows')
|
||||
.toggleRefine('Free shipping')
|
||||
.search();
|
||||
|
||||
const updateTheResult = (results: SearchResults, state: SearchParameters) => {
|
||||
console.log(results, state);
|
||||
};
|
||||
helper.on('result', updateTheResult);
|
||||
helper.once('result', updateTheResult);
|
||||
helper.removeListener('result', updateTheResult);
|
||||
helper.removeAllListeners('result');
|
||||
|
||||
() => {
|
||||
// Changing the number of records returned per page to 1
|
||||
// This example uses the callback API
|
||||
const state = helper.searchOnce({hitsPerPage: 1},
|
||||
(error, content: SearchResults, state: SearchParameters) => {});
|
||||
|
||||
// Changing the number of records returned per page to 1
|
||||
// This example uses the promise API
|
||||
const state1 = helper.searchOnce({hitsPerPage: 1})
|
||||
.then(promiseHandler);
|
||||
|
||||
function promiseHandler(res: {content: SearchResults, state: SearchParameters}) {
|
||||
// res contains
|
||||
// {
|
||||
// content : SearchResults
|
||||
// state : SearchParameters (the one used for this specific search)
|
||||
// }
|
||||
}
|
||||
};
|
||||
|
||||
helper.setIndex('highestPrice_products').getIndex();
|
||||
helper.setPage(0).nextPage().getPage();
|
||||
helper.setPage(1).previousPage().getPage();
|
||||
helper.setQueryParameter('hitsPerPage', 20).search();
|
||||
const hitsPerPage = helper.getQueryParameter('hitsPerPage');
|
||||
helper.addFacetRefinement('film-genre', 'comedy');
|
||||
helper.addFacetRefinement('film-genre', 'science-fiction');
|
||||
|
||||
() => {
|
||||
const indexName = 'test';
|
||||
const helper2 = algoliasearchHelper(client, indexName, {
|
||||
facets: ['nameOfTheAttribute']
|
||||
});
|
||||
};
|
||||
|
||||
// Removing all the refinements
|
||||
helper.clearRefinements().search();
|
||||
|
||||
// Removing all the filters on a the category attribute.
|
||||
helper.clearRefinements('category').search();
|
||||
|
||||
// Removing only the exclude filters on the category facet.
|
||||
helper.clearRefinements((value, attribute, type) => {
|
||||
return type === 'exclude' && attribute === 'category';
|
||||
}).search();
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#AlgoliaSearchHelper#hasRefinements
|
||||
|
||||
helper.hasRefinements('price'); // false
|
||||
helper.addNumericRefinement('price', '>', 100);
|
||||
helper.hasRefinements('price'); // true
|
||||
|
||||
helper.hasRefinements('color'); // false
|
||||
helper.addFacetRefinement('color', 'blue');
|
||||
helper.hasRefinements('color'); // true
|
||||
|
||||
helper.hasRefinements('material'); // false
|
||||
helper.addDisjunctiveFacetRefinement('material', 'plastic');
|
||||
helper.hasRefinements('material'); // true
|
||||
|
||||
helper.hasRefinements('categories'); // false
|
||||
helper.toggleFacetRefinement('categories', 'kitchen > knife');
|
||||
helper.hasRefinements('categories'); // true
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#AlgoliaSearchHelper#getRefinements
|
||||
|
||||
helper.addNumericRefinement('price', '>', 100);
|
||||
helper.getRefinements('price');
|
||||
|
||||
helper.addFacetRefinement('color', 'blue');
|
||||
helper.addFacetExclusion('color', 'red');
|
||||
helper.getRefinements('color');
|
||||
|
||||
helper.addDisjunctiveFacetRefinement('material', 'plastic');
|
||||
|
||||
helper.addDisjunctiveFacetRefinement('tech', 'crt');
|
||||
helper.addDisjunctiveFacetRefinement('tech', 'led');
|
||||
helper.addDisjunctiveFacetRefinement('tech', 'plasma');
|
||||
|
||||
() => {
|
||||
const helper2 = algoliasearchHelper(client, 'test', {
|
||||
disjunctiveFacets: ['nameOfTheAttribute']
|
||||
});
|
||||
};
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#AlgoliaSearchHelper#hasRefinements
|
||||
|
||||
// hasRefinements works with numeric, conjunctive, disjunctive and hierarchical filters
|
||||
helper.hasRefinements('price'); // false
|
||||
helper.addNumericRefinement('price', '>', 100);
|
||||
helper.hasRefinements('price'); // true
|
||||
|
||||
helper.hasRefinements('color'); // false
|
||||
helper.addFacetRefinement('color', 'blue');
|
||||
helper.hasRefinements('color'); // true
|
||||
|
||||
helper.hasRefinements('material'); // false
|
||||
helper.addDisjunctiveFacetRefinement('material', 'plastic');
|
||||
helper.hasRefinements('material'); // true
|
||||
|
||||
helper.hasRefinements('categories'); // false
|
||||
helper.toggleFacetRefinement('categories', 'kitchen > knife');
|
||||
helper.hasRefinements('categories'); // true
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#SearchResults#getFacetValues
|
||||
helper.on('result', (content) => {
|
||||
// get values ordered only by name ascending using the string predicate
|
||||
content.getFacetValues('city', {sortBy: ['name:asc']});
|
||||
// get values ordered only by count ascending using a function
|
||||
content.getFacetValues('city', {
|
||||
// this is equivalent to ['count:asc']
|
||||
sortBy(a: { count: number }, b: { count: number }) {
|
||||
if (a.count === b.count) return 0;
|
||||
if (a.count > b.count) return 1;
|
||||
if (b.count > a.count) return -1;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// https://community.algolia.com/algoliasearch-helper-js/reference.html#SearchParameters#addTagRefinement
|
||||
|
||||
const searchparameter = new SearchParameters();
|
||||
|
||||
// for price = 50 or 40
|
||||
searchparameter.addNumericRefinement('price', '=', [50, 40]);
|
||||
|
||||
// for size = 38 and 40
|
||||
searchparameter.addNumericRefinement('size', '=', 38);
|
||||
searchparameter.addNumericRefinement('size', '=', 40);
|
||||
|
||||
let queryParameters = new SearchParameters({}); // everything is optional
|
||||
queryParameters = new SearchParameters({
|
||||
advancedSyntax: true,
|
||||
allowTyposOnNumericTokens: true,
|
||||
analytics: true,
|
||||
analyticsTags: ['test'],
|
||||
aroundLatLng: 'latitude',
|
||||
aroundLatLngViaIP: true,
|
||||
aroundPrecision: 1,
|
||||
aroundRadius: 1,
|
||||
attributesToHighlight: ['test'],
|
||||
attributesToRetrieve: ['test'],
|
||||
attributesToSnippet: ['test'],
|
||||
disableExactOnAttributes: ['test'],
|
||||
disjunctiveFacets: ['test'],
|
||||
disjunctiveFacetsRefinements: { test: ['test'] },
|
||||
distinct: 2,
|
||||
enableExactOnSingleWordQuery: true,
|
||||
facets: ['test'],
|
||||
facetsExcludes: { test: ['test'] },
|
||||
facetsRefinements: { test: ['test'] },
|
||||
getRankingInfo: true,
|
||||
hierarchicalFacets: ['test'],
|
||||
hierarchicalFacetsRefinements: { test: ['test'] },
|
||||
highlightPostTag: 'test',
|
||||
highlightPreTag: 'test',
|
||||
hitsPerPage: 1,
|
||||
ignorePlurals: true,
|
||||
index: 'test',
|
||||
insideBoundingBox: [[1, 2, 3, 4]],
|
||||
insidePolygon: [[1, 2, 3, 4]],
|
||||
length: 2,
|
||||
maxValuesPerFacet: 1,
|
||||
minimumAroundRadius: 1,
|
||||
minProximity: 1,
|
||||
minWordSizefor1Typo: 1,
|
||||
minWordSizefor2Typos: 1,
|
||||
numericFilters: ['test'],
|
||||
numericRefinements: { test: { '=': [1], '>': [[2, 3]] } },
|
||||
offset: 1,
|
||||
optionalFacetFilters: 'test',
|
||||
optionalTagFilters: 'test',
|
||||
optionalWords: ['test'],
|
||||
page: 1,
|
||||
query: 'test',
|
||||
queryType: 'prefixAll',
|
||||
removeWordsIfNoResults: 'none',
|
||||
replaceSynonymsInHighlight: true,
|
||||
restrictSearchableAttributes: ['test'],
|
||||
snippetEllipsisText: '...',
|
||||
synonyms: true,
|
||||
tagFilters: ['test'],
|
||||
tagRefinements: ['test'],
|
||||
typoTolerance: true,
|
||||
});
|
||||
|
||||
queryParameters.advancedSyntax;
|
||||
queryParameters.allowTyposOnNumericTokens;
|
||||
queryParameters.analytics;
|
||||
queryParameters.analyticsTags;
|
||||
queryParameters.aroundLatLng;
|
||||
queryParameters.aroundLatLngViaIP;
|
||||
queryParameters.aroundPrecision;
|
||||
queryParameters.aroundRadius;
|
||||
queryParameters.attributesToHighlight;
|
||||
queryParameters.attributesToRetrieve;
|
||||
queryParameters.attributesToSnippet;
|
||||
queryParameters.disableExactOnAttributes;
|
||||
queryParameters.disjunctiveFacets;
|
||||
queryParameters.disjunctiveFacetsRefinements;
|
||||
queryParameters.distinct;
|
||||
queryParameters.enableExactOnSingleWordQuery;
|
||||
queryParameters.facets;
|
||||
queryParameters.facetsExcludes;
|
||||
queryParameters.facetsRefinements;
|
||||
queryParameters.getRankingInfo;
|
||||
queryParameters.hierarchicalFacets;
|
||||
queryParameters.hierarchicalFacetsRefinements;
|
||||
queryParameters.highlightPostTag;
|
||||
queryParameters.highlightPreTag;
|
||||
queryParameters.hitsPerPage;
|
||||
queryParameters.ignorePlurals;
|
||||
queryParameters.index;
|
||||
queryParameters.insideBoundingBox;
|
||||
queryParameters.insidePolygon;
|
||||
queryParameters.length;
|
||||
queryParameters.maxValuesPerFacet;
|
||||
queryParameters.minimumAroundRadius;
|
||||
queryParameters.minProximity;
|
||||
queryParameters.minWordSizefor1Typo;
|
||||
queryParameters.minWordSizefor2Typos;
|
||||
queryParameters.numericFilters;
|
||||
queryParameters.numericRefinements;
|
||||
queryParameters.offset;
|
||||
queryParameters.optionalFacetFilters;
|
||||
queryParameters.optionalTagFilters;
|
||||
queryParameters.optionalWords;
|
||||
queryParameters.page;
|
||||
queryParameters.query;
|
||||
queryParameters.queryType;
|
||||
queryParameters.removeWordsIfNoResults;
|
||||
queryParameters.replaceSynonymsInHighlight;
|
||||
queryParameters.restrictSearchableAttributes;
|
||||
queryParameters.snippetEllipsisText;
|
||||
queryParameters.synonyms;
|
||||
queryParameters.tagFilters;
|
||||
queryParameters.tagRefinements;
|
||||
queryParameters.typoTolerance;
|
||||
|
||||
queryParameters.addDisjunctiveFacet('test');
|
||||
queryParameters.addDisjunctiveFacetRefinement('test', 'test');
|
||||
queryParameters.addExcludeRefinement('test', 'test');
|
||||
queryParameters.addFacet('test');
|
||||
queryParameters.addFacetRefinement('test', 'test');
|
||||
queryParameters.addHierarchicalFacet({});
|
||||
queryParameters.addHierarchicalFacetRefinement('test', 'test');
|
||||
queryParameters.addNumericRefinement('test', '>', [7]);
|
||||
queryParameters.addTagRefinement('test');
|
||||
queryParameters.clearRefinements('test');
|
||||
queryParameters.clearTags();
|
||||
queryParameters.filter(['test']);
|
||||
queryParameters.getConjunctiveRefinements('test');
|
||||
queryParameters.getDisjunctiveRefinements('test');
|
||||
queryParameters.getExcludeRefinements('test');
|
||||
queryParameters.getHierarchicalFacetBreadcrumb('test');
|
||||
queryParameters.getHierarchicalFacetByName('test');
|
||||
queryParameters.getHierarchicalRefinement('test');
|
||||
queryParameters.getNumericRefinement('test', '=');
|
||||
queryParameters.getNumericRefinements('test');
|
||||
queryParameters.getQueryParameter('test');
|
||||
queryParameters.getRefinedDisjunctiveFacets('test', {});
|
||||
queryParameters.getRefinedHierarchicalFacets('test', {});
|
||||
queryParameters.getUnrefinedDisjunctiveFacets();
|
||||
queryParameters.isConjunctiveFacet('test');
|
||||
queryParameters.isDisjunctiveFacet('test');
|
||||
queryParameters.isDisjunctiveFacetRefined('test', 'test');
|
||||
queryParameters.isExcludeRefined('test', 'test');
|
||||
queryParameters.isFacetRefined('test', 'test');
|
||||
queryParameters.isHierarchicalFacet('test');
|
||||
queryParameters.isHierarchicalFacetRefined('test', 'test');
|
||||
queryParameters.isNumericRefined('test', '>', 'test');
|
||||
queryParameters.isTagRefined('test');
|
||||
queryParameters.removeDisjunctiveFacet('test');
|
||||
queryParameters.removeDisjunctiveFacetRefinement('test', 'test');
|
||||
queryParameters.removeExcludeRefinement('test', 'test');
|
||||
queryParameters.removeFacet('test');
|
||||
queryParameters.removeFacetRefinement('test', 'test');
|
||||
queryParameters.removeHierarchicalFacet('test');
|
||||
queryParameters.removeHierarchicalFacetRefinement('test');
|
||||
queryParameters.removeTagRefinement('test');
|
||||
queryParameters.setDisjunctiveFacets(['test']);
|
||||
queryParameters.setFacets(['test']);
|
||||
queryParameters.setHitsPerPage(1);
|
||||
queryParameters.setPage(1);
|
||||
queryParameters.setQuery('test');
|
||||
queryParameters.setQueryParameter('test', {});
|
||||
queryParameters.setQueryParameters({ test: {} });
|
||||
queryParameters.setTypoTolerance('test');
|
||||
queryParameters.toggleConjunctiveFacetRefinement('test', {});
|
||||
queryParameters.toggleDisjunctiveFacetRefinement('test', {});
|
||||
queryParameters.toggleExcludeFacetRefinement('test', {});
|
||||
queryParameters.toggleFacetRefinement('test', {});
|
||||
queryParameters.toggleHierarchicalFacetRefinement('test', {});
|
||||
queryParameters.toggleTagRefinement('test');
|
||||
|
||||
// static methods
|
||||
SearchParameters.make(queryParameters);
|
||||
SearchParameters.validate(queryParameters, { queryType: 'prefixAll' });
|
||||
+747
@@ -0,0 +1,747 @@
|
||||
// Type definitions for algoliasearch-helper 2.26
|
||||
// Project: https://community.algolia.com/algoliasearch-helper-js/
|
||||
// Definitions by: Gordon Burgett <https://github.com/gburgett>
|
||||
// Haroen Viaene <https://github.com/haroenv>
|
||||
// Samuel Vaillant <https://github.com/samouss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Client } from 'algoliasearch';
|
||||
import { EventEmitter } from 'events';
|
||||
import algoliasearch = require('algoliasearch');
|
||||
|
||||
/**
|
||||
* The algoliasearchHelper module is the function that will let its
|
||||
* contains everything needed to use the Algoliasearch
|
||||
* Helper. It is a also a function that instanciate the helper.
|
||||
* To use the helper, you also need the Algolia JS client v3.
|
||||
* @param client an AlgoliaSearch client
|
||||
* @param index the name of the index to query
|
||||
* @param opts
|
||||
*/
|
||||
declare function algoliasearchHelper(client: Client, index: string, opts: algoliasearchHelper.QueryParameters): algoliasearchHelper.AlgoliaSearchHelper;
|
||||
|
||||
declare namespace algoliasearchHelper {
|
||||
export const version: string;
|
||||
|
||||
export class AlgoliaSearchHelper extends EventEmitter {
|
||||
state: SearchParameters;
|
||||
lastResults: SearchResults;
|
||||
derivedHelpers: AlgoliaSearchHelper[];
|
||||
|
||||
on(event: 'change' | 'search', cb: (state: SearchParameters, lastResults: SearchResults | null) => any): this;
|
||||
on(event: 'searchForFacetValues', cb: (state: SearchParameters, facet: string, query: string) => any): this;
|
||||
on(event: 'searchOnce', cb: (state: SearchParameters) => any): this;
|
||||
on(event: 'result', cb: (results: SearchResults, state: SearchParameters) => any): this;
|
||||
on(event: 'error', cb: (error: any) => any): this;
|
||||
on(event: 'searchQueueEmpty', cb: () => any): this;
|
||||
|
||||
/**
|
||||
* Start the search with the parameters set in the state. When the
|
||||
* method is called, it triggers a `search` event. The results will
|
||||
* be available through the `result` event. If an error occurs, an
|
||||
* `error` will be fired instead.
|
||||
* @return
|
||||
* @fires search
|
||||
* @fires result
|
||||
* @fires error
|
||||
* @chainable
|
||||
*/
|
||||
search(): this;
|
||||
|
||||
/**
|
||||
* Gets the search query parameters that would be sent to the Algolia Client
|
||||
* for the hits
|
||||
* @return Query Parameters
|
||||
*/
|
||||
getQuery(): QueryParameters;
|
||||
|
||||
/**
|
||||
* Start a search using a modified version of the current state. This method does
|
||||
* not trigger the helper lifecycle and does not modify the state kept internally
|
||||
* by the helper. This second aspect means that the next search call will be the
|
||||
* same as a search call before calling searchOnce.
|
||||
* @param options can contain all the parameters that can be set to SearchParameters
|
||||
* plus the index
|
||||
* @param [callback] optional callback executed when the response from the
|
||||
* server is back.
|
||||
* @return if a callback is passed the method returns undefined
|
||||
* otherwise it returns a promise containing an object with two keys :
|
||||
* - content with a SearchResults
|
||||
* - state with the state used for the query as a SearchParameters
|
||||
* @example
|
||||
* // Changing the number of records returned per page to 1
|
||||
* // This example uses the callback API
|
||||
* var state = helper.searchOnce({hitsPerPage: 1},
|
||||
* function(error, content, state) {
|
||||
* // if an error occurred it will be passed in error, otherwise its value is null
|
||||
* // content contains the results formatted as a SearchResults
|
||||
* // state is the instance of SearchParameters used for this search
|
||||
* });
|
||||
* @example
|
||||
* // Changing the number of records returned per page to 1
|
||||
* // This example uses the promise API
|
||||
* var state1 = helper.searchOnce({hitsPerPage: 1})
|
||||
* .then(promiseHandler);
|
||||
*
|
||||
* function promiseHandler(res) {
|
||||
* // res contains
|
||||
* // {
|
||||
* // content : SearchResults
|
||||
* // state : SearchParameters (the one used for this specific search)
|
||||
* // }
|
||||
* }
|
||||
*/
|
||||
searchOnce(options: QueryParameters): Promise<{ content: SearchResults, state: SearchParameters }>;
|
||||
searchOnce(options: QueryParameters, cb: (error: any, content: SearchResults, state: SearchParameters) => any): undefined;
|
||||
|
||||
/**
|
||||
* Search for facet values based on an query and the name of a faceted attribute. This
|
||||
* triggers a search and will return a promise. On top of using the query, it also sends
|
||||
* the parameters from the state so that the search is narrowed down to only the possible values.
|
||||
*
|
||||
* See the description of [FacetSearchResult](reference.html#FacetSearchResult)
|
||||
* @param facet the name of the faceted attribute
|
||||
* @param query the string query for the search
|
||||
* @param [maxFacetHits] the maximum number values returned. Should be > 0 and <= 100
|
||||
* @param [userState] the set of custom parameters to use on top of the current state. Setting a property to `undefined` removes
|
||||
* it in the generated query.
|
||||
* @return the results of the search
|
||||
*/
|
||||
searchForFacetValues(facet: string, query: string, maxFacetHits: number, userState: any): Promise<AlgoliaSearchHelper.FacetSearchResult>;
|
||||
|
||||
/**
|
||||
* Sets the text query used for the search.
|
||||
*
|
||||
* This method resets the current page to 0.
|
||||
* @param q the user query
|
||||
* @return
|
||||
* @fires change
|
||||
* @chainable
|
||||
*/
|
||||
setQuery(q: string): this;
|
||||
|
||||
/**
|
||||
* Remove all the types of refinements except tags. A string can be provided to remove
|
||||
* only the refinements of a specific attribute. For more advanced use case, you can
|
||||
* provide a function instead. This function should follow the
|
||||
* [clearCallback definition](#SearchParameters.clearCallback).
|
||||
*
|
||||
* This method resets the current page to 0.
|
||||
* @param [name] optional name of the facet / attribute on which we want to remove all refinements
|
||||
* @return
|
||||
* @fires change
|
||||
* @chainable
|
||||
* @example
|
||||
* // Removing all the refinements
|
||||
* helper.clearRefinements().search();
|
||||
* @example
|
||||
* // Removing all the filters on a the category attribute.
|
||||
* helper.clearRefinements('category').search();
|
||||
* @example
|
||||
* // Removing only the exclude filters on the category facet.
|
||||
* helper.clearRefinements(function(value, attribute, type) {
|
||||
* return type === 'exclude' && attribute === 'category';
|
||||
* }).search();
|
||||
*/
|
||||
clearRefinements(name?: string): this;
|
||||
clearRefinements(func: (value: any, attribute: string, type: string) => boolean): this;
|
||||
|
||||
/**
|
||||
* Remove all the tag filters.
|
||||
*
|
||||
* This method resets the current page to 0.
|
||||
* @return
|
||||
* @fires change
|
||||
* @chainable
|
||||
*/
|
||||
clearTags(): this;
|
||||
|
||||
/**
|
||||
* Updates the name of the index that will be targeted by the query.
|
||||
*
|
||||
* This method resets the current page to 0.
|
||||
* @param name the index name
|
||||
* @return
|
||||
* @fires change
|
||||
* @chainable
|
||||
*/
|
||||
setIndex(name: string): this;
|
||||
|
||||
addDisjunctiveFacetRefinement(...args: any[]): any;
|
||||
addDisjunctiveRefine(...args: any[]): any;
|
||||
addHierarchicalFacetRefinement(...args: any[]): any;
|
||||
addNumericRefinement(...args: any[]): any;
|
||||
addFacetRefinement(...args: any[]): any;
|
||||
addRefine(...args: any[]): any;
|
||||
addFacetExclusion(...args: any[]): any;
|
||||
addExclude(...args: any[]): any;
|
||||
addTag(...args: any[]): any;
|
||||
removeNumericRefinement(...args: any[]): any;
|
||||
removeDisjunctiveFacetRefinement(...args: any[]): any;
|
||||
removeDisjunctiveRefine(...args: any[]): any;
|
||||
removeHierarchicalFacetRefinement(...args: any[]): any;
|
||||
removeFacetRefinement(...args: any[]): any;
|
||||
removeRefine(...args: any[]): any;
|
||||
removeFacetExclusion(...args: any[]): any;
|
||||
removeExclude(...args: any[]): any;
|
||||
removeTag(...args: any[]): any;
|
||||
toggleFacetExclusion(...args: any[]): any;
|
||||
toggleExclude(...args: any[]): any;
|
||||
toggleRefinement(...args: any[]): any;
|
||||
toggleFacetRefinement(...args: any[]): any;
|
||||
toggleRefine(...args: any[]): any;
|
||||
toggleTag(...args: any[]): any;
|
||||
nextPage(...args: any[]): any;
|
||||
previousPage(...args: any[]): any;
|
||||
setCurrentPage(...args: any[]): any;
|
||||
setPage(...args: any[]): any;
|
||||
setQueryParameter(...args: any[]): any;
|
||||
|
||||
/**
|
||||
* Set the whole state (warning: will erase previous state)
|
||||
* @param newState the whole new state
|
||||
* @return
|
||||
* @fires change
|
||||
* @chainable
|
||||
*/
|
||||
setState(newState: QueryParameters): this;
|
||||
|
||||
/**
|
||||
* Get the current search state stored in the helper. This object is immutable.
|
||||
* @param [filters] optional filters to retrieve only a subset of the state
|
||||
* @return if filters is specified a plain object is
|
||||
* returned containing only the requested fields, otherwise return the unfiltered
|
||||
* state
|
||||
* @example
|
||||
* // Get the complete state as stored in the helper
|
||||
* helper.getState();
|
||||
* @example
|
||||
* // Get a part of the state with all the refinements on attributes and the query
|
||||
* helper.getState(['query', 'attribute:category']);
|
||||
*/
|
||||
getState(): SearchParameters;
|
||||
getState(filters: string[]): QueryParameters;
|
||||
|
||||
getStateAsQueryString(...args: any[]): any;
|
||||
setStateFromQueryString(...args: any[]): any;
|
||||
overrideStateWithoutTriggeringChangeEvent(...args: any[]): any;
|
||||
isRefined(...args: any[]): any;
|
||||
hasRefinements(...args: any[]): any;
|
||||
isExcluded(...args: any[]): any;
|
||||
isDisjunctiveRefined(...args: any[]): any;
|
||||
hasTag(...args: any[]): any;
|
||||
isTagRefined(...args: any[]): any;
|
||||
getIndex(...args: any[]): any;
|
||||
getCurrentPage(...args: any[]): any;
|
||||
getPage(...args: any[]): any;
|
||||
getTags(...args: any[]): any;
|
||||
getQueryParameter(...args: any[]): any;
|
||||
getRefinements(...args: any[]): any;
|
||||
getNumericRefinement(...args: any[]): any;
|
||||
getHierarchicalFacetBreadcrumb(...args: any[]): any;
|
||||
containsRefinement(...args: any[]): any;
|
||||
clearCache(...args: any[]): any;
|
||||
setClient(...args: any[]): any;
|
||||
getClient(...args: any[]): any;
|
||||
derive(...args: any[]): any;
|
||||
detachDerivedHelper(...args: any[]): any;
|
||||
hasPendingRequests(...args: any[]): any;
|
||||
}
|
||||
|
||||
namespace AlgoliaSearchHelper {
|
||||
/**
|
||||
* Structure of each result when using
|
||||
* [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)
|
||||
*/
|
||||
interface FacetSearchHit {
|
||||
value: string;
|
||||
highlighted: string;
|
||||
count: number;
|
||||
isRefined: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure of the data resolved by the
|
||||
* [`searchForFacetValues()`](reference.html#AlgoliaSearchHelper#searchForFacetValues)
|
||||
* promise.
|
||||
*/
|
||||
interface FacetSearchResult {
|
||||
facetHits: FacetSearchHit;
|
||||
processingTimeMS: number;
|
||||
}
|
||||
}
|
||||
|
||||
export interface QueryParameters extends algoliasearch.QueryParameters {
|
||||
/**
|
||||
* Targeted index. This parameter is mandatory.
|
||||
*/
|
||||
index?: string;
|
||||
/**
|
||||
* This attribute contains the list of all the disjunctive facets
|
||||
* used. This list will be added to requested facets in the
|
||||
* [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.
|
||||
*/
|
||||
disjunctiveFacets?: string[];
|
||||
/**
|
||||
* This attribute contains the list of all the hierarchical facets
|
||||
* used. This list will be added to requested facets in the
|
||||
* [facets attribute](https://www.algolia.com/doc/rest-api/search#param-facets) sent to algolia.
|
||||
* Hierarchical facets are a sub type of disjunctive facets that
|
||||
* let you filter faceted attributes hierarchically.
|
||||
*/
|
||||
hierarchicalFacets?: string[] | object[];
|
||||
|
||||
// Refinements
|
||||
/**
|
||||
* This attribute contains all the filters that need to be
|
||||
* applied on the conjunctive facets. Each facet must be properly
|
||||
* defined in the `facets` attribute.
|
||||
*
|
||||
* The key is the name of the facet, and the `FacetList` contains all
|
||||
* filters selected for the associated facet name.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `facetFilters` attribute.
|
||||
*/
|
||||
facetsRefinements?: { [facet: string]: SearchParameters.FacetList };
|
||||
/**
|
||||
* This attribute contains all the filters that need to be
|
||||
* excluded from the conjunctive facets. Each facet must be properly
|
||||
* defined in the `facets` attribute.
|
||||
*
|
||||
* The key is the name of the facet, and the `FacetList` contains all
|
||||
* filters excluded for the associated facet name.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `facetFilters` attribute.
|
||||
*/
|
||||
facetsExcludes?: { [facet: string]: SearchParameters.FacetList };
|
||||
/**
|
||||
* This attribute contains all the filters that need to be
|
||||
* applied on the disjunctive facets. Each facet must be properly
|
||||
* defined in the `disjunctiveFacets` attribute.
|
||||
*
|
||||
* The key is the name of the facet, and the `FacetList` contains all
|
||||
* filters selected for the associated facet name.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `facetFilters` attribute.
|
||||
*/
|
||||
disjunctiveFacetsRefinements?: { [facet: string]: SearchParameters.FacetList };
|
||||
/**
|
||||
* This attribute contains all the filters that need to be
|
||||
* applied on the numeric attributes.
|
||||
*
|
||||
* The key is the name of the attribute, and the value is the
|
||||
* filters to apply to this attribute.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `numericFilters` attribute.
|
||||
*/
|
||||
numericRefinements?: { [facet: string]: SearchParameters.OperatorList };
|
||||
/**
|
||||
* This attribute contains all the tags used to refine the query.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `tagFilters` attribute.
|
||||
*/
|
||||
tagRefinements?: string[];
|
||||
/**
|
||||
* This attribute contains all the filters that need to be
|
||||
* applied on the hierarchical facets. Each facet must be properly
|
||||
* defined in the `hierarchicalFacets` attribute.
|
||||
*
|
||||
* The key is the name of the facet, and the `FacetList` contains all
|
||||
* filters selected for the associated facet name. The FacetList values
|
||||
* are structured as a string that contain the values for each level
|
||||
* separated by the configured separator.
|
||||
*
|
||||
* When querying algolia, the values stored in this attribute will
|
||||
* be translated into the `facetFilters` attribute.
|
||||
*/
|
||||
hierarchicalFacetsRefinements?: { [facet: string]: SearchParameters.FacetList };
|
||||
|
||||
/**
|
||||
* Contains the optional tag filters in the raw format of the Algolia API.
|
||||
* @see https://www.algolia.com/doc/rest#param-tagFilters
|
||||
*/
|
||||
optionalTagFilters?: string;
|
||||
|
||||
/**
|
||||
* Contains the optional facet filters in the raw format of the Algolia API.
|
||||
* @see https://www.algolia.com/doc/rest#param-tagFilters
|
||||
*/
|
||||
optionalFacetFilters?: string;
|
||||
|
||||
// Misc. parameters
|
||||
/**
|
||||
* Applies 'exact' on single word queries if the word contains at least 3 characters
|
||||
* and is not a stop word.
|
||||
* Can take two values?: true or false.
|
||||
* By default, its set to false.
|
||||
* @see https://www.algolia.com/doc/rest#param-enableExactOnSingleWordQuery
|
||||
*/
|
||||
enableExactOnSingleWordQuery?: boolean;
|
||||
}
|
||||
|
||||
export class SearchParameters implements QueryParameters {
|
||||
index?: string ;
|
||||
disjunctiveFacets?: string[] ;
|
||||
hierarchicalFacets?: string[] | object[] ;
|
||||
facetsRefinements?: { [facet: string]: string[]; } ;
|
||||
facetsExcludes?: { [facet: string]: string[]; } ;
|
||||
disjunctiveFacetsRefinements?: { [facet: string]: string[]; } ;
|
||||
numericRefinements?: { [facet: string]: SearchParameters.OperatorList };
|
||||
tagRefinements?: string[] ;
|
||||
hierarchicalFacetsRefinements?: { [facet: string]: string[]; } ;
|
||||
optionalTagFilters?: string ;
|
||||
optionalFacetFilters?: string ;
|
||||
hitsPerPage?: number ;
|
||||
maxValuesPerFacet?: number ;
|
||||
minWordSizefor1Typo?: number ;
|
||||
minWordSizefor2Typos?: number ;
|
||||
minProximity?: any;
|
||||
allowTyposOnNumericTokens?: boolean ;
|
||||
ignorePlurals?: boolean ;
|
||||
advancedSyntax?: boolean ;
|
||||
analytics?: boolean ;
|
||||
synonyms?: boolean ;
|
||||
replaceSynonymsInHighlight?: boolean ;
|
||||
highlightPreTag?: string ;
|
||||
highlightPostTag?: string ;
|
||||
distinct?: number | boolean ;
|
||||
aroundLatLng?: string ;
|
||||
aroundRadius?: number ;
|
||||
minimumAroundRadius?: number ;
|
||||
aroundPrecision?: number ;
|
||||
snippetEllipsisText?: string;
|
||||
enableExactOnSingleWordQuery?: boolean ;
|
||||
query?: string ;
|
||||
filters?: string ;
|
||||
attributesToRetrieve?: string[] ;
|
||||
restrictSearchableAttributes?: string[] ;
|
||||
facets?: string[] ;
|
||||
facetingAfterDistinct?: boolean ;
|
||||
attributesToHighlight?: string[] ;
|
||||
attributesToSnippet?: string[] ;
|
||||
restrictHighlightAndSnippetArrays?: boolean ;
|
||||
page?: number ;
|
||||
offset?: number ;
|
||||
length?: number ;
|
||||
typoTolerance?: boolean ;
|
||||
disableTypoToleranceOnAttributes?: string[] ;
|
||||
aroundLatLngViaIP?: boolean ;
|
||||
insideBoundingBox?: number[][] ;
|
||||
queryType?: "prefixAll" | "prefixLast" | "prefixNone" ;
|
||||
insidePolygon?: number[][] ;
|
||||
removeWordsIfNoResults?: "none" | "lastWords" | "firstWords" | "allOptional" ;
|
||||
optionalWords?: string[] ;
|
||||
removeStopWords?: boolean | string[] ;
|
||||
disableExactOnAttributes?: string[] ;
|
||||
exactOnSingleWordQuery?: "none" | "attribute" | "word" ;
|
||||
alternativesAsExact?: Array<"ignorePlurals" | "singleWordSynonym" | "multiWordsSynonym"> ;
|
||||
getRankingInfo?: boolean ;
|
||||
numericAttributesToIndex?: string[] ;
|
||||
numericAttributesForFiltering?: string[] ;
|
||||
numericFilters?: string[] ;
|
||||
tagFilters?: string[] ;
|
||||
facetFilters?: string[] | string[][] ;
|
||||
analyticsTags?: string[] ;
|
||||
nbShards?: number ;
|
||||
userData?: string | object ;
|
||||
|
||||
constructor(newParameters?: QueryParameters)
|
||||
|
||||
/* Add a disjunctive facet to the disjunctiveFacets attribute of the helper configuration, if it isn't already present. */
|
||||
addDisjunctiveFacet(facet: string): SearchParameters;
|
||||
/* Adds a refinement on a disjunctive facet. */
|
||||
addDisjunctiveFacetRefinement(facet: string, value: string): SearchParameters;
|
||||
/* Exclude a value from a "normal" facet */
|
||||
addExcludeRefinement(facet: string, value: string): SearchParameters;
|
||||
/* Add a facet to the facets attribute of the helper configuration, if it isn't already present. */
|
||||
addFacet(facet: string): SearchParameters;
|
||||
/* Add a refinement on a "normal" facet */
|
||||
addFacetRefinement(facet: string, value: string): SearchParameters;
|
||||
addHierarchicalFacet(facet: any): SearchParameters;
|
||||
addHierarchicalFacetRefinement(facet: string, path: string): SearchParameters;
|
||||
addNumericRefinement(attribute: string, operator: SearchParameters.Operator, value: number | number[]): SearchParameters;
|
||||
addTagRefinement(tag: string): SearchParameters;
|
||||
clearRefinements(attribute?: string | ((value: any, attribute: string, type: string) => any)): SearchParameters;
|
||||
clearTags(): SearchParameters;
|
||||
filter(filters: string[]): any;
|
||||
getConjunctiveRefinements(facetName: string): string[];
|
||||
getDisjunctiveRefinements(facetName: string): string[];
|
||||
getExcludeRefinements(facetName: string): string[];
|
||||
getHierarchicalFacetBreadcrumb(facetName: string): string[];
|
||||
getHierarchicalFacetByName(hierarchicalFacetName: string): any;
|
||||
getHierarchicalRefinement(facetName: string): string[];
|
||||
getNumericRefinements(facetName: string): SearchParameters.OperatorList[];
|
||||
getNumericRefinement(attribute: string, operator: SearchParameters.Operator): Array<number | number[]>;
|
||||
getQueryParameter(paramName: string): any;
|
||||
getRefinedDisjunctiveFacets(facet: string, value: any): string[];
|
||||
getRefinedHierarchicalFacets(facet: string, value: any): string[];
|
||||
getUnrefinedDisjunctiveFacets(): string[];
|
||||
isConjunctiveFacet(facet: string): boolean;
|
||||
isDisjunctiveFacetRefined(facet: string, value?: string): boolean;
|
||||
isDisjunctiveFacet(facet: string): boolean;
|
||||
isExcludeRefined(facet: string, value?: string): boolean;
|
||||
isFacetRefined(facet: string, value?: string): boolean;
|
||||
isHierarchicalFacetRefined(facet: string, value?: string): boolean;
|
||||
isHierarchicalFacet(facet: string): boolean;
|
||||
isNumericRefined(attribute: string, operator: SearchParameters.Operator, value?: string): boolean;
|
||||
isTagRefined(tag: string): boolean;
|
||||
static make(newParameters: QueryParameters): SearchParameters;
|
||||
removeExcludeRefinement(facet: string, value: string): SearchParameters;
|
||||
removeFacet(facet: string): SearchParameters;
|
||||
removeFacetRefinement(facet: string, value?: string): SearchParameters;
|
||||
removeDisjunctiveFacet(facet: string): SearchParameters;
|
||||
removeDisjunctiveFacetRefinement(facet: string, value?: string): SearchParameters;
|
||||
removeHierarchicalFacet(facet: string): SearchParameters;
|
||||
removeHierarchicalFacetRefinement(facet: string): SearchParameters;
|
||||
removeTagRefinement(tag: string): SearchParameters;
|
||||
setDisjunctiveFacets(facets: string[]): SearchParameters;
|
||||
setFacets(facets: string[]): SearchParameters;
|
||||
setHitsPerPage(n: number): SearchParameters;
|
||||
setPage(newPage: number): SearchParameters;
|
||||
setQueryParameters(params: { [key: string]: any }): SearchParameters;
|
||||
setQueryParameter(parameter: string, value: any): SearchParameters;
|
||||
setQuery(newQuery: string): SearchParameters;
|
||||
setTypoTolerance(typoTolerance: string): SearchParameters;
|
||||
toggleDisjunctiveFacetRefinement(facet: string, value: any): SearchParameters;
|
||||
toggleExcludeFacetRefinement(facet: string, value: any): SearchParameters;
|
||||
toggleConjunctiveFacetRefinement(facet: string, value: any): SearchParameters;
|
||||
toggleHierarchicalFacetRefinement(facet: string, value: any): SearchParameters;
|
||||
toggleFacetRefinement(facet: string, value: any): SearchParameters;
|
||||
toggleTagRefinement(tag: string): SearchParameters;
|
||||
static validate(currentState: SearchParameters, parameters: QueryParameters): null | Error;
|
||||
}
|
||||
|
||||
namespace SearchParameters {
|
||||
type FacetList = string[];
|
||||
|
||||
type OperatorList = {
|
||||
[k in Operator]?: Array<number | number[]>
|
||||
};
|
||||
type Operator = '=' | '>' | '>=' | '<' | '<=' | '!=';
|
||||
}
|
||||
|
||||
export class SearchResults {
|
||||
/**
|
||||
* query used to generate the results
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* The query as parsed by the engine given all the rules.
|
||||
*/
|
||||
parsedQuery: string;
|
||||
/**
|
||||
* all the records that match the search parameters. Each record is
|
||||
* augmented with a new attribute `_highlightResult`
|
||||
* which is an object keyed by attribute and with the following properties:
|
||||
* - `value` : the value of the facet highlighted (html)
|
||||
* - `matchLevel`: full, partial or none depending on how the query terms match
|
||||
*/
|
||||
hits: any[];
|
||||
/**
|
||||
* index where the results come from
|
||||
*/
|
||||
index: string;
|
||||
/**
|
||||
* number of hits per page requested
|
||||
*/
|
||||
hitsPerPage: number;
|
||||
/**
|
||||
* total number of hits of this query on the index
|
||||
*/
|
||||
nbHits: number;
|
||||
/**
|
||||
* total number of pages with respect to the number of hits per page and the total number of hits
|
||||
*/
|
||||
nbPages: number;
|
||||
/**
|
||||
* current page
|
||||
*/
|
||||
page: number;
|
||||
/**
|
||||
* sum of the processing time of all the queries
|
||||
*/
|
||||
processingTimeMS: number;
|
||||
/**
|
||||
* The position if the position was guessed by IP.
|
||||
* @example "48.8637,2.3615",
|
||||
*/
|
||||
aroundLatLng: string;
|
||||
/**
|
||||
* The radius computed by Algolia.
|
||||
* @example "126792922",
|
||||
*/
|
||||
automaticRadius: string;
|
||||
/**
|
||||
* String identifying the server used to serve this request.
|
||||
* @example "c7-use-2.algolia.net",
|
||||
*/
|
||||
serverUsed: string;
|
||||
/**
|
||||
* Boolean that indicates if the computation of the counts did time out.
|
||||
* @deprecated
|
||||
*/
|
||||
timeoutCounts: boolean;
|
||||
/**
|
||||
* Boolean that indicates if the computation of the hits did time out.
|
||||
* @deprecated
|
||||
*/
|
||||
timeoutHits: boolean;
|
||||
|
||||
/**
|
||||
* True if the counts of the facets is exhaustive
|
||||
*/
|
||||
exhaustiveFacetsCount: boolean;
|
||||
|
||||
/**
|
||||
* True if the number of hits is exhaustive
|
||||
*/
|
||||
exhaustiveNbHits: boolean;
|
||||
|
||||
/**
|
||||
* Contains the userData if they are set by a [query rule](https://www.algolia.com/doc/guides/query-rules/query-rules-overview/).
|
||||
*/
|
||||
userData: any[];
|
||||
|
||||
/**
|
||||
* queryID is the unique identifier of the query used to generate the current search results.
|
||||
* This value is only available if the `clickAnalytics` search parameter is set to `true`.
|
||||
*/
|
||||
queryID: string;
|
||||
|
||||
/**
|
||||
* disjunctive facets results
|
||||
*/
|
||||
disjunctiveFacets: SearchResults.Facet[];
|
||||
/**
|
||||
* disjunctive facets results
|
||||
*/
|
||||
hierarchicalFacets: SearchResults.HierarchicalFacet[];
|
||||
|
||||
/**
|
||||
* other facets results
|
||||
*/
|
||||
facets: SearchResults.Facet[];
|
||||
|
||||
_rawResults: any;
|
||||
_state: SearchParameters;
|
||||
|
||||
constructor(state: SearchParameters, results: any[])
|
||||
|
||||
/**
|
||||
* Get a facet object with its name
|
||||
* @deprecated
|
||||
* @param name name of the faceted attribute
|
||||
* @return the facet object
|
||||
*/
|
||||
getFacetByName(name: string): SearchResults.Facet;
|
||||
|
||||
/**
|
||||
* Get a the list of values for a given facet attribute. Those values are sorted
|
||||
* refinement first, descending count (bigger value on top), and name ascending
|
||||
* (alphabetical order). The sort formula can overridden using either string based
|
||||
* predicates or a function.
|
||||
*
|
||||
* This method will return all the values returned by the Algolia engine plus all
|
||||
* the values already refined. This means that it can happen that the
|
||||
* `maxValuesPerFacet` [configuration](https://www.algolia.com/doc/rest-api/search#param-maxValuesPerFacet)
|
||||
* might not be respected if you have facet values that are already refined.
|
||||
* @param attribute attribute name
|
||||
* @param opts configuration options.
|
||||
* @param opts.sortBy
|
||||
* When using strings, it consists of
|
||||
* the name of the [FacetValue](#SearchResults.FacetValue) or the
|
||||
* [HierarchicalFacet](#SearchResults.HierarchicalFacet) attributes with the
|
||||
* order (`asc` or `desc`). For example to order the value by count, the
|
||||
* argument would be `['count:asc']`.
|
||||
*
|
||||
* If only the attribute name is specified, the ordering defaults to the one
|
||||
* specified in the default value for this attribute.
|
||||
*
|
||||
* When not specified, the order is
|
||||
* ascending. This parameter can also be a function which takes two facet
|
||||
* values and should return a number, 0 if equal, 1 if the first argument is
|
||||
* bigger or -1 otherwise.
|
||||
*
|
||||
* The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`
|
||||
* @return depending on the type of facet of
|
||||
* the attribute requested (hierarchical, disjunctive or conjunctive)
|
||||
* @example
|
||||
* helper.on('results', function(content){
|
||||
* //get values ordered only by name ascending using the string predicate
|
||||
* content.getFacetValues('city', {sortBy: ['name:asc']});
|
||||
* //get values ordered only by count ascending using a function
|
||||
* content.getFacetValues('city', {
|
||||
* // this is equivalent to ['count:asc']
|
||||
* sortBy: function(a, b) {
|
||||
* if (a.count === b.count) return 0;
|
||||
* if (a.count > b.count) return 1;
|
||||
* if (b.count > a.count) return -1;
|
||||
* }
|
||||
* });
|
||||
* });
|
||||
*/
|
||||
getFacetValues(attribute: string, opts: any): SearchResults.FacetValue[] | SearchResults.HierarchicalFacet;
|
||||
|
||||
/**
|
||||
* Returns the facet stats if attribute is defined and the facet contains some.
|
||||
* Otherwise returns undefined.
|
||||
* @param attribute name of the faceted attribute
|
||||
* @return The stats of the facet
|
||||
*/
|
||||
getFacetStats(attribute: string): any;
|
||||
|
||||
/**
|
||||
* Returns all refinements for all filters + tags. It also provides
|
||||
* additional information: count and exhausistivity for each filter.
|
||||
*
|
||||
* See the [refinement type](#Refinement) for an exhaustive view of the available
|
||||
* data.
|
||||
*
|
||||
* @return all the refinements
|
||||
*/
|
||||
getRefinements(): SearchResults.Refinement[];
|
||||
}
|
||||
|
||||
namespace SearchResults {
|
||||
interface Facet {
|
||||
name: string;
|
||||
data: object;
|
||||
stats: object;
|
||||
}
|
||||
|
||||
interface HierarchicalFacet {
|
||||
name: string;
|
||||
count: number;
|
||||
path: string;
|
||||
isRefined: boolean;
|
||||
data: HierarchicalFacet[];
|
||||
}
|
||||
|
||||
interface FacetValue {
|
||||
name: string;
|
||||
count: number;
|
||||
isRefined: boolean;
|
||||
isExcluded: boolean;
|
||||
}
|
||||
|
||||
interface Refinement {
|
||||
type: `numeric` | `facet` | `exclude` | `disjunctive` | `hierarchical`;
|
||||
attributeName: string;
|
||||
name: string;
|
||||
numericValue: number;
|
||||
operator: string;
|
||||
count: number;
|
||||
exhaustive: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
}
|
||||
|
||||
export = algoliasearchHelper;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"algoliasearch-helper-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -124,7 +124,7 @@ let _algoliaQueryParameters: QueryParameters = {
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: [''],
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundLatLngViaIP: true,
|
||||
aroundRadius: 0,
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
|
||||
Vendored
+1
-1
@@ -1279,7 +1279,7 @@ declare namespace algoliasearch {
|
||||
* default: ""
|
||||
* https://www.algolia.com/doc/api-reference/api-parameters/aroundLatLngViaIP/
|
||||
*/
|
||||
aroundLatLngViaIP?: string;
|
||||
aroundLatLngViaIP?: boolean;
|
||||
/**
|
||||
* Control the radius associated with a geo search. Defined in meters.
|
||||
* default: null
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for ali-oss 6.0
|
||||
// Project: https://github.com/ali-sdk/ali-oss
|
||||
// Project: https://github.com/aliyun/oss-nodejs-sdk
|
||||
// Definitions by: Ptrdu <https://github.com/ptrdu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -148,7 +148,7 @@ declare module "alt/AltContainer" {
|
||||
stores?:Array<AltJS.AltStore<any>>;
|
||||
inject?:{[key:string]:any};
|
||||
actions?:{[key:string]:Object};
|
||||
render?:(...props:Array<any>) => React.ReactElement<any>;
|
||||
render?:(...props:Array<any>) => React.ReactElement;
|
||||
flux?:AltJS.Alt;
|
||||
transform?:(store:AltJS.AltStore<any>, actions:any) => any;
|
||||
shouldComponentUpdate?:(props:any) => boolean;
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for amap-js-sdk 1.4
|
||||
// Type definitions for non-npm package amap-js-sdk 1.4
|
||||
// Project: http://lbs.amap.com/api/javascript-api/summary/
|
||||
// Definitions by: Bian Zhongjie <https://github.com/agasbzj>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for amazon-cognito-auth-js 1.2
|
||||
// Project: https://github.com/aws/amazon-cognito-auth-js
|
||||
// Project: https://github.com/aws/amazon-cognito-auth-js, http://aws.amazon.com/cognito
|
||||
// Definitions by: Scott Escue <https://github.com/scottescue>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for amCharts 3.21
|
||||
// Project: http://www.amcharts.com/
|
||||
// Project: https://amcharts.com
|
||||
// Definitions by: ldrick <https://github.com/ldrick>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for AmplifyJs (using JQuery Deferred) 1.1
|
||||
// Project: http://amplifyjs.com/
|
||||
// Project: http://amplifyjs.com/, https://github.com/laurentiustamate94/amplify-deferred
|
||||
// Definitions by: Jonas Eriksson <https://github.com/joeriks>, Laurentiu Stamate <https://github.com/laurentiustamate94>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for amqplib 0.5
|
||||
// Project: https://github.com/squaremo/amqp.node
|
||||
// Project: https://github.com/squaremo/amqp.node, http://squaremo.github.io/amqp.node
|
||||
// Definitions by: Michael Nahkies <https://github.com/mnahkies>, Ab Reitsma <https://github.com/abreits>, Nicolás Fantone <https://github.com/nfantone>, Nick Zelei <https://github.com/zelein>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for analytics-node 3.1
|
||||
// Project: https://segment.com/docs/libraries/node/
|
||||
// Project: https://segment.com/docs/libraries/node/, https://github.com/segmentio/analytics-node
|
||||
// Definitions by: Andrew Fong <https://github.com/fongandrew>
|
||||
// Thomas Thiebaud <https://github.com/thomasthiebaud>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for angular-gridster (gridster module) 0.13
|
||||
// Project: https://github.com/ManifestWebDesign/angular-gridster
|
||||
// Project: https://github.com/ManifestWebDesign/angular-gridster, http://manifestwebdesign.github.io/angular-gridster
|
||||
// Definitions by: Joao Monteiro <https://github.com/jpmnteiro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for angular-hotkeys 1.7
|
||||
// Project: https://github.com/chieffancypants/angular-hotkeys
|
||||
// Project: https://github.com/chieffancypants/angular-hotkeys, https://chieffancypants.github.io/angular-hotkeys
|
||||
// Definitions by: Jason Zhao <https://github.com/jlz27>
|
||||
// Stefan Steinhart <https://github.com/reppners>
|
||||
// Cyril Gandon <https://github.com/cyrilgandon>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for angular-material 1.1
|
||||
// Project: https://github.com/angular/material
|
||||
// Project: https://github.com/angular/material, https://material.angularjs.org
|
||||
// Definitions by: Blake Bigelow <https://github.com/blbigelow>, Peter Hajdu <https://github.com/PeterHajdu>, Davide Donadello <https://github.com/Dona278>, Geert Jansen <https://github.com/geertjansen>, Edward Knowles <https://github.com/eknowles>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for angular-oauth2 4.1
|
||||
// Project: https://github.com/oauthjs/angular-oauth2
|
||||
// Project: https://github.com/oauthjs/angular-oauth2, https://github.com/seegno/angular-oauth2
|
||||
// Definitions by: Antério Vieira <https://github.com/anteriovieira>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for angular-websocket 2.0
|
||||
// Project: https://github.com/AngularClass/angular-websocket
|
||||
// Project: https://github.com/gdi2290/angular-websocket, https://github.com/angular-class/angular-websocket
|
||||
// Definitions by: Nick Veys <https://github.com/nickveys>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for ansi 0.3
|
||||
// Project: https://www.npmjs.com/package/ansi
|
||||
// Project: https://github.com/tootallnate/ansi.js
|
||||
// Definitions by: Gustavo6046 <https://github.com/Gustavo6046>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for anymatch 1.3
|
||||
// Project: https://github.com/es128/anymatch
|
||||
// Project: https://github.com/micromatch/anymatch
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for aos 3.0
|
||||
// Project: https://github.com/michalsnik/aos
|
||||
// Project: https://github.com/michalsnik/aos, https://michalsnik.github.io/aos
|
||||
// Definitions by: Rostislav Shermenyov <https://github.com/shermendev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArangoDB 3.4
|
||||
// Type definitions for non-npm package ArangoDB 3.4
|
||||
// Project: https://github.com/arangodb/arangodb
|
||||
// Definitions by: Alan Plum <https://github.com/pluma>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS REST API 10.4
|
||||
// Type definitions for non-npm package ArcGIS REST API 10.4
|
||||
// Project: http://resources.arcgis.com/en/help/arcgis-rest-api/
|
||||
// Definitions by: Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for artillery 1.6
|
||||
// Project: https://github.com/shoreditch-ops/artillery#readme
|
||||
// Project: https://github.com/artilleryio/artillery
|
||||
// Definitions by: Kira McCoan <https://github.com/kmccoan-allocadia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for commonjs-assert 1.4
|
||||
// Project: https://github.com/browserify/commonjs-assert
|
||||
// Project: https://github.com/browserify/commonjs-assert, https://github.com/defunctzombie/commonjs-assert
|
||||
// Definitions by: Nico Gallinal <https://github.com/nicoabie>
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for assets-webpack-plugin 3.5
|
||||
// Project: https://github.com/sporto/assets-webpack-plugin
|
||||
// Project: https://github.com/ztoben/assets-webpack-plugin
|
||||
// Definitions by: Michael Strobel <https://github.com/kryops>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for async-lock 1.1
|
||||
// Project: https://github.com/rain1017/async-lock
|
||||
// Project: https://github.com/rain1017/async-lock, https://github.com/rogierschouten/async-lock
|
||||
// Definitions by: Elisée MAURER <https://github.com/elisee>
|
||||
// Alejandro <https://github.com/afharo>
|
||||
// Anatoly <https://github.com/rhymmor>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for async.nexttick 0.5
|
||||
// Project: https://www.npmjs.com/package/async.nexttick
|
||||
// Project: https://github.com/caolan/async
|
||||
// Definitions by: Damien "pyrho" Rajon <https://github.com/pyrho>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Async 2.4
|
||||
// Project: https://github.com/caolan/async
|
||||
// Project: https://github.com/caolan/async, https://caolan.github.io/async
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
||||
// Arseniy Maximov <https://github.com/kern0>
|
||||
// Joe Herman <https://github.com/Penryn>
|
||||
|
||||
Vendored
+2
-2
@@ -42,9 +42,9 @@ export interface ButtonProps {
|
||||
/** Provides a url for buttons being used as a link. */
|
||||
readonly href?: string;
|
||||
/** Places an icon within the button, after the button's text. */
|
||||
readonly iconAfter?: ReactElement<any>;
|
||||
readonly iconAfter?: ReactElement;
|
||||
/** Places an icon within the button, before the button's text. */
|
||||
readonly iconBefore?: ReactElement<any>;
|
||||
readonly iconBefore?: ReactElement;
|
||||
/** Pass a reference on to the styled component */
|
||||
readonly innerRef?: (instance: any) => void;
|
||||
/** Provide a unique id to the button. */
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for atlaskit__calendar 5.0
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/, https://bitbucket.org/atlassian/atlaskit-mk-2
|
||||
// Definitions by: Lee Standen <https://github.com/lstanden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@ export interface BaseProps {
|
||||
/** Label above the input. */
|
||||
label?: string;
|
||||
/** Component to be shown when reading only */
|
||||
readView: ReactElement<any>;
|
||||
readView: ReactElement;
|
||||
/** Component to be shown when editing. Should be an @atlaskit/input. */
|
||||
editView?: ReactElement<any>;
|
||||
editView?: ReactElement;
|
||||
/** Set whether the read view should fit width, most obvious when hovered. */
|
||||
isFitContainerWidthReadView?: boolean;
|
||||
/** Greys out text and shows spinner. Does not disable input. */
|
||||
@@ -38,7 +38,7 @@ export interface BaseProps {
|
||||
/** Set whether default stylings should be disabled when editing. */
|
||||
disableEditViewFieldBase?: boolean;
|
||||
/** Component to be shown in an @atlaskit/inline-dialog when edit view is open. */
|
||||
invalidMessage?: ReactElement<any>;
|
||||
invalidMessage?: ReactElement;
|
||||
}
|
||||
|
||||
export interface StatelessProps extends BaseProps {
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @atlaskit/layer 3.1
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/, https://bitbucket.org/atlassian/atlaskit-mk-2
|
||||
// Definitions by: Lee Standen <https://github.com/lstanden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @atlaskit/single-select 4.0
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/
|
||||
// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/src/master/, https://bitbucket.org/atlassian/atlaskit-mk-2
|
||||
// Definitions by: Lee Standen <https://github.com/lstanden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Atom 1.31
|
||||
// Type definitions for non-npm package Atom 1.31
|
||||
// Project: https://github.com/atom/atom
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// smhxx <https://github.com/smhxx>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for auth0-lock 11.4
|
||||
// Project: http://auth0.com
|
||||
// Project: http://auth0.com, https://github.com/auth0/lock
|
||||
// Definitions by: Brian Caruso <https://github.com/carusology>
|
||||
// Dan Caddigan <https://github.com/goldcaddy77>
|
||||
// Larry Faudree <https://github.com/lfaudreejr>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for auto-launch 5.0
|
||||
// Project: https://github.com/Teamwork/node-auto-launch
|
||||
// Project: https://github.com/Teamwork/node-auto-launch, https://github.com/4ver/node-auto-launch
|
||||
// Definitions by: rhysd <https://github.com/rhysd>, Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for auto-sni 2.1
|
||||
// Project: https://www.npmjs.com/package/auto-sni
|
||||
// Project: https://github.com/dylanpiercey/auto-sni
|
||||
// Definitions by: Jan Wolf <https://github.com/janwo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for AutobahnJS 0.9
|
||||
// Project: http://autobahn.ws/js/
|
||||
// Project: http://autobahn.ws/js/, https://github.com/crossbario/autobahn-js
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl>, Andy Hawkins <https://github.com/a904guy>, Wladimir Totino <https://github.com/valepu>, Mathias Teier <https://github.com/glenroy37>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for axios-case-converter 0.3
|
||||
// Project: https://github.com/mpyw/axios-case-converter
|
||||
// Project: https://github.com/mpyw/axios-case-converter, https://github.com/mpyw/axios-interceptor-change-case
|
||||
// Definitions by: Derek Kniffin <https://github.com/dkniffin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
import { AxiosInstance } from "axios";
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-code-frame 6.20
|
||||
// Project: https://github.com/babel/babel/tree/master/packages
|
||||
// Project: https://github.com/babel/babel/tree/master/packages, https://babeljs.io
|
||||
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-core 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-core
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-generator 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Johnny Estilles <https://github.com/johnnyestilles>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-template 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-template
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-template, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-traverse 6.25
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Ryan Petrich <https://github.com/rpetrich>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babel-types 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-types
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-types, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Sam Baxter <https://github.com/baxtersa>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @babel/code-frame 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-code-frame
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-code-frame, https://babeljs.io
|
||||
// Definitions by: Mohsen Azimi <https://github.com/mohsen1>
|
||||
// Forbes Lindesay <https://github.com/ForbesLindesay>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @babel/core 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-core
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @babel/generator 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Johnny Estilles <https://github.com/johnnyestilles>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @babel/template 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-template
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-template, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Melvin Groenhoff <https://github.com/mgroenhoff>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for @babel/traverse 7.0
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse
|
||||
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Ryan Petrich <https://github.com/rpetrich>
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for babylon 6.16
|
||||
// Project: https://github.com/babel/babylon
|
||||
// Project: https://github.com/babel/babylon, https://babeljs.io
|
||||
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
||||
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for Backbone-associations 0.6.4
|
||||
// Project: https://github.com/dhruvaray/backbone-associations/
|
||||
// Project: http://dhruvaray.github.io/backbone-associations
|
||||
// Definitions by: Craig Brett <https://github.com/craigbrett17>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
Vendored
+120
-137
@@ -7,180 +7,163 @@
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
import { Events, EventsHash, Model as BModel, Collection } from 'backbone';
|
||||
import { EventsMixin, Events, Model as BModel, Collection } from 'backbone';
|
||||
|
||||
declare module 'backbone-relational' {
|
||||
class Model extends BModel {
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
**/
|
||||
//private static extend(properties:any, classProperties?:any):any;
|
||||
export class Model extends BModel {
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
**/
|
||||
//private static extend(properties:any, classProperties?:any):any;
|
||||
|
||||
relations:any;
|
||||
subModelTypes:any;
|
||||
subModelTypeAttribute:any;
|
||||
relations:any;
|
||||
subModelTypes:any;
|
||||
subModelTypeAttribute:any;
|
||||
|
||||
|
||||
initializeRelations(options:any):void;
|
||||
initializeRelations(options:any):void;
|
||||
|
||||
updateRelations(options:any):void;
|
||||
updateRelations(options:any):void;
|
||||
|
||||
queue(func:any):void;
|
||||
queue(func:any):void;
|
||||
|
||||
processQueue():void;
|
||||
processQueue():void;
|
||||
|
||||
getRelation(name:string):Relation;
|
||||
getRelation(name:string):Relation;
|
||||
|
||||
getRelations():Relation[];
|
||||
getRelations():Relation[];
|
||||
|
||||
fetchRelated(key:string, options?:any, update?:boolean):any;
|
||||
fetchRelated(key:string, options?:any, update?:boolean):any;
|
||||
|
||||
toJSON(options?: any):any;
|
||||
toJSON(options?: any):any;
|
||||
|
||||
static setup();
|
||||
static setup();
|
||||
|
||||
static build(attributes:any, options?:any);
|
||||
static build(attributes:any, options?:any);
|
||||
|
||||
static findOrCreate(attributes:string, options?:any);
|
||||
static findOrCreate(attributes:string, options?:any);
|
||||
|
||||
static findOrCreate(attributes:number, options?:any);
|
||||
static findOrCreate(attributes:number, options?:any);
|
||||
|
||||
static findOrCreate(attributes:any, options?:any);
|
||||
}
|
||||
static findOrCreate(attributes:any, options?:any);
|
||||
}
|
||||
|
||||
export class Relation extends BModel {
|
||||
export class Relation extends BModel {
|
||||
|
||||
options:any;
|
||||
instance:any;
|
||||
key:any;
|
||||
keyContents:any;
|
||||
relatedModel:any;
|
||||
relatedCollection:any;
|
||||
reverseRelation:any;
|
||||
related:any;
|
||||
options:any;
|
||||
instance:any;
|
||||
key:any;
|
||||
keyContents:any;
|
||||
relatedModel:any;
|
||||
relatedCollection:any;
|
||||
reverseRelation:any;
|
||||
related:any;
|
||||
|
||||
checkPreconditions():boolean;
|
||||
checkPreconditions():boolean;
|
||||
|
||||
setRelated(related:BModel):void;
|
||||
setRelated(related:BModel):void;
|
||||
|
||||
setRelated(related:Collection<BModel>):void;
|
||||
setRelated(related:Collection<BModel>):void;
|
||||
|
||||
getReverseRelations(model:Model):Relation;
|
||||
getReverseRelations(model:Model):Relation;
|
||||
|
||||
destroy():void;
|
||||
}
|
||||
destroy():void;
|
||||
}
|
||||
|
||||
export class HasOne extends Relation {
|
||||
collectionType:any;
|
||||
export class HasOne extends Relation {
|
||||
collectionType:any;
|
||||
|
||||
findRelated(options:any):BModel;
|
||||
findRelated(options:any):BModel;
|
||||
|
||||
setKeyContents(keyContents:string):void;
|
||||
setKeyContents(keyContents:string):void;
|
||||
|
||||
setKeyContents(keyContents:string[]):void;
|
||||
setKeyContents(keyContents:string[]):void;
|
||||
|
||||
setKeyContents(keyContents:number):void;
|
||||
setKeyContents(keyContents:number):void;
|
||||
|
||||
setKeyContents(keyContents:number[]):void;
|
||||
setKeyContents(keyContents:number[]):void;
|
||||
|
||||
setKeyContents(keyContents:Collection<BModel>):void;
|
||||
setKeyContents(keyContents:Collection<BModel>):void;
|
||||
|
||||
onChange(model:BModel, attr:any, options:any):void;
|
||||
onChange(model:BModel, attr:any, options:any):void;
|
||||
|
||||
handleAddition(model:BModel, coll:Collection<BModel>, options:any):void;
|
||||
handleAddition(model:BModel, coll:Collection<BModel>, options:any):void;
|
||||
|
||||
handleRemoval(model:BModel, coll:Collection<BModel>, options:any):void;
|
||||
handleRemoval(model:BModel, coll:Collection<BModel>, options:any):void;
|
||||
|
||||
handleReset(coll:Collection<BModel>, options:any):void;
|
||||
handleReset(coll:Collection<BModel>, options:any):void;
|
||||
|
||||
tryAddRelated(model:BModel, coll:any, options:any):void;
|
||||
tryAddRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
addRelated(model:BModel, options:any):void;
|
||||
addRelated(model:BModel, options:any):void;
|
||||
|
||||
removeRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
export class HasMany extends Relation {
|
||||
collectionType:any;
|
||||
|
||||
findRelated(options:any):BModel;
|
||||
|
||||
setKeyContents(keyContents:string):void;
|
||||
|
||||
setKeyContents(keyContents:number):void;
|
||||
|
||||
setKeyContents(keyContents:BModel):void;
|
||||
|
||||
onChange(model:BModel, attr:any, options:any):void;
|
||||
|
||||
tryAddRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
addRelated(model:BModel, options:any):void;
|
||||
|
||||
removeRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
}
|
||||
|
||||
export class Store implements Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
initializeRelation(model, relation, options);
|
||||
|
||||
addModelScope(scope:any):void;
|
||||
|
||||
removeModelScope(scope):void;
|
||||
|
||||
addSubModels(subModelTypes:Model, superModelType:Model):void;
|
||||
|
||||
setupSuperModel(modelType:Model):void;
|
||||
|
||||
addReverseRelation(relation:any):void;
|
||||
|
||||
addOrphanRelation(relation:any):void;
|
||||
|
||||
processOrphanRelations():void;
|
||||
|
||||
retroFitRelation(relation:Model, create:boolean):Collection<BModel>;
|
||||
|
||||
getCollection(type:Model, create:boolean):Collection<BModel>;
|
||||
|
||||
getObjectByName(name:string):any;
|
||||
|
||||
|
||||
resolveIdForItem(type:any, item:any):any;
|
||||
|
||||
static find(type:any, item:string):Model;
|
||||
|
||||
static find(type:any, item:number):Model;
|
||||
|
||||
static find(type:any, item:Model):Model;
|
||||
|
||||
static find(type:any, item:any):Model;
|
||||
|
||||
register(model:Model):void;
|
||||
|
||||
checkId(model:Model, id:any):void;
|
||||
|
||||
update(model:Model):void;
|
||||
|
||||
unregister(model:Model, collection:Collection<BModel>, options:any):void;
|
||||
|
||||
reset():void;
|
||||
|
||||
|
||||
}
|
||||
removeRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
export class HasMany extends Relation {
|
||||
collectionType:any;
|
||||
|
||||
findRelated(options:any):BModel;
|
||||
|
||||
setKeyContents(keyContents:string):void;
|
||||
|
||||
setKeyContents(keyContents:number):void;
|
||||
|
||||
setKeyContents(keyContents:BModel):void;
|
||||
|
||||
onChange(model:BModel, attr:any, options:any):void;
|
||||
|
||||
tryAddRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
addRelated(model:BModel, options:any):void;
|
||||
|
||||
removeRelated(model:BModel, coll:any, options:any):void;
|
||||
|
||||
}
|
||||
|
||||
export class Store extends EventsMixin implements Events {
|
||||
initializeRelation(model, relation, options);
|
||||
|
||||
addModelScope(scope:any):void;
|
||||
|
||||
removeModelScope(scope):void;
|
||||
|
||||
addSubModels(subModelTypes:Model, superModelType:Model):void;
|
||||
|
||||
setupSuperModel(modelType:Model):void;
|
||||
|
||||
addReverseRelation(relation:any):void;
|
||||
|
||||
addOrphanRelation(relation:any):void;
|
||||
|
||||
processOrphanRelations():void;
|
||||
|
||||
retroFitRelation(relation:Model, create:boolean):Collection<BModel>;
|
||||
|
||||
getCollection(type:Model, create:boolean):Collection<BModel>;
|
||||
|
||||
getObjectByName(name:string):any;
|
||||
|
||||
|
||||
resolveIdForItem(type:any, item:any):any;
|
||||
|
||||
static find(type:any, item:string):Model;
|
||||
|
||||
static find(type:any, item:number):Model;
|
||||
|
||||
static find(type:any, item:Model):Model;
|
||||
|
||||
static find(type:any, item:any):Model;
|
||||
|
||||
register(model:Model):void;
|
||||
|
||||
checkId(model:Model, id:any):void;
|
||||
|
||||
update(model:Model):void;
|
||||
|
||||
unregister(model:Model, collection:Collection<BModel>, options:any):void;
|
||||
|
||||
reset():void;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,79 +1,24 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+7
-12
@@ -1,11 +1,12 @@
|
||||
// Type definitions for Marionette 3.3
|
||||
// Project: https://github.com/marionettejs/
|
||||
// Project: https://github.com/marionettejs/, https://marionettejs.com
|
||||
// Definitions by: Zeeshan Hamid <https://github.com/zhamid>,
|
||||
// Natan Vivo <https://github.com/nvivo>,
|
||||
// Sven Tschui <https://github.com/sventschui>,
|
||||
// Volker Nauruhn <https://github.com/razorness>,
|
||||
// Ard Timmerman <https://github.com/confususs>,
|
||||
// J. Joe Koullas <https://github.com/jjoekoullas>
|
||||
// Julian Gonggrijp <https://github.com/jgonggrijp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -407,20 +408,14 @@ export interface ObjectOptions extends RadioMixinOptions {
|
||||
* A base class which other classes can extend from. Object incorporates many
|
||||
* backbone conventions and utilities like initialize and Backbone.Events.
|
||||
*/
|
||||
export class Object implements CommonMixin, RadioMixin, Backbone.Events {
|
||||
export class Object extends Backbone.EventsMixin implements CommonMixin, RadioMixin, Backbone.Events {
|
||||
constructor(options?: ObjectOptions);
|
||||
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
/**
|
||||
* Faulty overgeneralization of Backbone.Events.on, for historical
|
||||
* reasons.
|
||||
*/
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
|
||||
/**
|
||||
* Receives a hash of event names and functions and/or function names,
|
||||
|
||||
Vendored
+6
-11
@@ -1,6 +1,7 @@
|
||||
// Type definitions for Backbone.Radio v0.8.3
|
||||
// Project: https://github.com/marionettejs/backbone.radio
|
||||
// Definitions by: Peter Palotas <https://github.com/alphaleonis>
|
||||
// Julian Gonggrijp <https://github.com/jgonggrijp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -71,18 +72,12 @@ declare module "backbone" {
|
||||
stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
|
||||
}
|
||||
|
||||
class Channel implements Commands, Requests, Backbone.Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
class Channel extends Backbone.EventsMixin implements Commands, Requests, Backbone.Events {
|
||||
/**
|
||||
* Faulty overgeneralization of Backbone.Events.on, for historical
|
||||
* reasons.
|
||||
*/
|
||||
on(eventName: any, callback?: any, context?: any): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
channelName: string;
|
||||
reset(): Channel;
|
||||
|
||||
|
||||
@@ -15,6 +15,50 @@ function test_events() {
|
||||
object.off();
|
||||
}
|
||||
|
||||
class PubSub implements Backbone.Events {
|
||||
on: Backbone.Events_On<PubSub>;
|
||||
off: Backbone.Events_Off<PubSub>;
|
||||
trigger: Backbone.Events_Trigger<PubSub>;
|
||||
bind: Backbone.Events_On<PubSub>;
|
||||
unbind: Backbone.Events_Off<PubSub>;
|
||||
|
||||
once: Backbone.Events_On<PubSub>;
|
||||
listenTo: Backbone.Events_Listen<PubSub>;
|
||||
listenToOnce: Backbone.Events_Listen<PubSub>;
|
||||
stopListening: Backbone.Events_Stop<PubSub>;
|
||||
}
|
||||
|
||||
Object.assign(PubSub.prototype, Backbone.Events);
|
||||
|
||||
function test_events_shorthands() {
|
||||
let channel1 = new PubSub();
|
||||
let channel2 = new PubSub();
|
||||
let onChange = () => alert('whatever');
|
||||
|
||||
channel1.on("alert", (eventName: string) => alert("Triggered " + eventName));
|
||||
channel1.trigger("alert", "an event");
|
||||
|
||||
channel1.once('invalid', () => { }, this);
|
||||
channel1.once('invalid', () => { });
|
||||
channel1.once({invalid: () => { }, success: () => { }}, this);
|
||||
channel1.once({invalid: () => { }, success: () => { }});
|
||||
|
||||
channel1.off("change", onChange);
|
||||
channel1.off("change");
|
||||
channel1.off(null, onChange);
|
||||
channel1.off(null, null, this);
|
||||
channel1.off();
|
||||
|
||||
channel2.listenTo(channel1, 'invalid', () => { });
|
||||
channel2.listenTo(channel1, {invalid: () => { }, success: () => { }});
|
||||
channel2.listenToOnce(channel1, 'invalid', () => { });
|
||||
channel2.listenToOnce(channel1, {invalid: () => { }, success: () => { }});
|
||||
|
||||
channel2.stopListening(channel1, 'invalid', () => { });
|
||||
channel2.stopListening(channel1, 'invalid');
|
||||
channel2.stopListening(channel1);
|
||||
}
|
||||
|
||||
class SettingDefaults extends Backbone.Model {
|
||||
|
||||
// 'defaults' could be set in one of the following ways:
|
||||
@@ -272,18 +316,22 @@ namespace v1Changes {
|
||||
var model = new Employee;
|
||||
model.once('invalid', () => { }, this);
|
||||
model.once('invalid', () => { });
|
||||
model.once({invalid: () => { }, success: () => { }}, this);
|
||||
model.once({invalid: () => { }, success: () => { }});
|
||||
}
|
||||
|
||||
function test_listenTo() {
|
||||
var model = new Employee;
|
||||
var view = new Backbone.View<Employee>();
|
||||
view.listenTo(model, 'invalid', () => { });
|
||||
view.listenTo(model, {invalid: () => { }, success: () => { }});
|
||||
}
|
||||
|
||||
function test_listenToOnce() {
|
||||
var model = new Employee;
|
||||
var view = new Backbone.View<Employee>();
|
||||
view.listenToOnce(model, 'invalid', () => { });
|
||||
view.listenToOnce(model, {invalid: () => { }, success: () => { }});
|
||||
}
|
||||
|
||||
function test_stopListening() {
|
||||
@@ -398,7 +446,7 @@ namespace v1Changes {
|
||||
namespace Collection {
|
||||
function test_fetch() {
|
||||
var collection = new EmployeeCollection;
|
||||
collection.fetch({
|
||||
collection.fetch({
|
||||
reset: true,
|
||||
remove: false
|
||||
});
|
||||
|
||||
Vendored
+101
-48
@@ -1,9 +1,11 @@
|
||||
// Type definitions for Backbone 1.3.3
|
||||
// Project: http://backbonejs.org/
|
||||
// https://github.com/jashkenas/backbone
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
||||
// Natan Vivo <https://github.com/nvivo>
|
||||
// kenjiru <https://github.com/kenjiru>
|
||||
// jjoekoullas <https://github.com/jjoekoullas>
|
||||
// Julian Gonggrijp <https://github.com/jgonggrijp>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -91,44 +93,113 @@ declare namespace Backbone {
|
||||
[routePattern: string]: string | {(...urlParts: string[]): void};
|
||||
}
|
||||
|
||||
/**
|
||||
* DOM events (used in the events property of a View)
|
||||
*/
|
||||
interface EventsHash {
|
||||
[selector: string]: string | {(eventObject: JQuery.TriggeredEvent): void};
|
||||
}
|
||||
|
||||
export const Events: Events;
|
||||
interface Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
/**
|
||||
* JavaScript events (used in the methods of the Events interface)
|
||||
*/
|
||||
interface EventHandler {
|
||||
(...args: any[]): void;
|
||||
}
|
||||
interface EventMap {
|
||||
[event: string]: EventHandler;
|
||||
}
|
||||
|
||||
class ModelBase implements Events {
|
||||
on(eventName: string, callback?: Function, context?: any): any;
|
||||
on(eventMap: EventsHash): any;
|
||||
on(eventName: any, callback?: any, context?: any): any
|
||||
off(eventName?: string, callback?: Function, context?: any): any
|
||||
trigger(eventName: string, ...args: any[]): any
|
||||
bind(eventName: string, callback: Function, context?: any): any
|
||||
unbind(eventName?: string, callback?: Function, context?: any): any
|
||||
once(events: string, callback: Function, context?: any): any
|
||||
listenTo(object: any, events: string, callback: Function):any
|
||||
listenToOnce(object: any, events: string, callback: Function): any
|
||||
stopListening(object?: any, events?: string, callback?: Function): any
|
||||
export const Events: Events;
|
||||
interface Events extends EventsMixin { }
|
||||
|
||||
/**
|
||||
* Helper shorthands for classes that implement the Events interface.
|
||||
* Define your class like this:
|
||||
*
|
||||
* import {
|
||||
* Events,
|
||||
* Events_On,
|
||||
* Events_Off,
|
||||
* Events_Trigger,
|
||||
* Events_Listen,
|
||||
* Events_Stop,
|
||||
* } from 'backbone';
|
||||
*
|
||||
* class YourClass implements Events {
|
||||
* on: Events_On<YourClass>;
|
||||
* off: Events_Off<YourClass>;
|
||||
* trigger: Events_Trigger<YourClass>;
|
||||
* bind: Events_On<YourClass>;
|
||||
* unbind: Events_Off<YourClass>;
|
||||
*
|
||||
* once: Events_On<YourClass>;
|
||||
* listenTo: Events_Listen<YourClass>;
|
||||
* listenToOnce: Events_Listen<YourClass>;
|
||||
* stopListening: Events_Stop<YourClass>;
|
||||
*
|
||||
* // ... (other methods)
|
||||
* }
|
||||
*
|
||||
* Object.assign(YourClass.prototype, Events); // can also use _.extend
|
||||
*
|
||||
* If you are just writing a class type declaration that doesn't already
|
||||
* extend some other base class, you can use the EventsMixin instead;
|
||||
* see below.
|
||||
*/
|
||||
interface Events_On<BaseT> {
|
||||
<T extends BaseT>(this: T, eventName: string, callback: EventHandler, context?: any): T;
|
||||
<T extends BaseT>(this: T, eventMap: EventMap, context?: any): T;
|
||||
}
|
||||
interface Events_Off<BaseT> {
|
||||
<T extends BaseT>(this: T, eventName?: string, callback?: EventHandler, context?: any): T;
|
||||
}
|
||||
interface Events_Trigger<BaseT> {
|
||||
<T extends BaseT>(this: T, eventName: string, ...args: any[]): T;
|
||||
}
|
||||
interface Events_Listen<BaseT> {
|
||||
<T extends BaseT>(this: T, object: any, events: string, callback: EventHandler): T;
|
||||
<T extends BaseT>(this: T, object: any, eventMap: EventMap): T;
|
||||
}
|
||||
interface Events_Stop<BaseT> {
|
||||
<T extends BaseT>(this: T, object?: any, events?: string, callback?: EventHandler): T;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to avoid code repetition in type declarations.
|
||||
* Backbone.Events cannot be extended, hence a separate abstract
|
||||
* class with a different name. Both classes and interfaces can
|
||||
* extend from this helper class to reuse the signatures.
|
||||
*
|
||||
* For class type declarations that already extend another base
|
||||
* class, and for actual class definitions, please see the
|
||||
* Events_* interfaces above.
|
||||
*/
|
||||
abstract class EventsMixin implements Events {
|
||||
on(eventName: string, callback: EventHandler, context?: any): this;
|
||||
on(eventMap: EventMap, context?: any): this;
|
||||
off(eventName?: string, callback?: EventHandler, context?: any): this;
|
||||
trigger(eventName: string, ...args: any[]): this;
|
||||
bind(eventName: string, callback: EventHandler, context?: any): this;
|
||||
bind(eventMap: EventMap, context?: any): this;
|
||||
unbind(eventName?: string, callback?: EventHandler, context?: any): this;
|
||||
|
||||
once(events: string, callback: EventHandler, context?: any): this;
|
||||
once(eventMap: EventMap, context?: any): this;
|
||||
listenTo(object: any, events: string, callback: EventHandler): this;
|
||||
listenTo(object: any, eventMap: EventMap): this;
|
||||
listenToOnce(object: any, events: string, callback: EventHandler): this;
|
||||
listenToOnce(object: any, eventMap: EventMap): this;
|
||||
stopListening(object?: any, events?: string, callback?: EventHandler): this;
|
||||
}
|
||||
|
||||
class ModelBase extends EventsMixin {
|
||||
parse(response: any, options?: any): any;
|
||||
toJSON(options?: any): any;
|
||||
sync(...arg: any[]): JQueryXHR;
|
||||
}
|
||||
|
||||
class Model extends ModelBase {
|
||||
class Model extends ModelBase implements Events {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -229,7 +300,7 @@ declare namespace Backbone {
|
||||
matches(attrs: any): boolean;
|
||||
}
|
||||
|
||||
class Collection<TModel extends Model> extends ModelBase {
|
||||
class Collection<TModel extends Model> extends ModelBase implements Events {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -367,7 +438,7 @@ declare namespace Backbone {
|
||||
without(...values: TModel[]): TModel[];
|
||||
}
|
||||
|
||||
class Router extends EventSignatures {
|
||||
class Router extends EventsMixin implements Events {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -396,7 +467,7 @@ declare namespace Backbone {
|
||||
|
||||
var history: History;
|
||||
|
||||
class History extends EventSignatures {
|
||||
class History extends EventsMixin implements Events {
|
||||
|
||||
handlers: any[];
|
||||
interval: number;
|
||||
@@ -433,7 +504,7 @@ declare namespace Backbone {
|
||||
attributes?: {[id: string]: any};
|
||||
}
|
||||
|
||||
class View<TModel extends Model> extends EventSignatures {
|
||||
class View<TModel extends Model> extends EventsMixin implements Events {
|
||||
|
||||
/**
|
||||
* Do not use, prefer TypeScript's extend functionality.
|
||||
@@ -485,21 +556,3 @@ declare namespace Backbone {
|
||||
function noConflict(): typeof Backbone;
|
||||
var $: JQueryStatic;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not for external use and is only here as a convenient way to
|
||||
* specify signatures for internal implementers of Backbone.Events
|
||||
*/
|
||||
declare abstract class EventSignatures implements Backbone.Events {
|
||||
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
on(eventMap: Backbone.EventsHash): any;
|
||||
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
trigger(eventName: string, ...args: any[]): any;
|
||||
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
|
||||
|
||||
once(events: string, callback: (...args: any[]) => void, context?: any): any;
|
||||
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
|
||||
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
|
||||
}
|
||||
@@ -8,73 +8,35 @@
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-angle-bracket-type-assertion": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for swan-app 2.2
|
||||
// Type definitions for non-npm package swan-app 2.2
|
||||
// Project: https://smartprogram.baidu.com/docs/develop/tutorial/codedir/
|
||||
// Definitions by: taoqf <https://github.com/taoqf>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for bdapi 0.2
|
||||
// Type definitions for non-npm package bdapi 0.2
|
||||
// Project: https://github.com/rauenzi/BetterDiscordApp
|
||||
// Definitions by: Ari Seyhun <https://github.com/Acidic9>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// Type definitions for base-64 0.1
|
||||
// Project: https://github.com/mathiasbynens/base64
|
||||
// Project: https://github.com/mathiasbynens/base64, http://mths.be/base64
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user