@fluidframework/driver-web-cache 2.0.0-rc.2.0.2 → 2.0.0-rc.3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/api-report/driver-web-cache.api.md +3 -3
  3. package/dist/FluidCache.d.ts +1 -1
  4. package/dist/FluidCache.d.ts.map +1 -1
  5. package/dist/FluidCache.js +11 -11
  6. package/dist/FluidCache.js.map +1 -1
  7. package/dist/FluidCacheIndexedDb.d.ts +2 -2
  8. package/dist/FluidCacheIndexedDb.d.ts.map +1 -1
  9. package/dist/FluidCacheIndexedDb.js +2 -2
  10. package/dist/FluidCacheIndexedDb.js.map +1 -1
  11. package/dist/legacy.d.ts +16 -0
  12. package/dist/packageVersion.d.ts +1 -1
  13. package/dist/packageVersion.js +1 -1
  14. package/dist/packageVersion.js.map +1 -1
  15. package/dist/public.d.ts +12 -0
  16. package/internal.d.ts +11 -0
  17. package/legacy.d.ts +11 -0
  18. package/lib/FluidCache.d.ts +1 -1
  19. package/lib/FluidCache.d.ts.map +1 -1
  20. package/lib/FluidCache.js +5 -5
  21. package/lib/FluidCache.js.map +1 -1
  22. package/lib/FluidCacheIndexedDb.d.ts +2 -2
  23. package/lib/FluidCacheIndexedDb.d.ts.map +1 -1
  24. package/lib/FluidCacheIndexedDb.js +2 -2
  25. package/lib/FluidCacheIndexedDb.js.map +1 -1
  26. package/lib/legacy.d.ts +16 -0
  27. package/lib/packageVersion.d.ts +1 -1
  28. package/lib/packageVersion.js +1 -1
  29. package/lib/packageVersion.js.map +1 -1
  30. package/lib/public.d.ts +12 -0
  31. package/package.json +27 -48
  32. package/src/FluidCache.ts +10 -12
  33. package/src/FluidCacheIndexedDb.ts +4 -3
  34. package/src/packageVersion.ts +1 -1
  35. package/api-extractor-cjs.json +0 -8
  36. package/dist/driver-web-cache-alpha.d.ts +0 -65
  37. package/dist/driver-web-cache-beta.d.ts +0 -19
  38. package/dist/driver-web-cache-public.d.ts +0 -19
  39. package/dist/driver-web-cache-untrimmed.d.ts +0 -65
  40. package/lib/driver-web-cache-alpha.d.ts +0 -65
  41. package/lib/driver-web-cache-beta.d.ts +0 -19
  42. package/lib/driver-web-cache-public.d.ts +0 -19
  43. package/lib/driver-web-cache-untrimmed.d.ts +0 -65
  44. package/lib/test/FluidCache.test.js +0 -196
  45. package/lib/test/FluidCache.test.js.map +0 -1
  46. package/lib/test/FluidCacheIndexedDb.test.js +0 -77
  47. package/lib/test/FluidCacheIndexedDb.test.js.map +0 -1
  48. package/lib/test/FluidCacheTimer.test.js +0 -100
  49. package/lib/test/FluidCacheTimer.test.js.map +0 -1
  50. package/lib/test/types/validateDriverWebCachePrevious.generated.js +0 -8
  51. package/lib/test/types/validateDriverWebCachePrevious.generated.js.map +0 -1
  52. /package/{dist → lib}/tsdoc-metadata.json +0 -0
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/driver-web-cache";
8
- export declare const pkgVersion = "2.0.0-rc.2.0.2";
8
+ export declare const pkgVersion = "2.0.0-rc.3.0.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/driver-web-cache";
8
- export const pkgVersion = "2.0.0-rc.2.0.2";
8
+ export const pkgVersion = "2.0.0-rc.3.0.0";
9
9
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-rc.2.0.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,kCAAkC,CAAC;AAC1D,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/driver-web-cache\";\nexport const pkgVersion = \"2.0.0-rc.3.0.0\";\n"]}
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+
11
+ export {}
12
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/driver-web-cache",
3
- "version": "2.0.0-rc.2.0.2",
3
+ "version": "2.0.0-rc.3.0.0",
4
4
  "description": "Implementation of the driver caching API for a web browser",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -15,31 +15,21 @@
