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

  • Home
  • SEARCH
  • 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 8703337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:51:00+00:00 2026-06-13T02:51:00+00:00

If I reference a TypeScript declarations file (ex. jquery.d.ts) using the /// <reference path=…/>

  • 0

If I reference a TypeScript declarations file (ex. jquery.d.ts) using the /// <reference path="..."/> syntax, it’s up to me to make sure I load the corresponding library by some other means, i.e. just referencing the .d.ts file doesn’t load the library.

Is there a way to make TypeScript generate a require() call for the library when I use it? If I wasn’t using AMD/requirejs I could just call require manually, but I’d like to get this to work with AMD.

The advantage of this is that my dependencies wouldn’t be defined in two places. Referencing the library from a .ts file would be enough to make sure it loads, rather than having to maintain the list of dependencies manually in my HTML.

Update: I opened a new question that clarifies my exact situation. I want to give credit for the answer to my original question since I didn’t give all the necessary details.

  • 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-13T02:51:00+00:00Added an answer on June 13, 2026 at 2:51 am

    Yes, TypeScript supports “external” modules, which are basically first class AMD or CommonJS modules. For example:

    MyLib.ts

    export function foo() { return 'bar' }
    

    MyProj.ts

    import lib = module('./MyLib.ts')
    lib.foo(); // returns bar
    

    Compile this with “–module amd” and you’ll get the proper module and require syntax generated for you.

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

Sidebar

Related Questions

I am getting an error with the following TypeScript code: ///<reference path='../../../Shared/typescript/jquery.d.ts' /> ///<reference
Object reference not set to an instance of an object. using System; using System.Collections.Generic;
Assume the following class definition using TypeScript in Animal.ts: module Animals { export class
I am trying to create a .d.ts file for the KineticJS library. So far
I have spent some time reading the Typescript language specification and am somewhat confused
Reference is this page: http://demo.mypreviewbetasite.com/laverona/menu.html File in question: http://demo.mypreviewbetasite.com/laverona/scripts/menu.js The page works as expected
I reference the CyberLink library inside another target in an iPhone project. But I
I reference jQuery in my application via: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js . This generates an error with
reference : http://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/markerclusterer/src/markerclusterer.js?r=110 on line 915 I am trying this.div_.innerHTML = sums.text + some
Reference to the Question I asked before, the socket closing need some times to

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.