Skip to content

Commit

Permalink
Add a TypeScript module definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmunro committed Dec 8, 2020
1 parent c83942c commit 9bb6b1e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
type SpotlightItem = {
title: string
contentDescription?: string
uniqueIdentifier: string
domain: string
thumbnailName?: string
thumbnailData?: string
keywords?: string[]
}

export function indexItems(items: SpotlightItem[]): Promise<void>

export function indexItem(item: SpotlightItem): Promise<void>

export function deleteItemsWithIdentifiers(itemIdentifiers: string[]): Promise<void>;

export function deleteItemsInDomains(itemDomains: string[]): Promise<void>;

export function deleteAllItems(): Promise<void>

export function searchItemTapped(callback: (uniqueIdentifier: string) => void): void;

export function getInitialSearchItem(): Promise<string>
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"version": "1.3.0",
"description": "A React Native module for iOS that provides Spotlight search functionality.",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"ios/*",
"react-native-spotlight-search.podspec"
],
Expand Down

0 comments on commit 9bb6b1e

Please sign in to comment.