diff --git a/bower.json b/bower.json index 2f4e1392..c39a9dd3 100644 --- a/bower.json +++ b/bower.json @@ -1,27 +1,12 @@ { "name": "tribute", "description": "Native ES6 @mentions", - "version": "4.1.1", - "main": [ - "dist/tribute.js", - "dist/tribute.css" - ], - "authors": [ - "Jordan Humphreys " - ], + "version": "4.1.2", + "main": ["dist/tribute.js", "dist/tribute.css"], + "authors": ["Jordan Humphreys "], "license": "MIT", - "keywords": [ - "mentions", - "autocomplete", - "fuzzy", - "search" - ], + "keywords": ["mentions", "autocomplete", "fuzzy", "search"], "homepage": "https://github.com/zurb/tribute", "moduleType": [], - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test" - ] + "ignore": ["**/.*", "node_modules", "bower_components", "test"] } diff --git a/package.json b/package.json index 3aed165f..3b2aaa06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tributejs", - "version": "4.1.1", + "version": "4.1.2", "description": "Native ES6 @mentions", "main": "dist/tribute.js", "types": "tributejs.d.ts", diff --git a/tributejs.d.ts b/tributejs.d.ts index 36f98246..84fad5f6 100644 --- a/tributejs.d.ts +++ b/tributejs.d.ts @@ -1,92 +1,94 @@ -// Type definitions for TributeJS v4.1.1 +// Type definitions for TributeJS v4.1.2 // Project: https://github.com/zurb/tribute // Definitions by: Jordan Humphreys export type TributeItem = { - index: number - original: T - score: number - string: string -} + index: number; + original: T; + score: number; + string: string; +}; export type TributeSearchOpts = { - pre: string - post: string - skip: boolean -} + pre: string; + post: string; + skip: boolean; +}; export type TributeCollection = { // symbol that starts the lookup - trigger?: string + trigger?: string; // element to target for @mentions - iframe?: any + iframe?: any; // class added in the flyout menu for active item - selectClass?: string + selectClass?: string; // class added in the flyout menu for active item - containerClass?: string + containerClass?: string; - itemClass?: string + itemClass?: string; // function called on select that returns the content to insert - selectTemplate?: (item: TributeItem) => string + selectTemplate?: (item: TributeItem) => string; // template for displaying item in menu - menuItemTemplate?: (item: TributeItem) => string + menuItemTemplate?: (item: TributeItem) => string; // template for when no match is found (optional), // If no template is provided, menu is hidden. - noMatchTemplate?: () => string + noMatchTemplate?: () => string; // specify an alternative parent container for the menu - menuContainer?: Element + menuContainer?: Element; // column to search against in the object (accepts function or string) - lookup?: string | ((item: T, mentionText: string) => string) + lookup?: string | ((item: T, mentionText: string) => string); // column that contains the content to insert by default - fillAttr?: string + fillAttr?: string; // array of objects to match - values?: Array | ((text: string, cb: (result: Array) => void) => void) + values?: Array | ((text: string, cb: (result: Array) => void) => void); // specify whether a space is required before the trigger character - requireLeadingSpace?: boolean + requireLeadingSpace?: boolean; // specify whether a space is allowed in the middle of mentions - allowSpaces?: boolean + allowSpaces?: boolean; // optionally specify a custom suffix for the replace text // (defaults to empty space if undefined) - replaceTextSuffix?: string + replaceTextSuffix?: string; //specify whether the menu should be positioned - positionMenu?: boolean + positionMenu?: boolean; //specify whether to put Tribute in autocomplete mode - autocompleteMode?: boolean + autocompleteMode?: boolean; // Customize the elements used to wrap matched strings within the results list - searchOpts?: TributeSearchOpts -} + searchOpts?: TributeSearchOpts; +}; -export type TributeOptions = TributeCollection | { - // pass an array of config objects - collection: Array> -} +export type TributeOptions = + | TributeCollection + | { + // pass an array of config objects + collection: Array>; + }; export default class Tribute { - constructor(options: TributeOptions) + constructor(options: TributeOptions); - isActive: boolean + isActive: boolean; - append(index: number, values: Array, replace?: boolean): void + append(index: number, values: Array, replace?: boolean): void; - appendCurrent(values: Array, replace?: boolean): void + appendCurrent(values: Array, replace?: boolean): void; - attach(to: Element): void + attach(to: Element): void; - detach(to: Element): void + detach(to: Element): void; }