mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #23485 from senukartur/autosuggest-highlight
added definition for autosuggest-highlight
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import match = require('autosuggest-highlight/match');
|
||||
import parse = require('autosuggest-highlight/parse');
|
||||
|
||||
function matchTest() {
|
||||
let matches = match('some text', 'te'); // $ExpectType number[] | number[][]
|
||||
matches = match('some sweet text', 's s'); // $ExpectType number[] | number[][]
|
||||
}
|
||||
|
||||
function parseTest() {
|
||||
const parts = parse('Pretty cool text', [[7, 9], [12, 13]]); // $ExpectType { text: string; highlight: boolean; }[]
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// Type definitions for autosuggest-highlight 3.1
|
||||
// Project: https://github.com/moroshko/autosuggest-highlight#readme
|
||||
// Definitions by: Artur Sianiuk <https://github.com/senukartur>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
@@ -0,0 +1,3 @@
|
||||
declare function match(text: string, query: string): number[] | number[][];
|
||||
|
||||
export = match;
|
||||
@@ -0,0 +1,3 @@
|
||||
declare function parse(text: string, matches: number[] | number[][]): Array<{ text: string; highlight: boolean; }>;
|
||||
|
||||
export = parse;
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"autosuggest-highlight-tests.ts",
|
||||
"match/index.d.ts",
|
||||
"parse/index.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-useless-files": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user