<NME> main_module.ts
<BEF> import {bindDefaultCopyHandler, bindDefaultPasteHandler} from 'neuroglancer/ui/default_clipboard_handling';
import {setDefaultInputEventBindings} from 'neuroglancer/ui/default_input_event_bindings';
import {makeMinimalViewer} from 'neuroglancer/ui/minimal_viewer';
// import {UrlHashBinding} from 'neuroglancer/ui/url_hash_binding';

import 'neuroglancer/datasource/dvid/register_credentials_provider';
import 'neuroglancer/datasource/dvid/register_default';
import 'neuroglancer/datasource/brainmaps/register_default';
// import {UrlHashBinding} from 'neuroglancer/ui/url_hash_binding';

import {DVIDDataSource} from 'neuroglancer/datasource/dvid/frontend';
import {BrainmapsDataSource, productionInstance} from 'neuroglancer/datasource/brainmaps/frontend';
import {registerProvider} from 'neuroglancer/datasource/default_provider';



/**
 * Sets up the default neuroglancer viewer.
 */
// TODO: options here could enable or disable datasources.

// TODO: need to check for webGL2 support
// const gl = document.createElement('canvas').getContext('webgl2');
// if (!gl) {
//   console.log('your browser/OS/drivers do not support WebGL2');
// } else {
//   console.log('webgl2 works!');
// }

export function setupDefaultViewer(options: {
  brainMapsClientId: string | undefined,
  target: HTMLElement | undefined,
  bundleRoot: string | undefined
}) {
  // register_brainmaps
  if (options.brainMapsClientId) {
    const clientId: string = options.brainMapsClientId;
    defaultCredentialsManager.register(credentialsKey, () => new BrainmapsCredentialsProvider(clientId));
  }

  let viewer = makeMinimalViewer({ bundleRoot: options.bundleRoot }, options.target);
  setDefaultInputEventBindings(viewer.inputEventBindings);

  registerVolumeLayerType(VolumeType.SEGMENTATION, SegmentationUserLayer);

  registerProvider('dvid', () => new DVIDDataSource());

  // register_brainmaps
  if (options.brainMapsClientId) {
    }
    hashBinding.parseError;
  }));
  hashBinding.updateFromUrlHash(); */

  bindDefaultCopyHandler(viewer);
  bindDefaultPasteHandler(viewer);

  return viewer;
}

export default class Neuroglancer {
  version() {
    return '0.0.1';
  }
}

<MSG> Merge pull request #195 from neuroglancerhub/add_precomputed_support_to_module

feat(main_module): adds precomputed support
<DFF> @@ -9,6 +9,7 @@ import {SegmentationUserLayer} from 'neuroglancer/segmentation_user_layer';
 // import {UrlHashBinding} from 'neuroglancer/ui/url_hash_binding';
 
 import {DVIDDataSource} from 'neuroglancer/datasource/dvid/frontend';
+import {PrecomputedDataSource} from 'neuroglancer/datasource/precomputed/frontend';
 import {BrainmapsDataSource, productionInstance} from 'neuroglancer/datasource/brainmaps/frontend';
 import {registerProvider} from 'neuroglancer/datasource/default_provider';
 
@@ -44,6 +45,7 @@ export function setupDefaultViewer(options: {
   registerVolumeLayerType(VolumeType.SEGMENTATION, SegmentationUserLayer);
 
   registerProvider('dvid', () => new DVIDDataSource());
+  registerProvider('precomputed', () => new PrecomputedDataSource());
 
   // register_brainmaps
   if (options.brainMapsClientId) {

Merge pull request #195 from neuroglancerhub/add_precomputed_support_to_module