You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Get information about all the caches that have been created.
1055
+
* @returns key-value map of cacheId to the result of calling cache#info
1056
+
*/
1047
1057
info(): any;
1058
+
1059
+
/**
1060
+
* Get access to a cache object by the cacheId used when it was created.
1061
+
*
1062
+
* @param cacheId Name or id of a cache to access.
1063
+
*/
1048
1064
get(cacheId: string): ICacheObject;
1049
1065
}
1050
1066
1067
+
/**
1068
+
* $cacheFactory.Cache - type in module ng
1069
+
*
1070
+
* A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data.
1071
+
*
1072
+
* see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache
1073
+
*/
1051
1074
interfaceICacheObject{
1075
+
/**
1076
+
* Retrieve information regarding a particular Cache.
1077
+
*/
1052
1078
info(): {
1079
+
/**
1080
+
* the id of the cache instance
1081
+
*/
1053
1082
id: string;
1083
+
1084
+
/**
1085
+
* the number of entries kept in the cache instance
1086
+
*/
1054
1087
size: number;
1055
1088
1056
-
// Not garanteed to have, since it's a non-mandatory option
1057
-
//capacity: number;
1089
+
//...: any additional properties from the options object when creating the cache.
1058
1090
};
1091
+
1092
+
/**
1093
+
* Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set.
1094
+
*
1095
+
* It will not insert undefined values into the cache.
1096
+
*
1097
+
* @param key the key under which the cached data is stored.
1098
+
* @param value the value to store alongside the key. If it is undefined, the key will not be stored.
1099
+
*/
1059
1100
put<T>(key: string,value?: T): T;
1101
+
1102
+
/**
1103
+
* Retrieves named data stored in the Cache object.
1104
+
*
1105
+
* @param key the key of the data to be retrieved
1106
+
*/
1060
1107
get(key: string): any;
1108
+
1109
+
/**
1110
+
* Removes an entry from the Cache object.
1111
+
*
1112
+
* @param key the key of the entry to be removed
1113
+
*/
1061
1114
remove(key: string): void;
1115
+
1116
+
/**
1117
+
* Clears the cache object of any entries.
1118
+
*/
1062
1119
removeAll(): void;
1120
+
1121
+
/**
1122
+
* Destroys the Cache object entirely, removing it from the $cacheFactory set.
0 commit comments