Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions types/application.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ type RenditionResult = {
outputFile: File;
}

type DocumentInfo = {
/**
* Document name as displayed in the titlebar. For untitled documents, this will be a localized string such as "Untitled-1."
*/
name: string,
/**
* *Semi*-unique document identifier. Duplicating an .xd file on disk will result in two files with the same GUID. Duplicating a document via "Save As" will change its GUID; thus two *cloud* documents will never have the same GUID. The GUID of an Untitled document doesn't change when it is saved for the first time. <br><br>This returns the same value as `scenegraph.root.guid`.
pklaschka marked this conversation as resolved.
Show resolved Hide resolved
*/
guid: string
};

/**
* Generate renditions of nodes in the document in a batch. Overwrites any existing files without warning.
*
Expand All @@ -72,3 +83,21 @@ export const appLanguage: string;
* User's OS-wide locale setting. May not match the XD UI, since XD does not support all world languages. Includes both language and region (e.g. "fr_CA" or "en_US").
*/
export const systemLocale: string;

/**
* Information about the document which this instance of the plugin is attached to.
*
* > **Tip**
* >
* > _This does **not** indicate the frontmost "active" document window in the XD application._
* >
* > In XD, each document window loads a separate copy of your plugin. When a given instance of your plugin calls this API, you will always receive information about the document that this instance of the plugin is attached to, even if it's not the active window.
pklaschka marked this conversation as resolved.
Show resolved Hide resolved
*
* @example ```js
let application = require("application");
let documentInfo = application.activeDocument;
console.log("Document title: " + documentInfo.name);
console.log("Document ID: " + documentInfo.guid);
```
*/
pklaschka marked this conversation as resolved.
Show resolved Hide resolved
export const activeDocument: DocumentInfo;