@mappedin/mappedin-js 5.0.0-beta.3 → 5.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,6 +28,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue' {
28
28
  export type { TOperationHoursMap } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinLocation';
29
29
  export type { TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
30
30
  export { OfflineSearch } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.OfflineSearch';
31
+ export type { TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.OfflineSearch';
31
32
  /** API data types */
32
33
  export type { TLocationType, TNode, TImage, TLogo, TGalleryImage, TPhone, TSocial, TColor, TVortex, TPicture, TOpeningHours, TSiblingGroup, TState, TCategory, TEvent, TGeoReference, TMap, TMapGroup, TBuilding, TLocation, TPolygon, TPolygonRanking, TVenue, TMappedinAPI } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.API.types';
33
34
  export type { TGetVenueOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types';
@@ -131,6 +132,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types
131
132
  };
132
133
  venue: string;
133
134
  things?: any;
135
+ useDraftData?: boolean;
136
+ platformString?: string;
134
137
  };
135
138
  export type TGetVenueOptionsInternal = {
136
139
  baseUrl?: string;
@@ -1224,7 +1227,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Offli
1224
1227
  *
1225
1228
  * @class Mappedin.OfflineSearch
1226
1229
  */
1227
- export type TOfflineSearchOptions = Partial<{
1230
+ export type TMappedinOfflineSearchAllOptions = {
1228
1231
  /**
1229
1232
  * Array of stopwords to ignore when searching, default: english stopwords
1230
1233
  */
@@ -1257,6 +1260,11 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Offli
1257
1260
  * Use the location polygons' rank in weighing results
1258
1261
  */
1259
1262
  useLocationRank?: boolean;
1263
+ /**
1264
+ * Emit Analytics events when doing search
1265
+ * @default true when running in production
1266
+ */
1267
+ emitAnalyticsEvents?: boolean;
1260
1268
  /**
1261
1269
  * Fine tune search constants
1262
1270
  */
@@ -1307,8 +1315,8 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Offli
1307
1315
  */
1308
1316
  PRIMARY_INDEX_TAGS_NAME_WEIGHT: number;
1309
1317
  /**
1310
- * Default rank when one isn't available in the data, default = 0.1
1311
- * @default 0.1
1318
+ * Default rank when one isn't available in the data, default = 1
1319
+ * @default 1
1312
1320
  */
1313
1321
  LOCATION_DEFAULT_RANK: number;
1314
1322
  /**
@@ -1322,31 +1330,72 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Offli
1322
1330
  */
1323
1331
  RATIO_OF_PREFIX_TO_EXACT: number;
1324
1332
  };
1325
- }>;
1333
+ };
1334
+ export type TMappedinOfflineAllSearchMatch = {
1335
+ /**
1336
+ * The term that was found
1337
+ */
1338
+ term: string;
1339
+ /**
1340
+ * Term's weight
1341
+ */
1342
+ weight: number;
1343
+ /**
1344
+ * What field the search matched on
1345
+ */
1346
+ matchesOn: string;
1347
+ /**
1348
+ * The value of that field
1349
+ */
1350
+ value?: string;
1351
+ };
1352
+ export type TMappedinOfflineSearchOptions = Partial<TMappedinOfflineSearchAllOptions>;
1326
1353
  export type TMappedinOfflineSearchResult = {
1327
- type: 'MappedinLocation' | 'MappedinCategory' | string;
1328
- matches: {
1329
- term: string;
1330
- weight: number;
1331
- matchesOn: string;
1332
- value?: string;
1333
- }[];
1354
+ /**
1355
+ * Type describing the object
1356
+ */
1357
+ type: 'MappedinLocation' | 'MappedinCategory' | 'Custom';
1358
+ /**
1359
+ * Details on why the result was returned
1360
+ */
1361
+ matches: TMappedinOfflineAllSearchMatch[];
1362
+ /**
1363
+ * Found object
1364
+ */
1334
1365
  object: MappedinLocation | MappedinCategory | Record<string, unknown>;
1366
+ /**
1367
+ * Total score of the result
1368
+ */
1335
1369
  score: number;
1336
1370
  };
1337
1371
  export type TMappedinOfflineSearchSuggestions = {
1372
+ /**
1373
+ * Total number of suggestions generated
1374
+ */
1338
1375
  total: number;
1376
+ /**
1377
+ * List of suggestions
1378
+ */
1339
1379
  hits: {
1380
+ /**
1381
+ * Suggestion text
1382
+ */
1340
1383
  text: string;
1341
1384
  }[];
1342
1385
  };
1386
+ /**
1387
+ * A {@link OfflineSearch} is an offline search module. It can be initialized at any time by passing the {@link Mappedin} object and a set of {@link TMappedinOfflineSearchOptions} options.
1388
+ *
1389
+ *
1390
+ * @class Mappedin.OfflineSearch
1391
+ */
1343
1392
  export class OfflineSearch {
1344
1393
  #private;
1345
1394
  constructor(
1346
1395
  /**
1347
1396
  * Mappedin Venue Object, typically returned by `getVenue`/`showVenue`
1348
1397
  */
1349
- mappedin: Mappedin, options?: TOfflineSearchOptions);
1398
+ mappedin: Mappedin, options?: TMappedinOfflineSearchOptions);
1350
1399
  /**
1351
1400
  * Get Suggestions for term
1352
1401
  */
@@ -1373,10 +1422,9 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Offli
1373
1422
  */
1374
1423
  addQuery(params: {
1375
1424
  /**
1376
- * Query to match for this object, accepts a string, or
1377
- * a list of strings (for extra tags for example)
1425
+ * Query string to match for this object
1378
1426
  */
1379
- query: string | string[];
1427
+ query: string;
1380
1428
  /**
1381
1429
  * Object that is returned when query matches
1382
1430
  */
@@ -1881,6 +1929,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.Analy
1881
1929
  venue: string;
1882
1930
  testMode?: boolean | string;
1883
1931
  context?: string;
1932
+ platformString?: string;
1884
1933
  };
1885
1934
  /**
1886
1935
  * A class to access the Mappedin Analytics platform. Correct usage will improve Smart Search results, and lead to more accurate insights.
@@ -1981,6 +2030,7 @@ declare module '@mappedin/mappedin-js/lib/esm/get-venue/get-venue' {
1981
2030
  export type { TOperationHoursMap } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinLocation';
1982
2031
  export type { TDirectionToOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/MappedinNavigatable';
1983
2032
  export { OfflineSearch } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.OfflineSearch';
2033
+ export type { TMappedinOfflineSearchOptions, TMappedinOfflineSearchResult, TMappedinOfflineSearchSuggestions, TMappedinOfflineAllSearchMatch, TMappedinOfflineSearchAllOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.OfflineSearch';
1984
2034
  /** API data types */
1985
2035
  export type { TLocationType, TNode, TImage, TLogo, TGalleryImage, TPhone, TSocial, TColor, TVortex, TPicture, TOpeningHours, TSiblingGroup, TState, TCategory, TEvent, TGeoReference, TMap, TMapGroup, TBuilding, TLocation, TPolygon, TPolygonRanking, TVenue, TMappedinAPI } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.API.types';
1986
2036
  export type { TGetVenueOptions } from '@mappedin/mappedin-js/lib/esm/get-venue/get-venue/Mappedin.types';