Comments (7)
I'm using TypeScript 1.8.35, and when the go.d.ts file includes, at the end of the file:
// for TypeScript 1.*:
declare module "go" { // comment out module declaration for TypeScript 2.0
export = go; // but keep export = go in all versions for compatibility with AMD and CommonJS
}
I do not get an error when compiling the following code:
var $ = go.GraphObject.make; // for conciseness in defining templates
var myDiagram: go.Diagram =
$(go.Diagram, "myDiagram", // create a Diagram for the DIV HTML element
{
// position the graph in the middle of the diagram
initialContentAlignment: go.Spot.Center
});
And the code executes correctly too.
So could you explain why you think there should not be a "go" module declaration in the go.d.ts file?
Are you using modules, and if so, how?
from gojs.
I'm seeing the same problem. The package.json
looks fine, both main and typings are pointing to the correct files. The typescript compiler throws the following: error TS2306: File 'C:/snipped/node_modules/gojs/release/go.d.ts' is not a module.
The fix suggested at the top does work. The problem I have with the whole thing is that this is not a sustainable practice. I can't comment this code out during CI deployment or on another developer's machine. Can you please take another look at this problem.
from gojs.
Which fix "suggested at the top" are you talking about?
---Walter
On Sep 13, 2016 05:25, "Dan Kirkham" [email protected] wrote:
I'm seeing the same problem. The package.json looks fine, both main and
typings are pointing to the correct files. The typescript compiler throws
the following: error TS2306: File 'C:/snipped/node_modules/gojs/release/go.d.ts'
is not a module. The fix suggested at the top does work. The problem I
have with the whole thing is that this is not a sustainable practice. I
can't comment this code out during CI deployment or on another developer's
machine. Can you please take another look at this problem.Typescript 1.8.10.
GoJs 1.6.15.
Node v4.4.7.``
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKv8d1rHMUK6EI_ZFf_l_q0rLD_SCcMWks5qpmwfgaJpZM4Jbs5R
.
from gojs.
I need to change following lines in go.d.ts file:
declare module "go" {
export = go;
}
to
export = go;
from gojs.
How are you importing GoJS in your TypeScript code?
Later today I can experiment how such a change would work in AMD
environments, although I thought it did not.
---Walter
On Sep 13, 2016 05:45, "Dan Kirkham" [email protected] wrote:
I need to change following lines in go.d.ts file:
declare module "go" {
export = go;
}
to
export = go;—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#26 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKv8d8U-ApQJXbHjMljAYofGkAHQhdvJks5qpnCogaJpZM4Jbs5R
.
from gojs.
With ES6 syntax; import * as go from "gojs"
from gojs.
OK, I still cannot reproduce that TSC error, and that error you quoted does not make sense anyway. And a lot of other TypeScript definition files wrap their export = blah
with a declare module "blah" { }
.
But it does seem to work without that module declaration, so I'll change it for 1.6.17.
from gojs.
Related Issues (20)
- TypeError: a.forEach is not a function HOT 3
- Too much data crashes the browser HOT 2
- How to get Name Key onclick marker leaflet HOT 1
- Getting issues in GuidedDraggingTool.ts HOT 1
- Please provide the source code for the Data Flow (vertical) for the angular project HOT 1
- Using gojs in node to render large layouts on the server side HOT 1
- Orthogonal + Grid Snap = Jank HOT 1
- "Error: GraphObject.make requires a class function or GoJS class name or name of an object builder, not: ScrollingTable" HOT 1
- Inconsistent snap with default grid, default gridSnap, and objects of different widths HOT 1
- Last
- when the parent node uses scaling, the gojs click event will cause an error HOT 1
- dwg support HOT 1
- Change the origin of the diagram's coordinate HOT 1
- Extracting user data for graphs/flowcharts rendering HOT 1
- Support and integration of GoJs to Excalidraw Elements HOT 2
- Compile warnings generated when using esbuild HOT 4
- Types not exported HOT 3
- v2.3.16 has console.log statement happening HOT 1
- Module not found error for go-debug HOT 5
- Disappearing nodes on canvas, for macOS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gojs.