mirror of
https://github.com/nextapps-de/flexsearch.git
synced 2025-08-26 23:35:45 +02:00
- 添加tsconfig.json
支持ts类型测试 - 添加types.ts 测试ts静态类型
This commit is contained in:
16
test/types.ts
Normal file
16
test/types.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { Document } from 'flexsearch'
|
||||||
|
import '../index'
|
||||||
|
|
||||||
|
const document = new Document<{
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
tags: string[]
|
||||||
|
}>({})
|
||||||
|
|
||||||
|
async function test() {
|
||||||
|
const doc = await document.searchAsync('test', {
|
||||||
|
enrich: true,
|
||||||
|
pluck: 'test',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
5
tsconfig.json
Normal file
5
tsconfig.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ESNext"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user