-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xd 29 updates #77
base: master
Are you sure you want to change the base?
Xd 29 updates #77
Conversation
# Conflicts: # sample.js # types/application.d.ts # types/index.d.ts # types/interactions.d.ts # types/scenegraph.d.ts
@ericdrobinson Would you mind taking a look at this? Thank you very much in advance 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only major issue with this section is the broken @example
s (at least for VSCode's IntelliSense service). The *
s before each line within the example block are important, it turns out.
It also appears that the tripple-tick (```) syntax is optional. I've left it in with my suggestions to help clear things up.
I will also note that VSCode highlighted two unnecessary declare
keywords in this file. They do not need to exist in front of individual class
es as the module
itself is already declare
d.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some formatting suggestions here.
Co-authored-by: Eric Robinson <[email protected]>
Co-authored-by: Eric Robinson <[email protected]>
@pklaschka I've done a first-pass review and hit the major points, I think. Basically:
|
@pklaschka With respect to the third item above, something like this looks to work a treat: // Define the shape of the SceneNode "restricted" static properties.
// NOTE: These properties do not show up on sub-classes so they cannot
// be a part of the class-inheritance tree.
interface SceneNodeStatic {
readonly BLEND_MODE_PASSTHROUGH: string;
readonly BLEND_MODE_NORMAL: string;
readonly BLEND_MODE_MULTIPLY: string;
readonly BLEND_MODE_DARKEN: string;
readonly BLEND_MODE_COLOR_BURN: string;
readonly BLEND_MODE_LIGHTEN: string;
readonly BLEND_MODE_SCREEN: string;
readonly BLEND_MODE_COLOR_DODGE: string;
readonly BLEND_MODE_OVERLAY: string;
readonly BLEND_MODE_SOFT_LIGHT: string;
readonly BLEND_MODE_HARD_LIGHT: string;
readonly BLEND_MODE_DIFFERENCE: string;
readonly BLEND_MODE_EXCLUSION: string;
readonly BLEND_MODE_HUE: string;
readonly BLEND_MODE_SATURATION: string;
readonly BLEND_MODE_COLOR: string;
readonly BLEND_MODE_LUMINOSITY: string;
readonly FIXED_LEFT: string;
readonly FIXED_RIGHT: string;
readonly FIXED_TOP: string;
readonly FIXED_BOTTOM: string;
readonly FIXED_BOTH: string;
readonly POSITION_PROPORTIONAL: string;
readonly SIZE_FIXED: string;
readonly SIZE_RESIZES: string;
}
// Export the "name" of SceneNode. This provides access to the "restricted" static
// properties.
// You could get the "type" of this by using `typeof SceneNode` (especially in type
// declarations).
export const SceneNode: SceneNodeStatic;
// Export the "type" of SceneNode. This provides access to the "SceneNode" _type_.
export interface SceneNode extends SceneNodeBase {}
/**
* Base class of all scenegraph nodes. Nodes will always be an instance of some subclass of SceneNode.
*/
declare abstract class SceneNodeBase { NOTE: In the above, I renamed During my investigation I saw a few things that don't quite match up with this structure but it was nothing actually usable. Just differences in accessible prototype properties/functions. In terms of what is documented by Adobe and what you would want to use these APIs for, the structure I outline in this comment seems to work beautifully. |
Thank you so much for your input. I'm currently dealing with an ear infection (cf. my comment in the developer forum) and am unable to work on this, but I will look at it as soon as possible. Thank you again 👍. |
Yikes! Take care and I wish you a swift recovery! |
Truthfully, I wasn't able to replicate it. VSCode just doesn't link (at all) and WebStorm handled it fine (correctly linking). Do you have any examples where it wasn't working for you (I know it's been quite some time since your comment, sorry about that 😉 )? |
This stops the static constants from getting "implemented" in inheriting classes
Yes. If you attempt to use Note that " The links do not work. It turns out that intra-API linking in IntelliSense is not supported by the TypeScript language server. This TypeScript issue is tracking interest/development. While this does appear to work in WebStorm (and other JetBrains IDEs), any IDE that relies on the TypeScript Language Server (most non-JetBrains IDEs?) will report errors when you attempt to use this syntax. That all said, the workaround would be to point to the Adobe XD documentation website. In the case outlined above, this would mean converting this:
to this:
In my tests, this appears to work perfectly. Clicking that link opens the expected dialog in VSCode: |
Contents of this Pull Request
This PR makes changes to
types
foldertsconfig.json
,jsconfig.json
,.gitignore
etc.)sample.js
)README.md
or other files containing documentationPurpose of this Pull Request
To update the types to the current API status
Issues resolved by this Pull Request