15
15
  "exports": {
16
16
  ".": {
17
17
  "import": {
18
- "types": "./lib/index.d.ts",
19
- "default": "./lib/index.js"
20
- },
21
- "require": {
22
- "types": "./dist/index.d.ts",
23
- "default": "./dist/index.js"
24
- }
25
- },
26
- "./public": {
27
- "import": {
28
- "types": "./lib/driver-web-cache-public.d.ts",
18
+ "types": "./lib/public.d.ts",
29
19
  "default": "./lib/index.js"
30
20
  },
31
21
  "require": {
32
- "types": "./dist/driver-web-cache-public.d.ts",
22
+ "types": "./dist/public.d.ts",
33
23
  "default": "./dist/index.js"
34
24
  }
35
25
  },
36
- "./alpha": {
26
+ "./legacy": {
37
27
  "import": {
38
- "types": "./lib/driver-web-cache-alpha.d.ts",
28
+ "types": "./lib/legacy.d.ts",
39
29
  "default": "./lib/index.js"
40
30
  },
41
31
  "require": {
42
- "types": "./dist/driver-web-cache-alpha.d.ts",
32
+ "types": "./dist/legacy.d.ts",
43
33
  "default": "./dist/index.js"
44
34
  }
45
35
  },
@@ -54,22 +44,23 @@
54
44
  }
55
45
  }
56
46
  },
57
- "main": "dist/index.js",
58
- "types": "dist/index.d.ts",
47
+ "main": "lib/index.js",
48
+ "types": "lib/public.d.ts",
59
49
  "dependencies": {
60
- "@fluidframework/core-interfaces": ">=2.0.0-rc.2.0.2 <2.0.0-rc.2.1.0",
61
- "@fluidframework/core-utils": ">=2.0.0-rc.2.0.2 <2.0.0-rc.2.1.0",
62
- "@fluidframework/odsp-driver-definitions": ">=2.0.0-rc.2.0.2 <2.0.0-rc.2.1.0",
63
- "@fluidframework/telemetry-utils": ">=2.0.0-rc.2.0.2 <2.0.0-rc.2.1.0",
50
+ "@fluidframework/core-interfaces": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
51
+ "@fluidframework/core-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
52
+ "@fluidframework/odsp-driver-definitions": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
53
+ "@fluidframework/telemetry-utils": ">=2.0.0-rc.3.0.0 <2.0.0-rc.3.1.0",
64
54
  "idb": "^6.1.2"
65
55
  },
66
56
  "devDependencies": {
67
- "@arethetypeswrong/cli": "^0.13.3",
68
- "@fluid-tools/build-cli": "^0.34.0",
57
+ "@arethetypeswrong/cli": "^0.15.2",
58
+ "@biomejs/biome": "^1.6.2",
59
+ "@fluid-tools/build-cli": "^0.37.0",
69
60
  "@fluidframework/build-common": "^2.0.3",
70
- "@fluidframework/build-tools": "^0.34.0",
61
+ "@fluidframework/build-tools": "^0.37.0",
71
62
  "@fluidframework/driver-web-cache-previous": "npm:@fluidframework/driver-web-cache@2.0.0-internal.8.0.0",
72
- "@fluidframework/eslint-config-fluid": "^4.0.0",
63
+ "@fluidframework/eslint-config-fluid": "^5.1.0",
73
64
  "@microsoft/api-extractor": "^7.42.3",
74
65
  "@types/jest": "29.5.3",
75
66
  "@types/node": "^18.19.0",
@@ -81,45 +72,33 @@
81
72
  "rimraf": "^4.4.0",
82
73
  "typescript": "~5.1.6"
83
74
  },
