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 8871583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:01:24+00:00 2026-06-14T18:01:24+00:00

We have an already existing JavaScript system. What we want to do: We would

  • 0

We have an already existing JavaScript system.

What we want to do:
We would like to start to integrate TypeScript into the current system; We cannot just move everything to TypeScript. We want to slowly start writing some of the new modules in TypeScript.

What we tried:
We use a pattern for organizing our JS code simillar to the MODULE TypeScript construct.

We tried to rewrite a simple class/object in TypeScript and were successful but we had trouble accessing JS functions defined in our code, in other files.

Problems Encountered:
We had to create dummy interfaces, and dummy functions using those interfaces etc.

So the question:
can anyone comment, what would be the best approach to slowly integrate TypeScript into an existing JavaScript system.

  • 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-14T18:01:26+00:00Added an answer on June 14, 2026 at 6:01 pm

    It sounds like you have a sensible plan. Here are my observations!

    It is best to make sure you TypeScript depends on your JavaScript and not the other way around where possible. This is because it is very easy to refactor TypeScript using the Visual Studio tools, but it won’t refactor JavaScript that calls your TypeScript.

    You will have to write definition files for the parts of your JavaScript you need to call from TypeScript. You will need to balance the cost of writing a definition with the cost of simply converting the JavaScript to TypeScript.

    If you are only calling one function, just write the definition for that one function – don’t write a definition until you need it. This will keep the cost of calling your old code lower.

    You could also temporarily use the any type to get away with calling anything on your JavaScript code. When you convert the file to TypeScript you will get better type checking. This is an “it depends” decision point. Rather than spending ages writing a definition, you could save the time at the cost of type checking.

    For example…

    declare var MyExistingClass: any;
    

    You can now call…

    var example = new MyExistingClass.Anything();
    example.anythingYouLike();
    

    You have to decide as a team whether this is acceptable or if you want to write definitions:

    declare class MyExistingClass {
        anythingYouLike(): void;
    }
    

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to integrate zxing in my already existing iPhone app. I have
I'm having a bit of trouble loading pages into an already-existing colorbox. I have
I have a JavaScript code that adds new XHTML to already existing page (DOM
I have an already existing stored procedure. But when I am trying to create
I have a DB table that already has an existing value that I don't
I have already created my application on web socket with ASP.net 4.0. I just
I have a very simple greasemonkey script that I want to call an already
I have a current system using IIS 6 and 7, written in ASP.NET with
I have parsed a given CSS file/string into a JSON object like so: {
I would like to write an html/javascript/sql app for personal use only running locally

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.