44 * Copyright (C) 2023 Posit Software, PBC
55 */
66
7- import { connectToServer } from ' ./server/connection' ;
8- import { navigationHandler } from ' ./server/navigation' ;
9- import { progressHandler } from ' ./server/progress' ;
7+ import { connectToServer } from " ./server/connection" ;
8+ import { navigationHandler } from " ./server/navigation" ;
9+ import { progressHandler } from " ./server/progress" ;
1010
1111import { handleExternalLinks } from "./frame/links" ;
12- import { handleMecaLinks } from ' ./frame/meca' ;
12+ import { handleMecaLinks } from " ./frame/meca" ;
1313import { handleRevealMessages } from "./frame/reveal" ;
1414import { handleViewerMessages } from "./frame/viewer" ;
15- import { handleCommands } from './frame/commands' ;
16-
17- import './ui/fluent.css'
15+ import { handleCommands } from "./frame/commands" ;
1816
17+ import "./ui/fluent.css" ;
1918
2019export interface Options {
21- origin : string | null ,
22- search : string | null ,
23- inputFile : string | null ,
20+ origin : string | null ;
21+ search : string | null ;
22+ inputFile : string | null ;
2423 isPresentation : boolean ;
2524}
2625
2726function init ( options : Options ) {
28-
2927 try {
30-
3128 // detect dark mode
3229 const darkMode = detectDarkMode ( ) ;
3330
3431 // server connection
3532 const disconnect = connectToServer ( [
3633 progressHandler ( darkMode ) ,
37- navigationHandler ( )
34+ navigationHandler ( ) ,
3835 ] ) ;
3936
4037 // handle commands
@@ -50,11 +47,10 @@ function init(options: Options) {
5047
5148 // handle messages as approprate for format
5249 if ( options . isPresentation ) {
53- handleRevealMessages ( disconnect )
50+ handleRevealMessages ( disconnect ) ;
5451 } else {
5552 handleViewerMessages ( options . inputFile ) ;
5653 }
57-
5854 } catch ( error ) {
5955 console . error ( error ) ;
6056 }
@@ -69,8 +65,4 @@ function detectDarkMode() {
6965 }
7066}
7167
72- export { init }
73-
74-
75-
76-
68+ export { init } ;
0 commit comments