Skip to content

Instantly share code, notes, and snippets.

@jahson
Created May 26, 2018 16:47
Show Gist options
  • Save jahson/f6470fd9a043ed0abc7fa25560eb1f3e to your computer and use it in GitHub Desktop.
Save jahson/f6470fd9a043ed0abc7fa25560eb1f3e to your computer and use it in GitHub Desktop.
declare namespace I18NextLocalStorageBackend {
interface BackendOptions {
prefix?: string; // prefix for stored langs
expirationTime?: number;
versions: any;
}
type LoadCallback = (error: any, result: string | false) => void;
}
declare class I18NextLocalStorageBackend {
constructor(
services?: any,
options?: I18NextLocalStorageBackend.BackendOptions
);
init(options?: I18NextLocalStorageBackend.BackendOptions): void;
read(
language: string,
namespace: string,
callback: I18NextLocalStorageBackend.LoadCallback
): void;
save(language: string, namespace: string, data: any): void;
type: 'backend';
services: any;
options: I18NextLocalStorageBackend.BackendOptions;
}
export = I18NextLocalStorageBackend;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment