Skip to content

Instantly share code, notes, and snippets.

View cdriesler's full-sized avatar

Chuck Driesler cdriesler

View GitHub Profile
@cdriesler
cdriesler / RhinoService.ts
Created January 5, 2020 02:02
Run rhino3dm.js 'synchronously'
import Rhino3dm, { RhinoModule } from 'rhino3dm';
let rhinoModule:RhinoModule = undefined;
const wasmHandler: ProxyHandler<any> = {
apply: (target: any, thisArg: any, argArray?: any) => {
console.log('from proxy');
if (rhinoModule == undefined) {
Rhino3dm().then(rhino => {
declare module 'rhino3dm' {
export default function rhino3dm() : Promise<RhinoModule>;
enum ActiveSpace {
None,
ModelSpace,
PageSpace
}