shortcutkit 0.5.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,18 +1,47 @@
1
1
  import { type PlistValue } from "./plist.js";
2
+ import { type ActionDefinition } from "./definitions.js";
3
+ import { ACTIONS } from "./generated/actions.js";
2
4
  import type { ActionId, MetaParams, ParamTypes } from "./generated/actions.js";
3
5
  import type { Attachment, Picker, TokenString, Value } from "./values.js";
4
- export { actions, ACTIONS, type ActionId, type ActionKey, type ParamKey, type ParamTypes, type MetaParams } from "./generated/actions.js";
6
+ export { actions, ACTIONS, PARAM_KINDS, type ActionId, type ActionKey, type ParamKey, type ParamTypes, type MetaParams } from "./generated/actions.js";
5
7
  export type { PlistValue } from "./plist.js";
6
8
  export type * from "./values.js";
7
9
  export { getDefinition, allDefinitions, type ActionDefinition, type ParameterDefinition, type Localized } from "./definitions.js";
8
10
  export { provenance, type Provenance } from "./provenance.js";
11
+ export type * from "./generated/params.js";
9
12
  /** Parameters accepted for an identifier: typed per key for built-in actions, open for anything else. */
10
13
  export type ParamsFor<I extends string> = I extends ActionId ? Partial<ParamTypes[I] & MetaParams> : Record<string, Value>;
11
14
  export type Action = {
12
15
  WFWorkflowActionIdentifier: string;
13
16
  WFWorkflowActionParameters: Record<string, Value>;
14
17
  outputName?: string;
18
+ outputTypes?: readonly string[];
15
19
  };
20
+ /** Content types an action's output can be (`WFStringContentItem`, `NSURL`, an App Intents entity, …). Shortcuts coerces between many of them at run time, so this describes, it does not restrict. */
21
+ export type OutputTypes<I extends ActionId> = (typeof ACTIONS)[I]["outputTypes"];
22
+ /** What the catalogue knows about an identifier: built-in or App Intent, engine definition or not. */
23
+ export type CatalogEntry = {
24
+ identifier: string;
25
+ /** Display name, as the editor shows it. */
26
+ name: string;
27
+ /** Parameter keys the action accepts, in the editor's order. */
28
+ params: readonly string[];
29
+ /** Value kind per key: bool, number, string, text, picker, plainString, plainNumber, dictionary, quantity, filter, any. */
30
+ kinds: Record<string, string>;
31
+ /** Output name, or null when the action produces nothing. */
32
+ output: string | null;
33
+ /** Content types the output can be; empty when the action produces nothing. */
34
+ outputTypes: readonly string[];
35
+ /** Present for App Intents actions; written as the AppIntentDescriptor parameter. */
36
+ descriptor?: AppIntentDescriptor;
37
+ /** The engine's definition, for built-ins only. */
38
+ definition?: ActionDefinition;
39
+ };
40
+ /**
41
+ * Look up any catalogue identifier, built-in or App Intent. getDefinition() only knows built-ins
42
+ * (App Intents have no engine definition); this covers both with the same shape.
43
+ */
44
+ export declare function getAction(identifier: string): CatalogEntry | undefined;
16
45
  /** Names the app that provides an App Intents action; written as the AppIntentDescriptor parameter. */
17
46
  export type AppIntentDescriptor = {
18
47
  BundleIdentifier: string;