diff --git a/services/web/test/frontend/helpers/editor-providers.js b/services/web/test/frontend/helpers/editor-providers.js index c81c921d3b..9798dbe8d3 100644 --- a/services/web/test/frontend/helpers/editor-providers.js +++ b/services/web/test/frontend/helpers/editor-providers.js @@ -55,6 +55,13 @@ export function EditorProviders({ getCurrentDocValue: () => {}, openDoc: sinon.stub(), }, + metadataManager = { + metadata: { + state: { + documents: {}, + }, + }, + }, }) { window.user = user || window.user window.gitBridgePublicBaseUrl = 'git.overleaf.test' @@ -86,14 +93,6 @@ export function EditorProviders({ ...scope, } - const metadataManager = { - metadata: { - state: { - documents: {}, - }, - }, - } - window._ide = { $scope, socket, diff --git a/services/web/types/doc.ts b/services/web/types/doc.ts new file mode 100644 index 0000000000..ee2bcac004 --- /dev/null +++ b/services/web/types/doc.ts @@ -0,0 +1,4 @@ +export type Doc = { + _id: string + name: string +} diff --git a/services/web/types/fileref.ts b/services/web/types/fileref.ts new file mode 100644 index 0000000000..80fd2bbeab --- /dev/null +++ b/services/web/types/fileref.ts @@ -0,0 +1,4 @@ +export type FileRef = { + _id: string + name: string +} diff --git a/services/web/types/folder.ts b/services/web/types/folder.ts index ee12a87a55..34c64c35aa 100644 --- a/services/web/types/folder.ts +++ b/services/web/types/folder.ts @@ -1,7 +1,10 @@ +import { Doc } from './doc' +import { FileRef } from './fileref' + export type Folder = { _id: string name: string - docs: [] - folders: [] - fileRefs: [] + docs: Doc[] + folders: Folder[] + fileRefs: FileRef[] } diff --git a/services/web/types/metadata.ts b/services/web/types/metadata.ts new file mode 100644 index 0000000000..4690615f01 --- /dev/null +++ b/services/web/types/metadata.ts @@ -0,0 +1,18 @@ +type Package = { + caption: string + meta: string + score: number + snippet: string +} + +export type Metadata = { + state: { + documents: Record< + string, + { + labels: string[] + packages: Record + } + > + } +}