diff --git a/libraries/fetch-utils/index.js b/libraries/fetch-utils/index.js index b2e66e4350..2167e9f407 100644 --- a/libraries/fetch-utils/index.js +++ b/libraries/fetch-utils/index.js @@ -5,6 +5,10 @@ const fetch = require('node-fetch') const http = require('http') const https = require('https') +/** + * @import { Response } from 'node-fetch' + */ + /** * Make a request and return the parsed JSON response. * @@ -240,8 +244,6 @@ async function discardResponseBody(response) { } /** - * @typedef {import('node-fetch').Response} Response - * * @param {Response} response */ async function maybeGetResponseBody(response) { diff --git a/libraries/overleaf-editor-core/lib/change.js b/libraries/overleaf-editor-core/lib/change.js index cc84f9970f..63b49265fb 100644 --- a/libraries/overleaf-editor-core/lib/change.js +++ b/libraries/overleaf-editor-core/lib/change.js @@ -12,8 +12,8 @@ const FileMap = require('./file_map') const V2DocVersions = require('./v2_doc_versions') /** - * @typedef {import("./author")} Author - * @typedef {import("./types").BlobStore} BlobStore + * @import Author from "./author" + * @import { BlobStore } from "./types" */ /** diff --git a/libraries/overleaf-editor-core/lib/change_request.js b/libraries/overleaf-editor-core/lib/change_request.js index 63eb1d1fd1..a5cbb2e388 100644 --- a/libraries/overleaf-editor-core/lib/change_request.js +++ b/libraries/overleaf-editor-core/lib/change_request.js @@ -7,7 +7,7 @@ const Change = require('./change') const Operation = require('./operation') /** - * @typedef {import("./author")} Author + * @import Author from "./author" */ /** diff --git a/libraries/overleaf-editor-core/lib/chunk.js b/libraries/overleaf-editor-core/lib/chunk.js index f090eb9ee7..897c3fa647 100644 --- a/libraries/overleaf-editor-core/lib/chunk.js +++ b/libraries/overleaf-editor-core/lib/chunk.js @@ -6,9 +6,9 @@ const OError = require('@overleaf/o-error') const History = require('./history') /** - * @typedef {import("./types").BlobStore} BlobStore - * @typedef {import("./change")} Change - * @typedef {import("./snapshot")} Snapshot + * @import { BlobStore } from "./types" + * @import Change from "./change" + * @import Snapshot from "./snapshot" */ class ConflictingEndVersion extends OError { constructor(clientEndVersion, latestEndVersion) { diff --git a/libraries/overleaf-editor-core/lib/comment.js b/libraries/overleaf-editor-core/lib/comment.js index bd1a46d21a..89a56dd119 100644 --- a/libraries/overleaf-editor-core/lib/comment.js +++ b/libraries/overleaf-editor-core/lib/comment.js @@ -3,8 +3,8 @@ const { RetainOp, InsertOp, RemoveOp } = require('./operation/scan_op') const Range = require('./range') /** - * @typedef {import("./types").CommentRawData} CommentRawData - * @typedef {import("./operation/text_operation")} TextOperation + * @import { CommentRawData } from "./types" + * @import TextOperation from "./operation/text_operation" */ class Comment { diff --git a/libraries/overleaf-editor-core/lib/file.js b/libraries/overleaf-editor-core/lib/file.js index 01cef3d273..2b7117eef3 100644 --- a/libraries/overleaf-editor-core/lib/file.js +++ b/libraries/overleaf-editor-core/lib/file.js @@ -10,16 +10,13 @@ const HashFileData = require('./file_data/hash_file_data') const StringFileData = require('./file_data/string_file_data') /** - * @typedef {import("./blob")} Blob - * @typedef {import("./types").BlobStore} BlobStore - * @typedef {import("./types").ReadonlyBlobStore} ReadonlyBlobStore - * @typedef {import("./types").RawFileData} RawFileData - * @typedef {import("./types").RawFile} RawFile - * @typedef {import("./types").StringFileRawData} StringFileRawData - * @typedef {import("./types").CommentRawData} CommentRawData - * @typedef {import("./file_data/comment_list")} CommentList - * @typedef {import("./operation/text_operation")} TextOperation - * @typedef {import("./file_data/tracked_change_list")} TrackedChangeList + * @import Blob from "./blob" + * @import { BlobStore, ReadonlyBlobStore, RawFileData, RawFile } from "./types" + * @import { StringFileRawData, CommentRawData } from "./types" + * @import CommentList from "./file_data/comment_list" + * @import TextOperation from "./operation/text_operation" + * @import TrackedChangeList from "./file_data/tracked_change_list" + * * @typedef {{filterTrackedDeletes?: boolean}} FileGetContentOptions */ diff --git a/libraries/overleaf-editor-core/lib/file_data/binary_file_data.js b/libraries/overleaf-editor-core/lib/file_data/binary_file_data.js index 4e78b359fd..7919634c5d 100644 --- a/libraries/overleaf-editor-core/lib/file_data/binary_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/binary_file_data.js @@ -6,7 +6,7 @@ const Blob = require('../blob') const FileData = require('./') /** - * @typedef {import('../types').RawBinaryFileData} RawBinaryFileData + * @import { RawBinaryFileData } from '../types' */ class BinaryFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/clear_tracking_props.js b/libraries/overleaf-editor-core/lib/file_data/clear_tracking_props.js index ad735fbf5c..ba7f0bf00b 100644 --- a/libraries/overleaf-editor-core/lib/file_data/clear_tracking_props.js +++ b/libraries/overleaf-editor-core/lib/file_data/clear_tracking_props.js @@ -1,7 +1,7 @@ // @ts-check /** - * @typedef {import('../types').ClearTrackingPropsRawData} ClearTrackingPropsRawData + * @import { ClearTrackingPropsRawData } from '../types' */ class ClearTrackingProps { diff --git a/libraries/overleaf-editor-core/lib/file_data/comment_list.js b/libraries/overleaf-editor-core/lib/file_data/comment_list.js index 13300b44c2..69e552918d 100644 --- a/libraries/overleaf-editor-core/lib/file_data/comment_list.js +++ b/libraries/overleaf-editor-core/lib/file_data/comment_list.js @@ -2,8 +2,8 @@ const Comment = require('../comment') /** - * @typedef {import("../types").CommentRawData} CommentRawData - * @typedef {import("../range")} Range + * @import { CommentRawData } from "../types" + * @import Range from "../range" */ class CommentList { diff --git a/libraries/overleaf-editor-core/lib/file_data/hash_file_data.js b/libraries/overleaf-editor-core/lib/file_data/hash_file_data.js index 90ddb55ba0..d12da1cf65 100644 --- a/libraries/overleaf-editor-core/lib/file_data/hash_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/hash_file_data.js @@ -6,11 +6,10 @@ const assert = require('check-types').assert const Blob = require('../blob') const FileData = require('./') /** - * @typedef {import('./string_file_data')} StringFileData - * @typedef {import('./lazy_string_file_data')} LazyStringFileData - * @typedef {import('./hollow_string_file_data')} HollowStringFileData - * @typedef {import('../types').BlobStore} BlobStore - * @typedef {import('../types').RawHashFileData} RawHashFileData + * @import StringFileData from './string_file_data' + * @import LazyStringFileData from './lazy_string_file_data' + * @import HollowStringFileData from './hollow_string_file_data' + * @import { BlobStore, RawHashFileData } from '../types' */ class HashFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/hollow_binary_file_data.js b/libraries/overleaf-editor-core/lib/file_data/hollow_binary_file_data.js index 93431ebda1..4187024b41 100644 --- a/libraries/overleaf-editor-core/lib/file_data/hollow_binary_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/hollow_binary_file_data.js @@ -5,7 +5,7 @@ const assert = require('check-types').assert const FileData = require('./') /** - * @typedef {import('../types').RawHollowBinaryFileData} RawHollowBinaryFileData + * @import { RawHollowBinaryFileData } from '../types' */ class HollowBinaryFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/hollow_string_file_data.js b/libraries/overleaf-editor-core/lib/file_data/hollow_string_file_data.js index a22c07533b..717c060ef0 100644 --- a/libraries/overleaf-editor-core/lib/file_data/hollow_string_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/hollow_string_file_data.js @@ -1,15 +1,13 @@ // @ts-check 'use strict' -/** - * @typedef {import('../operation/edit_operation')} EditOperation - */ const assert = require('check-types').assert const FileData = require('./') /** - * @typedef {import('../types').RawHollowStringFileData} RawHollowStringFileData + * @import { RawHollowStringFileData } from '../types' + * @import EditOperation from '../operation/edit_operation' */ class HollowStringFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/index.js b/libraries/overleaf-editor-core/lib/file_data/index.js index fd5390558b..0e6f50325f 100644 --- a/libraries/overleaf-editor-core/lib/file_data/index.js +++ b/libraries/overleaf-editor-core/lib/file_data/index.js @@ -7,13 +7,10 @@ const assert = require('check-types').assert const Blob = require('../blob') /** - * @typedef {import("../types").BlobStore} BlobStore - * @typedef {import("../types").ReadonlyBlobStore} ReadonlyBlobStore - * @typedef {import("../types").RawFileData} RawFileData - * @typedef {import("../operation/edit_operation")} EditOperation - * @typedef {import("../file_data/comment_list")} CommentList - * @typedef {import("../types").CommentRawData} CommentRawData - * @typedef {import("../file_data/tracked_change_list")} TrackedChangeList + * @import { BlobStore, ReadonlyBlobStore, RawFileData, CommentRawData } from "../types" + * @import EditOperation from "../operation/edit_operation" + * @import CommentList from "../file_data/comment_list" + * @import TrackedChangeList from "../file_data/tracked_change_list" */ /** diff --git a/libraries/overleaf-editor-core/lib/file_data/lazy_string_file_data.js b/libraries/overleaf-editor-core/lib/file_data/lazy_string_file_data.js index fba3e716b0..bc11b3e98d 100644 --- a/libraries/overleaf-editor-core/lib/file_data/lazy_string_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/lazy_string_file_data.js @@ -11,11 +11,7 @@ const EditOperation = require('../operation/edit_operation') const EditOperationBuilder = require('../operation/edit_operation_builder') /** - * @typedef {import('../types').BlobStore} BlobStore - * @typedef {import('../types').ReadonlyBlobStore} ReadonlyBlobStore - * @typedef {import('../types').RangesBlob} RangesBlob - * @typedef {import('../types').RawFileData} RawFileData - * @typedef {import('../types').RawLazyStringFileData} RawLazyStringFileData + * @import { BlobStore, ReadonlyBlobStore, RangesBlob, RawFileData, RawLazyStringFileData } from '../types' */ class LazyStringFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/string_file_data.js b/libraries/overleaf-editor-core/lib/file_data/string_file_data.js index 6af37c6e74..04d486b6b0 100644 --- a/libraries/overleaf-editor-core/lib/file_data/string_file_data.js +++ b/libraries/overleaf-editor-core/lib/file_data/string_file_data.js @@ -8,13 +8,9 @@ const CommentList = require('./comment_list') const TrackedChangeList = require('./tracked_change_list') /** - * @typedef {import("../types").StringFileRawData} StringFileRawData - * @typedef {import("../types").RawFileData} RawFileData - * @typedef {import("../operation/edit_operation")} EditOperation - * @typedef {import("../types").BlobStore} BlobStore - * @typedef {import("../types").CommentRawData} CommentRawData - * @typedef {import("../types").TrackedChangeRawData} TrackedChangeRawData - * @typedef {import('../types').RangesBlob} RangesBlob + * @import { StringFileRawData, RawFileData, BlobStore, CommentRawData } from "../types" + * @import { TrackedChangeRawData, RangesBlob } from "../types" + * @import EditOperation from "../operation/edit_operation" */ class StringFileData extends FileData { diff --git a/libraries/overleaf-editor-core/lib/file_data/tracked_change.js b/libraries/overleaf-editor-core/lib/file_data/tracked_change.js index 955be73635..d0e6517d0f 100644 --- a/libraries/overleaf-editor-core/lib/file_data/tracked_change.js +++ b/libraries/overleaf-editor-core/lib/file_data/tracked_change.js @@ -3,7 +3,7 @@ const Range = require('../range') const TrackingProps = require('./tracking_props') /** - * @typedef {import("../types").TrackedChangeRawData} TrackedChangeRawData + * @import { TrackedChangeRawData } from "../types" */ class TrackedChange { diff --git a/libraries/overleaf-editor-core/lib/file_data/tracked_change_list.js b/libraries/overleaf-editor-core/lib/file_data/tracked_change_list.js index fd4f016ed9..263b37ab50 100644 --- a/libraries/overleaf-editor-core/lib/file_data/tracked_change_list.js +++ b/libraries/overleaf-editor-core/lib/file_data/tracked_change_list.js @@ -4,8 +4,7 @@ const TrackedChange = require('./tracked_change') const TrackingProps = require('../file_data/tracking_props') /** - * @typedef {import("../types").TrackingDirective} TrackingDirective - * @typedef {import("../types").TrackedChangeRawData} TrackedChangeRawData + * @import { TrackingDirective, TrackedChangeRawData } from "../types" */ class TrackedChangeList { diff --git a/libraries/overleaf-editor-core/lib/file_data/tracking_props.js b/libraries/overleaf-editor-core/lib/file_data/tracking_props.js index cffe7bbef9..75ec95c566 100644 --- a/libraries/overleaf-editor-core/lib/file_data/tracking_props.js +++ b/libraries/overleaf-editor-core/lib/file_data/tracking_props.js @@ -1,7 +1,6 @@ // @ts-check /** - * @typedef {import("../types").TrackingPropsRawData} TrackingPropsRawData - * @typedef {import("../types").TrackingDirective} TrackingDirective + * @import { TrackingPropsRawData, TrackingDirective } from "../types" */ class TrackingProps { diff --git a/libraries/overleaf-editor-core/lib/file_map.js b/libraries/overleaf-editor-core/lib/file_map.js index 9fb4181f01..328b7539d2 100644 --- a/libraries/overleaf-editor-core/lib/file_map.js +++ b/libraries/overleaf-editor-core/lib/file_map.js @@ -10,8 +10,8 @@ const File = require('./file') const safePathname = require('./safe_pathname') /** - * @typedef {import('./types').RawFile} RawFile - * @typedef {import('./types').RawFileMap} RawFileMap + * @import { RawFile, RawFileMap } from './types' + * * @typedef {Record} FileMapData */ diff --git a/libraries/overleaf-editor-core/lib/history.js b/libraries/overleaf-editor-core/lib/history.js index 86992d7aeb..a2e222acd3 100644 --- a/libraries/overleaf-editor-core/lib/history.js +++ b/libraries/overleaf-editor-core/lib/history.js @@ -7,7 +7,7 @@ const Change = require('./change') const Snapshot = require('./snapshot') /** - * @typedef {import("./types").BlobStore} BlobStore + * @import { BlobStore } from "./types" */ class History { diff --git a/libraries/overleaf-editor-core/lib/label.js b/libraries/overleaf-editor-core/lib/label.js index 8f7345d93c..958f7583ab 100644 --- a/libraries/overleaf-editor-core/lib/label.js +++ b/libraries/overleaf-editor-core/lib/label.js @@ -4,7 +4,7 @@ const assert = require('check-types').assert /** - * @typedef {import('./types').RawLabel} RawLabel + * @import { RawLabel } from './types' */ /** diff --git a/libraries/overleaf-editor-core/lib/operation/add_comment_operation.js b/libraries/overleaf-editor-core/lib/operation/add_comment_operation.js index efadb501ed..9165d42011 100644 --- a/libraries/overleaf-editor-core/lib/operation/add_comment_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/add_comment_operation.js @@ -5,10 +5,9 @@ const Range = require('../range') const EditOperation = require('./edit_operation') /** - * @typedef {import('./delete_comment_operation')} DeleteCommentOperation - * @typedef {import('../types').CommentRawData} CommentRawData - * @typedef {import('../types').RawAddCommentOperation} RawAddCommentOperation - * @typedef {import('../file_data/string_file_data')} StringFileData + * @import DeleteCommentOperation from './delete_comment_operation' + * @import { CommentRawData, RawAddCommentOperation } from '../types' + * @import StringFileData from '../file_data/string_file_data' */ /** diff --git a/libraries/overleaf-editor-core/lib/operation/delete_comment_operation.js b/libraries/overleaf-editor-core/lib/operation/delete_comment_operation.js index 30dd58c860..4f4a457d3a 100644 --- a/libraries/overleaf-editor-core/lib/operation/delete_comment_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/delete_comment_operation.js @@ -4,9 +4,9 @@ const EditNoOperation = require('./edit_no_operation') const EditOperation = require('./edit_operation') /** - * @typedef {import('./add_comment_operation')} AddCommentOperation - * @typedef {import('../types').RawDeleteCommentOperation} RawDeleteCommentOperation - * @typedef {import('../file_data/string_file_data')} StringFileData + * @import AddCommentOperation from './add_comment_operation' + * @import StringFileData from '../file_data/string_file_data' + * @import { RawDeleteCommentOperation } from '../types' */ /** diff --git a/libraries/overleaf-editor-core/lib/operation/edit_file_operation.js b/libraries/overleaf-editor-core/lib/operation/edit_file_operation.js index 1e014b21fe..8505b8a23b 100644 --- a/libraries/overleaf-editor-core/lib/operation/edit_file_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/edit_file_operation.js @@ -1,9 +1,9 @@ // @ts-check 'use strict' /** - * @typedef {import('./edit_operation')} EditOperation - * @typedef {import('../types').RawEditFileOperation} RawEditFileOperation - * @typedef {import("../snapshot")} Snapshot + * @import EditOperation from './edit_operation' + * @import { RawEditFileOperation } from '../types' + * @import Snapshot from "../snapshot" */ const Operation = require('./') diff --git a/libraries/overleaf-editor-core/lib/operation/edit_no_operation.js b/libraries/overleaf-editor-core/lib/operation/edit_no_operation.js index 5201b8f6df..81eae0d814 100644 --- a/libraries/overleaf-editor-core/lib/operation/edit_no_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/edit_no_operation.js @@ -1,7 +1,7 @@ const EditOperation = require('./edit_operation') /** - * @typedef {import('../types').RawEditNoOperation} RawEditNoOperation + * @import { RawEditNoOperation } from '../types' */ class EditNoOperation extends EditOperation { diff --git a/libraries/overleaf-editor-core/lib/operation/edit_operation.js b/libraries/overleaf-editor-core/lib/operation/edit_operation.js index 2617ae6ad4..5058bb0295 100644 --- a/libraries/overleaf-editor-core/lib/operation/edit_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/edit_operation.js @@ -1,7 +1,7 @@ // @ts-check /** - * @typedef {import('../file_data')} FileData - * @typedef {import('../types').RawEditOperation} RawEditOperation + * @import FileData from '../file_data' + * @import { RawEditOperation } from '../types' */ class EditOperation { diff --git a/libraries/overleaf-editor-core/lib/operation/edit_operation_builder.js b/libraries/overleaf-editor-core/lib/operation/edit_operation_builder.js index 6f27746fc0..febdebc034 100644 --- a/libraries/overleaf-editor-core/lib/operation/edit_operation_builder.js +++ b/libraries/overleaf-editor-core/lib/operation/edit_operation_builder.js @@ -1,12 +1,11 @@ // @ts-check + /** - * @typedef {import('./edit_operation')} EditOperation - * @typedef {import('../types').RawTextOperation} RawTextOperation - * @typedef {import('../types').RawAddCommentOperation} RawAddCommentOperation - * @typedef {import('../types').RawDeleteCommentOperation} RawDeleteCommentOperation - * @typedef {import('../types').RawSetCommentStateOperation} RawSetCommentStateOperation - * @typedef {import('../types').RawEditOperation} RawEditOperation + * @import EditOperation from './edit_operation' + * @import { RawTextOperation, RawAddCommentOperation, RawEditOperation } from '../types' + * @import { RawDeleteCommentOperation, RawSetCommentStateOperation } from '../types' */ + const DeleteCommentOperation = require('./delete_comment_operation') const AddCommentOperation = require('./add_comment_operation') const TextOperation = require('./text_operation') diff --git a/libraries/overleaf-editor-core/lib/operation/edit_operation_transformer.js b/libraries/overleaf-editor-core/lib/operation/edit_operation_transformer.js index 719ef5b50a..c82393c6a2 100644 --- a/libraries/overleaf-editor-core/lib/operation/edit_operation_transformer.js +++ b/libraries/overleaf-editor-core/lib/operation/edit_operation_transformer.js @@ -3,7 +3,10 @@ const core = require('../..') const Comment = require('../comment') const EditNoOperation = require('./edit_no_operation') const TextOperation = require('./text_operation') -/** @typedef {import('./edit_operation')} EditOperation */ + +/** + * @import EditOperation from './edit_operation' + */ class EditOperationTransformer { /** diff --git a/libraries/overleaf-editor-core/lib/operation/index.js b/libraries/overleaf-editor-core/lib/operation/index.js index fedfdee250..ebc6f73907 100644 --- a/libraries/overleaf-editor-core/lib/operation/index.js +++ b/libraries/overleaf-editor-core/lib/operation/index.js @@ -13,8 +13,8 @@ let EditFileOperation = null let SetFileMetadataOperation = null /** - * @typedef {import("../types").BlobStore} BlobStore - * @typedef {import("../snapshot")} Snapshot + * @import { BlobStore } from "../types" + * @import Snapshot from "../snapshot" */ /** diff --git a/libraries/overleaf-editor-core/lib/operation/scan_op.js b/libraries/overleaf-editor-core/lib/operation/scan_op.js index 9600c38c21..4f179f24b4 100644 --- a/libraries/overleaf-editor-core/lib/operation/scan_op.js +++ b/libraries/overleaf-editor-core/lib/operation/scan_op.js @@ -9,12 +9,9 @@ const ClearTrackingProps = require('../file_data/clear_tracking_props') const TrackingProps = require('../file_data/tracking_props') /** + * @import { RawScanOp, RawInsertOp, RawRetainOp, RawRemoveOp, TrackingDirective } from '../types' + * * @typedef {{ length: number, inputCursor: number, readonly inputLength: number}} LengthApplyContext - * @typedef {import('../types').RawScanOp} RawScanOp - * @typedef {import('../types').RawInsertOp} RawInsertOp - * @typedef {import('../types').RawRetainOp} RawRetainOp - * @typedef {import('../types').RawRemoveOp} RawRemoveOp - * @typedef {import('../types').TrackingDirective} TrackingDirective */ class ScanOp { diff --git a/libraries/overleaf-editor-core/lib/operation/set_comment_state_operation.js b/libraries/overleaf-editor-core/lib/operation/set_comment_state_operation.js index 25c1ffa224..5ac1a4682e 100644 --- a/libraries/overleaf-editor-core/lib/operation/set_comment_state_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/set_comment_state_operation.js @@ -5,10 +5,10 @@ const EditNoOperation = require('./edit_no_operation') const EditOperation = require('./edit_operation') /** - * @typedef {import('./delete_comment_operation')} DeleteCommentOperation - * @typedef {import('../types').CommentRawData} CommentRawData - * @typedef {import('../types').RawSetCommentStateOperation} RawSetCommentStateOperation - * @typedef {import('../file_data/string_file_data')} StringFileData + * @import DeleteCommentOperation from './delete_comment_operation' + * @import { CommentRawData } from '../types' + * @import { RawSetCommentStateOperation } from '../types' + * @import StringFileData from '../file_data/string_file_data' */ /** diff --git a/libraries/overleaf-editor-core/lib/operation/text_operation.js b/libraries/overleaf-editor-core/lib/operation/text_operation.js index 29690ce74e..4f556012c6 100644 --- a/libraries/overleaf-editor-core/lib/operation/text_operation.js +++ b/libraries/overleaf-editor-core/lib/operation/text_operation.js @@ -30,11 +30,11 @@ const ClearTrackingProps = require('../file_data/clear_tracking_props') const TrackingProps = require('../file_data/tracking_props') /** - * @typedef {import('../file_data/string_file_data')} StringFileData - * @typedef {import('../types').RawTextOperation} RawTextOperation - * @typedef {import('../operation/scan_op').ScanOp} ScanOp - * @typedef {import('../file_data/tracked_change_list')} TrackedChangeList - * @typedef {import('../types').TrackingDirective} TrackingDirective + * @import StringFileData from '../file_data/string_file_data' + * @import { RawTextOperation, TrackingDirective } from '../types' + * @import { ScanOp } from '../operation/scan_op' + * @import TrackedChangeList from '../file_data/tracked_change_list' + * * @typedef {{tracking?: TrackingProps, commentIds?: string[]}} InsertOptions */ diff --git a/libraries/overleaf-editor-core/lib/range.js b/libraries/overleaf-editor-core/lib/range.js index 1847c2a273..bc47632f92 100644 --- a/libraries/overleaf-editor-core/lib/range.js +++ b/libraries/overleaf-editor-core/lib/range.js @@ -3,7 +3,7 @@ const OError = require('@overleaf/o-error') /** - * @typedef {import('./types').RawRange} RawRange + * @import { RawRange } from './types' */ class Range { diff --git a/libraries/overleaf-editor-core/lib/snapshot.js b/libraries/overleaf-editor-core/lib/snapshot.js index e880f68558..d7cbe62ae9 100644 --- a/libraries/overleaf-editor-core/lib/snapshot.js +++ b/libraries/overleaf-editor-core/lib/snapshot.js @@ -10,12 +10,10 @@ const V2DocVersions = require('./v2_doc_versions') const FILE_LOAD_CONCURRENCY = 50 /** - * @typedef {import("./types").BlobStore} BlobStore - * @typedef {import("./types").RawSnapshot} RawSnapshot - * @typedef {import("./types").ReadonlyBlobStore} ReadonlyBlobStore - * @typedef {import("./change")} Change - * @typedef {import("./operation/text_operation")} TextOperation - * @typedef {import("./file")} File + * @import { BlobStore, RawSnapshot, ReadonlyBlobStore } from "./types" + * @import Change from "./change" + * @import TextOperation from "./operation/text_operation" + * @import File from "./file" */ class EditMissingFileError extends OError {} diff --git a/libraries/overleaf-editor-core/lib/v2_doc_versions.js b/libraries/overleaf-editor-core/lib/v2_doc_versions.js index 711b8457ce..4d313bb2dd 100644 --- a/libraries/overleaf-editor-core/lib/v2_doc_versions.js +++ b/libraries/overleaf-editor-core/lib/v2_doc_versions.js @@ -4,9 +4,9 @@ const _ = require('lodash') /** - * @typedef {import("./file")} File - * @typedef {import("./snapshot")} Snapshot - * @typedef {import("./types").RawV2DocVersions} RawV2DocVersions + * @import File from "./file" + * @import Snapshot from "./snapshot" + * @import { RawV2DocVersions } from "./types" */ class V2DocVersions { diff --git a/libraries/overleaf-editor-core/test/support/fake_blob_store.js b/libraries/overleaf-editor-core/test/support/fake_blob_store.js index bdb7c17f82..2b6ad7c1a9 100644 --- a/libraries/overleaf-editor-core/test/support/fake_blob_store.js +++ b/libraries/overleaf-editor-core/test/support/fake_blob_store.js @@ -1,5 +1,5 @@ /** - * @typedef {import("../..").Blob } Blob + * @import { Blob } from "../.." */ /** diff --git a/libraries/overleaf-editor-core/test/tracked_change_list.test.js b/libraries/overleaf-editor-core/test/tracked_change_list.test.js index b72caf2423..6cf47f0b0b 100644 --- a/libraries/overleaf-editor-core/test/tracked_change_list.test.js +++ b/libraries/overleaf-editor-core/test/tracked_change_list.test.js @@ -3,7 +3,7 @@ const TrackedChangeList = require('../lib/file_data/tracked_change_list') const TrackingProps = require('../lib/file_data/tracking_props') const ClearTrackingProps = require('../lib/file_data/clear_tracking_props') const { expect } = require('chai') -/** @typedef {import('../lib/types').TrackedChangeRawData} TrackedChangeRawData */ +/** @import { TrackedChangeRawData } from '../lib/types' */ describe('TrackedChangeList', function () { describe('applyInsert', function () { diff --git a/services/docstore/app/js/DocManager.js b/services/docstore/app/js/DocManager.js index 777f4ab6a4..80e8ae4527 100644 --- a/services/docstore/app/js/DocManager.js +++ b/services/docstore/app/js/DocManager.js @@ -9,8 +9,8 @@ const { callbackifyAll } = require('@overleaf/promise-utils') const { setTimeout } = require('timers/promises') /** - * @typedef {import('mongodb').Document} Document - * @typedef {import('mongodb').WithId} WithId + * @import { Document } from 'mongodb' + * @import { WithId } from 'mongodb' */ const DocManager = { diff --git a/services/document-updater/app/js/HistoryConversions.js b/services/document-updater/app/js/HistoryConversions.js index a6eb7e1513..50db911ed6 100644 --- a/services/document-updater/app/js/HistoryConversions.js +++ b/services/document-updater/app/js/HistoryConversions.js @@ -4,12 +4,8 @@ const _ = require('lodash') const { isDelete } = require('./Utils') /** - * @typedef {import('./types').Comment} Comment - * @typedef {import('./types').HistoryComment} HistoryComment - * @typedef {import('./types').HistoryRanges} HistoryRanges - * @typedef {import('./types').HistoryTrackedChange} HistoryTrackedChange - * @typedef {import('./types').Ranges} Ranges - * @typedef {import('./types').TrackedChange} TrackedChange + * @import { Comment, HistoryComment, HistoryRanges, HistoryTrackedChange } from './types' + * @import { Ranges, TrackedChange } from './types' */ /** diff --git a/services/document-updater/app/js/ProjectHistoryRedisManager.js b/services/document-updater/app/js/ProjectHistoryRedisManager.js index 8f16c3b5d8..b84edfe74a 100644 --- a/services/document-updater/app/js/ProjectHistoryRedisManager.js +++ b/services/document-updater/app/js/ProjectHistoryRedisManager.js @@ -14,7 +14,7 @@ const HistoryConversions = require('./HistoryConversions') const OError = require('@overleaf/o-error') /** - * @typedef {import('./types').Ranges} Ranges + * @import { Ranges } from './types' */ const ProjectHistoryRedisManager = { diff --git a/services/document-updater/app/js/RangesManager.js b/services/document-updater/app/js/RangesManager.js index 0970de5fb4..6ee5ae3abf 100644 --- a/services/document-updater/app/js/RangesManager.js +++ b/services/document-updater/app/js/RangesManager.js @@ -8,21 +8,9 @@ const _ = require('lodash') const { isInsert, isDelete, isComment, getDocLength } = require('./Utils') /** - * @typedef {import('./types').Comment} Comment - * @typedef {import('./types').CommentOp} CommentOp - * @typedef {import('./types').DeleteOp} DeleteOp - * @typedef {import('./types').HistoryCommentOp} HistoryCommentOp - * @typedef {import('./types').HistoryDeleteOp} HistoryDeleteOp - * @typedef {import('./types').HistoryDeleteTrackedChange} HistoryDeleteTrackedChange - * @typedef {import('./types').HistoryInsertOp} HistoryInsertOp - * @typedef {import('./types').HistoryRetainOp} HistoryRetainOp - * @typedef {import('./types').HistoryOp} HistoryOp - * @typedef {import('./types').HistoryUpdate} HistoryUpdate - * @typedef {import('./types').InsertOp} InsertOp - * @typedef {import('./types').Op} Op - * @typedef {import('./types').Ranges} Ranges - * @typedef {import('./types').TrackedChange} TrackedChange - * @typedef {import('./types').Update} Update + * @import { Comment, CommentOp, InsertOp, DeleteOp, HistoryOp, Op } from './types' + * @import { HistoryCommentOp, HistoryDeleteOp, HistoryInsertOp, HistoryRetainOp } from './types' + * @import { HistoryDeleteTrackedChange, HistoryUpdate, Ranges, TrackedChange, Update } from './types' */ const RANGE_DELTA_BUCKETS = [0, 1, 2, 3, 4, 5, 10, 20, 50] diff --git a/services/document-updater/app/js/UpdateManager.js b/services/document-updater/app/js/UpdateManager.js index dff81f9fa4..b23522a2cb 100644 --- a/services/document-updater/app/js/UpdateManager.js +++ b/services/document-updater/app/js/UpdateManager.js @@ -17,12 +17,7 @@ const Profiler = require('./Profiler') const { isInsert, isDelete, getDocLength } = require('./Utils') /** - * @typedef {import("./types").DeleteOp} DeleteOp - * @typedef {import("./types").HistoryUpdate } HistoryUpdate - * @typedef {import("./types").InsertOp} InsertOp - * @typedef {import("./types").Op} Op - * @typedef {import("./types").Ranges} Ranges - * @typedef {import("./types").Update} Update + * @import { DeleteOp, InsertOp, Op, Ranges, Update, HistoryUpdate } from "./types" */ const UpdateManager = { diff --git a/services/document-updater/app/js/Utils.js b/services/document-updater/app/js/Utils.js index 496c40dbcc..4e9e60ba06 100644 --- a/services/document-updater/app/js/Utils.js +++ b/services/document-updater/app/js/Utils.js @@ -2,11 +2,7 @@ const _ = require('lodash') /** - * @typedef {import('./types').CommentOp} CommentOp - * @typedef {import('./types').DeleteOp} DeleteOp - * @typedef {import('./types').InsertOp} InsertOp - * @typedef {import('./types').Op} Op - * @typedef {import('./types').TrackedChange} TrackedChange + * @import { CommentOp, DeleteOp, InsertOp, Op, TrackedChange } from './types' */ /** diff --git a/services/history-v1/storage/lib/blob_store/index.js b/services/history-v1/storage/lib/blob_store/index.js index 830120e3ea..6f5632a595 100644 --- a/services/history-v1/storage/lib/blob_store/index.js +++ b/services/history-v1/storage/lib/blob_store/index.js @@ -22,7 +22,7 @@ const postgresBackend = require('./postgres') const mongoBackend = require('./mongo') const logger = require('@overleaf/logger') -/** @typedef {import('stream').Readable} Readable */ +/** @import { Readable } from 'stream' */ const GLOBAL_BLOBS = new Map() diff --git a/services/history-v1/storage/lib/project_archive.js b/services/history-v1/storage/lib/project_archive.js index 67858ea9cd..d6680ae33c 100644 --- a/services/history-v1/storage/lib/project_archive.js +++ b/services/history-v1/storage/lib/project_archive.js @@ -1,7 +1,10 @@ // @ts-check 'use strict' -/** @typedef {import('overleaf-editor-core').Snapshot} Snapshot */ +/** + * @import { Snapshot } from 'overleaf-editor-core' + * @import { BlobStore } from '../../storage/lib/blob_store/index' + */ const Archive = require('archiver') const BPromise = require('bluebird') @@ -15,10 +18,6 @@ const OError = require('@overleaf/o-error') const assert = require('./assert') -/** - * @typedef {import('../../storage/lib/blob_store/index').BlobStore} BlobStore - */ - // The maximum safe concurrency appears to be 1. // https://github.com/overleaf/issues/issues/1909 const FETCH_CONCURRENCY = 1 // number of files to fetch at once diff --git a/services/project-history/app/js/ChunkTranslator.js b/services/project-history/app/js/ChunkTranslator.js index 43aac34003..90843d3929 100644 --- a/services/project-history/app/js/ChunkTranslator.js +++ b/services/project-history/app/js/ChunkTranslator.js @@ -14,8 +14,7 @@ import { } from 'overleaf-editor-core' /** - * @typedef {import('overleaf-editor-core/lib/types').RawEditOperation} RawEditOperation - * @typedef {import('overleaf-editor-core/lib/types').TrackedChangeRawData} TrackedChangeRawData + * @import { RawEditOperation, TrackedChangeRawData } from 'overleaf-editor-core/lib/types' */ export function convertToSummarizedUpdates(chunk, callback) { diff --git a/services/project-history/app/js/HistoryBlobTranslator.js b/services/project-history/app/js/HistoryBlobTranslator.js index 4a6515a6ae..b0a6d4bb2f 100644 --- a/services/project-history/app/js/HistoryBlobTranslator.js +++ b/services/project-history/app/js/HistoryBlobTranslator.js @@ -12,10 +12,9 @@ import logger from '@overleaf/logger' import OError from '@overleaf/o-error' /** - * @typedef {import('./types').AddDocUpdate} AddDocUpdate - * @typedef {import('overleaf-editor-core/lib/types').CommentRawData} CommentRawData - * @typedef {import('overleaf-editor-core/lib/types').TrackedChangeRawData} TrackedChangeRawData - * */ + * @import { AddDocUpdate } from './types' + * @import { CommentRawData, TrackedChangeRawData } from 'overleaf-editor-core/lib/types' + */ /** * diff --git a/services/project-history/app/js/SnapshotManager.js b/services/project-history/app/js/SnapshotManager.js index 1049d074a3..abe12ade47 100644 --- a/services/project-history/app/js/SnapshotManager.js +++ b/services/project-history/app/js/SnapshotManager.js @@ -10,9 +10,8 @@ import * as Errors from './Errors.js' import _ from 'lodash' /** - * @typedef {import('stream').Readable} ReadableStream - * @typedef {import('overleaf-editor-core').Snapshot} Snapshot - * @typedef {import('./types').RangesSnapshot} RangesSnapshot + * @import { Snapshot } from 'overleaf-editor-core' + * @import { RangesSnapshot } from './types' */ StringStream.prototype._read = function () {} diff --git a/services/project-history/app/js/SyncManager.js b/services/project-history/app/js/SyncManager.js index f0619f2ac3..ad4584009b 100644 --- a/services/project-history/app/js/SyncManager.js +++ b/services/project-history/app/js/SyncManager.js @@ -22,18 +22,10 @@ import * as HashManager from './HashManager.js' import { isInsert, isDelete } from './Utils.js' /** - * @typedef {import('overleaf-editor-core').Comment} HistoryComment - * @typedef {import('overleaf-editor-core').TrackedChange} HistoryTrackedChange - * @typedef {import('./types').Comment} Comment - * @typedef {import('./types').Entity} Entity - * @typedef {import('./types').ResyncDocContentUpdate} ResyncDocContentUpdate - * @typedef {import('./types').RetainOp} RetainOp - * @typedef {import('./types').TrackedChange} TrackedChange - * @typedef {import('./types').TrackedChangeTransition} TrackedChangeTransition - * @typedef {import('./types').TrackingDirective} TrackingDirective - * @typedef {import('./types').TrackingType} TrackingType - * @typedef {import('./types').Update} Update - * @typedef {import('./types').ProjectStructureUpdate} ProjectStructureUpdate + * @import { Comment as HistoryComment, TrackedChange as HistoryTrackedChange } from 'overleaf-editor-core' + * @import { Comment, Entity, ResyncDocContentUpdate, RetainOp, TrackedChange } from './types' + * @import { TrackedChangeTransition, TrackingDirective, TrackingType, Update } from './types' + * @import { ProjectStructureUpdate } from './types' */ const MAX_RESYNC_HISTORY_RECORDS = 100 // keep this many records of previous resyncs const EXPIRE_RESYNC_HISTORY_INTERVAL_MS = 90 * 24 * 3600 * 1000 // 90 days diff --git a/services/project-history/app/js/UpdateCompressor.js b/services/project-history/app/js/UpdateCompressor.js index 53513dd1a4..c6ab91f959 100644 --- a/services/project-history/app/js/UpdateCompressor.js +++ b/services/project-history/app/js/UpdateCompressor.js @@ -4,10 +4,7 @@ import OError from '@overleaf/o-error' import DMP from 'diff-match-patch' /** - * @typedef {import('./types').DeleteOp} DeleteOp - * @typedef {import('./types').InsertOp} InsertOp - * @typedef {import('./types').Op} Op - * @typedef {import('./types').Update} Update + * @import { DeleteOp, InsertOp, Op, Update } from './types' */ const MAX_TIME_BETWEEN_UPDATES = 60 * 1000 // one minute diff --git a/services/project-history/app/js/UpdateTranslator.js b/services/project-history/app/js/UpdateTranslator.js index 8a3e2fd399..7755731e15 100644 --- a/services/project-history/app/js/UpdateTranslator.js +++ b/services/project-history/app/js/UpdateTranslator.js @@ -7,19 +7,9 @@ import * as OperationsCompressor from './OperationsCompressor.js' import { isInsert, isRetain, isDelete, isComment } from './Utils.js' /** - * @typedef {import('./types').AddDocUpdate} AddDocUpdate - * @typedef {import('./types').AddFileUpdate} AddFileUpdate - * @typedef {import('./types').DeleteCommentUpdate} DeleteCommentUpdate - * @typedef {import('./types').Op} Op - * @typedef {import('./types').RawScanOp} RawScanOp - * @typedef {import('./types').RenameUpdate} RenameUpdate - * @typedef {import('./types').TextUpdate} TextUpdate - * @typedef {import('./types').TrackingDirective} TrackingDirective - * @typedef {import('./types').TrackingProps} TrackingProps - * @typedef {import('./types').SetCommentStateUpdate} SetCommentStateUpdate - * @typedef {import('./types').SetFileMetadataOperation} SetFileMetadataOperation - * @typedef {import('./types').Update} Update - * @typedef {import('./types').UpdateWithBlob} UpdateWithBlob + * @import { AddDocUpdate, AddFileUpdate, DeleteCommentUpdate, Op, RawScanOp } from './types' + * @import { RenameUpdate, TextUpdate, TrackingDirective, TrackingProps } from './types' + * @import { SetCommentStateUpdate, SetFileMetadataOperation, Update, UpdateWithBlob } from './types' */ /** diff --git a/services/project-history/app/js/Utils.js b/services/project-history/app/js/Utils.js index 59eaf43683..9158b28f4c 100644 --- a/services/project-history/app/js/Utils.js +++ b/services/project-history/app/js/Utils.js @@ -1,11 +1,7 @@ // @ts-check /** - * @typedef {import('./types').CommentOp} CommentOp - * @typedef {import('./types').DeleteOp} DeleteOp - * @typedef {import('./types').InsertOp} InsertOp - * @typedef {import('./types').Op} Op - * @typedef {import('./types').RetainOp} RetainOp + * @import { CommentOp, DeleteOp, InsertOp, Op, RetainOp } from './types' */ /** diff --git a/services/project-history/test/unit/js/HistoryBlobTranslator/HistoryBlobTranslatorTests.js b/services/project-history/test/unit/js/HistoryBlobTranslator/HistoryBlobTranslatorTests.js index e94f6bb02a..c07aee8c02 100644 --- a/services/project-history/test/unit/js/HistoryBlobTranslator/HistoryBlobTranslatorTests.js +++ b/services/project-history/test/unit/js/HistoryBlobTranslator/HistoryBlobTranslatorTests.js @@ -1,7 +1,9 @@ import { expect } from 'chai' import { createRangeBlobDataFromUpdate } from '../../../../app/js/HistoryBlobTranslator.js' -/** @typedef {import("../../../../app/js/types").AddDocUpdate} AddDocUpdate */ +/** + * @import { AddDocUpdate } from "../../../../app/js/types" + */ /** * diff --git a/services/web/app/src/Features/Project/ProjectController.js b/services/web/app/src/Features/Project/ProjectController.js index 6f40606533..6cf917486e 100644 --- a/services/web/app/src/Features/Project/ProjectController.js +++ b/services/web/app/src/Features/Project/ProjectController.js @@ -47,9 +47,7 @@ const Modules = require('../../infrastructure/Modules') const UserGetter = require('../User/UserGetter') /** - * @typedef {import("./types").GetProjectsRequest} GetProjectsRequest - * @typedef {import("./types").GetProjectsResponse} GetProjectsResponse - * @typedef {import("./types").Project} Project + * @import { GetProjectsRequest, GetProjectsResponse, Project } from "./types" */ const _ProjectController = { diff --git a/services/web/app/src/Features/Project/ProjectHelper.js b/services/web/app/src/Features/Project/ProjectHelper.js index 404d079c83..dc64fbfe1f 100644 --- a/services/web/app/src/Features/Project/ProjectHelper.js +++ b/services/web/app/src/Features/Project/ProjectHelper.js @@ -5,7 +5,7 @@ const { promisify } = require('util') const Settings = require('@overleaf/settings') /** - * @typedef {import("./types").MongoProject} MongoProject + * @import { MongoProject } from "./types" */ const ENGINE_TO_COMPILER_MAP = { diff --git a/services/web/app/src/Features/Project/ProjectListController.js b/services/web/app/src/Features/Project/ProjectListController.js index 1821d39fdd..3340c62639 100644 --- a/services/web/app/src/Features/Project/ProjectListController.js +++ b/services/web/app/src/Features/Project/ProjectListController.js @@ -27,15 +27,11 @@ const SplitTestHandler = require('../SplitTests/SplitTestHandler') const SplitTestSessionHandler = require('../SplitTests/SplitTestSessionHandler') const SubscriptionLocator = require('../Subscription/SubscriptionLocator') -/** @typedef {import("./types").GetProjectsRequest} GetProjectsRequest */ -/** @typedef {import("./types").GetProjectsResponse} GetProjectsResponse */ -/** @typedef {import("../../../../types/project/dashboard/api").ProjectApi} ProjectApi */ -/** @typedef {import("../../../../types/project/dashboard/api").Filters} Filters */ -/** @typedef {import("../../../../types/project/dashboard/api").Page} Page */ -/** @typedef {import("../../../../types/project/dashboard/api").Sort} Sort */ -/** @typedef {import("./types").AllUsersProjects} AllUsersProjects */ -/** @typedef {import("./types").MongoProject} MongoProject */ -/** @typedef {import("../Tags/types").Tag} Tag */ +/** + * @import { GetProjectsRequest, GetProjectsResponse, AllUsersProjects, MongoProject } from "./types" + * @import { ProjectApi, Filters, Page, Sort } from "../../../../types/project/dashboard/api" + * @import { Tag } from "../Tags/types" + */ const _ssoAvailable = (affiliation, session, linkedInstitutionIds) => { if (!affiliation.institution) return false diff --git a/services/web/app/src/Features/SplitTests/SplitTestHandler.js b/services/web/app/src/Features/SplitTests/SplitTestHandler.js index 6ba9074d84..02321aac2e 100644 --- a/services/web/app/src/Features/SplitTests/SplitTestHandler.js +++ b/services/web/app/src/Features/SplitTests/SplitTestHandler.js @@ -17,7 +17,7 @@ const SplitTestSessionHandler = require('./SplitTestSessionHandler') const SplitTestUserGetter = require('./SplitTestUserGetter') /** - * @typedef {import("./types").Assignment} Assignment + * @import { Assignment } from "./types" */ const DEFAULT_VARIANT = 'default' diff --git a/services/web/app/src/Features/Subscription/SubscriptionFormatters.js b/services/web/app/src/Features/Subscription/SubscriptionFormatters.js index adf87f645f..0a82c35a84 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionFormatters.js +++ b/services/web/app/src/Features/Subscription/SubscriptionFormatters.js @@ -1,6 +1,10 @@ const dateformat = require('dateformat') const { formatCurrencyLocalized } = require('../../util/currency') +/** + * @import { CurrencyCode } from '@/shared/utils/currency' + */ + const currencySymbols = { EUR: '€', USD: '$', @@ -48,10 +52,6 @@ function formatPriceDefault(priceInCents, currency) { return `${symbol}${dollars}.${cents}` } -/** - * @typedef {import('@/shared/utils/currency').CurrencyCode} CurrencyCode - */ - /** * @param {number} priceInCents - price in the smallest currency unit (e.g. dollar cents, CLP units, ...) * @param {CurrencyCode?} currency - currency code (default to USD) diff --git a/services/web/app/src/Features/Subscription/SubscriptionGroupController.js b/services/web/app/src/Features/Subscription/SubscriptionGroupController.js index 75fe8872da..f8e685af5d 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionGroupController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionGroupController.js @@ -9,7 +9,7 @@ const { expressify } = require('@overleaf/promise-utils') const Modules = require('../../infrastructure/Modules') /** - * @typedef {import("../../../../types/subscription/dashboard/subscription").Subscription} Subscription + * @import { Subscription } from "../../../../types/subscription/dashboard/subscription" */ /** diff --git a/services/web/app/src/Features/Subscription/SubscriptionHelper.js b/services/web/app/src/Features/Subscription/SubscriptionHelper.js index 06aebf2a62..b31a8bfa06 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionHelper.js +++ b/services/web/app/src/Features/Subscription/SubscriptionHelper.js @@ -9,7 +9,7 @@ function shouldPlanChangeAtTermEnd(oldPlan, newPlan) { } /** - * @typedef {import('../../../../frontend/js/shared/utils/currency').CurrencyCode} CurrencyCode + * @import { CurrencyCode } from '../../../../frontend/js/shared/utils/currency' */ /** diff --git a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js index f05023c181..eb180b895c 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js +++ b/services/web/app/src/Features/Subscription/SubscriptionViewModelBuilder.js @@ -20,7 +20,9 @@ const { } = require('../Errors/Errors') const FeaturesHelper = require('./FeaturesHelper') -/** @typedef {import("../../../../types/project/dashboard/subscription").Subscription} Subscription */ +/** + * @import { Subscription } from "../../../../types/project/dashboard/subscription" + */ function buildHostedLink(type) { return `/user/subscription/recurly/${type}` diff --git a/services/web/app/src/Features/Survey/SurveyHandler.js b/services/web/app/src/Features/Survey/SurveyHandler.js index 27e0c663a6..8c35b095bd 100644 --- a/services/web/app/src/Features/Survey/SurveyHandler.js +++ b/services/web/app/src/Features/Survey/SurveyHandler.js @@ -5,7 +5,7 @@ const SubscriptionLocator = require('../Subscription/SubscriptionLocator') const { callbackify } = require('@overleaf/promise-utils') /** - * @typedef {import('../../../../types/project/dashboard/survey').Survey} Survey + * @import { Survey } from '../../../../types/project/dashboard/survey' */ /** diff --git a/services/web/app/src/infrastructure/HttpPermissionsPolicy.js b/services/web/app/src/infrastructure/HttpPermissionsPolicy.js index a4be6b8e32..2c81ddb868 100644 --- a/services/web/app/src/infrastructure/HttpPermissionsPolicy.js +++ b/services/web/app/src/infrastructure/HttpPermissionsPolicy.js @@ -3,8 +3,8 @@ const Settings = require('@overleaf/settings') /** - * @typedef {import('./types').HttpPermissionsPolicy} HttpPermissionsPolicy - * */ + * @import { HttpPermissionsPolicy } from './types' + */ class HttpPermissionsPolicyMiddleware { /** diff --git a/services/web/app/src/util/currency.js b/services/web/app/src/util/currency.js index 52b6411a17..c4b3eaacc1 100644 --- a/services/web/app/src/util/currency.js +++ b/services/web/app/src/util/currency.js @@ -3,7 +3,7 @@ */ /** - * @typedef {import('@/shared/utils/currency').CurrencyCode} CurrencyCode + * @import { CurrencyCode } from '@/shared/utils/currency' */ /** diff --git a/services/web/frontend/js/features/plans/utils/group-plan-pricing.js b/services/web/frontend/js/features/plans/utils/group-plan-pricing.js index 4a3917c03a..1a00209ed2 100644 --- a/services/web/frontend/js/features/plans/utils/group-plan-pricing.js +++ b/services/web/frontend/js/features/plans/utils/group-plan-pricing.js @@ -1,7 +1,7 @@ import getMeta from '../../../utils/meta' /** - * @typedef {import('@/shared/utils/currency').CurrencyCode} CurrencyCode + * @import { CurrencyCode } from '@/shared/utils/currency' */ // plan: 'collaborator' or 'professional' diff --git a/services/web/modules/history-v1/index.js b/services/web/modules/history-v1/index.js index 9c5c8a3c73..57a7963265 100644 --- a/services/web/modules/history-v1/index.js +++ b/services/web/modules/history-v1/index.js @@ -1,4 +1,4 @@ -/** @typedef {import("../../types/web-module").WebModule} WebModule */ +/** @import { WebModule } from "../../types/web-module" */ /** @type {WebModule} */ const HistoryModule = {} diff --git a/services/web/modules/launchpad/index.js b/services/web/modules/launchpad/index.js index 30eefa56a2..db44c19f0a 100644 --- a/services/web/modules/launchpad/index.js +++ b/services/web/modules/launchpad/index.js @@ -1,6 +1,6 @@ const LaunchpadRouter = require('./app/src/LaunchpadRouter') -/** @typedef {import("../../types/web-module").WebModule} WebModule */ +/** @import { WebModule } from "../../types/web-module" */ /** @type {WebModule} */ const LaunchpadModule = { diff --git a/services/web/modules/server-ce-scripts/index.js b/services/web/modules/server-ce-scripts/index.js index 2730f4b74a..28c3d81419 100644 --- a/services/web/modules/server-ce-scripts/index.js +++ b/services/web/modules/server-ce-scripts/index.js @@ -1,4 +1,4 @@ -/** @typedef {import("../../types/web-module").WebModule} WebModule */ +/** @import { WebModule } from "../../types/web-module" */ /** @type {WebModule} */ const ServerCeScriptsModule = {} diff --git a/services/web/modules/user-activate/index.js b/services/web/modules/user-activate/index.js index a9dc5d56e4..d6ef502eb8 100644 --- a/services/web/modules/user-activate/index.js +++ b/services/web/modules/user-activate/index.js @@ -1,6 +1,8 @@ const UserActivateRouter = require('./app/src/UserActivateRouter') -/** @typedef {import("../../types/web-module").WebModule} WebModule */ +/** + * @import { WebModule } from "../../types/web-module" + */ /** @type {WebModule} */ const UserActivateModule = {