@kwiz/common
Version:
KWIZ common utilities and helpers for M365 platform
20 lines (19 loc) • 1.03 kB
TypeScript
import { IJsonSyncResult, IRequestBody, IRestOptions } from "../types/rest.types";
/** cache for 1 day */
export declare const noLocalCache: IRestOptions;
/** cache for 1 days */
export declare const longLocalCache: IRestOptions;
/** cache for 2 days */
export declare const extraLongLocalCache: IRestOptions;
/** cache for 7 days */
export declare const weeekLongLocalCache: IRestOptions;
/** cache for 30 days */
export declare const monthLongLocalCache: IRestOptions;
/** cache for 5 minutes */
export declare const shortLocalCache: IRestOptions;
/** cache for 15 minutes */
export declare const mediumLocalCache: IRestOptions;
export declare function GetJsonSync<T>(url: string, body?: IRequestBody, options?: IRestOptions): IJsonSyncResult<T>;
export declare function GetJson<T>(url: string, body?: IRequestBody, options?: IRestOptions): Promise<T>;
/** if you detected a change that invalidates all requests stored in memory - this will clear all in-memory cached results */
export declare function GetJsonClearCache(): void;