JXA-userland / JXA

JavaScript for Automation(JXA) packages for TypeScript/Node.js.
MIT License
429 stars 22 forks source link

Questions about @jxa/sdef-to-dts #38

Open JMichaelTX opened 3 years ago

JMichaelTX commented 3 years ago

First, let me give you many, many thanks for providing this tool. I hope to use it to provide autocomplete in Visual Studio Code (VSC) for many of the third party apps (like Microsoft Outlook, Evernote, and Keyboard Maestro, and more) and many of the AppleScript Scripting Libraries (like Shane Stanley's "Myriad Tables Lib").

I have several questions:

Installation

My first question is about installation, using this command you provided: npm install @jxa/sdef-to-dts

Where do I install this? What folder do I need to be in so that it is available to all folders and workspaces of VSC?

Using @jxa/sdef-to-dts

You provide this command to convert .sdef and .app files $ npx @jxa/sdef-to-dts /Applications/Safari.app --output ./safari.d.ts

Two Questions:

  1. Where do I run this command so that the resulting dts files are fully integrated with other dts files, and so that all of these are available to all folders and workspaces of VSC?
  2. Does the name of the output dts file need to exactly match the input name?
    • For example, if the input file is "Microsoft Outlook.app", does the output file need to be "Microsoft Outlook.d.ts"?

Many thanks.

azu commented 3 years ago

@jxa/sdef-to-dts is just converter that generate from sdef to d.ts file.

Where do I run this command so that the resulting dts files are fully integrated with other dts files, and so that all of these are available to all folders and workspaces of VSC?

It may related to https://www.typescriptlang.org/tsconfig#types

Does the name of the output dts file need to exactly match the input name?

Probably, No.

https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-d-ts.html However, TypeSript's namespace disallow to include space.