UNPKG

2.02 kBTypeScriptView Raw
1import { ITypedHash } from "./collections.js";
2import { ISPFXContext } from "./spfxcontextinterface.js";
3export interface ILibraryConfiguration {
4 /**
5 * Allows caching to be global disabled, default: false
6 */
7 globalCacheDisable?: boolean;
8 /**
9 * Defines the default store used by the usingCaching method, default: session
10 */
11 defaultCachingStore?: "session" | "local";
12 /**
13 * Defines the default timeout in seconds used by the usingCaching method, default 30
14 */
15 defaultCachingTimeoutSeconds?: number;
16 /**
17 * If true a timeout expired items will be removed from the cache in intervals determined by cacheTimeoutInterval
18 */
19 enableCacheExpiration?: boolean;
20 /**
21 * Determines the interval in milliseconds at which the cache is checked to see if items have expired (min: 100)
22 */
23 cacheExpirationIntervalMilliseconds?: number;
24 /**
25 * Used to supply the current context from an SPFx webpart to the library
26 */
27 spfxContext?: ISPFXContext;
28 /**
29 * Used to place the library in ie11 compat mode. Some features may not work as expected
30 */
31 ie11?: boolean;
32}
33export declare function setup<T = ILibraryConfiguration>(config: T, runtime?: Runtime): void;
34export declare function onRuntimeCreate(hook: (runtime: Runtime) => void): void;
35export declare class Runtime {
36 private _v;
37 constructor(_v?: Map<string | number | symbol, any>);
38 /**
39 *
40 * @param config The set of properties to add to this runtime instance
41 */
42 assign<T = ITypedHash<any>>(config: T): void;
43 /**
44 * Gets a runtime value using T to define the available keys, and R to define the type returned by that key
45 *
46 * @param key
47 */
48 get<T = ILibraryConfiguration, R = any>(key: keyof T): R;
49 /**
50 * Exports the internal Map representing this runtime
51 */
52 export(): Map<string | number | symbol, any>;
53}
54export declare const DefaultRuntime: Runtime;
55//# sourceMappingURL=libconfig.d.ts.map
\No newline at end of file