84
- "fluidBuild": {
85
- "tasks": {
86
- "build:docs": {
87
- "dependsOn": [
88
- "...",
89
- "api-extractor:commonjs",
90
- "api-extractor:esnext"
91
- ],
92
- "script": false
93
- }
94
- }
95
- },
96
75
  "typeValidation": {
97
76
  "broken": {}
98
77
  },
99
78
  "scripts": {
100
79
  "api": "fluid-build . --task api",
101
- "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
102
- "api-extractor:esnext": "api-extractor run --local",
80
+ "api-extractor:commonjs": "flub generate entrypoints --outFileAlpha legacy --outDir ./dist",
81
+ "api-extractor:esnext": "flub generate entrypoints --outFileAlpha legacy --outDir ./lib --node10TypeCompat",
103
82
  "build": "fluid-build . --task build",
104
83
  "build:commonjs": "fluid-build . --task commonjs",
105
84
  "build:compile": "fluid-build . --task compile",
106
- "build:docs": "fluid-build . --task api",
85
+ "build:docs": "api-extractor run --local",
107
86
  "build:esnext": "tsc --project ./tsconfig.json",
108
87
  "build:genver": "gen-version",
109
88
  "build:test": "npm run build:test:esm && npm run build:test:cjs",
110
89
  "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
111
90
  "build:test:esm": "tsc --project ./src/test/tsconfig.json",
112
- "check:are-the-types-wrong": "attw --pack . --entrypoints .",
91
+ "check:are-the-types-wrong": "attw --pack .",
92
+ "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
113
93
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
114
94
  "ci:build:docs": "api-extractor run",
115
- "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
95
+ "clean": "rimraf --glob dist lib \"*.d.ts\" \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
116
96
  "eslint": "eslint --format stylish src",
117
97
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
118
- "format": "npm run prettier:fix",
119
- "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
120
- "lint:fix": "npm run prettier:fix && npm run eslint:fix",
121
- "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
122
- "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
98
+ "format": "fluid-build --task format .",
99
+ "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
100
+ "lint": "fluid-build . --task lint",
101
+ "lint:fix": "fluid-build . --task eslint:fix --task format",
123
102
  "test": "npm run test:jest",
124
103
  "test:jest": "jest",
125
104
  "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
package/src/FluidCache.ts CHANGED
@@ -3,25 +3,22 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { IDBPDatabase } from "idb";
7
- import { assert } from "@fluidframework/core-utils";
6
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
7
+ import { assert } from "@fluidframework/core-utils/internal";
8
8
  import {
9
- IPersistedCache,
10
9
  ICacheEntry,
11
10
  IFileEntry,
11
+ IPersistedCache,
12
12
  maximumCacheDurationMs,
13
- } from "@fluidframework/odsp-driver-definitions";
14
- import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
15
- import {
16
- ITelemetryLoggerExt,
17
- UsageError,
18
- createChildLogger,
19
- } from "@fluidframework/telemetry-utils";
20
- import { scheduleIdleTask } from "./scheduleIdleTask.js";
13
+ } from "@fluidframework/odsp-driver-definitions/internal";
14
+ import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
15
+ import { UsageError, createChildLogger } from "@fluidframework/telemetry-utils/internal";
16
+ import { IDBPDatabase } from "idb";
17
+
21
18
  import {
22
- getFluidCacheIndexedDbInstance,
23
19
  FluidCacheDBSchema,
24
20
  FluidDriverObjectStoreName,
21
+ getFluidCacheIndexedDbInstance,
25
22
  getKeyForCacheEntry,
26
23
  } from "./FluidCacheIndexedDb.js";
