mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 16:45:10 +08:00
Merge pull request #11403 from algolia/master
adding algoliasearch-client-js definitions
This commit is contained in:
136
algoliasearch-client-js/algoliasearch-client-js-tests.ts
Normal file
136
algoliasearch-client-js/algoliasearch-client-js-tests.ts
Normal file
@@ -0,0 +1,136 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
///<reference path="./algoliasearch-client-js.d.ts"/>
|
||||
|
||||
var algoliasearch = require('algoliasearch');
|
||||
|
||||
var _clientOptions: ClientOptions = {
|
||||
timeout : 12,
|
||||
protocol: "",
|
||||
httpAgent: ""
|
||||
};
|
||||
|
||||
var _synonymOption: SynonymOption = {
|
||||
forwardToSlaves: false,
|
||||
replaceExistingSynonyms: false
|
||||
};
|
||||
|
||||
var _algoliaUserKeyOptions : AlgoliaUserKeyOptions = {
|
||||
validity: 0,
|
||||
maxQueriesPerIPPerHour: 0,
|
||||
indexes: [""],
|
||||
queryParameters: { attributesToRetrieve: ["algolia"] },
|
||||
description: ""
|
||||
};
|
||||
|
||||
var _searchSynonymOptions : SearchSynonymOptions = {
|
||||
query: "",
|
||||
page: 0,
|
||||
type: "",
|
||||
hitsPerPage: 0
|
||||
};
|
||||
|
||||
var _algoliaSecuredApiOptions: AlgoliaSecuredApiOptions = {
|
||||
filters: "",
|
||||
validUntil: 0,
|
||||
restrictIndices: "",
|
||||
userToken: ""
|
||||
};
|
||||
|
||||
var _algoliaIndexSettings : AlgoliaIndexSettings = {
|
||||
attributesToIndex: [""],
|
||||
attributesforFaceting: [""],
|
||||
unretrievableAttributes: [""],
|
||||
attributesToRetrieve: [""],
|
||||
ranking: [""],
|
||||
customRanking: [""],
|
||||
slaves: [""],
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [""],
|
||||
attributesToSnippet: [""],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
separatorsToIndex: '',
|
||||
queryType: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [""],
|
||||
removeStopWords: [""],
|
||||
disablePrefixOnAttributes: [""],
|
||||
disableExactOnAttributes: [""],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: false,
|
||||
attributeForDistinct: "",
|
||||
distinct: false,
|
||||
numericAttributesToIndex: [""],
|
||||
allowCompressionOfIntegerArray: false,
|
||||
altCorrections: [{}],
|
||||
minProximity: 0,
|
||||
placeholders: ''
|
||||
};
|
||||
|
||||
var _algoliaQueryParameters : AlgoliaQueryParameters = {
|
||||
query: '',
|
||||
filters: '',
|
||||
attributesToRetrieve: [""],
|
||||
restrictSearchableAttributes: [""],
|
||||
facets: '',
|
||||
maxValuesPerFacet: '',
|
||||
attributesToHighlight: [''],
|
||||
attributesToSnippet: [''],
|
||||
highlightPreTag: '',
|
||||
highlightPostTag: '',
|
||||
snippetEllipsisText: '',
|
||||
restrictHighlightAndSnippetArrays: false,
|
||||
hitsPerPage: 0,
|
||||
page: 0,
|
||||
offset: 0,
|
||||
length: 0,
|
||||
minWordSizefor1Typo: 0,
|
||||
minWordSizefor2Typos: 0,
|
||||
typoTolerance: false,
|
||||
allowTyposOnNumericTokens: false,
|
||||
ignorePlurals: false,
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: '',
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: '',
|
||||
queryType: '',
|
||||
insidePolygon: '',
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
removeStopWords: [''],
|
||||
disableExactOnAttributes: [''],
|
||||
exactOnSingleWordQuery: '',
|
||||
alternativesAsExact: true,
|
||||
distinct: 0,
|
||||
getRankingInfo: false,
|
||||
numericAttributesToIndex: [''],
|
||||
numericFilters: [''],
|
||||
tagFilters: '',
|
||||
facetFilters: '',
|
||||
analytics: false,
|
||||
analyticsTags: [''],
|
||||
synonyms: true,
|
||||
replaceSynonymsInHighlight: false,
|
||||
minProximity: 0
|
||||
};
|
||||
|
||||
var index: AlgoliaIndex = algoliasearch('', '').initIndex('');
|
||||
|
||||
var search = index.search({query: ""});
|
||||
index.search({query: ""}, function(err, res){});
|
||||
|
||||
|
||||
1571
algoliasearch-client-js/algoliasearch-client-js.d.ts
vendored
Normal file
1571
algoliasearch-client-js/algoliasearch-client-js.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user