mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-23 01:20:25 +00:00
Merge pull request #30622 from igl00/store-update
[store] Add declarations for storage modules to store
This commit is contained in:
Vendored
+30
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Vincent Bortone <https://github.com/vbortone>
|
||||
// harry0000 <https://github.com/harry0000>
|
||||
// Roman Nuritdinov (Ky6uk) <https://github.com/Ky6uk>
|
||||
// Johnny Edwards (igl00) <https://github.com/igl00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Cross-browser storage for all use cases, used across the web.
|
||||
@@ -25,6 +26,15 @@ interface StoreJsEngine {
|
||||
createStore(storages: any[], plugins?: any[], namespace?: string): StoreJsAPI;
|
||||
}
|
||||
|
||||
interface StoreJsStorage {
|
||||
name: string;
|
||||
read: (key: string) => string | null;
|
||||
write: (key: string, data: string) => void;
|
||||
each: (callback: (val: string, key: string) => any) => void;
|
||||
remove: (key: string) => void;
|
||||
clearAll: () => void;
|
||||
}
|
||||
|
||||
declare const store: StoreJsAPI;
|
||||
declare module 'store' {
|
||||
export = store;
|
||||
@@ -73,3 +83,23 @@ declare module 'store/plugins/update' {
|
||||
declare module 'store/plugins/v1-backcompat' {
|
||||
export = Function;
|
||||
}
|
||||
|
||||
declare const storage: StoreJsStorage;
|
||||
declare module 'store/storages/cookieStorage' {
|
||||
export = storage;
|
||||
}
|
||||
declare module 'store/storages/localStorage' {
|
||||
export = storage;
|
||||
}
|
||||
declare module 'store/storages/memoryStorage' {
|
||||
export = storage;
|
||||
}
|
||||
declare module 'store/storages/oldFF-globalStorage' {
|
||||
export = storage;
|
||||
}
|
||||
declare module 'store/storages/oldIE-userDataStorage' {
|
||||
export = storage;
|
||||
}
|
||||
declare module 'store/storages/sessionStorage' {
|
||||
export = storage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user