window.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { ExposedSettings } from './exposed-settings'
  2. import { OAuthProviders } from './oauth-providers'
  3. import { OverallThemeMeta } from './project-settings'
  4. import { User } from './user'
  5. import 'recurly__recurly-js'
  6. import { UserSettings } from './user-settings'
  7. import { ScopeValueStore } from './ide/scope-value-store'
  8. declare global {
  9. // eslint-disable-next-line no-unused-vars
  10. interface Window {
  11. csrfToken: string
  12. user: User
  13. user_id?: string
  14. userSettings: UserSettings
  15. oauthProviders: OAuthProviders
  16. thirdPartyIds: Record<string, string>
  17. metaAttributesCache: Map<string, any>
  18. i18n: {
  19. currentLangCode: string
  20. }
  21. ExposedSettings: ExposedSettings
  22. project_id: string
  23. gitBridgePublicBaseUrl: string
  24. _ide: Record<string, unknown> & {
  25. $scope: Record<string, unknown> & {
  26. pdf?: {
  27. logEntryAnnotations: Record<string, unknown>
  28. }
  29. }
  30. socket: {
  31. on: (event: string, listener: any) => void
  32. removeListener: (event: string, listener: any) => void
  33. }
  34. }
  35. isRestrictedTokenMember: boolean
  36. _reportCM6Perf: () => void
  37. _reportAcePerf: () => void
  38. MathJax: Record<string, any>
  39. overallThemes: OverallThemeMeta[]
  40. crypto: {
  41. randomUUID: () => string
  42. }
  43. // For react-google-recaptcha
  44. recaptchaOptions?: {
  45. enterprise?: boolean
  46. useRecaptchaNet?: boolean
  47. }
  48. brandVariation?: Record<string, any>
  49. data?: Record<string, any>
  50. expectingLinkedFileRefreshedSocketFor?: string | null
  51. writefull?: {
  52. type: 'extension' | 'integration'
  53. }
  54. WritefullStub?: any
  55. io?: any
  56. overleaf: {
  57. unstable: {
  58. store: ScopeValueStore
  59. }
  60. }
  61. }
  62. }