27
24
  import {
@@ -30,6 +27,7 @@ import {
30
27
  FluidCacheGenericEvent,
31
28
  } from "./fluidCacheTelemetry.js";
32
29
  import { pkgVersion } from "./packageVersion.js";
30
+ import { scheduleIdleTask } from "./scheduleIdleTask.js";
33
31
 
34
32
  // Some browsers have a usageDetails property that will tell you more detailed information
35
33
  // on how the storage is being used
@@ -3,10 +3,11 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { openDB, DBSchema, DeleteDBCallbacks, IDBPDatabase, deleteDB } from "idb";
7
- import { ICacheEntry } from "@fluidframework/odsp-driver-definitions";
8
6
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
9
- import { createChildLogger } from "@fluidframework/telemetry-utils";
7
+ import { ICacheEntry } from "@fluidframework/odsp-driver-definitions/internal";
8
+ import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
9
+ import { DBSchema, DeleteDBCallbacks, IDBPDatabase, deleteDB, openDB } from "idb";
10
+
10
11
  import { FluidCacheErrorEvent } from "./fluidCacheTelemetry.js";
11
12
 
12
13
  // The name of the database that we use for caching Fluid info.
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/driver-web-cache";
9
- export const pkgVersion = "2.0.0-rc.2.0.2";
9
+ export const pkgVersion = "2.0.0-rc.3.0.0";
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
- // CJS is actually secondary; so, no report.
5
- "apiReport": {
6
- "enabled": false
7
- }
8
- }
@@ -1,65 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Deletes the indexed DB instance.
9
- *
10
- * @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
11
- * @alpha
12
- */
13
- export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
14
-
15
- /**
16
- * A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
17
- * @alpha
18
- */
19
- export declare class FluidCache implements IPersistedCache {
20
- private readonly logger;
21
- private readonly partitionKey;
22
- private readonly maxCacheItemAge;
23
- private readonly closeDbImmediately;
24
- private readonly closeDbAfterMs;
25
- private db;
26
- private dbCloseTimer;
27
- private dbReuseCount;
28
- constructor(config: FluidCacheConfig);
29
- private openDb;
30
- private closeDb;
31
- removeEntries(file: IFileEntry): Promise<void>;
32
- get(cacheEntry: ICacheEntry): Promise<any>;
33
- private getItemFromCache;
34
- put(entry: ICacheEntry, value: any): Promise<void>;
35
- }
36
-
37
- /**
38
- * @alpha
39
- */
40
- export declare interface FluidCacheConfig {
41
- /**
42
- * A string to specify what partition of the cache you wish to use (e.g. a user id).
43
- * Null can be used to explicity indicate no partitioning, and has been chosen
44
- * vs undefined so that it is clear this is an intentional choice by the caller.
45
- * A null value should only be used when the host can ensure that the cache is not able
46
- * to be shared with multiple users.
47
- */
48
- partitionKey: string | null;
49
- /**
50
- * A logger that can be used to get insight into cache performance and errors
51
- */
52
- logger?: ITelemetryBaseLogger;
53
- /**
54
- * A value in milliseconds that determines the maximum age of a cache entry to return.
55
- * If an entry exists in the cache, but is older than this value, the cached value will not be returned.
56
- */
57
- maxCacheItemAge: number;
58
- /**
59
- * Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
60
- * any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
61
- */
62
- closeDbAfterMs?: number;
63
- }
64
-
65
- export { }
@@ -1,19 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: deleteFluidCacheIndexDbInstance */
8
-
9
- /* Excluded from this release type: FluidCache */
10
-
11
- /* Excluded from this release type: FluidCacheConfig */
12
-
13
- /* Excluded from this release type: ICacheEntry */
14
-
15
- /* Excluded from this release type: IFileEntry */
16
-
17
- /* Excluded from this release type: IPersistedCache */
18
-
19
- export { }
@@ -1,19 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: deleteFluidCacheIndexDbInstance */
8
-
9
- /* Excluded from this release type: FluidCache */
10
-
11
- /* Excluded from this release type: FluidCacheConfig */
12
-
13
- /* Excluded from this release type: ICacheEntry */
14
-
15
- /* Excluded from this release type: IFileEntry */
16
-
17
- /* Excluded from this release type: IPersistedCache */
18
-
19
- export { }
@@ -1,65 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Deletes the indexed DB instance.
9
- *
10
- * @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
11
- * @alpha
12
- */
13
- export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
14
-
15
- /**
16
- * A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
17
- * @alpha
18
- */
19
- export declare class FluidCache implements IPersistedCache {
20
- private readonly logger;
21
- private readonly partitionKey;
22
- private readonly maxCacheItemAge;
23
- private readonly closeDbImmediately;
24
- private readonly closeDbAfterMs;
25
- private db;
26
- private dbCloseTimer;
27
- private dbReuseCount;
28
- constructor(config: FluidCacheConfig);
29
- private openDb;
30
- private closeDb;
31
- removeEntries(file: IFileEntry): Promise<void>;
32
- get(cacheEntry: ICacheEntry): Promise<any>;
33
- private getItemFromCache;
34
- put(entry: ICacheEntry, value: any): Promise<void>;
35
- }
36
-
37
- /**
38
- * @alpha
39
- */
40
- export declare interface FluidCacheConfig {
41
- /**
42
- * A string to specify what partition of the cache you wish to use (e.g. a user id).
43
- * Null can be used to explicity indicate no partitioning, and has been chosen
44
- * vs undefined so that it is clear this is an intentional choice by the caller.
45
- * A null value should only be used when the host can ensure that the cache is not able
46
- * to be shared with multiple users.
47
- */
48
- partitionKey: string | null;
49
- /**
50
- * A logger that can be used to get insight into cache performance and errors
51
- */
52
- logger?: ITelemetryBaseLogger;
53
- /**
54
- * A value in milliseconds that determines the maximum age of a cache entry to return.
55
- * If an entry exists in the cache, but is older than this value, the cached value will not be returned.
56
- */
57
- maxCacheItemAge: number;
58
- /**
59
- * Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
60
- * any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
61
- */
62
- closeDbAfterMs?: number;
63
- }
64
-
65
- export { }
@@ -1,65 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Deletes the indexed DB instance.
9
- *
10
- * @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
11
- * @alpha
12
- */
13
- export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
14
-
15
- /**
16
- * A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
17
- * @alpha
18
- */
19
- export declare class FluidCache implements IPersistedCache {
20
- private readonly logger;
21
- private readonly partitionKey;
22
- private readonly maxCacheItemAge;
23
- private readonly closeDbImmediately;
24
- private readonly closeDbAfterMs;
25
- private db;
26
- private dbCloseTimer;
27
- private dbReuseCount;
28
- constructor(config: FluidCacheConfig);
29
- private openDb;
30
- private closeDb;
31
- removeEntries(file: IFileEntry): Promise<void>;
32
- get(cacheEntry: ICacheEntry): Promise<any>;
33
- private getItemFromCache;
34
- put(entry: ICacheEntry, value: any): Promise<void>;
35
- }
36
-
37
- /**
38
- * @alpha
39
- */
40
- export declare interface FluidCacheConfig {
41
- /**
42
- * A string to specify what partition of the cache you wish to use (e.g. a user id).
43
- * Null can be used to explicity indicate no partitioning, and has been chosen
44
- * vs undefined so that it is clear this is an intentional choice by the caller.
45
- * A null value should only be used when the host can ensure that the cache is not able
46
- * to be shared with multiple users.
47
- */
48
- partitionKey: string | null;
49
- /**
50
- * A logger that can be used to get insight into cache performance and errors
51
- */
52
- logger?: ITelemetryBaseLogger;
53
- /**
54
- * A value in milliseconds that determines the maximum age of a cache entry to return.
55
- * If an entry exists in the cache, but is older than this value, the cached value will not be returned.
56
- */
57
- maxCacheItemAge: number;
58
- /**
59
- * Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
60
- * any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
61
- */
62
- closeDbAfterMs?: number;
63
- }
64
-
65
- export { }
@@ -1,19 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: deleteFluidCacheIndexDbInstance */
8
-
9
- /* Excluded from this release type: FluidCache */
10
-
11
- /* Excluded from this release type: FluidCacheConfig */
12
-
13
- /* Excluded from this release type: ICacheEntry */
14
-
15
- /* Excluded from this release type: IFileEntry */
16
-
17
- /* Excluded from this release type: IPersistedCache */
18
-
19
- export { }
@@ -1,19 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: deleteFluidCacheIndexDbInstance */
8
-
9
- /* Excluded from this release type: FluidCache */
10
-
11
- /* Excluded from this release type: FluidCacheConfig */
12
-
13
- /* Excluded from this release type: ICacheEntry */
14
-
15
- /* Excluded from this release type: IFileEntry */
16
-
17
- /* Excluded from this release type: IPersistedCache */
18
-
19
- export { }
@@ -1,65 +0,0 @@
1
- import { DeleteDBCallbacks } from 'idb';
2
- import { ICacheEntry } from '@fluidframework/odsp-driver-definitions';
3
- import { IFileEntry } from '@fluidframework/odsp-driver-definitions';
4
- import { IPersistedCache } from '@fluidframework/odsp-driver-definitions';
5
- import { ITelemetryBaseLogger } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Deletes the indexed DB instance.
9
- *
10
- * @remarks Warning this can throw an error in Firefox incognito, where accessing storage is prohibited.
11
- * @alpha
12
- */
13
- export declare function deleteFluidCacheIndexDbInstance(deleteDBCallbacks?: DeleteDBCallbacks): Promise<void>;
14
-
15
- /**
16
- * A cache that can be used by the Fluid ODSP driver to cache data for faster performance.
17
- * @alpha
18
- */
19
- export declare class FluidCache implements IPersistedCache {
20
- private readonly logger;
21
- private readonly partitionKey;
22
- private readonly maxCacheItemAge;
23
- private readonly closeDbImmediately;
24
- private readonly closeDbAfterMs;
25
- private db;
26
- private dbCloseTimer;
27
- private dbReuseCount;
28
- constructor(config: FluidCacheConfig);
29
- private openDb;
30
- private closeDb;
31
- removeEntries(file: IFileEntry): Promise<void>;
32
- get(cacheEntry: ICacheEntry): Promise<any>;
33
- private getItemFromCache;
34
- put(entry: ICacheEntry, value: any): Promise<void>;
35
- }
36
-
37
- /**
38
- * @alpha
39
- */
40
- export declare interface FluidCacheConfig {
41
- /**
42
- * A string to specify what partition of the cache you wish to use (e.g. a user id).
43
- * Null can be used to explicity indicate no partitioning, and has been chosen
44
- * vs undefined so that it is clear this is an intentional choice by the caller.
45
- * A null value should only be used when the host can ensure that the cache is not able
46
- * to be shared with multiple users.
47
- */
48
- partitionKey: string | null;
49
- /**
50
- * A logger that can be used to get insight into cache performance and errors
51
- */
52
- logger?: ITelemetryBaseLogger;
53
- /**
54
- * A value in milliseconds that determines the maximum age of a cache entry to return.
55
- * If an entry exists in the cache, but is older than this value, the cached value will not be returned.
56
- */
57
- maxCacheItemAge: number;
58
- /**
59
- * Each time db is opened, it will remain open for this much time. To improve perf, if this property is set as
60
- * any number greater than 0, then db will not be closed immediately after usage. This value is in milliseconds.
61
- */
62
- closeDbAfterMs?: number;
63
- }
64
-
65
- export { }