From cc67538044bc38d15ce2a7a69ffe84a738f5b483 Mon Sep 17 00:00:00 2001 From: simonlary Date: Wed, 14 Oct 2020 18:16:24 -0400 Subject: [PATCH] Fix and update the TypeScript typings (#553) * Add autocompleteSeparator to type definition file. * Add spaceSelectsMatch to type definition file. * Fix type definition file by specifying array type. --- tributejs.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tributejs.d.ts b/tributejs.d.ts index 66a90fb7..00b0e38f 100644 --- a/tributejs.d.ts +++ b/tributejs.d.ts @@ -71,6 +71,9 @@ export type TributeCollection = { //specify whether to put Tribute in autocomplete mode autocompleteMode?: boolean; + // specify a regex to define after which characters the autocomplete option should open + autocompleteSeparator?: RegExp; + // Customize the elements used to wrap matched strings within the results list searchOpts?: TributeSearchOpts; @@ -79,6 +82,9 @@ export type TributeCollection = { // require X number of characters to be entered before menu shows menuShowMinLength?: number; + + // specify if the current match should be selected when the spacebar is hit + spaceSelectsMatch?: boolean; }; export type TributeOptions = @@ -88,7 +94,7 @@ export type TributeOptions = collection: Array>; }; -type TributeElement = Element | NodeList | HTMLCollection | Array; +type TributeElement = Element | NodeList | HTMLCollection | Array; export default class Tribute { constructor(options: TributeOptions);