Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Ok, excellent! I had a quick try and noticed that there was no entry for
ElementPlacement
.
Also the entry for page item move method worked, but wasn't quite right:
This is going to be *really* helpful for all of us struggling to remember!
P.S. let me know if you'd prefer for me to open issues on the repo if I find anything in the future.
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11832909#M263915
Feb 15, 2021
Feb 15, 2021
Yes, I also noticed this and checked the source TS file to make sure it's really not there. But it's not!
It totally is one of the most useful enums to have at-hand though, and I wonder how
@Inventsable
got that to work in the ovid editor:
https://ovid-editor.web.app/ILST
Also the Illustrator d.ts file depends on the shared global.d.ts file, which isn't included here (yet).
The global file in turn depends on the javascript.d.ts file which contains even more of our basics.
However unlike the Illustrator types file, those files contain items that I wouldn't know how to necessarily parse out. For example, it's easy to take a statement of:
* The screen mode.
declare enum ScreenMode {
* Full screen with menu bar.
DESKTOP = 2,
* Full screen without menu bar.
FULLSCREEN = 3,
* Display multiple windows.
MULTIWINDOW = 1,
And turn it into:
* @typedef {Object} ScreenMode - The screen mode.
* @property {2} DESKTOP - Full screen with menu bar.
* @property {3} FULLSCREEN - Full screen without menu bar.
* @property {1} MULTIWINDOW - Display multiple windows.
/** @type {ScreenMode} */
const ScreenMode = {
DESKTOP : 2,
FULLSCREEN : 3,
MULTIWINDOW : 1,
(This could be done differently, with the @ property items turned into @ type items inside the 'const', but I originally had made the typedefs without the 'const' at the bottom and afterwards I only realized that wasn't really doing the auto-completion I was hoping for)
But then the global and shared files have stuff like this:
* An XML list object.
* In this implementation, an XMLList object is synonymous to the XML object. The constructor accepts an XML list, but everything else works like theXML object.
interface XMLList {}
declare const XMLList: XMLList
interface UnitValueConstructor {
readonly prototype: UnitValue
* Creates a new UnitValue object.
new (value: string | UnitValue): UnitValue
(value: string | UnitValue): UnitValue
* The base unit for all conversions.
baseUnit: UnitValue
declare const UnitValue: UnitValueConstructor
And for those, I'm not even sure how to approach them. Most of those are very basic things that are in javascript anyway like the Error object, but others like the Socket object are not.
I actually hunted down the omv xml file (C:\Program Files (x86)\Common Files\Adobe\Scripting Dictionaries CC\illustrator 2021\omv.xml) and while there's ElementPlacement listed there as a linked item of sorts, I could not find its definition anywhere, so I wonder where it is linking from inside the omv?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11833038#M263920
Feb 15, 2021
Feb 15, 2021
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11833318#M263940
Feb 15, 2021
Feb 15, 2021
Update: it turns out this whole thing is not necessary and we can just use the d.ts types for adobe files!
Here is what the behavior appears to be: VSCode helps with intellisense when either a JSDoc JS or d.TS files are
opened
and
the VSCode workspace is open in a
folder
.
So all we have to do is open VSCode and open any folder. Then, open the types for Adobe .d.ts file and have it sitting in the same workspace. You still get all the benefits of intellisense from the .d.ts file with no JSDoc js file required!
So indeed, this whole exercise was a learning experience and a moot point!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11834045#M263985
Feb 15, 2021
Feb 15, 2021
So it doesn't matter if it's been marked up for JSDoc?
I just opened Type for Adobe/Illustrator/2015.3/index.d.ts and it works as you say. (However, as we knew, it doesn't have the .move() method or ElementPlacement.)
I know it was a reoundabout journey for you, but it was a clever idea, and it was good for my learning. TBH, I'm thinking that a file that simply enumerated all the constants would go a long way! I can never remember them.
🙂
- Mark
P.S. you've introduced me to JSDocs, too, which I'm glad to know about for future.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11834116#M263990
Feb 15, 2021
Feb 15, 2021
The JSDoc annotations are actually powered by the open d.ts file, they are for labelling your variables and function parameters for easy intellisense help, so it does the same thing as my JSDoc file and now that I've learned it works just the same in VSCode, it's case-closed. But yes the JSDoc markups still same and needed for auto-completion whether its the jsdoc file or ts file - both produce the same result which is to actually enable your annotations to perform it.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
/t5/illustrator-discussions/jsdoc-for-illustrator-vscode/m-p/11834335#M264008
Feb 15, 2021
Feb 15, 2021
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more