Skip to content

Commit

Permalink
addPath should accept function (#80)
Browse files Browse the repository at this point in the history
* addPath should accept function
  • Loading branch information
0x0a0d committed Sep 7, 2021
1 parent 82498bd commit c111620
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ type LoadPathOption =
| ((lngs: string[], namespaces: string[]) => string)
| ((lngs: string[], namespaces: string[]) => Promise<string>);

type AddPathOption =
| string
| ((lng: string, namespace: string) => string)

interface BackendOptions {
/**
* path where resources get loaded from, or a function
Expand All @@ -14,9 +18,10 @@ interface BackendOptions {
*/
loadPath?: LoadPathOption;
/**
* path to post missing resources
* path to post missing resources, must be `string` or a `function` returning a path:
* function(lng, namespace) { return customPath; }
*/
addPath?: string;
addPath?: AddPathOption;
/**
* your backend server supports multiLoading
* locales/resources.json?lng=de+en&ns=ns1+ns2
Expand Down

0 comments on commit c111620

Please sign in to comment.