Skip to content

Commit

Permalink
style: improve typings (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 authored Apr 10, 2024
1 parent 616e186 commit c35ed89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BackendModule, Resource, ReadCallback, ResourceKey } from 'i18next'

type ImportFn = ((language: string, namespace: string, callback: ReadCallback) => void) | ((language: string, namespace: string) => Promise<ResourceKey | boolean | null | undefined>)
type ImportFn<L, N> = ((language: L, namespace: N, callback: ReadCallback) => void) | ((language: L, namespace: N) => Promise<ResourceKey | boolean | null | undefined>)

declare function resourcesToBackend(res: Resource | ImportFn): BackendModule
declare function resourcesToBackend<L = string, N = string>(res: Resource | ImportFn<L, N>): BackendModule

export default resourcesToBackend

0 comments on commit c35ed89

Please sign in to comment.