Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8657535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:32:40+00:00 2026-06-12T15:32:40+00:00

I am trying to create a .d.ts file for the KineticJS library. So far

  • 0

I am trying to create a .d.ts file for the KineticJS library. So far I have created the following interface declaration “kinect.d.ts”.(I cropped the code a bit for stackoverflow but I hope you get the idea)

module Kinetic {

    interface Rect extends  Shape {
        constructor (config) ;
    }

    interface Shape extends Node
    { 

    }

    interface Node {
        constructor (config);
        clone(attrs): Node;
        getAbsoluteOpacity(): number;
        getAbsolutePosition(): any;       

        /*
        other methods removed for stackoverflow example
        */
    }
}

I hoped this would be enough to be able to create a Kinetic.Rect object in my app.ts file

/// <reference path="Kinetic.d.ts" />
var rect = new Kinetic.Rect({
          x: 239,
          y: 75,
          width: 100,
          height: 50        
        });

But it appears I have to do some extra work to use the KineticJS classes (like Rect) in TypeScript. Could anyone give some pointers on how to archive this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:32:42+00:00Added an answer on June 12, 2026 at 3:32 pm

    Have you looked at the TypeScript example app at: http://typescript.codeplex.com/SourceControl/changeset/view/fe3bc0bfce1f#samples/imageboard/mongodb.ts

    The code at this link creates a definition for the mongodb library. One difference between this and the Sohnee answer is that Sohnee implements the constructor in contrast to the following code snip from the link which is a stub class. I do not have enough reputation to ask Sohnee in the accepted answer why he implemented the constructor for an ambient class?

    declare module "mongodb" {
       export class Server {
           constructor(host: string, port: number, opts?: any, moreopts?: any);
       }
       export class Db {
           constructor(databaseName: string, serverConfig: Server);
           public open(callback: ()=>void);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a file inside a directory using the following code:
I am just trying to create a file with QProcess by the following source
I have just started learning python version 3 and trying to create a file
i am trying to create an .htaccess file that will achieve the following create
I am trying to create a debugfs file using the debugfs_create_file(...). I have written
I'm trying to create a file which has the following structure: - Each line
I am trying to create a CSV file using the C# code below: string
I'm trying to create a file mapper right now, but stumbling a bit over
I'm trying to create an ePub file in android. Below is my source code.
I am trying to create a file with PHP here is my code: $file_to_send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.