mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 01:51:58 -05:00
2c6aa3d4a7
Add "settings" object to global scope store GitOrigin-RevId: 1d5c7c3a1b417be0726c4a5e95e611ded47c13c4
56 lines
1 KiB
TypeScript
56 lines
1 KiB
TypeScript
import { MainDocument } from '../../../../types/project-settings'
|
|
import { PdfViewer } from '../../../../types/user-settings'
|
|
|
|
type Scope = {
|
|
settings?: {
|
|
syntaxValidation?: boolean
|
|
pdfViewer?: PdfViewer
|
|
}
|
|
editor?: {
|
|
sharejs_doc?: {
|
|
doc_id?: string
|
|
getSnapshot?: () => string
|
|
}
|
|
}
|
|
hasLintingError?: boolean
|
|
ui?: {
|
|
view?: 'editor' | 'history' | 'file' | 'pdf'
|
|
pdfLayout?: 'flat' | 'sideBySide' | 'split'
|
|
leftMenuShown?: boolean
|
|
}
|
|
project?: {
|
|
members?: any[]
|
|
owner: {
|
|
_id: string
|
|
}
|
|
features?: {
|
|
gitBridge?: boolean
|
|
}
|
|
}
|
|
user?: {
|
|
features?: {
|
|
dropbox: boolean
|
|
}
|
|
}
|
|
docs?: MainDocument[]
|
|
}
|
|
|
|
export const mockScope = (scope?: Scope) => ({
|
|
settings: {
|
|
syntaxValidation: false,
|
|
pdfViewer: 'pdfjs',
|
|
},
|
|
editor: {
|
|
sharejs_doc: {
|
|
doc_id: 'test-doc',
|
|
getSnapshot: () => 'some doc content',
|
|
},
|
|
},
|
|
hasLintingError: false,
|
|
ui: {
|
|
view: 'editor',
|
|
pdfLayout: 'sideBySide',
|
|
leftMenuShown: false,
|
|
},
|
|
...scope,
|
|
})
|