@fluidframework/file-driver 2.0.0-dev-rc.2.0.0.246488 → 2.0.0-dev-rc.3.0.0.253463

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 (56) hide show
  1. package/api-report/file-driver.api.md +14 -14
  2. package/dist/file-driver-alpha.d.ts +14 -14
  3. package/dist/file-driver-beta.d.ts +14 -14
  4. package/dist/file-driver-public.d.ts +14 -14
  5. package/dist/file-driver-untrimmed.d.ts +14 -14
  6. package/dist/fileDeltaStorageService.d.ts +1 -1
  7. package/dist/fileDeltaStorageService.d.ts.map +1 -1
  8. package/dist/fileDeltaStorageService.js +4 -4
  9. package/dist/fileDeltaStorageService.js.map +1 -1
  10. package/dist/fileDocumentDeltaConnection.d.ts +2 -2
  11. package/dist/fileDocumentDeltaConnection.d.ts.map +1 -1
  12. package/dist/fileDocumentDeltaConnection.js +1 -1
  13. package/dist/fileDocumentDeltaConnection.js.map +1 -1
  14. package/dist/fileDocumentService.d.ts +1 -1
  15. package/dist/fileDocumentService.d.ts.map +1 -1
  16. package/dist/fileDocumentService.js.map +1 -1
  17. package/dist/fileDocumentServiceFactory.d.ts +1 -1
  18. package/dist/fileDocumentServiceFactory.d.ts.map +1 -1
  19. package/dist/fileDocumentServiceFactory.js.map +1 -1
  20. package/dist/fileDocumentStorageService.d.ts +6 -6
  21. package/dist/fileDocumentStorageService.d.ts.map +1 -1
  22. package/dist/fileDocumentStorageService.js +10 -10
  23. package/dist/fileDocumentStorageService.js.map +1 -1
  24. package/lib/file-driver-alpha.d.ts +14 -14
  25. package/lib/file-driver-beta.d.ts +14 -14
  26. package/lib/file-driver-public.d.ts +14 -14
  27. package/lib/file-driver-untrimmed.d.ts +14 -14
  28. package/lib/fileDeltaStorageService.d.ts +1 -1
  29. package/lib/fileDeltaStorageService.d.ts.map +1 -1
  30. package/lib/fileDeltaStorageService.js +2 -2
  31. package/lib/fileDeltaStorageService.js.map +1 -1
  32. package/lib/fileDocumentDeltaConnection.d.ts +2 -2
  33. package/lib/fileDocumentDeltaConnection.d.ts.map +1 -1
  34. package/lib/fileDocumentDeltaConnection.js +1 -1
  35. package/lib/fileDocumentDeltaConnection.js.map +1 -1
  36. package/lib/fileDocumentService.d.ts +1 -1
  37. package/lib/fileDocumentService.d.ts.map +1 -1
  38. package/lib/fileDocumentService.js.map +1 -1
  39. package/lib/fileDocumentServiceFactory.d.ts +1 -1
  40. package/lib/fileDocumentServiceFactory.d.ts.map +1 -1
  41. package/lib/fileDocumentServiceFactory.js.map +1 -1
  42. package/lib/fileDocumentStorageService.d.ts +6 -6
  43. package/lib/fileDocumentStorageService.d.ts.map +1 -1
  44. package/lib/fileDocumentStorageService.js +3 -3
  45. package/lib/fileDocumentStorageService.js.map +1 -1
  46. package/lib/tsdoc-metadata.json +11 -0
  47. package/package.json +14 -23
  48. package/src/fileDeltaStorageService.ts +4 -3
  49. package/src/fileDocumentDeltaConnection.ts +3 -2
  50. package/src/fileDocumentService.ts +2 -1
  51. package/src/fileDocumentServiceFactory.ts +3 -2
  52. package/src/fileDocumentStorageService.ts +14 -4
  53. package/lib/test/types/validateFileDriverPrevious.generated.d.ts +0 -2
  54. package/lib/test/types/validateFileDriverPrevious.generated.d.ts.map +0 -1
  55. package/lib/test/types/validateFileDriverPrevious.generated.js +0 -26
  56. package/lib/test/types/validateFileDriverPrevious.generated.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"fileDocumentStorageService.js","sourceRoot":"","sources":["../src/fileDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACpG,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAC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;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,8BAA8B,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IDocumentStorageService, ISummaryContext } from \"@fluidframework/driver-definitions\";\nimport { buildSnapshotTree, convertSummaryTreeToSnapshotITree } from \"@fluidframework/driver-utils\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport { IFileSnapshot, ReadDocumentStorageServiceBase } from \"@fluidframework/replay-driver\";\n\n// This ID is used by replay tool as Document Id.\n// We leverage it to figure out when container is asking for root document tree.\n/**\n * @internal\n */\nexport const FileStorageDocumentName = \"FileStorageDocId\"; // Some unique document name\n\n// Tree ID use to communicate between getVersions() & getSnapshotTree() that IVersion is ours.\nconst FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n/**\n * Document storage service for the file driver.\n * @internal\n */\nexport class FluidFetchReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\tprotected docTree: api.ISnapshotTree | null = null;\n\n\tconstructor(\n\t\tprivate readonly path: string,\n\t\tprivate readonly versionName?: string,\n\t) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Read the file and returns the snapshot tree.\n\t * @param version - The version contains the path of the file which contains the snapshot tree.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\tassert(version !== null, 0x092 /* \"version input for reading snapshot tree is null!\" */);\n\t\tassert(\n\t\t\t!version || version.treeId === FileStorageVersionTreeId,\n\t\t\t0x093 /* \"invalid version input for reading snapshot tree!\" */,\n\t\t);\n\n\t\tlet filename: string;\n\t\tlet rootTree = false;\n\t\tif (!version || version.id === \"latest\") {\n\t\t\tif (this.docTree) {\n\t\t\t\treturn this.docTree;\n\t\t\t}\n\t\t\tif (this.versionName === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\trootTree = true;\n\t\t\tfilename = `${this.path}/${this.versionName}/tree.json`;\n\t\t} else {\n\t\t\tfilename = `${this.path}/${this.versionName}/${version.id}.json`;\n\t\t}\n\n\t\tif (!fs.existsSync(filename)) {\n\t\t\tthrow new Error(`Can't find file ${filename}`);\n\t\t}\n\t\tconst data = fs.readFileSync(filename);\n\t\tconst tree = JSON.parse(data.toString(\"utf-8\"));\n\t\tif (rootTree) {\n\t\t\tthis.docTree = tree;\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn tree;\n\t}\n\n\t/**\n\t * Gets the path of the snapshot tree to be read.\n\t * @param versionId - version ID.\n\t * @param count - Number of versions to be returned.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\tif (versionId === FileStorageDocumentName || versionId === null) {\n\t\t\tif (this.docTree !== null || this.versionName !== undefined) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\t\t\t// Started with ops - return empty set.\n\t\t\treturn [];\n\t\t} else if (this.versionName !== undefined) {\n\t\t\tassert(!!this.docTree, 0x094 /* \"Missing snapshot tree!\" */);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: versionId,\n\t\t\t\t\ttreeId: FileStorageVersionTreeId,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\tthrow new Error(`Unknown version: ${versionId}`);\n\t}\n\n\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\tif (this.versionName !== undefined) {\n\t\t\tconst fileName = `${this.path}/${this.versionName}/${sha}`;\n\t\t\tif (fs.existsSync(fileName)) {\n\t\t\t\tconst data = fs.readFileSync(fileName);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Can't find blob ${sha}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ISnapshotWriterStorage extends IDocumentStorageService {\n\tonSnapshotHandler(snapshot: IFileSnapshot): void;\n\treset(): void;\n}\n\n/**\n * @internal\n */\nexport type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;\n/**\n * @internal\n */\nexport const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(Base: TBase) =>\n\tclass extends Base implements ISnapshotWriterStorage {\n\t\t// Note: if variable name has same name as in base class, it overrides it!\n\t\tpublic blobsWriter = new Map<string, ArrayBufferLike>();\n\t\tpublic latestWriterTree?: api.ISnapshotTree;\n\t\tpublic docId?: string;\n\n\t\tpublic reset() {\n\t\t\tthis.blobsWriter = new Map<string, ArrayBufferLike>();\n\t\t\tthis.latestWriterTree = undefined;\n\t\t\tthis.docId = undefined;\n\t\t}\n\n\t\tpublic onSnapshotHandler(snapshot: IFileSnapshot): void {\n\t\t\tthrow new Error(\"onSnapshotHandler is not setup! Please provide your handler!\");\n\t\t}\n\n\t\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\t\tconst blob = this.blobsWriter.get(sha);\n\t\t\tif (blob !== undefined) {\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn super.readBlob(sha);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\t\t// If we already saved document, that means we are getting here because of snapshot generation.\n\t\t\t// Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for\n\t\t\t// each unchanged data store.\n\t\t\t// If we want to change that, we would need to capture docId on first call and return this.latestWriterTree\n\t\t\t// when latest is requested.\n\t\t\tif (this.latestWriterTree && (this.docId === versionId || versionId === null)) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\n\t\t\tif (this.docId === undefined && versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\n\t\t\treturn super.getVersions(versionId, count);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\t\tif (this.latestWriterTree && (!version || version.id === \"latest\")) {\n\t\t\t\treturn this.latestWriterTree;\n\t\t\t}\n\t\t\treturn super.getSnapshotTree(version);\n\t\t}\n\n\t\tpublic async uploadSummaryWithContext(\n\t\t\tsummary: api.ISummaryTree,\n\t\t\tcontext: ISummaryContext,\n\t\t): Promise<string> {\n\t\t\tconst tree = convertSummaryTreeToSnapshotITree(summary);\n\n\t\t\t// Remove tree IDs for easier comparison of snapshots\n\t\t\tdelete tree.id;\n\t\t\tremoveNullTreeIds(tree);\n\n\t\t\tthis.latestWriterTree = buildSnapshotTree(tree.entries, this.blobsWriter);\n\n\t\t\tconst fileSnapshot: IFileSnapshot = { tree, commits: {} };\n\t\t\tthis.onSnapshotHandler(fileSnapshot);\n\t\t\treturn \"testHandleId\";\n\t\t}\n\n\t\tpublic async buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree> {\n\t\t\tconst tree: api.ITree = { entries: [] };\n\n\t\t\tfor (const subTreeId of Object.keys(snapshotTree.trees)) {\n\t\t\t\tconst subTree = await this.buildTree(snapshotTree.trees[subTreeId]);\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.Directory,\n\t\t\t\t\tpath: subTreeId,\n\t\t\t\t\ttype: api.TreeEntry.Tree,\n\t\t\t\t\tvalue: subTree,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const blobName of Object.keys(snapshotTree.blobs)) {\n\t\t\t\tconst buffer = await this.readBlob(snapshotTree.blobs[blobName]);\n\t\t\t\tconst contents = bufferToString(buffer, \"utf8\");\n\t\t\t\tconst blob: api.IBlob = {\n\t\t\t\t\tcontents,\n\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t};\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.File,\n\t\t\t\t\tpath: blobName,\n\t\t\t\t\ttype: api.TreeEntry.Blob,\n\t\t\t\t\tvalue: blob,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn tree;\n\t\t}\n\t};\n\nfunction removeNullTreeIds(tree: api.ITree) {\n\tfor (const node of tree.entries) {\n\t\tif (node.type === api.TreeEntry.Tree) {\n\t\t\tremoveNullTreeIds(node.value);\n\t\t}\n\t}\n\tassert(\n\t\ttree.id === undefined || tree.id === null,\n\t\t0x096 /* \"Trying to remove valid tree IDs in removeNullTreeIds()!\" */,\n\t);\n\tdelete tree.id;\n}\n/**\n * @internal\n */\nexport const FluidFetchReaderFileSnapshotWriter = FileSnapshotWriterClassFactory(FluidFetchReader);\n"]}
