mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 18:54:23 -05:00
9875e55a27
GitOrigin-RevId: ec8788fdbc8aea73ca33ec2810f4e588fe9476b5
55 lines
1,007 B
TypeScript
55 lines
1,007 B
TypeScript
import { MainDocument, PdfViewer } from '../../../../types/project-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,
|
|
})
|