/
Action.d.ts
49 lines (45 loc) · 1.31 KB
/
Action.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* # Action
*
* In addition to being able to lookup an action using the find method, a single global `action` object is created and available in scripts to inquire about the current action and control flow.
*
* ### Example
*
* ```javascript
* // find action
* let action = Action.find("Copy");
*
* // queue to action to run after the current action
* app.queueAction(action, draft);
```
*/
declare class Action {
/**
* Search for action matching the name passed and return it if found. Useful to lookup and action and queue it to be run using `app.queueAction(action, draft)`
* @param name Name of a valid, installed action.
*/
static find(name: string): Action | undefined
/**
* The display name of the action as displayed in the action list.
* @category Identification
*/
readonly name: string
/**
* URL which can be used to install this Action in another installation of Drafts. Useful for sharing and backups.
* @category Identification
*/
readonly installURL: string
/**
* The unique identifier of the action group.
* @category Identification
*/
readonly uuid: string
/**
* If true, the action is a separator.
*/
readonly isSeparator: boolean
}
/**
* The current running action.
*/
declare const action: Action