Giter VIP home page Giter VIP logo

Comments (6)

larsgw avatar larsgw commented on September 24, 2024

I didn't write the typescript declarations myself, maybe @natemoo-re can help? If not, I'll investigate.

from kdljs.

natemoo-re avatar natemoo-re commented on September 24, 2024

Ah yeah I can take a look! Probably just needs to be exported.

from kdljs.

natemoo-re avatar natemoo-re commented on September 24, 2024

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.

focusaurus avatar focusaurus commented on September 24, 2024

@natemoo-re sure the tsconfig I'm using is in focusaurus/nofi

from kdljs.

focusaurus avatar focusaurus commented on September 24, 2024

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.

larsgw avatar larsgw commented on September 24, 2024

That stood out to me too but I don't know the TS idioms.

from kdljs.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.