Closed havardh closed 5 years ago
Great!
I've published https://github.com/JXA-userland/JXA/releases/tag/v1.3.0
Can someone please explain how to use this, and what the benefits are? I'm trying to use this extension with Visual Studio Code, and I'm having trouble. I know very little about bash scripting, so please provide detailed instructions. Thanks.
@JMichaelTX: This tool will generate TypeScript definitions for any application bundle which sdef
can derive a .sdef
file for. My own intention is to use it to generate types for applications which are not found in the types package. You can follow #5 to see discussion that lead to this feature.
Building from the example
in this repo, these are the instructions to use this command.
cd example
@jxa/types
package
yarn add @jxa/types
mkdir types
npx @jxa/sdef-to-dts /Applications/Google\ Chrome.app --output types
src/example.ts
import { GoogleChrome } from "../types/GoogleChrome.t.ds
import { Application } from "@jxa/types";
src/example.ts
file
run(() => {
Application<GoogleChrome>("GoogleChrome").
});
Visual Studio Code should provide autocomplete suggestions for the Google Chrome application after the .
.
Running @jxa/sdef-to-dts
requires that you have xcode or Command Line Tools set up so that sdef
runs correctly.
It turns out that the
sdef
command can be used to generate.d.ts
files from App bundles. I've made the input parameter to the command the path to the app bundle to allow bundles outside of the/Applications
folder to be converted too.Fixes #7