Comments (6)
I didn't write the typescript declarations myself, maybe @natemoo-re can help? If not, I'll investigate.
from kdljs.
Ah yeah I can take a look! Probably just needs to be exported.
from kdljs.
Okay I looked into this! @focusaurus would it be possible to share a link to your project using something like https://stackblitz.com? I'm thinking that you might have something misconfigured.
export interface Node
is definitely included under the defined kdljs
namespace.
from kdljs.
@natemoo-re sure the tsconfig I'm using is in focusaurus/nofi
from kdljs.
OK so I found the section red flags in the typescript docs that suggests:
A file whose only top-level declaration is export namespace Foo { ... } (remove Foo and move everything ‘up’ a level)
I deleted the outer block with the declare namespace kdljs
and now I'm able to use the Node type with:
import type kdl from "kdljs";
// later...
function nodeToItem(node: kdl.Node, _index?: number, _array?: kdl.Node[]): Item | Menu {
So maybe that's a possible solution?
from kdljs.
That stood out to me too but I don't know the TS idioms.
from kdljs.
Related Issues (18)
- Identifiers "null", "true" and "false"
- API documentation
- Parser test suite HOT 1
- Update the parser for any changes to the spec before 1.0 HOT 1
- KDL 1.0 Compliance HOT 8
- Add ESModule support HOT 3
- Parser should fail when a string contains invalid unicode escapes HOT 3
- Parser should fail when string contains unsupported escapes
- Parser fails on bare identifiers containing a prefix matching a keyword
- Include input line numbers HOT 3
- Please include a query example in the docs HOT 1
- Document tags
- Allow for unicode whitespace
- Make `tags` optional when formatting HOT 1
- KDL 2.0 compliance HOT 4
- KQL: sibling selector support
- Typings: make name optional in NodeTypeAnnotation
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 kdljs.