1
+ {"version":3,"file":"fileDocumentStorageService.js","sourceRoot":"","sources":["../src/fileDocumentStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAK7D,OAAO,EACN,iBAAiB,EACjB,iCAAiC,GACjC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,GAAG,MAAM,sCAAsC,CAAC;AAC5D,OAAO,EAEN,8BAA8B,GAC9B,MAAM,wCAAwC,CAAC;AAEhD,iDAAiD;AACjD,gFAAgF;AAChF;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,CAAC,4BAA4B;AAEvF,8FAA8F;AAC9F,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAErD;;;GAGG;AACH,MAAM,OAAO,gBACZ,SAAQ,8BAA8B;IAKtC,YACkB,IAAY,EACZ,WAAoB;QAErC,KAAK,EAAE,CAAC;QAHS,SAAI,GAAJ,IAAI,CAAQ;QACZ,gBAAW,GAAX,WAAW,CAAS;QAJ5B,YAAO,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CAAC,QAAQ,CAAC,CAAC,CAAC;YACjE,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAChD,MAAM,IAAI,GAAc;gBACvB,QAAQ;gBACR,QAAQ,EAAE,OAAO;aACjB,CAAC;YACF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI;gBACxB,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AAEH,SAAS,iBAAiB,CAAC,IAAe;IACzC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,EAAE;QAChC,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;YACrC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;KACD;IACD,MAAM,CACL,IAAI,CAAC,EAAE,KAAK,SAAS,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,EACzC,KAAK,CAAC,+DAA+D,CACrE,CAAC;IACF,OAAO,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC;AACD;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,8BAA8B,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport fs from \"fs\";\n\nimport { bufferToString } from \"@fluid-internal/client-utils\";\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tIDocumentStorageService,\n\tISummaryContext,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tbuildSnapshotTree,\n\tconvertSummaryTreeToSnapshotITree,\n} from \"@fluidframework/driver-utils/internal\";\nimport * as api from \"@fluidframework/protocol-definitions\";\nimport {\n\tIFileSnapshot,\n\tReadDocumentStorageServiceBase,\n} from \"@fluidframework/replay-driver/internal\";\n\n// This ID is used by replay tool as Document Id.\n// We leverage it to figure out when container is asking for root document tree.\n/**\n * @internal\n */\nexport const FileStorageDocumentName = \"FileStorageDocId\"; // Some unique document name\n\n// Tree ID use to communicate between getVersions() & getSnapshotTree() that IVersion is ours.\nconst FileStorageVersionTreeId = \"FileStorageTreeId\";\n\n/**\n * Document storage service for the file driver.\n * @internal\n */\nexport class FluidFetchReader\n\textends ReadDocumentStorageServiceBase\n\timplements IDocumentStorageService\n{\n\tprotected docTree: api.ISnapshotTree | null = null;\n\n\tconstructor(\n\t\tprivate readonly path: string,\n\t\tprivate readonly versionName?: string,\n\t) {\n\t\tsuper();\n\t}\n\n\t/**\n\t * Read the file and returns the snapshot tree.\n\t * @param version - The version contains the path of the file which contains the snapshot tree.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\tassert(version !== null, 0x092 /* \"version input for reading snapshot tree is null!\" */);\n\t\tassert(\n\t\t\t!version || version.treeId === FileStorageVersionTreeId,\n\t\t\t0x093 /* \"invalid version input for reading snapshot tree!\" */,\n\t\t);\n\n\t\tlet filename: string;\n\t\tlet rootTree = false;\n\t\tif (!version || version.id === \"latest\") {\n\t\t\tif (this.docTree) {\n\t\t\t\treturn this.docTree;\n\t\t\t}\n\t\t\tif (this.versionName === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\trootTree = true;\n\t\t\tfilename = `${this.path}/${this.versionName}/tree.json`;\n\t\t} else {\n\t\t\tfilename = `${this.path}/${this.versionName}/${version.id}.json`;\n\t\t}\n\n\t\tif (!fs.existsSync(filename)) {\n\t\t\tthrow new Error(`Can't find file ${filename}`);\n\t\t}\n\t\tconst data = fs.readFileSync(filename);\n\t\tconst tree = JSON.parse(data.toString(\"utf-8\"));\n\t\tif (rootTree) {\n\t\t\tthis.docTree = tree;\n\t\t}\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-return\n\t\treturn tree;\n\t}\n\n\t/**\n\t * Gets the path of the snapshot tree to be read.\n\t * @param versionId - version ID.\n\t * @param count - Number of versions to be returned.\n\t */\n\t// eslint-disable-next-line @rushstack/no-new-null\n\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\tif (versionId === FileStorageDocumentName || versionId === null) {\n\t\t\tif (this.docTree !== null || this.versionName !== undefined) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\t\t\t// Started with ops - return empty set.\n\t\t\treturn [];\n\t\t} else if (this.versionName !== undefined) {\n\t\t\tassert(!!this.docTree, 0x094 /* \"Missing snapshot tree!\" */);\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: versionId,\n\t\t\t\t\ttreeId: FileStorageVersionTreeId,\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t\tthrow new Error(`Unknown version: ${versionId}`);\n\t}\n\n\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\tif (this.versionName !== undefined) {\n\t\t\tconst fileName = `${this.path}/${this.versionName}/${sha}`;\n\t\t\tif (fs.existsSync(fileName)) {\n\t\t\t\tconst data = fs.readFileSync(fileName);\n\t\t\t\treturn data;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(`Can't find blob ${sha}`);\n\t}\n}\n\n/**\n * @internal\n */\nexport interface ISnapshotWriterStorage extends IDocumentStorageService {\n\tonSnapshotHandler(snapshot: IFileSnapshot): void;\n\treset(): void;\n}\n\n/**\n * @internal\n */\nexport type ReaderConstructor = new (...args: any[]) => IDocumentStorageService;\n/**\n * @internal\n */\nexport const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(Base: TBase) =>\n\tclass extends Base implements ISnapshotWriterStorage {\n\t\t// Note: if variable name has same name as in base class, it overrides it!\n\t\tpublic blobsWriter = new Map<string, ArrayBufferLike>();\n\t\tpublic latestWriterTree?: api.ISnapshotTree;\n\t\tpublic docId?: string;\n\n\t\tpublic reset() {\n\t\t\tthis.blobsWriter = new Map<string, ArrayBufferLike>();\n\t\t\tthis.latestWriterTree = undefined;\n\t\t\tthis.docId = undefined;\n\t\t}\n\n\t\tpublic onSnapshotHandler(snapshot: IFileSnapshot): void {\n\t\t\tthrow new Error(\"onSnapshotHandler is not setup! Please provide your handler!\");\n\t\t}\n\n\t\tpublic async readBlob(sha: string): Promise<ArrayBufferLike> {\n\t\t\tconst blob = this.blobsWriter.get(sha);\n\t\t\tif (blob !== undefined) {\n\t\t\t\treturn blob;\n\t\t\t}\n\t\t\treturn super.readBlob(sha);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {\n\t\t\t// If we already saved document, that means we are getting here because of snapshot generation.\n\t\t\t// Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for\n\t\t\t// each unchanged data store.\n\t\t\t// If we want to change that, we would need to capture docId on first call and return this.latestWriterTree\n\t\t\t// when latest is requested.\n\t\t\tif (this.latestWriterTree && (this.docId === versionId || versionId === null)) {\n\t\t\t\treturn [{ id: \"latest\", treeId: FileStorageVersionTreeId }];\n\t\t\t}\n\n\t\t\tif (this.docId === undefined && versionId !== null) {\n\t\t\t\tthis.docId = versionId;\n\t\t\t}\n\n\t\t\treturn super.getVersions(versionId, count);\n\t\t}\n\n\t\t// eslint-disable-next-line @rushstack/no-new-null\n\t\tpublic async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {\n\t\t\tif (this.latestWriterTree && (!version || version.id === \"latest\")) {\n\t\t\t\treturn this.latestWriterTree;\n\t\t\t}\n\t\t\treturn super.getSnapshotTree(version);\n\t\t}\n\n\t\tpublic async uploadSummaryWithContext(\n\t\t\tsummary: api.ISummaryTree,\n\t\t\tcontext: ISummaryContext,\n\t\t): Promise<string> {\n\t\t\tconst tree = convertSummaryTreeToSnapshotITree(summary);\n\n\t\t\t// Remove tree IDs for easier comparison of snapshots\n\t\t\tdelete tree.id;\n\t\t\tremoveNullTreeIds(tree);\n\n\t\t\tthis.latestWriterTree = buildSnapshotTree(tree.entries, this.blobsWriter);\n\n\t\t\tconst fileSnapshot: IFileSnapshot = { tree, commits: {} };\n\t\t\tthis.onSnapshotHandler(fileSnapshot);\n\t\t\treturn \"testHandleId\";\n\t\t}\n\n\t\tpublic async buildTree(snapshotTree: api.ISnapshotTree): Promise<api.ITree> {\n\t\t\tconst tree: api.ITree = { entries: [] };\n\n\t\t\tfor (const subTreeId of Object.keys(snapshotTree.trees)) {\n\t\t\t\tconst subTree = await this.buildTree(snapshotTree.trees[subTreeId]);\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.Directory,\n\t\t\t\t\tpath: subTreeId,\n\t\t\t\t\ttype: api.TreeEntry.Tree,\n\t\t\t\t\tvalue: subTree,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfor (const blobName of Object.keys(snapshotTree.blobs)) {\n\t\t\t\tconst buffer = await this.readBlob(snapshotTree.blobs[blobName]);\n\t\t\t\tconst contents = bufferToString(buffer, \"utf8\");\n\t\t\t\tconst blob: api.IBlob = {\n\t\t\t\t\tcontents,\n\t\t\t\t\tencoding: \"utf-8\",\n\t\t\t\t};\n\t\t\t\ttree.entries.push({\n\t\t\t\t\tmode: api.FileMode.File,\n\t\t\t\t\tpath: blobName,\n\t\t\t\t\ttype: api.TreeEntry.Blob,\n\t\t\t\t\tvalue: blob,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn tree;\n\t\t}\n\t};\n\nfunction removeNullTreeIds(tree: api.ITree) {\n\tfor (const node of tree.entries) {\n\t\tif (node.type === api.TreeEntry.Tree) {\n\t\t\tremoveNullTreeIds(node.value);\n\t\t}\n\t}\n\tassert(\n\t\ttree.id === undefined || tree.id === null,\n\t\t0x096 /* \"Trying to remove valid tree IDs in removeNullTreeIds()!\" */,\n\t);\n\tdelete tree.id;\n}\n/**\n * @internal\n */\nexport const FluidFetchReaderFileSnapshotWriter = FileSnapshotWriterClassFactory(FluidFetchReader);\n"]}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.42.3"
9
+ }
10
+ ]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/file-driver",
3
- "version": "2.0.0-dev-rc.2.0.0.246488",
3
+ "version": "2.0.0-dev-rc.3.0.0.253463",
4
4
  "description": "A driver that reads/write from/to local file storage.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -14,16 +14,6 @@
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {
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
17
  "import": {
28
18
  "types": "./lib/file-driver-public.d.ts",
29
19
  "default": "./lib/index.js"
@@ -47,16 +37,17 @@
47
37
  "main": "dist/index.js",
48
38
  "types": "dist/index.d.ts",
49
39
  "dependencies": {
50
- "@fluid-internal/client-utils": "2.0.0-dev-rc.2.0.0.246488",
51
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.246488",
52
- "@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.246488",
53
- "@fluidframework/driver-definitions": "2.0.0-dev-rc.2.0.0.246488",
54
- "@fluidframework/driver-utils": "2.0.0-dev-rc.2.0.0.246488",
40
+ "@fluid-internal/client-utils": "2.0.0-dev-rc.3.0.0.253463",
41
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.253463",
42
+ "@fluidframework/core-utils": "2.0.0-dev-rc.3.0.0.253463",
43
+ "@fluidframework/driver-definitions": "2.0.0-dev-rc.3.0.0.253463",
44
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.3.0.0.253463",
55
45
  "@fluidframework/protocol-definitions": "^3.2.0",
56
- "@fluidframework/replay-driver": "2.0.0-dev-rc.2.0.0.246488"
46
+ "@fluidframework/replay-driver": "2.0.0-dev-rc.3.0.0.253463"
57
47
  },
58
48
  "devDependencies": {
59
- "@arethetypeswrong/cli": "^0.13.3",
49
+ "@arethetypeswrong/cli": "^0.15.2",
50
+ "@biomejs/biome": "^1.6.2",
60
51
  "@fluid-tools/build-cli": "^0.34.0",
61
52
  "@fluidframework/build-common": "^2.0.3",
62
53
  "@fluidframework/build-tools": "^0.34.0",
@@ -105,16 +96,16 @@
105
96
  "build:docs": "fluid-build . --task api",
106
97
  "build:esnext": "tsc --project ./tsconfig.json",
107
98
  "check:are-the-types-wrong": "attw --pack . --entrypoints .",
99
+ "check:prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
108
100
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
109
101
  "ci:build:docs": "api-extractor run",
110
102
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp",
111
103
  "eslint": "eslint --format stylish src",
112
104
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
113
- "format": "npm run prettier:fix",
114
- "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
115
- "lint:fix": "npm run prettier:fix && npm run eslint:fix",
116
- "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
117
- "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
105
+ "format": "fluid-build --task format .",
106
+ "format:prettier": "prettier --write . --cache --ignore-path ../../../.prettierignore",
107
+ "lint": "fluid-build . --task lint",
108
+ "lint:fix": "fluid-build . --task eslint:fix --task format",
118
109
  "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
119
110
  "typetests:gen": "fluid-type-test-generator",
120
111
  "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
@@ -4,9 +4,10 @@
4
4
  */
5
5
 
6
6
  import fs from "fs";
7
- import { assert } from "@fluidframework/core-utils";
8
- import { IDocumentDeltaStorageService, IStream } from "@fluidframework/driver-definitions";
9
- import { emptyMessageStream } from "@fluidframework/driver-utils";
7
+
8
+ import { assert } from "@fluidframework/core-utils/internal";
9
+ import { IDocumentDeltaStorageService, IStream } from "@fluidframework/driver-definitions/internal";
10
+ import { emptyMessageStream } from "@fluidframework/driver-utils/internal";
10
11
  import * as api from "@fluidframework/protocol-definitions";
11
12
 
12
13
  /**
@@ -3,11 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
6
7
  import { IDisposable } from "@fluidframework/core-interfaces";
7
8
  import {
8
9
  IDocumentDeltaConnection,
9
10
  IDocumentDeltaConnectionEvents,
10
- } from "@fluidframework/driver-definitions";
11
+ } from "@fluidframework/driver-definitions/internal";
11
12
  import {
12
13
  ConnectionMode,
13
14
  IClientConfiguration,
@@ -19,7 +20,7 @@ import {
19
20
  ITokenClaims,
20
21
  ScopeType,
21
22
  } from "@fluidframework/protocol-definitions";
22
- import { TypedEventEmitter } from "@fluid-internal/client-utils";
23
+
23
24
  import { FileDeltaStorageService } from "./fileDeltaStorageService.js";
24
25
 
25
26
  const MaxBatchDeltas = 2000;
@@ -4,8 +4,9 @@
4
4
  */
5
5
 
6
6
  import { TypedEventEmitter } from "@fluid-internal/client-utils";
7
- import * as api from "@fluidframework/driver-definitions";
7
+ import * as api from "@fluidframework/driver-definitions/internal";
8
8
  import { IClient } from "@fluidframework/protocol-definitions";
9
+
9
10
  import { FileDeltaStorageService } from "./fileDeltaStorageService.js";
10
11
 
11
12
  /**
@@ -3,15 +3,16 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
6
7
  import {
7
8
  IDocumentDeltaConnection,
8
9
  IDocumentService,
9
10
  IDocumentServiceFactory,
10
11
  IDocumentStorageService,
11
12
  IResolvedUrl,
12
- } from "@fluidframework/driver-definitions";
13
- import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
13
+ } from "@fluidframework/driver-definitions/internal";
14
14
  import { ISummaryTree } from "@fluidframework/protocol-definitions";
15
+
15
16
  import { FileDeltaStorageService } from "./fileDeltaStorageService.js";
16
17
  import { FileDocumentService } from "./fileDocumentService.js";
17
18
 
@@ -4,12 +4,22 @@
4
4
  */
5
5
 
6
6
  import fs from "fs";
7
+
7
8
  import { bufferToString } from "@fluid-internal/client-utils";
8
- import { assert } from "@fluidframework/core-utils";
9
- import { IDocumentStorageService, ISummaryContext } from "@fluidframework/driver-definitions";
10
- import { buildSnapshotTree, convertSummaryTreeToSnapshotITree } from "@fluidframework/driver-utils";
9
+ import { assert } from "@fluidframework/core-utils/internal";
10
+ import {
11
+ IDocumentStorageService,
12
+ ISummaryContext,
13
+ } from "@fluidframework/driver-definitions/internal";
14
+ import {
15
+ buildSnapshotTree,
16
+ convertSummaryTreeToSnapshotITree,
17
+ } from "@fluidframework/driver-utils/internal";
11
18
  import * as api from "@fluidframework/protocol-definitions";
12
- import { IFileSnapshot, ReadDocumentStorageServiceBase } from "@fluidframework/replay-driver";
19
+ import {
20
+ IFileSnapshot,
21
+ ReadDocumentStorageServiceBase,
22
+ } from "@fluidframework/replay-driver/internal";
13
23
 
14
24
  // This ID is used by replay tool as Document Id.
15
25
  // We leverage it to figure out when container is asking for root document tree.
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=validateFileDriverPrevious.generated.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateFileDriverPrevious.generated.d.ts","sourceRoot":"","sources":["../../../src/test/types/validateFileDriverPrevious.generated.ts"],"names":[],"mappings":""}
@@ -1,26 +0,0 @@
1
- use_current_ClassDeclaration_FileDeltaStorageService(get_old_ClassDeclaration_FileDeltaStorageService());
2
- use_old_ClassDeclaration_FileDeltaStorageService(get_current_ClassDeclaration_FileDeltaStorageService());
3
- use_current_ClassDeclaration_FileDocumentServiceFactory(get_old_ClassDeclaration_FileDocumentServiceFactory());
4
- use_old_ClassDeclaration_FileDocumentServiceFactory(get_current_ClassDeclaration_FileDocumentServiceFactory());
5
- use_current_VariableDeclaration_FileSnapshotWriterClassFactory(get_old_VariableDeclaration_FileSnapshotWriterClassFactory());
6
- use_old_VariableDeclaration_FileSnapshotWriterClassFactory(get_current_VariableDeclaration_FileSnapshotWriterClassFactory());
7
- use_current_VariableDeclaration_FileStorageDocumentName(get_old_VariableDeclaration_FileStorageDocumentName());
8
- use_old_VariableDeclaration_FileStorageDocumentName(get_current_VariableDeclaration_FileStorageDocumentName());
9
- use_current_ClassDeclaration_FluidFetchReader(get_old_ClassDeclaration_FluidFetchReader());
10
- use_old_ClassDeclaration_FluidFetchReader(
11
- // @ts-expect-error compatibility expected to be broken
12
- get_current_ClassDeclaration_FluidFetchReader());
13
- use_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(get_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter());
14
- use_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(get_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter());
15
- use_current_InterfaceDeclaration_ISnapshotWriterStorage(get_old_InterfaceDeclaration_ISnapshotWriterStorage());
16
- use_old_InterfaceDeclaration_ISnapshotWriterStorage(
17
- // @ts-expect-error compatibility expected to be broken
18
- get_current_InterfaceDeclaration_ISnapshotWriterStorage());
19
- use_current_TypeAliasDeclaration_ReaderConstructor(get_old_TypeAliasDeclaration_ReaderConstructor());
20
- use_old_TypeAliasDeclaration_ReaderConstructor(get_current_TypeAliasDeclaration_ReaderConstructor());
21
- use_current_ClassDeclaration_ReplayFileDeltaConnection(get_old_ClassDeclaration_ReplayFileDeltaConnection());
22
- use_old_ClassDeclaration_ReplayFileDeltaConnection(get_current_ClassDeclaration_ReplayFileDeltaConnection());
23
- use_current_ClassDeclaration_Replayer(get_old_ClassDeclaration_Replayer());
24
- use_old_ClassDeclaration_Replayer(get_current_ClassDeclaration_Replayer());
25
- export {};
26
- //# sourceMappingURL=validateFileDriverPrevious.generated.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateFileDriverPrevious.generated.js","sourceRoot":"","sources":["../../../src/test/types/validateFileDriverPrevious.generated.ts"],"names":[],"mappings":"AAgCA,oDAAoD,CAChD,gDAAgD,EAAE,CAAC,CAAC;AAWxD,gDAAgD,CAC5C,oDAAoD,EAAE,CAAC,CAAC;AAW5D,uDAAuD,CACnD,mDAAmD,EAAE,CAAC,CAAC;AAW3D,mDAAmD,CAC/C,uDAAuD,EAAE,CAAC,CAAC;AAW/D,8DAA8D,CAC1D,0DAA0D,EAAE,CAAC,CAAC;AAWlE,0DAA0D,CACtD,8DAA8D,EAAE,CAAC,CAAC;AAWtE,uDAAuD,CACnD,mDAAmD,EAAE,CAAC,CAAC;AAW3D,mDAAmD,CAC/C,uDAAuD,EAAE,CAAC,CAAC;AAW/D,6CAA6C,CACzC,yCAAyC,EAAE,CAAC,CAAC;AAWjD,yCAAyC;AACrC,uDAAuD;AACvD,6CAA6C,EAAE,CAAC,CAAC;AAWrD,kEAAkE,CAC9D,8DAA8D,EAAE,CAAC,CAAC;AAWtE,8DAA8D,CAC1D,kEAAkE,EAAE,CAAC,CAAC;AAW1E,uDAAuD,CACnD,mDAAmD,EAAE,CAAC,CAAC;AAW3D,mDAAmD;AAC/C,uDAAuD;AACvD,uDAAuD,EAAE,CAAC,CAAC;AAW/D,kDAAkD,CAC9C,8CAA8C,EAAE,CAAC,CAAC;AAWtD,8CAA8C,CAC1C,kDAAkD,EAAE,CAAC,CAAC;AAW1D,sDAAsD,CAClD,kDAAkD,EAAE,CAAC,CAAC;AAW1D,kDAAkD,CAC9C,sDAAsD,EAAE,CAAC,CAAC;AAW9D,qCAAqC,CACjC,iCAAiC,EAAE,CAAC,CAAC;AAWzC,iCAAiC,CAC7B,qCAAqC,EAAE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/*\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n * Generated by fluid-type-test-generator in @fluidframework/build-tools.\n */\nimport type * as old from \"@fluidframework/file-driver-previous\";\nimport type * as current from \"../../index.js\";\n\n\n// See 'build-tools/src/type-test-generator/compatibility.ts' for more information.\ntype TypeOnly<T> = T extends number\n\t? number\n\t: T extends string\n\t? string\n\t: T extends boolean | bigint | symbol\n\t? T\n\t: {\n\t\t\t[P in keyof T]: TypeOnly<T[P]>;\n\t };\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileDeltaStorageService\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileDeltaStorageService():\n TypeOnly<old.FileDeltaStorageService>;\ndeclare function use_current_ClassDeclaration_FileDeltaStorageService(\n use: TypeOnly<current.FileDeltaStorageService>): void;\nuse_current_ClassDeclaration_FileDeltaStorageService(\n get_old_ClassDeclaration_FileDeltaStorageService());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileDeltaStorageService\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileDeltaStorageService():\n TypeOnly<current.FileDeltaStorageService>;\ndeclare function use_old_ClassDeclaration_FileDeltaStorageService(\n use: TypeOnly<old.FileDeltaStorageService>): void;\nuse_old_ClassDeclaration_FileDeltaStorageService(\n get_current_ClassDeclaration_FileDeltaStorageService());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileDocumentServiceFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FileDocumentServiceFactory():\n TypeOnly<old.FileDocumentServiceFactory>;\ndeclare function use_current_ClassDeclaration_FileDocumentServiceFactory(\n use: TypeOnly<current.FileDocumentServiceFactory>): void;\nuse_current_ClassDeclaration_FileDocumentServiceFactory(\n get_old_ClassDeclaration_FileDocumentServiceFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FileDocumentServiceFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FileDocumentServiceFactory():\n TypeOnly<current.FileDocumentServiceFactory>;\ndeclare function use_old_ClassDeclaration_FileDocumentServiceFactory(\n use: TypeOnly<old.FileDocumentServiceFactory>): void;\nuse_old_ClassDeclaration_FileDocumentServiceFactory(\n get_current_ClassDeclaration_FileDocumentServiceFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FileSnapshotWriterClassFactory\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_FileSnapshotWriterClassFactory():\n TypeOnly<typeof old.FileSnapshotWriterClassFactory>;\ndeclare function use_current_VariableDeclaration_FileSnapshotWriterClassFactory(\n use: TypeOnly<typeof current.FileSnapshotWriterClassFactory>): void;\nuse_current_VariableDeclaration_FileSnapshotWriterClassFactory(\n get_old_VariableDeclaration_FileSnapshotWriterClassFactory());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FileSnapshotWriterClassFactory\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_FileSnapshotWriterClassFactory():\n TypeOnly<typeof current.FileSnapshotWriterClassFactory>;\ndeclare function use_old_VariableDeclaration_FileSnapshotWriterClassFactory(\n use: TypeOnly<typeof old.FileSnapshotWriterClassFactory>): void;\nuse_old_VariableDeclaration_FileSnapshotWriterClassFactory(\n get_current_VariableDeclaration_FileSnapshotWriterClassFactory());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FileStorageDocumentName\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_FileStorageDocumentName():\n TypeOnly<typeof old.FileStorageDocumentName>;\ndeclare function use_current_VariableDeclaration_FileStorageDocumentName(\n use: TypeOnly<typeof current.FileStorageDocumentName>): void;\nuse_current_VariableDeclaration_FileStorageDocumentName(\n get_old_VariableDeclaration_FileStorageDocumentName());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FileStorageDocumentName\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_FileStorageDocumentName():\n TypeOnly<typeof current.FileStorageDocumentName>;\ndeclare function use_old_VariableDeclaration_FileStorageDocumentName(\n use: TypeOnly<typeof old.FileStorageDocumentName>): void;\nuse_old_VariableDeclaration_FileStorageDocumentName(\n get_current_VariableDeclaration_FileStorageDocumentName());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidFetchReader\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_FluidFetchReader():\n TypeOnly<old.FluidFetchReader>;\ndeclare function use_current_ClassDeclaration_FluidFetchReader(\n use: TypeOnly<current.FluidFetchReader>): void;\nuse_current_ClassDeclaration_FluidFetchReader(\n get_old_ClassDeclaration_FluidFetchReader());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_FluidFetchReader\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_FluidFetchReader():\n TypeOnly<current.FluidFetchReader>;\ndeclare function use_old_ClassDeclaration_FluidFetchReader(\n use: TypeOnly<old.FluidFetchReader>): void;\nuse_old_ClassDeclaration_FluidFetchReader(\n // @ts-expect-error compatibility expected to be broken\n get_current_ClassDeclaration_FluidFetchReader());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FluidFetchReaderFileSnapshotWriter\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter():\n TypeOnly<typeof old.FluidFetchReaderFileSnapshotWriter>;\ndeclare function use_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(\n use: TypeOnly<typeof current.FluidFetchReaderFileSnapshotWriter>): void;\nuse_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(\n get_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"VariableDeclaration_FluidFetchReaderFileSnapshotWriter\": {\"backCompat\": false}\n*/\ndeclare function get_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter():\n TypeOnly<typeof current.FluidFetchReaderFileSnapshotWriter>;\ndeclare function use_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(\n use: TypeOnly<typeof old.FluidFetchReaderFileSnapshotWriter>): void;\nuse_old_VariableDeclaration_FluidFetchReaderFileSnapshotWriter(\n get_current_VariableDeclaration_FluidFetchReaderFileSnapshotWriter());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISnapshotWriterStorage\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_InterfaceDeclaration_ISnapshotWriterStorage():\n TypeOnly<old.ISnapshotWriterStorage>;\ndeclare function use_current_InterfaceDeclaration_ISnapshotWriterStorage(\n use: TypeOnly<current.ISnapshotWriterStorage>): void;\nuse_current_InterfaceDeclaration_ISnapshotWriterStorage(\n get_old_InterfaceDeclaration_ISnapshotWriterStorage());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"InterfaceDeclaration_ISnapshotWriterStorage\": {\"backCompat\": false}\n*/\ndeclare function get_current_InterfaceDeclaration_ISnapshotWriterStorage():\n TypeOnly<current.ISnapshotWriterStorage>;\ndeclare function use_old_InterfaceDeclaration_ISnapshotWriterStorage(\n use: TypeOnly<old.ISnapshotWriterStorage>): void;\nuse_old_InterfaceDeclaration_ISnapshotWriterStorage(\n // @ts-expect-error compatibility expected to be broken\n get_current_InterfaceDeclaration_ISnapshotWriterStorage());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReaderConstructor\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_TypeAliasDeclaration_ReaderConstructor():\n TypeOnly<old.ReaderConstructor>;\ndeclare function use_current_TypeAliasDeclaration_ReaderConstructor(\n use: TypeOnly<current.ReaderConstructor>): void;\nuse_current_TypeAliasDeclaration_ReaderConstructor(\n get_old_TypeAliasDeclaration_ReaderConstructor());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"TypeAliasDeclaration_ReaderConstructor\": {\"backCompat\": false}\n*/\ndeclare function get_current_TypeAliasDeclaration_ReaderConstructor():\n TypeOnly<current.ReaderConstructor>;\ndeclare function use_old_TypeAliasDeclaration_ReaderConstructor(\n use: TypeOnly<old.ReaderConstructor>): void;\nuse_old_TypeAliasDeclaration_ReaderConstructor(\n get_current_TypeAliasDeclaration_ReaderConstructor());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayFileDeltaConnection\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_ReplayFileDeltaConnection():\n TypeOnly<old.ReplayFileDeltaConnection>;\ndeclare function use_current_ClassDeclaration_ReplayFileDeltaConnection(\n use: TypeOnly<current.ReplayFileDeltaConnection>): void;\nuse_current_ClassDeclaration_ReplayFileDeltaConnection(\n get_old_ClassDeclaration_ReplayFileDeltaConnection());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_ReplayFileDeltaConnection\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_ReplayFileDeltaConnection():\n TypeOnly<current.ReplayFileDeltaConnection>;\ndeclare function use_old_ClassDeclaration_ReplayFileDeltaConnection(\n use: TypeOnly<old.ReplayFileDeltaConnection>): void;\nuse_old_ClassDeclaration_ReplayFileDeltaConnection(\n get_current_ClassDeclaration_ReplayFileDeltaConnection());\n\n/*\n* Validate forward compat by using old type in place of current type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_Replayer\": {\"forwardCompat\": false}\n*/\ndeclare function get_old_ClassDeclaration_Replayer():\n TypeOnly<old.Replayer>;\ndeclare function use_current_ClassDeclaration_Replayer(\n use: TypeOnly<current.Replayer>): void;\nuse_current_ClassDeclaration_Replayer(\n get_old_ClassDeclaration_Replayer());\n\n/*\n* Validate back compat by using current type in place of old type\n* If breaking change required, add in package.json under typeValidation.broken:\n* \"ClassDeclaration_Replayer\": {\"backCompat\": false}\n*/\ndeclare function get_current_ClassDeclaration_Replayer():\n TypeOnly<current.Replayer>;\ndeclare function use_old_ClassDeclaration_Replayer(\n use: TypeOnly<old.Replayer>): void;\nuse_old_ClassDeclaration_Replayer(\n get_current_ClassDeclaration_Replayer());\n"]}