framer-api 0.1.4 → 0.1.5

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
@@ -30,6 +30,65 @@ type NodeRuntimeErrorResult = {
30
30
  message: string;
31
31
  };
32
32
 
33
+ interface AgentClarificationSuggestedAnswerWithDescription {
34
+ answer: string;
35
+ description: string;
36
+ }
37
+ type AgentClarificationSuggestedAnswer = string | AgentClarificationSuggestedAnswerWithDescription;
38
+ interface AgentClarificationQuestion {
39
+ question: string;
40
+ suggestedAnswers: readonly AgentClarificationSuggestedAnswer[];
41
+ }
42
+ interface AgentClarificationAnswer {
43
+ questionIndex: number;
44
+ answer: AgentClarificationSuggestedAnswer;
45
+ }
46
+ interface AgentConversationCompletedResult {
47
+ responseMessages: readonly unknown[];
48
+ }
49
+ interface AgentConversationNeedsClarificationResult {
50
+ clarificationQuestions: readonly AgentClarificationQuestion[];
51
+ }
52
+ type StartAgentConversationResult = ({
53
+ conversationId: string;
54
+ } & AgentConversationCompletedResult) | ({
55
+ conversationId: string;
56
+ } & AgentConversationNeedsClarificationResult);
57
+ type ContinueAgentConversationResult = AgentConversationCompletedResult | AgentConversationNeedsClarificationResult;
58
+ type SubmitAgentClarificationResult = ContinueAgentConversationResult;
59
+ interface SubmitAgentClarificationOptions {
60
+ conversationId: string;
61
+ answers: AgentClarificationAnswer[];
62
+ }
63
+ interface AgentTurnOptions {
64
+ /**
65
+ * Treat these nodes as the implicit selection for this agent turn.
66
+ *
67
+ * When provided, all node ids must exist. If a node is not currently loaded in the session, it may not be found.
68
+ */
69
+ selectionNodeIds?: readonly string[];
70
+ /**
71
+ * Attach images to this agent turn by URL.
72
+ *
73
+ * URLs can be external or existing Framer asset URLs. They will be ingested into the
74
+ * project's assets if needed, then sent to the model as image parts.
75
+ *
76
+ * Tip: if you have a local file (or bytes), upload it first (e.g. `framer.uploadImage(...)`) and
77
+ * pass the returned asset URL here.
78
+ */
79
+ imageUrls?: readonly string[];
80
+ }
81
+ interface StartAgentConversationOptions extends AgentTurnOptions {
82
+ /**
83
+ * Target page path (e.g. `"/about"`). Defaults to the active page.
84
+ */
85
+ pagePath?: string;
86
+ }
87
+ interface ContinueAgentConversationOptions extends AgentTurnOptions {
88
+ /** Existing agent conversation to continue. */
89
+ conversationId: string;
90
+ }
91
+
33
92
  /** @alpha */
34
93
  interface Breakpoint {
35
94
  /** Name of the breakpoint as displayed on the node */
@@ -257,6 +316,15 @@ interface LocalizationGroup {
257
316
  */
258
317
  statusByLocale: LocalizationGroupStatusByLocale;
259
318
  }
319
+ /**
320
+ * Filter options for {@link FramerPluginAPI.getLocalizationGroups}.
321
+ */
322
+ interface GetLocalizationGroupsFilter {
323
+ /** Return only groups matching these IDs. */
324
+ groupIds?: LocalizationGroupId[];
325
+ /** Return only groups of this type. */
326
+ type?: LocalizationGroup["type"];
327
+ }
260
328
  type LocalizedValueUpdate = {
261
329
  action: "set";
262
330
  value: string;
@@ -318,6 +386,10 @@ interface WithUnsupportedComputedValueClass {
318
386
  [classKey]: typeof unsupportedComputedValueClass;
319
387
  }
320
388
  type UnsupportedComputedValueData = WithUnsupportedComputedValueClass;
389
+ /**
390
+ * A computed value type not yet supported by the plugin API.
391
+ * @category canvas
392
+ */
321
393
  declare class UnsupportedComputedValue extends ComputedValueBase {
322
394
  #private;
323
395
  readonly type = "unsupported";
@@ -358,7 +430,10 @@ declare const fontWeights: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900
358
430
  * - `900` - Black (Heavy)
359
431
  * */
360
432
  type FontWeight = (typeof fontWeights)[number];
361
- /** A font available in the project, including custom uploaded fonts. */
433
+ /**
434
+ * A font available in the project, including custom uploaded fonts.
435
+ * @category canvas
436
+ */
362
437
  declare class Font {
363
438
  /** An identifier used internally for differentiating fonts. */
364
439
  readonly selector: string;
@@ -670,6 +745,7 @@ interface IsComponentGestureVariant extends IsComponentVariant {
670
745
  interface WithNameTrait {
671
746
  /**
672
747
  * The name of the node displayed in the layers panel.
748
+ *
673
749
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode,
674
750
  * ComponentNode, VectorSetNode, VectorSetItemNode.
675
751
  */
@@ -677,14 +753,18 @@ interface WithNameTrait {
677
753
  }
678
754
  interface WithVisibleTrait {
679
755
  /**
680
- * Whether the node is visible on the canvas. Defaults to `true`.
756
+ * Whether the node is visible on the canvas.
757
+ *
758
+ * Defaults to `true`.
681
759
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
682
760
  */
683
761
  readonly visible: boolean;
684
762
  }
685
763
  interface WithLockedTrait {
686
764
  /**
687
- * Whether the node is locked for editing. Defaults to `false`.
765
+ * Whether the node is locked for editing.
766
+ *
767
+ * Defaults to `false`.
688
768
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
689
769
  */
690
770
  readonly locked: boolean;
@@ -702,6 +782,7 @@ interface IsBreakpoint {
702
782
  interface WithBackgroundColorTrait<T extends TraitVariant> {
703
783
  /**
704
784
  * Background color in RGBA format (e.g. `rgba(242, 59, 57, 1)`) or as a {@link ColorStyle} instance.
785
+ *
705
786
  * Setting to `null` removes the background color. Supported by FrameNode.
706
787
  */
707
788
  readonly backgroundColor: (T extends TraitVariantData ? ColorStyleData : ColorStyle) | string | null;
@@ -716,22 +797,26 @@ interface WithBackgroundGradientTrait<T extends TraitVariant> {
716
797
  }
717
798
  interface WithRotationTrait {
718
799
  /**
719
- * Rotation angle in degrees. Defaults to `0`.
720
- * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
800
+ * Rotation angle in degrees.
801
+ *
802
+ * Defaults to `0`. Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
721
803
  */
722
804
  readonly rotation: number;
723
805
  }
724
806
  interface WithOpacityTrait {
725
807
  /**
726
- * Opacity of the node, from `0` (fully transparent) to `1` (fully opaque). Defaults to `1`.
727
- * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
808
+ * Opacity of the node, from `0` (fully transparent) to `1` (fully opaque).
809
+ *
810
+ * Defaults to `1`. Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
728
811
  */
729
812
  readonly opacity: number;
730
813
  }
731
814
  type BorderRadius = CSSDimension<CSSUnit.Percentage | CSSUnit.Pixel> | `${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>}` | null;
732
815
  interface WithBorderRadiusTrait {
733
816
  /**
734
- * Border radius for rounded corners. Single value (e.g. `"10px"` or `"50%"`)
817
+ * Border radius for rounded corners.
818
+ *
819
+ * Single value (e.g. `"10px"` or `"50%"`)
735
820
  * or per-corner (e.g. `"10px 20px 30px 40px"` for top-left, top-right, bottom-right, bottom-left).
736
821
  * Setting to `null` removes the border radius. Supported by FrameNode.
737
822
  */
@@ -747,6 +832,7 @@ interface Border {
747
832
  interface WithBorderTrait<T extends TraitVariant> {
748
833
  /**
749
834
  * Border properties including width, color, and style.
835
+ *
750
836
  * Styles: `"solid"`, `"dashed"`, `"dotted"`, `"double"`.
751
837
  * Width can be per-side (e.g. `"1px 2px 3px 4px"`).
752
838
  * Setting to `null` removes the border. Supported by FrameNode.
@@ -758,6 +844,7 @@ type ImageRendering = "auto" | "pixelated";
758
844
  interface WithImageRenderingTrait {
759
845
  /**
760
846
  * How images should be rendered when scaled: `"auto"` or `"pixelated"`.
847
+ *
761
848
  * Only applies to frames with image backgrounds.
762
849
  * Setting to `null` uses default rendering. Supported by FrameNode.
763
850
  */
@@ -769,24 +856,28 @@ type AxisOverflow = Overflow;
769
856
  interface WithOverflowTrait {
770
857
  /**
771
858
  * Controls how content that exceeds the element's box is handled.
859
+ *
772
860
  * Setting to `null` removes the overflow property. Will overwrite `overflowX` or `overflowY`.
773
861
  * Supported by FrameNode, TextNode.
774
862
  */
775
863
  readonly overflow: Overflow | null;
776
864
  /**
777
865
  * Controls horizontal overflow behavior.
866
+ *
778
867
  * Setting to `null` removes the overflow X property. Supported by FrameNode, TextNode.
779
868
  */
780
869
  readonly overflowX: AxisOverflow | null;
781
870
  /**
782
871
  * Controls vertical overflow behavior.
872
+ *
783
873
  * Setting to `null` removes the overflow Y property. Supported by FrameNode, TextNode.
784
874
  */
785
875
  readonly overflowY: AxisOverflow | null;
786
876
  }
787
877
  interface WithTextTruncationTrait {
788
878
  /**
789
- * Maximum number of lines a text node can display before being truncated with an ellipsis.
879
+ * Maximum number of lines before text is truncated with an ellipsis.
880
+ *
790
881
  * Must be used alongside `overflow`. Setting to `null` removes the text truncation property.
791
882
  * Supported by TextNode.
792
883
  */
@@ -794,7 +885,9 @@ interface WithTextTruncationTrait {
794
885
  }
795
886
  interface WithZIndexTrait {
796
887
  /**
797
- * Stacking order of positioned elements. Higher values appear on top of lower values.
888
+ * Stacking order of positioned elements.
889
+ *
890
+ * Higher values appear on top of lower values.
798
891
  * Setting to `null` removes the z-index property. Supported by FrameNode, TextNode.
799
892
  */
800
893
  readonly zIndex: number | null;
@@ -816,18 +909,44 @@ interface WithWebPageInfoTrait {
816
909
  /** Collection ID for the web page. Supported by WebPageNode. */
817
910
  readonly collectionId: string | null;
818
911
  }
912
+ /** Supported rel values for links. See https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel */
913
+ type SupportedLinkRelValue = "nofollow" | "noreferrer" | "me" | "ugc" | "sponsored";
819
914
  interface WithLinkTrait {
820
915
  /**
821
- * URL or internal page link. External: `"https://example.com"`, internal: `"/about"`,
916
+ * URL or internal page link.
917
+ *
918
+ * External: `"https://example.com"`, internal: `"/about"`,
822
919
  * email: `"mailto:user@example.com"`. Setting to `null` removes the link.
823
920
  * Supported by FrameNode, TextNode.
824
921
  */
825
922
  readonly link: string | null;
826
923
  /**
827
- * Whether to open the link in a new tab. Default is automatically determined based on link type.
924
+ * Whether to open the link in a new tab.
925
+ *
926
+ * Default is automatically determined based on link type.
828
927
  * Supported by FrameNode, TextNode.
829
928
  */
830
929
  readonly linkOpenInNewTab: boolean | null;
930
+ /**
931
+ * Whether to use smooth scrolling for scroll-to-section links.
932
+ * Supported by FrameNode, TextNode.
933
+ */
934
+ readonly linkSmoothScroll: boolean | null;
935
+ /**
936
+ * Click tracking identifier for analytics.
937
+ * Supported by FrameNode, TextNode.
938
+ */
939
+ readonly linkClickTrackingId: string | null;
940
+ /**
941
+ * Array of rel attribute values for the link.
942
+ * Supported by FrameNode, TextNode.
943
+ */
944
+ readonly linkRelValues: readonly SupportedLinkRelValue[] | null;
945
+ /**
946
+ * Whether to preserve URL query parameters when navigating.
947
+ * Supported by FrameNode, TextNode.
948
+ */
949
+ readonly linkPreserveParams: boolean | null;
831
950
  }
832
951
  type ControlAttributes = Record<string, unknown>;
833
952
  interface WithControlAttributesTrait {
@@ -857,36 +976,42 @@ type FitImage = "fit-image";
857
976
  interface WithPinsTrait {
858
977
  /**
859
978
  * Distance from top edge when using absolute/fixed positioning.
979
+ *
860
980
  * Only applies when position is not `"relative"`.
861
981
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
862
982
  */
863
983
  top: CSSDimension<CSSUnit.Pixel> | null;
864
984
  /**
865
985
  * Distance from right edge when using absolute/fixed positioning.
986
+ *
866
987
  * Only applies when position is not `"relative"`.
867
988
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
868
989
  */
869
990
  right: CSSDimension<CSSUnit.Pixel> | null;
870
991
  /**
871
992
  * Distance from bottom edge when using absolute/fixed positioning.
993
+ *
872
994
  * Only applies when position is not `"relative"`.
873
995
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
874
996
  */
875
997
  bottom: CSSDimension<CSSUnit.Pixel> | null;
876
998
  /**
877
999
  * Distance from left edge when using absolute/fixed positioning.
1000
+ *
878
1001
  * Only applies when position is not `"relative"`.
879
1002
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
880
1003
  */
881
1004
  left: CSSDimension<CSSUnit.Pixel> | null;
882
1005
  /**
883
1006
  * Center anchor horizontal position as percentage (e.g. `"50%"`).
1007
+ *
884
1008
  * Used when pins are not set.
885
1009
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
886
1010
  */
887
1011
  centerX: CSSDimension<CSSUnit.Percentage> | null;
888
1012
  /**
889
1013
  * Center anchor vertical position as percentage (e.g. `"50%"`).
1014
+ *
890
1015
  * Used when pins are not set.
891
1016
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
892
1017
  */
@@ -897,12 +1022,16 @@ type WidthLength = Length | FitContent | FitImage;
897
1022
  type HeightLength = Length | FitContent | CSSDimension<CSSUnit.ViewportHeight> | FitImage;
898
1023
  interface WithSizeTrait {
899
1024
  /**
900
- * Width of the node. Accepts pixel, percentage, fraction values, or `"fit-content"`.
1025
+ * Width of the node.
1026
+ *
1027
+ * Accepts pixel, percentage, fraction values, or `"fit-content"`.
901
1028
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
902
1029
  */
903
1030
  width: WidthLength | null;
904
1031
  /**
905
- * Height of the node. Accepts pixel, percentage, fraction, viewport-height values, or `"fit-content"`.
1032
+ * Height of the node.
1033
+ *
1034
+ * Accepts pixel, percentage, fraction, viewport-height values, or `"fit-content"`.
906
1035
  * Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
907
1036
  */
908
1037
  height: HeightLength | null;
@@ -910,6 +1039,7 @@ interface WithSizeTrait {
910
1039
  interface WithAspectRatioTrait {
911
1040
  /**
912
1041
  * Width-to-height ratio (e.g. `1.5` for 3:2).
1042
+ *
913
1043
  * Setting to `null` removes the aspect ratio constraint.
914
1044
  * Supported by FrameNode, ComponentInstanceNode.
915
1045
  */
@@ -929,8 +1059,9 @@ interface WithSizeConstraintsTrait {
929
1059
  }
930
1060
  interface WithInlineTextStyleTrait<T extends TraitVariant> {
931
1061
  /**
932
- * Apply a text style preset. Setting to `null` removes the text style.
933
- * Supported by TextNode.
1062
+ * Apply a text style preset.
1063
+ *
1064
+ * Setting to `null` removes the text style. Supported by TextNode.
934
1065
  */
935
1066
  readonly inlineTextStyle: (T extends TraitVariantData ? TextStyleData : TextStyle) | null;
936
1067
  }
@@ -979,18 +1110,24 @@ interface GridLayout {
979
1110
  }
980
1111
  interface WithLayoutTrait extends StackLayout, GridLayout {
981
1112
  /**
982
- * Enables stack or grid layout. Setting to `null` disables any applied layout.
1113
+ * Enables stack or grid layout.
1114
+ *
1115
+ * Setting to `null` disables any applied layout.
983
1116
  * Operation is deferred and applied after the current update cycle. Supported by FrameNode.
984
1117
  */
985
1118
  layout: LayoutType | null;
986
1119
  /**
987
- * Spacing between items in a layout. Single value (e.g. `"10px"`) applies to both axes;
1120
+ * Spacing between items in a layout.
1121
+ *
1122
+ * Single value (e.g. `"10px"`) applies to both axes;
988
1123
  * two values (e.g. `"10px 20px"`) set horizontal and vertical separately.
989
1124
  * Only works with layout enabled. Supported by FrameNode.
990
1125
  */
991
1126
  gap: CSSDimension<CSSUnit.Pixel> | `${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>}` | null;
992
1127
  /**
993
- * Inner spacing of a container with layout. Single value (e.g. `"10px"`) applies to all sides;
1128
+ * Inner spacing of a container with layout.
1129
+ *
1130
+ * Single value (e.g. `"10px"`) applies to all sides;
994
1131
  * four values (e.g. `"10px 20px 30px 40px"`) set top, right, bottom, left.
995
1132
  * Only works with layout enabled. Supported by FrameNode.
996
1133
  */
@@ -999,17 +1136,41 @@ interface WithLayoutTrait extends StackLayout, GridLayout {
999
1136
  type GridItemAlignment = "start" | "center" | "end";
1000
1137
  type GridItemColumnSpan = number | "all";
1001
1138
  interface WithGridItemTrait {
1002
- /** Whether to fill the grid cell width. For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode. */
1139
+ /**
1140
+ * Whether to fill the grid cell width.
1141
+ *
1142
+ * For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode.
1143
+ */
1003
1144
  gridItemFillCellWidth: boolean | null;
1004
- /** Whether to fill the grid cell height. For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode. */
1145
+ /**
1146
+ * Whether to fill the grid cell height.
1147
+ *
1148
+ * For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode.
1149
+ */
1005
1150
  gridItemFillCellHeight: boolean | null;
1006
- /** Horizontal alignment within grid cell. For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode. */
1151
+ /**
1152
+ * Horizontal alignment within grid cell.
1153
+ *
1154
+ * For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode.
1155
+ */
1007
1156
  gridItemHorizontalAlignment: GridItemAlignment | null;
1008
- /** Vertical alignment within grid cell. For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode. */
1157
+ /**
1158
+ * Vertical alignment within grid cell.
1159
+ *
1160
+ * For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode.
1161
+ */
1009
1162
  gridItemVerticalAlignment: GridItemAlignment | null;
1010
- /** Number of columns to span, or `"all"` for all columns. For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode. */
1163
+ /**
1164
+ * Number of columns to span, or `"all"` for all columns.
1165
+ *
1166
+ * For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode.
1167
+ */
1011
1168
  gridItemColumnSpan: GridItemColumnSpan | null;
1012
- /** Number of rows to span. For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode. */
1169
+ /**
1170
+ * Number of rows to span.
1171
+ *
1172
+ * For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode.
1173
+ */
1013
1174
  gridItemRowSpan: number | null;
1014
1175
  }
1015
1176
  type TraitVariant = TraitVariantData | TraitVariantNode;
@@ -1110,6 +1271,7 @@ type ColorStyleAttributes = Prettify<RequiredColorStyleAttributes & Partial<Opti
1110
1271
  * // Store plugin data on a color style.
1111
1272
  * await colorStyle.setPluginData("key", "value")
1112
1273
  * ```
1274
+ * @category canvas
1113
1275
  */
1114
1276
  declare class ColorStyle {
1115
1277
  #private;
@@ -1289,6 +1451,7 @@ type TextStyleAttributes = Prettify<Partial<Omit<TextStyleData, "id" | "color" |
1289
1451
  * // Remove a text style from the project.
1290
1452
  * await textStyle.remove()
1291
1453
  * ```
1454
+ * @category canvas
1292
1455
  */
1293
1456
  declare class TextStyle {
1294
1457
  #private;
@@ -1542,6 +1705,10 @@ declare abstract class GradientBase {
1542
1705
  cloneWithAttributes(attributes: Partial<ExtractUnmarshaledGradientAttributes<typeof this>>): typeof this;
1543
1706
  }
1544
1707
  type UnmarshaledLinearGradientAttributes = Omit<UnmarshaledLinearGradient, ClassKey>;
1708
+ /**
1709
+ * A linear gradient with two or more color stops.
1710
+ * @category canvas
1711
+ */
1545
1712
  declare class LinearGradient extends GradientBase {
1546
1713
  #private;
1547
1714
  readonly [classKey]: "LinearGradient";
@@ -1553,6 +1720,10 @@ declare class LinearGradient extends GradientBase {
1553
1720
  toCSS(): string;
1554
1721
  }
1555
1722
  type UnmarshaledRadialGradientAttributes = Omit<UnmarshaledRadialGradient, ClassKey>;
1723
+ /**
1724
+ * A radial gradient with two or more color stops.
1725
+ * @category canvas
1726
+ */
1556
1727
  declare class RadialGradient extends GradientBase {
1557
1728
  #private;
1558
1729
  readonly [classKey]: "RadialGradient";
@@ -1570,6 +1741,10 @@ declare class RadialGradient extends GradientBase {
1570
1741
  toCSS(): string;
1571
1742
  }
1572
1743
  type UnmarshaledConicGradientAttributes = Omit<UnmarshaledConicGradient, ClassKey>;
1744
+ /**
1745
+ * A conic (angular) gradient with two or more color stops.
1746
+ * @category canvas
1747
+ */
1573
1748
  declare class ConicGradient extends GradientBase {
1574
1749
  #private;
1575
1750
  readonly [classKey]: "ConicGradient";
@@ -1678,6 +1853,10 @@ interface CreateBooleanVariable extends WithBooleanVariableType, CreateVariableB
1678
1853
  }
1679
1854
  interface UpdateBooleanVariable extends WithBooleanVariableType, UpdateVariableBase, Partial<WithBooleanDefaultValue> {
1680
1855
  }
1856
+ /**
1857
+ * A boolean variable.
1858
+ * @category canvas
1859
+ */
1681
1860
  declare class BooleanVariable extends VariableBase {
1682
1861
  #private;
1683
1862
  readonly type: "boolean";
@@ -1702,6 +1881,10 @@ interface CreateNumberVariable extends WithNumberVariableType, CreateVariableBas
1702
1881
  }
1703
1882
  interface UpdateNumberVariable extends WithNumberVariableType, UpdateVariableBase, Partial<WithNumberDefaultValue> {
1704
1883
  }
1884
+ /**
1885
+ * A number variable.
1886
+ * @category canvas
1887
+ */
1705
1888
  declare class NumberVariable extends VariableBase {
1706
1889
  #private;
1707
1890
  readonly type: "number";
@@ -1726,6 +1909,10 @@ interface CreateStringVariable extends WithStringVariableType, CreateVariableBas
1726
1909
  }
1727
1910
  interface UpdateStringVariable extends WithStringVariableType, UpdateVariableBase, Partial<WithStringDefaultValue> {
1728
1911
  }
1912
+ /**
1913
+ * A string variable.
1914
+ * @category canvas
1915
+ */
1729
1916
  declare class StringVariable extends VariableBase {
1730
1917
  #private;
1731
1918
  readonly type: "string";
@@ -1747,6 +1934,10 @@ interface CreateFormattedTextVariable extends WithFormattedTextVariableType, Cre
1747
1934
  }
1748
1935
  interface UpdateFormattedTextVariable extends WithFormattedTextVariableType, UpdateVariableBase, Partial<WithStringDefaultValue> {
1749
1936
  }
1937
+ /**
1938
+ * A formatted text (rich text) variable.
1939
+ * @category canvas
1940
+ */
1750
1941
  declare class FormattedTextVariable extends VariableBase {
1751
1942
  #private;
1752
1943
  readonly type: "formattedText";
@@ -1760,7 +1951,10 @@ interface EnumCaseData extends WithId, WithName, WithNameByLocale {
1760
1951
  }
1761
1952
  interface UpdateEnumCase extends Partial<WithName>, Partial<WithNameByLocaleUpdate> {
1762
1953
  }
1763
- /** An individual case (option) within an Enum Field or Enum Variable. */
1954
+ /**
1955
+ * An individual case (option) within an Enum Field or Enum Variable.
1956
+ * @category cms
1957
+ */
1764
1958
  declare class EnumCase {
1765
1959
  #private;
1766
1960
  /** A unique identifier for the enum case. */
@@ -1825,6 +2019,10 @@ interface CreateEnumVariable extends WithEnumVariableType, CreateVariableBase {
1825
2019
  }
1826
2020
  interface UpdateEnumVariable extends WithEnumVariableType, UpdateVariableBase, Partial<WithStringDefaultValue> {
1827
2021
  }
2022
+ /**
2023
+ * An enum variable with a fixed set of cases.
2024
+ * @category canvas
2025
+ */
1828
2026
  declare class EnumVariable extends VariableBase {
1829
2027
  #private;
1830
2028
  readonly type: "enum";
@@ -1865,6 +2063,10 @@ interface CreateColorVariable extends WithColorVariableType, CreateVariableBase,
1865
2063
  }
1866
2064
  interface UpdateColorVariable extends WithColorVariableType, UpdateVariableBase, Partial<WithColorDefaultValue> {
1867
2065
  }
2066
+ /**
2067
+ * A color variable.
2068
+ * @category canvas
2069
+ */
1868
2070
  declare class ColorVariable extends VariableBase {
1869
2071
  #private;
1870
2072
  readonly type: "color";
@@ -1892,6 +2094,10 @@ interface CreateImageVariable extends WithImageVariableType, CreateVariableBase,
1892
2094
  }
1893
2095
  interface UpdateImageVariable extends WithImageVariableType, UpdateVariableBase, Partial<WithImageDefaultValue> {
1894
2096
  }
2097
+ /**
2098
+ * An image variable.
2099
+ * @category canvas
2100
+ */
1895
2101
  declare class ImageVariable extends VariableBase {
1896
2102
  #private;
1897
2103
  readonly type: "image";
@@ -1930,6 +2136,10 @@ interface CreateFileVariable extends WithFileVariableType, CreateVariableBase, P
1930
2136
  }
1931
2137
  interface UpdateFileVariable extends WithFileVariableType, UpdateVariableBase, Partial<WithFileDefaultValue>, Partial<WithAllowedFileTypes> {
1932
2138
  }
2139
+ /**
2140
+ * A file variable.
2141
+ * @category canvas
2142
+ */
1933
2143
  declare class FileVariable extends VariableBase {
1934
2144
  #private;
1935
2145
  readonly type: "file";
@@ -1952,6 +2162,10 @@ interface CreateLinkVariable extends WithLinkVariableType, CreateVariableBase {
1952
2162
  }
1953
2163
  interface UpdateLinkVariable extends WithLinkVariableType, UpdateVariableBase {
1954
2164
  }
2165
+ /**
2166
+ * A link variable.
2167
+ * @category canvas
2168
+ */
1955
2169
  declare class LinkVariable extends VariableBase {
1956
2170
  #private;
1957
2171
  readonly type: "link";
@@ -1976,6 +2190,10 @@ interface CreateDateVariable extends WithDateVariableType, CreateVariableBase, P
1976
2190
  }
1977
2191
  interface UpdateDateVariable extends WithDateVariableType, UpdateVariableBase, Partial<WithStringDefaultValue>, Partial<WithDisplayTime> {
1978
2192
  }
2193
+ /**
2194
+ * A date variable.
2195
+ * @category canvas
2196
+ */
1979
2197
  declare class DateVariable extends VariableBase {
1980
2198
  #private;
1981
2199
  readonly type: "date";
@@ -2004,6 +2222,10 @@ interface CreateBorderVariable extends WithBorderVariableType, CreateVariableBas
2004
2222
  }
2005
2223
  interface UpdateBorderVariable extends WithBorderVariableType, UpdateVariableBase, Partial<WithBorderDefaultValue> {
2006
2224
  }
2225
+ /**
2226
+ * A border variable.
2227
+ * @category canvas
2228
+ */
2007
2229
  declare class BorderVariable extends VariableBase {
2008
2230
  #private;
2009
2231
  readonly type: "border";
@@ -2023,6 +2245,10 @@ interface UnsupportedVariableData extends WithUnsupportedVariableClass, BaseVari
2023
2245
  }
2024
2246
  interface UpdateUnsupportedVariable extends WithUnsupportedVariableType, UpdateVariableBase {
2025
2247
  }
2248
+ /**
2249
+ * A variable type not yet supported by the plugin API.
2250
+ * @category canvas
2251
+ */
2026
2252
  declare class UnsupportedVariable extends VariableBase {
2027
2253
  #private;
2028
2254
  readonly type: "unsupported";
@@ -2107,38 +2333,62 @@ declare abstract class FieldBaseWithRequired extends FieldBase implements WithFi
2107
2333
  get required(): boolean;
2108
2334
  constructor(engine: PluginEngine, collectionId: string, data: FieldDefinitionBase & WithFieldRequired);
2109
2335
  }
2110
- /** A CMS Collection field that stores a boolean (true or false) value. */
2336
+ /**
2337
+ * A CMS Collection field that stores a boolean (true or false) value.
2338
+ * @category cms
2339
+ */
2111
2340
  declare class BooleanField extends FieldBase {
2112
2341
  readonly type = "boolean";
2113
2342
  }
2114
- /** A CMS Collection field that stores a color value (RGBA/HSL/HEX format). */
2343
+ /**
2344
+ * A CMS Collection field that stores a color value (RGBA/HSL/HEX format).
2345
+ * @category cms
2346
+ */
2115
2347
  declare class ColorField extends FieldBase {
2116
2348
  readonly type = "color";
2117
2349
  }
2118
- /** A CMS Collection field that stores a numeric value. */
2350
+ /**
2351
+ * A CMS Collection field that stores a numeric value.
2352
+ * @category cms
2353
+ */
2119
2354
  declare class NumberField extends FieldBase {
2120
2355
  readonly type = "number";
2121
2356
  }
2122
- /** A CMS Collection field that stores a text string value. */
2357
+ /**
2358
+ * A CMS Collection field that stores a text string value.
2359
+ * @category cms
2360
+ */
2123
2361
  declare class StringField extends FieldBaseWithRequired implements WithFieldBasedOn {
2124
2362
  #private;
2125
2363
  readonly type = "string";
2126
2364
  constructor(engine: PluginEngine, collectionId: string, data: StringFieldDefinitionData);
2127
2365
  get basedOn(): string | null;
2128
2366
  }
2129
- /** A CMS Collection field that stores HTML-formatted text content (H1-H6, P, and other standard content elements). */
2367
+ /**
2368
+ * A CMS Collection field that stores HTML-formatted text content (H1-H6, P, and other standard content elements).
2369
+ * @category cms
2370
+ */
2130
2371
  declare class FormattedTextField extends FieldBaseWithRequired {
2131
2372
  readonly type = "formattedText";
2132
2373
  }
2133
- /** A CMS Collection field that stores an image asset (`ImageAsset`). */
2374
+ /**
2375
+ * A CMS Collection field that stores an image asset (`ImageAsset`).
2376
+ * @category cms
2377
+ */
2134
2378
  declare class ImageField extends FieldBaseWithRequired {
2135
2379
  readonly type = "image";
2136
2380
  }
2137
- /** A CMS Collection field that stores a URL in string format. */
2381
+ /**
2382
+ * A CMS Collection field that stores a URL in string format.
2383
+ * @category cms
2384
+ */
2138
2385
  declare class LinkField extends FieldBaseWithRequired {
2139
2386
  readonly type = "link";
2140
2387
  }
2141
- /** A CMS Collection field that stores a date in UTC format. Optionally displays time. */
2388
+ /**
2389
+ * A CMS Collection field that stores a date in UTC format. Optionally displays time.
2390
+ * @category cms
2391
+ */
2142
2392
  declare class DateField extends FieldBaseWithRequired {
2143
2393
  #private;
2144
2394
  readonly type = "date";
@@ -2146,18 +2396,25 @@ declare class DateField extends FieldBaseWithRequired {
2146
2396
  get displayTime(): boolean | undefined;
2147
2397
  constructor(engine: PluginEngine, collectionId: string, data: DateFieldDefinitionData);
2148
2398
  }
2149
- /** A visual divider between fields in the CMS UI. Not a data field. */
2399
+ /**
2400
+ * A visual divider between fields in the CMS UI. Not a data field.
2401
+ * @category cms
2402
+ */
2150
2403
  declare class FieldDivider extends FieldBase {
2151
2404
  readonly type = "divider";
2152
2405
  }
2153
2406
  /**
2154
2407
  * A field type that is not yet supported by the plugin API.
2155
2408
  * Returned when Framer uses a field type that the plugin API does not recognize.
2409
+ * @category cms
2156
2410
  */
2157
2411
  declare class UnsupportedField extends FieldBase {
2158
2412
  readonly type = "unsupported";
2159
2413
  }
2160
- /** A CMS Collection field that stores a file asset (`FileAsset`). */
2414
+ /**
2415
+ * A CMS Collection field that stores a file asset (`FileAsset`).
2416
+ * @category cms
2417
+ */
2161
2418
  declare class FileField extends FieldBaseWithRequired implements WithAllowedFileTypes {
2162
2419
  #private;
2163
2420
  readonly type = "file";
@@ -2169,6 +2426,7 @@ declare class FileField extends FieldBaseWithRequired implements WithAllowedFile
2169
2426
  * A CMS Collection field with a fixed set of enum cases (options) that the user
2170
2427
  * can choose from. Enum cases must be defined as options before they can be
2171
2428
  * assigned to CMS items.
2429
+ * @category cms
2172
2430
  */
2173
2431
  declare class EnumField extends FieldBase {
2174
2432
  #private;
@@ -2212,7 +2470,10 @@ declare class EnumField extends FieldBase {
2212
2470
  */
2213
2471
  setCaseOrder(caseIds: string[]): Promise<void>;
2214
2472
  }
2215
- /** A field that references an item in another collection. */
2473
+ /**
2474
+ * A field that references an item in another collection.
2475
+ * @category cms
2476
+ */
2216
2477
  declare class CollectionReferenceField extends FieldBaseWithRequired implements WithFieldCollectionId {
2217
2478
  #private;
2218
2479
  readonly type = "collectionReference";
@@ -2220,7 +2481,10 @@ declare class CollectionReferenceField extends FieldBaseWithRequired implements
2220
2481
  get collectionId(): string;
2221
2482
  constructor(engine: PluginEngine, collectionId: string, data: CollectionReferenceFieldDefinitionData);
2222
2483
  }
2223
- /** A field that references multiple items in another collection. */
2484
+ /**
2485
+ * A field that references multiple items in another collection.
2486
+ * @category cms
2487
+ */
2224
2488
  declare class MultiCollectionReferenceField extends FieldBaseWithRequired implements WithFieldCollectionId {
2225
2489
  #private;
2226
2490
  readonly type = "multiCollectionReference";
@@ -2232,6 +2496,7 @@ type ArrayItemField = ImageField;
2232
2496
  /**
2233
2497
  * A CMS Collection field that stores an array of nested fields. Currently only
2234
2498
  * supports a single image field, which creates a Gallery in the CMS.
2499
+ * @category cms
2235
2500
  */
2236
2501
  declare class ArrayField extends FieldBaseWithRequired {
2237
2502
  readonly type = "array";
@@ -2803,16 +3068,19 @@ type ManagedCollectionField = SupportedFieldDefinitionData & WithUserEditable;
2803
3068
  /** @deprecated Use `ManagedCollectionFieldInput` instead. */
2804
3069
  type EditableManagedCollectionField = ManagedCollectionFieldInputData;
2805
3070
  /**
2806
- * A CMS Collection that is fully controlled by a plugin. Managed Collections
2807
- * allow plugins to define fields and sync items programmatically. Fields and
2808
- * items can only be added, edited, and deleted by the owning plugin, not by
2809
- * the user (unless a field is marked `userEditable`).
3071
+ * A CMS Collection that is fully controlled by a plugin.
3072
+ *
3073
+ * Managed Collections allow plugins to define fields and sync items
3074
+ * programmatically. Fields and items can only be added, edited, and deleted
3075
+ * by the owning plugin, not by the user (unless a field is marked
3076
+ * `userEditable`).
2810
3077
  *
2811
3078
  * A Managed Collection plugin becomes available within the CMS when it supports
2812
3079
  * both `configureManagedCollection` and `syncManagedCollection` modes.
2813
3080
  *
2814
3081
  * Use `framer.getManagedCollection()` to obtain an instance when the plugin is
2815
3082
  * launched in either of those modes.
3083
+ * @category cms
2816
3084
  */
2817
3085
  declare class ManagedCollection implements Navigable {
2818
3086
  #private;
@@ -2870,8 +3138,10 @@ declare class ManagedCollection implements Navigable {
2870
3138
  */
2871
3139
  getFields(): Promise<ManagedCollectionField[]>;
2872
3140
  /**
2873
- * Add, update, or remove Collection fields. Fields not included in the
2874
- * array will be removed. You can configure up to 30 custom fields.
3141
+ * Add, update, or remove Collection fields.
3142
+ *
3143
+ * Fields not included in the array will be removed. You can configure
3144
+ * up to 30 custom fields.
2875
3145
  *
2876
3146
  * Each field requires an `id`, `name`, and `type`. For the `id`, use a
2877
3147
  * unique identifier that stays the same across future synchronizations.
@@ -2898,9 +3168,10 @@ declare class ManagedCollection implements Navigable {
2898
3168
  */
2899
3169
  setFields(fields: ManagedCollectionFieldInput[]): Promise<void>;
2900
3170
  /**
2901
- * Add new items or update existing ones if their IDs match. This method
2902
- * performs an upsert: items with matching IDs are updated, new IDs are
2903
- * inserted.
3171
+ * Add new items or update existing ones if their IDs match.
3172
+ *
3173
+ * This method performs an upsert: items with matching IDs are updated,
3174
+ * new IDs are inserted.
2904
3175
  *
2905
3176
  * Each item requires an `id` and `slug`. Custom field data is provided via
2906
3177
  * the `fieldData` object, using field IDs as keys.
@@ -2955,9 +3226,11 @@ declare class ManagedCollection implements Navigable {
2955
3226
  */
2956
3227
  setAsActive(): Promise<void>;
2957
3228
  /**
2958
- * Set plugin data by key. Similar to local storage, you can store custom
2959
- * data on the Managed Collection (e.g., the last synchronization date or a
2960
- * connected database ID).
3229
+ * Set plugin data by key.
3230
+ *
3231
+ * Similar to local storage, you can store custom data on the Managed
3232
+ * Collection (e.g., the last synchronization date or a connected database
3233
+ * ID).
2961
3234
  *
2962
3235
  * Use `"ManagedCollection.setPluginData"` to check if this method is allowed.
2963
3236
  *
@@ -2987,17 +3260,19 @@ declare class ManagedCollection implements Navigable {
2987
3260
  */
2988
3261
  getPluginDataKeys(): Promise<string[]>;
2989
3262
  /**
2990
- * Navigate to this collection. May switch modes to reveal the relevant view.
3263
+ * Navigate to this collection.
3264
+ *
3265
+ * May switch modes to reveal the relevant view.
2991
3266
  */
2992
3267
  navigateTo(opts?: NavigableOptions): Promise<void>;
2993
3268
  }
2994
3269
  /**
2995
- * A CMS Collection in the project. Collections can be created by users or
2996
- * managed by plugins. Use `managedBy` to check the owner.
3270
+ * A CMS Collection in the project.
2997
3271
  *
2998
- * Any kind of Collection can be read from. Unmanaged Collections are those
2999
- * created and updated by people. Use the `collection` mode to access CMS
3000
- * data from your plugin.
3272
+ * Collections can be created by users or managed by plugins. Use `managedBy`
3273
+ * to check the owner. Any kind of Collection can be read from, while those
3274
+ * managed by other plugins are read-only.
3275
+ * @category cms
3001
3276
  */
3002
3277
  declare class Collection implements Navigable {
3003
3278
  #private;
@@ -3057,6 +3332,7 @@ declare class Collection implements Navigable {
3057
3332
  constructor(data: CollectionData, engine: PluginEngine);
3058
3333
  /**
3059
3334
  * Reorder the items in this Collection based on an array of item IDs.
3335
+ *
3060
3336
  * Unknown item IDs are ignored.
3061
3337
  *
3062
3338
  * Use `"Collection.setItemOrder"` to check if this method is allowed.
@@ -3084,8 +3360,9 @@ declare class Collection implements Navigable {
3084
3360
  */
3085
3361
  getFields(): Promise<Field[]>;
3086
3362
  /**
3087
- * Create new unmanaged Collection fields. Use `Field.setAttributes` to
3088
- * update existing fields.
3363
+ * Create new unmanaged Collection fields.
3364
+ *
3365
+ * Use `Field.setAttributes` to update existing fields.
3089
3366
  *
3090
3367
  * Use `"Collection.addFields"` to check if this method is allowed.
3091
3368
  *
@@ -3118,6 +3395,7 @@ declare class Collection implements Navigable {
3118
3395
  removeFields(fieldIds: string[]): Promise<void>;
3119
3396
  /**
3120
3397
  * Reorder the fields in this Collection based on an array of field IDs.
3398
+ *
3121
3399
  * Unknown field IDs are ignored.
3122
3400
  *
3123
3401
  * Use `"Collection.setFieldOrder"` to check if this method is allowed.
@@ -3132,6 +3410,7 @@ declare class Collection implements Navigable {
3132
3410
  setFieldOrder(fieldIds: string[]): Promise<void>;
3133
3411
  /**
3134
3412
  * Retrieve all items within this Collection, in their current order.
3413
+ *
3135
3414
  * Items may include drafts (unpublished items).
3136
3415
  *
3137
3416
  * @returns An array of CollectionItem instances.
@@ -3214,13 +3493,18 @@ declare class Collection implements Navigable {
3214
3493
  */
3215
3494
  getPluginDataKeys(): Promise<string[]>;
3216
3495
  /**
3217
- * Navigate to this collection. May switch modes to reveal the relevant view.
3496
+ * Navigate to this collection.
3497
+ *
3498
+ * May switch modes to reveal the relevant view.
3218
3499
  */
3219
3500
  navigateTo(opts?: NavigableOptions): Promise<void>;
3220
3501
  }
3221
3502
  /**
3222
- * An item (row) in a CMS Collection. Each item contains field data keyed by
3223
- * field ID, a unique slug, and a draft status.
3503
+ * An item (row) in a CMS Collection.
3504
+ *
3505
+ * Each item contains field data keyed by field ID, a unique slug, and a
3506
+ * draft status.
3507
+ * @category cms
3224
3508
  */
3225
3509
  declare class CollectionItem implements Navigable {
3226
3510
  #private;
@@ -3234,8 +3518,9 @@ declare class CollectionItem implements Navigable {
3234
3518
  /** Drafts are excluded from publishing. */
3235
3519
  readonly draft: boolean;
3236
3520
  /**
3237
- * The fields and corresponding values of this Collection item. Field data
3238
- * uses the field `id` as keys in an object.
3521
+ * The fields and corresponding values of this Collection item.
3522
+ *
3523
+ * Field data uses the field `id` as keys in an object.
3239
3524
  *
3240
3525
  * @example
3241
3526
  * ```ts
@@ -3356,9 +3641,10 @@ interface NodeClassToEditableAttributes {
3356
3641
  UnknownNode: object;
3357
3642
  }
3358
3643
  /**
3359
- * Base class providing common methods shared by all node types. Nodes are
3360
- * the building blocks that make up the content in a project. They are
3361
- * represented as "layers" in the editor UI.
3644
+ * Base class providing common methods shared by all node types.
3645
+ *
3646
+ * Nodes are the building blocks that make up the content in a project.
3647
+ * They are represented as "layers" in the editor UI.
3362
3648
  *
3363
3649
  * Every node has a unique {@link NodeMethods.id | id}. Nodes support
3364
3650
  * plugin data storage, tree traversal (parent/children), cloning,
@@ -3410,8 +3696,10 @@ declare abstract class NodeMethods implements WithIdTrait, Navigable {
3410
3696
  */
3411
3697
  clone(): Promise<typeof this | null>;
3412
3698
  /**
3413
- * Set the attributes of this node. Attributes are merged with existing
3414
- * values, so only the provided attributes are updated.
3699
+ * Set the attributes of this node.
3700
+ *
3701
+ * Attributes are merged with existing values, so only the provided
3702
+ * attributes are updated.
3415
3703
  *
3416
3704
  * @param update - The attributes to update.
3417
3705
  * @returns The updated node, or `null` if the node was not found.
@@ -3433,7 +3721,9 @@ declare abstract class NodeMethods implements WithIdTrait, Navigable {
3433
3721
  */
3434
3722
  zoomIntoView(options?: ZoomIntoViewOptions): Promise<void>;
3435
3723
  /**
3436
- * Navigate to this node. May switch modes to reveal the relevant view.
3724
+ * Navigate to this node.
3725
+ *
3726
+ * May switch modes to reveal the relevant view.
3437
3727
  */
3438
3728
  navigateTo(opts?: Pick<NavigableOptions, "select" | "zoomIntoView">): Promise<void>;
3439
3729
  /**
@@ -3449,8 +3739,9 @@ declare abstract class NodeMethods implements WithIdTrait, Navigable {
3449
3739
  */
3450
3740
  getChildren(): Promise<CanvasNode[]>;
3451
3741
  /**
3452
- * Get descendants of this node that match the given type. This can
3453
- * also be used to query within a selection subtree.
3742
+ * Get descendants of this node that match the given type.
3743
+ *
3744
+ * This can also be used to query within a selection subtree.
3454
3745
  *
3455
3746
  * @param type - The node type to search for.
3456
3747
  * @returns An array of matching descendant nodes.
@@ -3475,8 +3766,9 @@ declare abstract class NodeMethods implements WithIdTrait, Navigable {
3475
3766
  getNodesWithType(type: "WebPageNode"): Promise<WebPageNode[]>;
3476
3767
  getNodesWithType(type: "ComponentNode"): Promise<ComponentNode[]>;
3477
3768
  /**
3478
- * Get the descendants of this node that support `attribute`. This
3479
- * returns nodes that have the given attribute defined in their type,
3769
+ * Get the descendants of this node that support `attribute`.
3770
+ *
3771
+ * This returns nodes that have the given attribute defined in their type,
3480
3772
  * regardless of whether it has been set.
3481
3773
  *
3482
3774
  * @param attribute - The attribute name to filter by.
@@ -3504,21 +3796,26 @@ declare abstract class NodeMethods implements WithIdTrait, Navigable {
3504
3796
  */
3505
3797
  getNodesWithAttributeSet<T extends NodeAttributeKey, Node = NodeWithAttribute<T>>(attribute: T): Promise<Node[]>;
3506
3798
  /**
3507
- * Walk this node and its descendants recursively using an async
3508
- * generator. Yields nodes depth-first.
3799
+ * Walk this node and its descendants recursively.
3800
+ *
3801
+ * Uses an async generator. Yields nodes depth-first.
3509
3802
  */
3510
3803
  walk(this: AnyNode): AsyncGenerator<AnyNode>;
3511
3804
  /**
3512
- * Get plugin data by key. Plugin data lets you store arbitrary
3513
- * string values on individual nodes, scoped to your plugin.
3805
+ * Get plugin data by key.
3806
+ *
3807
+ * Plugin data lets you store arbitrary string values on individual
3808
+ * nodes, scoped to your plugin.
3514
3809
  *
3515
3810
  * @param key - The plugin data key.
3516
3811
  * @returns The stored value, or `null` if no data exists for the key.
3517
3812
  */
3518
3813
  getPluginData(key: string): Promise<string | null>;
3519
3814
  /**
3520
- * Set plugin data by key. Plugin data lets you store arbitrary
3521
- * string values on individual nodes, scoped to your plugin.
3815
+ * Set plugin data by key.
3816
+ *
3817
+ * Plugin data lets you store arbitrary string values on individual
3818
+ * nodes, scoped to your plugin.
3522
3819
  *
3523
3820
  * @param key - The plugin data key.
3524
3821
  * @param value - The value to set, or `null` to remove.
@@ -3541,9 +3838,11 @@ interface FrameNodeData extends CommonNodeData, Partial<DrawableNode>, WithPosit
3541
3838
  [classKey]: "FrameNode";
3542
3839
  }
3543
3840
  /**
3544
- * A frame layer on the canvas, the most common container node. Frames
3545
- * can contain children, have layout settings, backgrounds, borders, and
3546
- * can serve as breakpoint or component variants.
3841
+ * A frame layer on the canvas, the most common container node.
3842
+ *
3843
+ * Frames can contain children, have layout settings, backgrounds, borders,
3844
+ * and can serve as breakpoint or component variants.
3845
+ * @category canvas
3547
3846
  */
3548
3847
  declare class FrameNode extends NodeMethods implements EditableFrameNodeAttributes, WithBreakpointTrait {
3549
3848
  readonly [classKey]: FrameNodeData[ClassKey];
@@ -3573,8 +3872,12 @@ declare class FrameNode extends NodeMethods implements EditableFrameNodeAttribut
3573
3872
  readonly minHeight: HeightConstraint | null;
3574
3873
  readonly aspectRatio: number | null;
3575
3874
  readonly zIndex: WithZIndexTrait["zIndex"];
3576
- readonly link: string | null;
3577
- readonly linkOpenInNewTab: boolean | null;
3875
+ readonly link: WithLinkTrait["link"];
3876
+ readonly linkOpenInNewTab: WithLinkTrait["linkOpenInNewTab"];
3877
+ readonly linkSmoothScroll: WithLinkTrait["linkSmoothScroll"];
3878
+ readonly linkClickTrackingId: WithLinkTrait["linkClickTrackingId"];
3879
+ readonly linkRelValues: WithLinkTrait["linkRelValues"];
3880
+ readonly linkPreserveParams: WithLinkTrait["linkPreserveParams"];
3578
3881
  readonly overflow: WithOverflowTrait["overflow"];
3579
3882
  readonly overflowX: WithOverflowTrait["overflowX"];
3580
3883
  readonly overflowY: WithOverflowTrait["overflowY"];
@@ -3613,7 +3916,9 @@ interface TextNodeData extends CommonNodeData, Partial<DrawableNode>, WithPositi
3613
3916
  [classKey]: "TextNode";
3614
3917
  }
3615
3918
  /**
3616
- * A text layer on the canvas. Use {@link TextNode.setText | setText} and
3919
+ * A text layer on the canvas.
3920
+ *
3921
+ * Use {@link TextNode.setText | setText} and
3617
3922
  * {@link TextNode.getText | getText} to work with plain text, or
3618
3923
  * {@link TextNode.setHTML | setHTML} and {@link TextNode.getHTML | getHTML}
3619
3924
  * for rich text content.
@@ -3627,6 +3932,7 @@ interface TextNodeData extends CommonNodeData, Partial<DrawableNode>, WithPositi
3627
3932
  * }
3628
3933
  * }
3629
3934
  * ```
3935
+ * @category canvas
3630
3936
  */
3631
3937
  declare class TextNode extends NodeMethods implements EditableTextNodeAttributes {
3632
3938
  #private;
@@ -3652,8 +3958,12 @@ declare class TextNode extends NodeMethods implements EditableTextNodeAttributes
3652
3958
  readonly minWidth: WidthConstraint | null;
3653
3959
  readonly maxHeight: HeightConstraint | null;
3654
3960
  readonly minHeight: HeightConstraint | null;
3655
- readonly link: string | null;
3656
- readonly linkOpenInNewTab: boolean | null;
3961
+ readonly link: WithLinkTrait["link"];
3962
+ readonly linkOpenInNewTab: WithLinkTrait["linkOpenInNewTab"];
3963
+ readonly linkSmoothScroll: WithLinkTrait["linkSmoothScroll"];
3964
+ readonly linkClickTrackingId: WithLinkTrait["linkClickTrackingId"];
3965
+ readonly linkRelValues: WithLinkTrait["linkRelValues"];
3966
+ readonly linkPreserveParams: WithLinkTrait["linkPreserveParams"];
3657
3967
  readonly gridItemFillCellWidth: WithGridItemTrait["gridItemFillCellWidth"];
3658
3968
  readonly gridItemFillCellHeight: WithGridItemTrait["gridItemFillCellHeight"];
3659
3969
  readonly gridItemHorizontalAlignment: WithGridItemTrait["gridItemHorizontalAlignment"];
@@ -3666,13 +3976,17 @@ declare class TextNode extends NodeMethods implements EditableTextNodeAttributes
3666
3976
  readonly textTruncation: WithTextTruncationTrait["textTruncation"];
3667
3977
  constructor(rawData: TextNodeData, engine: PluginEngine);
3668
3978
  /**
3669
- * Set the text of this node. Plain text content, not HTML.
3979
+ * Set the text of this node.
3980
+ *
3981
+ * Plain text content, not HTML.
3670
3982
  *
3671
3983
  * Use `"TextNode.setText"` to check if this method is allowed.
3672
3984
  */
3673
3985
  setText(text: string): Promise<void>;
3674
3986
  /**
3675
- * Get the text of this node. Plain text content, not HTML.
3987
+ * Get the text of this node.
3988
+ *
3989
+ * Plain text content, not HTML.
3676
3990
  */
3677
3991
  getText(): Promise<string | null>;
3678
3992
  /**
@@ -3694,8 +4008,11 @@ interface SVGNodeData extends CommonNodeData, Partial<DrawableNode>, WithPositio
3694
4008
  [classKey]: "SVGNode";
3695
4009
  }
3696
4010
  /**
3697
- * An SVG graphic layer on the canvas. Contains the raw SVG string and
3698
- * supports positioning, sizing, rotation, and visibility.
4011
+ * An SVG graphic layer on the canvas.
4012
+ *
4013
+ * Contains the raw SVG string and supports positioning, sizing,
4014
+ * rotation, and visibility.
4015
+ * @category canvas
3699
4016
  */
3700
4017
  declare class SVGNode extends NodeMethods implements EditableSVGNodeAttributes {
3701
4018
  readonly [classKey]: SVGNodeData[ClassKey];
@@ -3721,7 +4038,10 @@ interface EditableVectorSetItemNodeAttributes extends WithNameTrait, WithVisible
3721
4038
  interface VectorSetItemNodeData extends CommonNodeData, Partial<WithNameTrait>, Partial<WithVisibleTrait>, Partial<WithLockedTrait>, Partial<WithPinsTrait>, Partial<WithSizeTrait> {
3722
4039
  [classKey]: "VectorSetItemNode";
3723
4040
  }
3724
- /** An individual item within a VectorSet node. */
4041
+ /**
4042
+ * An individual item within a VectorSet node.
4043
+ * @category canvas
4044
+ */
3725
4045
  declare class VectorSetItemNode extends NodeMethods implements EditableVectorSetItemNodeAttributes {
3726
4046
  #private;
3727
4047
  readonly [classKey]: VectorSetItemNodeData[ClassKey];
@@ -3745,8 +4065,10 @@ interface ComponentInstanceNodeData extends CommonNodeData, Partial<DrawableNode
3745
4065
  [classKey]: "ComponentInstanceNode";
3746
4066
  }
3747
4067
  /**
3748
- * An instance of a code or design component on the canvas. Component
3749
- * instances are identified by their {@link ComponentInstanceNode.componentIdentifier | componentIdentifier}
4068
+ * An instance of a code or design component on the canvas.
4069
+ *
4070
+ * Component instances are identified by their
4071
+ * {@link ComponentInstanceNode.componentIdentifier | componentIdentifier}
3750
4072
  * and can have their control properties updated via
3751
4073
  * {@link NodeMethods.setAttributes | setAttributes}.
3752
4074
  *
@@ -3758,6 +4080,7 @@ interface ComponentInstanceNodeData extends CommonNodeData, Partial<DrawableNode
3758
4080
  * })
3759
4081
  * }
3760
4082
  * ```
4083
+ * @category canvas
3761
4084
  */
3762
4085
  declare class ComponentInstanceNode extends NodeMethods implements EditableComponentInstanceNodeAttributes, WithComponentInfoTrait {
3763
4086
  #private;
@@ -3803,9 +4126,11 @@ interface WebPageNodeData extends CommonNodeData, Partial<WithWebPageInfoTrait>
3803
4126
  [classKey]: "WebPageNode";
3804
4127
  }
3805
4128
  /**
3806
- * A web page in the project's site map. Web pages have a
3807
- * {@link WebPageNode.path | path} and may be associated with a CMS
3808
- * collection when used as a detail page.
4129
+ * A web page in the project's site map.
4130
+ *
4131
+ * Web pages have a {@link WebPageNode.path | path} and may be associated
4132
+ * with a CMS collection when used as a detail page.
4133
+ * @category canvas
3809
4134
  */
3810
4135
  declare class WebPageNode extends NodeMethods implements EditableWebPageNodeAttributes, WithWebPageInfoTrait {
3811
4136
  #private;
@@ -3840,6 +4165,7 @@ declare class WebPageNode extends NodeMethods implements EditableWebPageNodeAttr
3840
4165
  addBreakpoint(basedOn: NodeId, breakpoint: Breakpoint): Promise<FrameNode>;
3841
4166
  /**
3842
4167
  * Get the active collection item for this CMS detail page.
4168
+ *
3843
4169
  * Returns null if this is not a detail page or the collection is empty.
3844
4170
  *
3845
4171
  * @alpha
@@ -3851,9 +4177,11 @@ interface ComponentNodeData extends CommonNodeData, Partial<WithNameTrait>, With
3851
4177
  [classKey]: "ComponentNode";
3852
4178
  }
3853
4179
  /**
3854
- * A reusable design component definition. Component nodes contain
3855
- * variants, gesture states, and variables. They can be inserted as
3856
- * instances via their module URL.
4180
+ * A reusable design component definition.
4181
+ *
4182
+ * Component nodes contain variants, gesture states, and variables.
4183
+ * They can be inserted as instances via their module URL.
4184
+ * @category canvas
3857
4185
  */
3858
4186
  declare class ComponentNode extends NodeMethods implements EditableComponentNodeAttributes, WithComponentInfoTrait {
3859
4187
  #private;
@@ -3921,7 +4249,10 @@ type EditableVectorSetNodeAttributes = WithNameTrait;
3921
4249
  interface VectorSetNodeData extends CommonNodeData, Partial<WithNameTrait> {
3922
4250
  [classKey]: "VectorSetNode";
3923
4251
  }
3924
- /** A container node for a set of vector icons. */
4252
+ /**
4253
+ * A container node for a set of vector icons.
4254
+ * @category canvas
4255
+ */
3925
4256
  declare class VectorSetNode extends NodeMethods implements EditableVectorSetNodeAttributes {
3926
4257
  readonly [classKey]: VectorSetNodeData[ClassKey];
3927
4258
  readonly name: string | null;
@@ -3934,7 +4265,10 @@ interface DesignPageCloneOptions {
3934
4265
  interface DesignPageNodeData extends CommonNodeData, Partial<WithNameTrait> {
3935
4266
  [classKey]: "DesignPageNode";
3936
4267
  }
3937
- /** A design page (non-web canvas) in the project. */
4268
+ /**
4269
+ * A design page (non-web canvas) in the project.
4270
+ * @category canvas
4271
+ */
3938
4272
  declare class DesignPageNode extends NodeMethods implements EditableDesignPageNodeAttributes {
3939
4273
  #private;
3940
4274
  readonly [classKey]: DesignPageNodeData[ClassKey];
@@ -4056,6 +4390,7 @@ interface CodeFileVersionData extends Pick<CodeFileData, "id" | "name"> {
4056
4390
  }
4057
4391
  /**
4058
4392
  * A saved version (snapshot) of a code file.
4393
+ * @category code-files
4059
4394
  */
4060
4395
  declare class CodeFileVersion {
4061
4396
  #private;
@@ -4083,6 +4418,7 @@ declare class CodeFileVersion {
4083
4418
  /**
4084
4419
  * Represents a code file in the Framer project, such as a code component
4085
4420
  * or code override.
4421
+ * @category code-files
4086
4422
  */
4087
4423
  declare class CodeFile implements Navigable {
4088
4424
  #private;
@@ -4310,6 +4646,9 @@ declare const readProjectForAgent: unique symbol;
4310
4646
  declare const getAgentSystemPrompt: unique symbol;
4311
4647
  declare const getAgentContext: unique symbol;
4312
4648
  declare const applyAgentChanges: unique symbol;
4649
+ declare const startAgentConversation: unique symbol;
4650
+ declare const continueAgentConversation: unique symbol;
4651
+ declare const submitAgentClarification: unique symbol;
4313
4652
  declare const $framerApiOnly: {
4314
4653
  readonly publish: typeof publish;
4315
4654
  readonly getDeployments: typeof getDeployments;
@@ -4322,6 +4661,9 @@ declare const $framerApiOnly: {
4322
4661
  readonly getAgentSystemPrompt: typeof getAgentSystemPrompt;
4323
4662
  readonly getAgentContext: typeof getAgentContext;
4324
4663
  readonly applyAgentChanges: typeof applyAgentChanges;
4664
+ readonly startAgentConversation: typeof startAgentConversation;
4665
+ readonly continueAgentConversation: typeof continueAgentConversation;
4666
+ readonly submitAgentClarification: typeof submitAgentClarification;
4325
4667
  };
4326
4668
 
4327
4669
  type Ownership = {
@@ -4643,6 +4985,9 @@ declare const methodToMessageTypes: {
4643
4985
  readonly [getAgentSystemPrompt]: [];
4644
4986
  readonly [getAgentContext]: [];
4645
4987
  readonly [applyAgentChanges]: ["applyAgentChanges"];
4988
+ readonly [startAgentConversation]: ["startAgentConversation"];
4989
+ readonly [continueAgentConversation]: ["continueAgentConversation"];
4990
+ readonly [submitAgentClarification]: ["submitAgentClarification"];
4646
4991
  };
4647
4992
  type AllMethods = keyof {
4648
4993
  [K in Method as (typeof methodToMessageTypes)[K] extends [] ? never : K]: (typeof methodToMessageTypes)[K];
@@ -4712,6 +5057,7 @@ type RedirectInput = Prettify<CreateRedirect | UpdateRedirect>;
4712
5057
  /**
4713
5058
  * A URL redirect configured in the project. Redirects are applied when
4714
5059
  * the site is published.
5060
+ * @category settings
4715
5061
  */
4716
5062
  declare class Redirect {
4717
5063
  #private;
@@ -5022,6 +5368,8 @@ interface Navigable {
5022
5368
  type Unsubscribe$1 = VoidFunction;
5023
5369
  type Cleanup = VoidFunction;
5024
5370
 
5371
+ /** Major version segment for the Framer AI chat HTTP path (`/ai/v{version}/chat/`). */
5372
+ type AiServiceVersion = "2" | "3";
5025
5373
  interface AiServiceInfo {
5026
5374
  endpoint: string;
5027
5375
  token: string;
@@ -5031,9 +5379,11 @@ declare class FramerPluginAPI {
5031
5379
  #private;
5032
5380
  constructor(engine: PluginEngine);
5033
5381
  /**
5034
- * Get the current mode. A plugin can launch in a special mode where only a
5035
- * subset of the API is allowed. The mode is set when the plugin launches
5036
- * and never changes while the plugin is active.
5382
+ * Get the current mode.
5383
+ *
5384
+ * A plugin can launch in a special mode where only a subset of the API is
5385
+ * allowed. The mode is set when the plugin launches and never changes while
5386
+ * the plugin is active.
5037
5387
  *
5038
5388
  * @example
5039
5389
  * ```ts
@@ -5042,6 +5392,7 @@ declare class FramerPluginAPI {
5042
5392
  * return
5043
5393
  * }
5044
5394
  * ```
5395
+ * @category settings
5045
5396
  */
5046
5397
  get mode(): Mode;
5047
5398
  /**
@@ -5064,6 +5415,7 @@ declare class FramerPluginAPI {
5064
5415
  *
5065
5416
  * @param methods - The methods to check, at least one.
5066
5417
  * @returns `true` if all of `methods` can be executed, `false` otherwise.
5418
+ * @category permissions
5067
5419
  */
5068
5420
  isAllowedTo(...methods: [ProtectedMethod, ...ProtectedMethod[]]): boolean;
5069
5421
  /**
@@ -5096,6 +5448,7 @@ declare class FramerPluginAPI {
5096
5448
  * width: 220
5097
5449
  * })
5098
5450
  * ```
5451
+ * @category plugin-ui
5099
5452
  */
5100
5453
  showUI(options?: UIOptions): Promise<void>;
5101
5454
  /**
@@ -5108,14 +5461,14 @@ declare class FramerPluginAPI {
5108
5461
  * ```ts
5109
5462
  * framer.hideUI()
5110
5463
  * ```
5464
+ * @category plugin-ui
5111
5465
  */
5112
5466
  hideUI(): Promise<void>;
5113
5467
  /**
5114
5468
  * Update the background status text shown while the plugin UI is hidden.
5115
- * This allows plugins running in the background to communicate their current
5116
- * status to users.
5117
5469
  *
5118
- * Set to `null` to clear the message.
5470
+ * This allows plugins running in the background to communicate their current
5471
+ * status to users. Set to `null` to clear the message.
5119
5472
  *
5120
5473
  * @param status - The message to display, or `null` to clear.
5121
5474
  *
@@ -5127,10 +5480,13 @@ declare class FramerPluginAPI {
5127
5480
  * // Clear the status message
5128
5481
  * await framer.setBackgroundMessage(null)
5129
5482
  * ```
5483
+ * @category plugin-ui
5130
5484
  */
5131
5485
  setBackgroundMessage(status: string | null): Promise<void>;
5132
5486
  /**
5133
- * Close and terminate the plugin. Throws `FramerPluginClosedError`, which should be ignored.
5487
+ * Close and terminate the plugin.
5488
+ *
5489
+ * Throws `FramerPluginClosedError`, which should be ignored.
5134
5490
  *
5135
5491
  * @param message - Optional message to show in the notification (ignored if options.silent is true)
5136
5492
  * @param options - Options to control the close behaviour
@@ -5141,6 +5497,7 @@ declare class FramerPluginAPI {
5141
5497
  * variant: "success",
5142
5498
  * })
5143
5499
  * ```
5500
+ * @category plugin-ui
5144
5501
  */
5145
5502
  closePlugin(message?: string, options?: ClosePluginOptions): never;
5146
5503
  /**
@@ -5150,32 +5507,45 @@ declare class FramerPluginAPI {
5150
5507
  * ```ts
5151
5508
  * const user = await framer.getCurrentUser();
5152
5509
  * ```
5510
+ * @category user
5153
5511
  */
5154
5512
  getCurrentUser(): Promise<User>;
5155
- /** Get the project info like name and id. */
5513
+ /** Get the project info like name and id.
5514
+ * @category settings
5515
+ */
5156
5516
  getProjectInfo(): Promise<ProjectInfo>;
5157
- /** Get the current selection. */
5517
+ /** Get the current selection.
5518
+ * @category canvas
5519
+ */
5158
5520
  getSelection(): Promise<CanvasNode[]>;
5159
- /** Set the current selection. */
5521
+ /** Set the current selection.
5522
+ * @category canvas
5523
+ */
5160
5524
  setSelection(nodeIds: string | Iterable<string>): Promise<void>;
5161
5525
  /** Subscribe to selection changes. */
5162
5526
  subscribeToSelection(selectionUpdate: (nodes: CanvasNode[]) => void): Unsubscribe$1;
5163
- /** Get the root of the current canvas. */
5527
+ /** Get the root of the current canvas.
5528
+ * @category canvas
5529
+ */
5164
5530
  getCanvasRoot(): Promise<CanvasRootNode>;
5165
5531
  /** Subscribe to canvas root changes */
5166
5532
  subscribeToCanvasRoot(rootUpdate: (root: CanvasRootNode) => void): Unsubscribe$1;
5167
5533
  /**
5168
- * Get information about the published website, such as the time of the most
5169
- * recent deploy, or the URL of the current page. Provides information about
5170
- * both `staging` and `production` environments (either may be `null` if the
5171
- * site has never been published).
5534
+ * Get information about the published website.
5535
+ *
5536
+ * Provides details such as the time of the most recent deploy or the URL of
5537
+ * the current page. Covers both `staging` and `production` environments
5538
+ * (either may be `null` if the site has never been published).
5172
5539
  *
5173
5540
  * @returns The current publish info for both staging and production.
5541
+ * @category settings
5174
5542
  */
5175
5543
  getPublishInfo(): Promise<PublishInfo>;
5176
5544
  /**
5177
- * Subscribe to publish info changes. The callback is called whenever
5178
- * publish info is updated (e.g., after a new deployment).
5545
+ * Subscribe to publish info changes.
5546
+ *
5547
+ * The callback is called whenever publish info is updated (e.g., after a
5548
+ * new deployment).
5179
5549
  *
5180
5550
  * @param publishInfoUpdate - Called when publish info changes.
5181
5551
  * @returns A function to unsubscribe from updates.
@@ -5192,21 +5562,35 @@ declare class FramerPluginAPI {
5192
5562
  * ```
5193
5563
  */
5194
5564
  subscribeToPublishInfo(publishInfoUpdate: (info: PublishInfo) => void): Unsubscribe$1;
5195
- /** Create a new node on the canvas. */
5565
+ /** Create a new node on the canvas.
5566
+ * @category canvas
5567
+ */
5196
5568
  createFrameNode(attributes: Partial<EditableFrameNodeAttributes>, parentId?: string): Promise<FrameNode | null>;
5197
- /** Remove nodes from the canvas. */
5569
+ /** Remove nodes from the canvas.
5570
+ * @category canvas
5571
+ */
5198
5572
  removeNodes(nodeIds: NodeId[]): Promise<void>;
5199
5573
  /** @deprecated Use `removeNodes` directly. */
5200
5574
  removeNode(nodeId: NodeId): Promise<void>;
5201
- /** Clone a node. */
5575
+ /** Clone a node.
5576
+ * @category canvas
5577
+ */
5202
5578
  cloneNode(nodeId: NodeId): Promise<AnyNode | null>;
5203
- /** Get a node by its id. */
5579
+ /** Get a node by its id.
5580
+ * @category canvas
5581
+ */
5204
5582
  getNode(nodeId: NodeId): Promise<AnyNode | null>;
5205
- /** Get the parent of a node. */
5583
+ /** Get the parent of a node.
5584
+ * @category canvas
5585
+ */
5206
5586
  getParent(nodeId: NodeId): Promise<AnyNode | null>;
5207
- /** Get the children of a node. */
5587
+ /** Get the children of a node.
5588
+ * @category canvas
5589
+ */
5208
5590
  getChildren(nodeId: NodeId): Promise<CanvasNode[]>;
5209
- /** Get the rect of a node */
5591
+ /** Get the rect of a node
5592
+ * @category canvas
5593
+ */
5210
5594
  getRect(nodeId: NodeId): Promise<Rect$1 | null>;
5211
5595
  /**
5212
5596
  * Pans and zooms the viewport to center a single or group of nodes.
@@ -5222,13 +5606,21 @@ declare class FramerPluginAPI {
5222
5606
  * // Scroll and zoom to fit multiple nodes into the viewport.
5223
5607
  * await framer.zoomIntoView(["node-id-1", "node-id-2"])
5224
5608
  * ```
5609
+ * @category navigation
5225
5610
  */
5226
5611
  zoomIntoView(nodeIds: NodeId | Iterable<NodeId>, options?: ZoomIntoViewOptions): Promise<void>;
5227
- /** Set the attributes of a node. */
5612
+ /** Set the attributes of a node.
5613
+ * @category canvas
5614
+ */
5228
5615
  setAttributes(nodeId: NodeId, attributes: Partial<AnyEditableAttributes>): Promise<AnyNode | null>;
5229
- /** Set the parent of a node. */
5616
+ /** Set the parent of a node.
5617
+ * @category canvas
5618
+ */
5230
5619
  setParent(nodeId: NodeId, parentId: NodeId, index?: number | undefined): Promise<void>;
5231
- /** Get all nodes of a certain class. */
5620
+ /**
5621
+ * Get all nodes of a certain class.
5622
+ * @category canvas
5623
+ */
5232
5624
  getNodesWithType(type: "FrameNode"): Promise<FrameNode[]>;
5233
5625
  getNodesWithType(type: "TextNode"): Promise<TextNode[]>;
5234
5626
  getNodesWithType(type: "SVGNode"): Promise<SVGNode[]>;
@@ -5236,39 +5628,59 @@ declare class FramerPluginAPI {
5236
5628
  getNodesWithType(type: "WebPageNode"): Promise<WebPageNode[]>;
5237
5629
  getNodesWithType(type: "DesignPageNode"): Promise<DesignPageNode[]>;
5238
5630
  getNodesWithType(type: "ComponentNode"): Promise<ComponentNode[]>;
5239
- /** Get all nodes with a certain attribute. */
5631
+ /** Get all nodes with a certain attribute.
5632
+ * @category canvas
5633
+ */
5240
5634
  getNodesWithAttribute<T extends NodeAttributeKey, Node = NodeWithAttribute<T>>(attribute: T): Promise<Node[]>;
5241
- /** Get all nodes with a certain attribute which value is set. */
5635
+ /** Get all nodes with a certain attribute which value is set.
5636
+ * @category canvas
5637
+ */
5242
5638
  getNodesWithAttributeSet<T extends NodeAttributeKey, Node = NodeWithAttribute<T>>(attribute: T): Promise<Node[]>;
5243
5639
  /**
5244
5640
  * Get the image of the current selection or `null` if there is no image.
5245
5641
  *
5246
5642
  * In `editImage` mode, this returns the image the user already has set,
5247
5643
  * which your plugin can then modify.
5644
+ * @category canvas
5248
5645
  */
5249
5646
  getImage(): Promise<ImageAsset | null>;
5250
5647
  /** Subscribe to single image selection changes. */
5251
5648
  subscribeToImage(imageUpdate: (image: ImageAsset | null) => void): Unsubscribe$1;
5252
- /** Upload an image, and insert on the canvas. */
5649
+ /** Upload an image, and insert on the canvas.
5650
+ * @category canvas
5651
+ */
5253
5652
  addImage(image: NamedImageAssetInput | File): Promise<void>;
5254
5653
  /**
5255
5654
  * Upload an image and set it on the selected node.
5256
5655
  *
5257
5656
  * In `image` or `editImage` mode, this is the primary method to send the
5258
5657
  * selected or edited image back to Framer.
5658
+ * @category canvas
5259
5659
  */
5260
5660
  setImage(image: NamedImageAssetInput | File): Promise<void>;
5261
- /** Upload an image without assigning it to a property. */
5661
+ /** Upload an image without assigning it to a property.
5662
+ * @category canvas
5663
+ */
5262
5664
  uploadImage(image: NamedImageAssetInput | File): Promise<ImageAsset>;
5263
- /** Add multiple images, replacing the selected images, or insert on the canvas. */
5665
+ /** Add multiple images, replacing the selected images, or insert on the canvas.
5666
+ * @category canvas
5667
+ */
5264
5668
  addImages(images: readonly NamedImageAssetInput[]): Promise<void>;
5265
- /** Upload multiple images without assigning them to properties. */
5669
+ /** Upload multiple images without assigning them to properties.
5670
+ * @category canvas
5671
+ */
5266
5672
  uploadImages(images: readonly NamedImageAssetInput[]): Promise<ImageAsset[]>;
5267
- /** Uploads a file without assigning it to a property. */
5673
+ /** Uploads a file without assigning it to a property.
5674
+ * @category canvas
5675
+ */
5268
5676
  uploadFile(file: NamedFileAssetInput | File): Promise<FileAsset>;
5269
- /** Upload multiple files without assigning them to properties. */
5677
+ /** Upload multiple files without assigning them to properties.
5678
+ * @category canvas
5679
+ */
5270
5680
  uploadFiles(files: readonly NamedFileAssetInput[]): Promise<FileAsset[]>;
5271
- /** Add an SVG, replacing the selected SVG, or insert on the canvas. */
5681
+ /** Add an SVG, replacing the selected SVG, or insert on the canvas.
5682
+ * @category canvas
5683
+ */
5272
5684
  addSVG(svg: SVGData): Promise<void>;
5273
5685
  /**
5274
5686
  * Add a component instance by module URL.
@@ -5277,22 +5689,34 @@ declare class FramerPluginAPI {
5277
5689
  * @param attributes - Optional component attributes.
5278
5690
  *
5279
5691
  * @returns The newly created component instance node.
5692
+ * @category canvas
5280
5693
  */
5281
5694
  addComponentInstance({ url, attributes, parentId, }: AddComponentInstanceOptions): Promise<ComponentInstanceNode>;
5282
- /** Adds the layers of a component by module URL. */
5695
+ /** Adds the layers of a component by module URL.
5696
+ * @category canvas
5697
+ */
5283
5698
  addDetachedComponentLayers({ url, layout, attributes }: AddDetachedComponentLayersOptions): Promise<FrameNode>;
5284
- /** Preload the component layers for detached insertion. */
5699
+ /** Preload the component layers for detached insertion.
5700
+ * @category canvas
5701
+ */
5285
5702
  preloadDetachedComponentLayers(url: string): Promise<void>;
5286
5703
  preloadImageUrlForInsertion(url: string): Promise<void>;
5287
5704
  preloadDragPreviewImage(url: string): Promise<void>;
5288
- /** Get plaintext of the current selection or null if there is no text. */
5705
+ /** Get plaintext of the current selection or null if there is no text.
5706
+ * @category canvas
5707
+ */
5289
5708
  getText(): Promise<string | null>;
5290
- /** Set the text of the current selection or insert it onto the canvas. */
5709
+ /** Set the text of the current selection or insert it onto the canvas.
5710
+ * @category canvas
5711
+ */
5291
5712
  setText(text: string): Promise<void>;
5292
- /** Add a new text node to the canvas. */
5713
+ /** Add a new text node to the canvas.
5714
+ * @category canvas
5715
+ */
5293
5716
  addText(text: string, options?: AddTextOptions): Promise<void>;
5294
5717
  /**
5295
5718
  * Install a custom code snippet in the user's website via `<script>` tags.
5719
+ *
5296
5720
  * A plugin can only set custom HTML once per location. Custom code should be
5297
5721
  * valid HTML. Setting `html` to `null` clears the installed code snippet.
5298
5722
  *
@@ -5305,11 +5729,14 @@ declare class FramerPluginAPI {
5305
5729
  * location: "bodyEnd"
5306
5730
  * })
5307
5731
  * ```
5732
+ * @category code-files
5308
5733
  */
5309
5734
  setCustomCode(options: SetCustomCodeOptions): Promise<void>;
5310
5735
  /**
5311
- * Get custom code settings set by the plugin. Your plugin can detect if
5312
- * custom code was set and whether the user has disabled it.
5736
+ * Get custom code settings set by the plugin.
5737
+ *
5738
+ * Your plugin can detect if custom code was set and whether the user has
5739
+ * disabled it.
5313
5740
  *
5314
5741
  * @example
5315
5742
  * ```ts
@@ -5318,11 +5745,14 @@ declare class FramerPluginAPI {
5318
5745
  * // Custom code was disabled by the user in settings
5319
5746
  * }
5320
5747
  * ```
5748
+ * @category code-files
5321
5749
  */
5322
5750
  getCustomCode(): Promise<CustomCode>;
5323
5751
  /**
5324
- * Subscribe to custom code changes. Called when custom code is registered
5325
- * or when changes to the settings are made.
5752
+ * Subscribe to custom code changes.
5753
+ *
5754
+ * Called when custom code is registered or when changes to the settings
5755
+ * are made.
5326
5756
  *
5327
5757
  * @param callback - Called when custom code settings change.
5328
5758
  * @returns A function to unsubscribe from updates.
@@ -5340,9 +5770,12 @@ declare class FramerPluginAPI {
5340
5770
  /** Subscribe to the current text selection. */
5341
5771
  subscribeToText(callback: (text: string | null) => void): Unsubscribe$1;
5342
5772
  /**
5343
- * Allow any HTML element to become draggable. Different types of drag data can be dropped onto
5344
- * Framer. A function is returned to remove the draggable behavior from the element and to stop
5773
+ * Allow any HTML element to become draggable.
5774
+ *
5775
+ * Different types of drag data can be dropped onto Framer. A function is
5776
+ * returned to remove the draggable behavior from the element and to stop
5345
5777
  * all of the added listeners.
5778
+ * @category canvas
5346
5779
  */
5347
5780
  makeDraggable(element: HTMLElement, getDragData: () => DragData, onDragComplete?: DragCompleteCallback): Cleanup;
5348
5781
  /**
@@ -5354,9 +5787,12 @@ declare class FramerPluginAPI {
5354
5787
  * ```ts
5355
5788
  * const collection = await framer.getActiveManagedCollection();
5356
5789
  * ```
5790
+ * @category cms
5357
5791
  */
5358
5792
  getActiveManagedCollection(): Promise<ManagedCollection>;
5359
- /** @deprecated Use `getActiveManagedCollection` */
5793
+ /** @deprecated Use `getActiveManagedCollection`
5794
+ * @category cms
5795
+ */
5360
5796
  getManagedCollection(): Promise<ManagedCollection>;
5361
5797
  /**
5362
5798
  * Retrieve Collections that are managed by the current Plugin.
@@ -5368,9 +5804,12 @@ declare class FramerPluginAPI {
5368
5804
  * ```ts
5369
5805
  * const managedCollections = await framer.getManagedCollections();
5370
5806
  * ```
5807
+ * @category cms
5371
5808
  */
5372
5809
  getManagedCollections(): Promise<ManagedCollection[]>;
5373
- /** Get a collection by its id. */
5810
+ /** Get a collection by its id.
5811
+ * @category cms
5812
+ */
5374
5813
  getCollection(id: NodeId): Promise<Collection | null>;
5375
5814
  /**
5376
5815
  * Retrieve the Collection currently active (selected) in the Framer UI.
@@ -5384,6 +5823,7 @@ declare class FramerPluginAPI {
5384
5823
  * ```ts
5385
5824
  * const collection = await framer.getActiveCollection();
5386
5825
  * ```
5826
+ * @category cms
5387
5827
  */
5388
5828
  getActiveCollection(): Promise<Collection | null>;
5389
5829
  /**
@@ -5393,10 +5833,13 @@ declare class FramerPluginAPI {
5393
5833
  * ```ts
5394
5834
  * const collections = await framer.getCollections()
5395
5835
  * ```
5836
+ * @category cms
5396
5837
  */
5397
5838
  getCollections(): Promise<Collection[]>;
5398
5839
  /**
5399
- * Display a notification message. The message will be truncated if longer than 120 characters.
5840
+ * Display a notification message.
5841
+ *
5842
+ * The message will be truncated if longer than 120 characters.
5400
5843
  *
5401
5844
  * @param message - The message to display. Truncated if longer than 120 characters.
5402
5845
  * @param options - Options like `variant` (`"info"`, `"success"`, `"warning"`, `"error"`), `durationMs`, `button`, and `onDisappear`.
@@ -5414,34 +5857,55 @@ declare class FramerPluginAPI {
5414
5857
  * // Close the notification programmatically
5415
5858
  * notification.close()
5416
5859
  * ```
5860
+ * @category plugin-ui
5417
5861
  */
5418
5862
  notify: Notify;
5419
- /** Get plugin data by key. */
5863
+ /** Get plugin data by key.
5864
+ * @category plugin-ui
5865
+ */
5420
5866
  getPluginData(key: string): Promise<string | null>;
5421
- /** Set plugin data by key. */
5867
+ /** Set plugin data by key.
5868
+ * @category plugin-ui
5869
+ */
5422
5870
  setPluginData(key: string, value: string | null): Promise<void>;
5423
- /** Get all plugin data keys. */
5871
+ /** Get all plugin data keys.
5872
+ * @category plugin-ui
5873
+ */
5424
5874
  getPluginDataKeys(): Promise<string[]>;
5425
- /** Get all color styles in the project. */
5875
+ /** Get all color styles in the project.
5876
+ * @category canvas
5877
+ */
5426
5878
  getColorStyles(): Promise<ColorStyle[]>;
5427
- /** Get a specific color style. */
5879
+ /** Get a specific color style.
5880
+ * @category canvas
5881
+ */
5428
5882
  getColorStyle(id: NodeId): Promise<ColorStyle | null>;
5429
- /** Add a new color style to the project. */
5883
+ /** Add a new color style to the project.
5884
+ * @category canvas
5885
+ */
5430
5886
  createColorStyle(attributes: ColorStyleAttributes): Promise<ColorStyle>;
5431
5887
  /** Fired when a color style is added, edited or removed. */
5432
5888
  subscribeToColorStyles(callback: (styles: ColorStyle[]) => void): Unsubscribe$1;
5433
- /** Get all text styles in the project. */
5889
+ /** Get all text styles in the project.
5890
+ * @category canvas
5891
+ */
5434
5892
  getTextStyles(): Promise<TextStyle[]>;
5435
- /** Get a specific text style. */
5893
+ /** Get a specific text style.
5894
+ * @category canvas
5895
+ */
5436
5896
  getTextStyle(id: NodeId): Promise<TextStyle | null>;
5437
- /** Add a new text style to the project. */
5897
+ /** Add a new text style to the project.
5898
+ * @category canvas
5899
+ */
5438
5900
  createTextStyle(attributes: TextStyleAttributes): Promise<TextStyle>;
5439
5901
  /** Fired when a text style is added, edited or removed. */
5440
5902
  subscribeToTextStyles(callback: (styles: TextStyle[]) => void): Unsubscribe$1;
5441
5903
  /**
5442
- * Get a specific font from a family by name. This is not case sensitive.
5443
- * By default, returns a font with normal weight and style. Returns `null`
5444
- * if the font does not exist or lacks the requested weight/style combination.
5904
+ * Get a specific font from a family by name.
5905
+ *
5906
+ * This is not case sensitive. By default, returns a font with normal weight
5907
+ * and style. Returns `null` if the font does not exist or lacks the
5908
+ * requested weight/style combination.
5445
5909
  *
5446
5910
  * Note: Custom fonts are not available to plugins.
5447
5911
  *
@@ -5460,12 +5924,15 @@ declare class FramerPluginAPI {
5460
5924
  * style: "italic"
5461
5925
  * })
5462
5926
  * ```
5927
+ * @category canvas
5463
5928
  */
5464
5929
  getFont(family: string, attributes?: FontAttributes): Promise<Font | null>;
5465
5930
  /**
5466
- * Get all available fonts. Unlike the Font Picker which groups fonts by
5467
- * typeface, this lists individual fonts for each weight and style (each
5468
- * representing a separate font file).
5931
+ * Get all available fonts.
5932
+ *
5933
+ * Unlike the Font Picker which groups fonts by typeface, this lists
5934
+ * individual fonts for each weight and style (each representing a separate
5935
+ * font file).
5469
5936
  *
5470
5937
  * Note: Custom fonts are not available to plugins.
5471
5938
  *
@@ -5475,6 +5942,7 @@ declare class FramerPluginAPI {
5475
5942
  * ```ts
5476
5943
  * const fonts = await framer.getFonts()
5477
5944
  * ```
5945
+ * @category canvas
5478
5946
  */
5479
5947
  getFonts(): Promise<Font[]>;
5480
5948
  /**
@@ -5486,6 +5954,7 @@ declare class FramerPluginAPI {
5486
5954
  * ```ts
5487
5955
  * const locales = await framer.getLocales()
5488
5956
  * ```
5957
+ * @category localization
5489
5958
  */
5490
5959
  getLocales(): Promise<readonly Locale[]>;
5491
5960
  /**
@@ -5495,6 +5964,7 @@ declare class FramerPluginAPI {
5495
5964
  * ```ts
5496
5965
  * const defaultLocale = await framer.getDefaultLocale()
5497
5966
  * ```
5967
+ * @category localization
5498
5968
  */
5499
5969
  getDefaultLocale(): Promise<Locale>;
5500
5970
  /**
@@ -5508,25 +5978,28 @@ declare class FramerPluginAPI {
5508
5978
  * ```ts
5509
5979
  * const activeLocale = await framer.getActiveLocale()
5510
5980
  * ```
5981
+ * @category localization
5511
5982
  */
5512
5983
  getActiveLocale(): Promise<Locale | null>;
5513
5984
  /**
5514
- * Get all Localization Groups in the project.
5985
+ * Get Localization Groups in the project, optionally filtered.
5986
+ *
5987
+ * @param filter - Optional filter to narrow down the returned groups.
5515
5988
  *
5516
5989
  * @example
5517
5990
  * ```ts
5991
+ * // Get all groups
5518
5992
  * const groups = await framer.getLocalizationGroups()
5519
5993
  *
5520
- * for (const group of groups) {
5521
- * console.log(`Group: ${group.name}`)
5994
+ * // Get only page groups
5995
+ * const pageGroups = await framer.getLocalizationGroups({ type: "page" })
5522
5996
  *
5523
- * for (const source of group.sources) {
5524
- * console.log(`Source: ${source.value}`)
5525
- * }
5526
- * }
5997
+ * // Get specific groups by ID
5998
+ * const specific = await framer.getLocalizationGroups({ groupIds: ["id1", "id2"] })
5527
5999
  * ```
6000
+ * @category localization
5528
6001
  */
5529
- getLocalizationGroups(): Promise<readonly LocalizationGroup[]>;
6002
+ getLocalizationGroups(filter?: GetLocalizationGroupsFilter): Promise<readonly LocalizationGroup[]>;
5530
6003
  /**
5531
6004
  * Update localization data.
5532
6005
  *
@@ -5548,6 +6021,7 @@ declare class FramerPluginAPI {
5548
6021
  * }
5549
6022
  * })
5550
6023
  * ```
6024
+ * @category localization
5551
6025
  */
5552
6026
  setLocalizationData(update: LocalizationData): Promise<SetLocalizationDataResult>;
5553
6027
  /**
@@ -5559,6 +6033,7 @@ declare class FramerPluginAPI {
5559
6033
  * ```ts
5560
6034
  * const redirects = await framer.getRedirects()
5561
6035
  * ```
6036
+ * @category settings
5562
6037
  */
5563
6038
  getRedirects(): Promise<readonly Redirect[]>;
5564
6039
  /** Subscribe to redirect changes. */
@@ -5584,10 +6059,13 @@ declare class FramerPluginAPI {
5584
6059
  * { from: "/posts/*", to: "/blog/:1", expandToAllLocales: false },
5585
6060
  * ])
5586
6061
  * ```
6062
+ * @category settings
5587
6063
  */
5588
6064
  addRedirects(redirects: RedirectInput[]): Promise<Redirect[]>;
5589
6065
  /**
5590
- * Remove Redirects from the project. Unknown Redirect IDs are ignored.
6066
+ * Remove Redirects from the project.
6067
+ *
6068
+ * Unknown Redirect IDs are ignored.
5591
6069
  *
5592
6070
  * Throws a `FramerPluginError` when the user lacks Site Settings permissions
5593
6071
  * or when the project plan does not include Redirects.
@@ -5598,10 +6076,13 @@ declare class FramerPluginAPI {
5598
6076
  * ```ts
5599
6077
  * await framer.removeRedirects([aboutPageRedirect.id, blogPageRedirect.id])
5600
6078
  * ```
6079
+ * @category settings
5601
6080
  */
5602
6081
  removeRedirects(redirectIds: string[]): Promise<void>;
5603
6082
  /**
5604
- * Set the order of Redirects in the list. Unknown Redirect IDs are ignored.
6083
+ * Set the order of Redirects in the list.
6084
+ *
6085
+ * Unknown Redirect IDs are ignored.
5605
6086
  *
5606
6087
  * Throws a `FramerPluginError` when the user lacks Site Settings permissions
5607
6088
  * or when the project plan does not include Redirects.
@@ -5612,6 +6093,7 @@ declare class FramerPluginAPI {
5612
6093
  * ```ts
5613
6094
  * await framer.setRedirectOrder([aboutPageRedirect.id, blogPageRedirect.id])
5614
6095
  * ```
6096
+ * @category settings
5615
6097
  */
5616
6098
  setRedirectOrder(redirectIds: string[]): Promise<void>;
5617
6099
  /**
@@ -5631,6 +6113,7 @@ declare class FramerPluginAPI {
5631
6113
  * }`
5632
6114
  * )
5633
6115
  * ```
6116
+ * @category code-files
5634
6117
  */
5635
6118
  createCodeFile(name: string, code: string, options?: {
5636
6119
  editViaPlugin?: boolean;
@@ -5645,6 +6128,7 @@ declare class FramerPluginAPI {
5645
6128
  * const allFiles = await framer.getCodeFiles()
5646
6129
  * console.log(`Project has ${allFiles.length} code files`)
5647
6130
  * ```
6131
+ * @category code-files
5648
6132
  */
5649
6133
  getCodeFiles(): Promise<readonly CodeFile[]>;
5650
6134
  /**
@@ -5657,6 +6141,7 @@ declare class FramerPluginAPI {
5657
6141
  * ```ts
5658
6142
  * const codeFile = await framer.getCodeFile("code-file-id")
5659
6143
  * ```
6144
+ * @category code-files
5660
6145
  */
5661
6146
  getCodeFile(id: string): Promise<CodeFile | null>;
5662
6147
  /**
@@ -5676,12 +6161,14 @@ declare class FramerPluginAPI {
5676
6161
  * @param content - The content of the code file.
5677
6162
  * @param compilerOptions - Optional compiler options to override the default compiler options for type checking.
5678
6163
  * @param sessionId - Optional session ID. Pass it when repeatedly type checking the same file. If not provided, a new session will be created for each type check, which is slow.
6164
+ * @category code-files
5679
6165
  */
5680
6166
  typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions, sessionId?: string): Promise<TypecheckDiagnostic[]>;
5681
6167
  /**
5682
- * Subscribe to changes in code files across the project. The callback is
5683
- * called when code files are added, removed, or updated, and receives an
5684
- * array of all code files in the project.
6168
+ * Subscribe to changes in code files across the project.
6169
+ *
6170
+ * The callback is called when code files are added, removed, or updated,
6171
+ * and receives an array of all code files in the project.
5685
6172
  *
5686
6173
  * @param callback - Function called when code files change.
5687
6174
  * @returns A function to stop listening to changes.
@@ -5718,6 +6205,7 @@ declare class FramerPluginAPI {
5718
6205
  * },
5719
6206
  * ])
5720
6207
  * ```
6208
+ * @category plugin-ui
5721
6209
  */
5722
6210
  setMenu(menuItems: MenuItem[]): Promise<void>;
5723
6211
  /**
@@ -5750,6 +6238,7 @@ declare class FramerPluginAPI {
5750
6238
  * }
5751
6239
  * )
5752
6240
  * ```
6241
+ * @category plugin-ui
5753
6242
  */
5754
6243
  showContextMenu(menuItems: MenuItem[], config: ContextMenuConfig): Promise<void>;
5755
6244
  /**
@@ -5757,11 +6246,14 @@ declare class FramerPluginAPI {
5757
6246
  * specified version.
5758
6247
  *
5759
6248
  * WARNING: This API is unstable and may change or break in the future
6249
+ * @category code-files
5760
6250
  */
5761
6251
  unstable_ensureMinimumDependencyVersion(packageName: string, version: string): Promise<void>;
5762
6252
  /**
5763
- * Navigate the Framer UI to a target by its ID. When the target isn't in the
5764
- * current mode, it might terminate or restart the plugin in the new mode.
6253
+ * Navigate the Framer UI to a target by its ID.
6254
+ *
6255
+ * When the target isn't in the current mode, it might terminate or restart
6256
+ * the plugin in the new mode.
5765
6257
  *
5766
6258
  * @param nodeId - The ID of the node to navigate to.
5767
6259
  * @param opts - The options for the navigation.
@@ -5771,11 +6263,13 @@ declare class FramerPluginAPI {
5771
6263
  * ```ts
5772
6264
  * await framer.navigateTo(nodeId, opts)
5773
6265
  * ```
6266
+ * @category navigation
5774
6267
  */
5775
6268
  navigateTo(nodeId: string, opts?: NavigableOptions): Promise<void>;
5776
6269
  /**
5777
- * Subscribe to changes in the Code Editor's active file. This function is
5778
- * primarily useful when the plugin's mode is `"code"`.
6270
+ * Subscribe to changes in the Code Editor's active file.
6271
+ *
6272
+ * This function is primarily useful when the plugin's mode is `"code"`.
5779
6273
  *
5780
6274
  * @param callback - Function called when the active code file changes.
5781
6275
  * @returns A function to stop listening to changes.
@@ -5805,6 +6299,7 @@ declare class FramerPluginAPI {
5805
6299
  * const designPage = await framer.createDesignPage("About")
5806
6300
  * await designPage.navigateTo()
5807
6301
  * ```
6302
+ * @category canvas
5808
6303
  */
5809
6304
  createDesignPage(pageName: string): Promise<DesignPageNode>;
5810
6305
  /**
@@ -5819,12 +6314,14 @@ declare class FramerPluginAPI {
5819
6314
  * const webPage = await framer.createWebPage("/about")
5820
6315
  * await webPage.navigateTo()
5821
6316
  * ```
6317
+ * @category canvas
5822
6318
  */
5823
6319
  createWebPage(pagePath: string): Promise<WebPageNode>;
5824
6320
  /**
5825
6321
  * Create a new collection.
5826
6322
  *
5827
6323
  * @param name - The name to give the new collection.
6324
+ * @category cms
5828
6325
  */
5829
6326
  createCollection(name: string): Promise<Collection>;
5830
6327
  /**
@@ -5838,6 +6335,7 @@ declare class FramerPluginAPI {
5838
6335
  * ```ts
5839
6336
  * const newCollection = await framer.createManagedCollection(name)
5840
6337
  * ```
6338
+ * @category cms
5841
6339
  */
5842
6340
  createManagedCollection(name: string): Promise<ManagedCollection>;
5843
6341
  /**
@@ -5855,6 +6353,7 @@ declare class FramerPluginAPI {
5855
6353
  * // Remove the close warning
5856
6354
  * await framer.setCloseWarning(false)
5857
6355
  * ```
6356
+ * @category settings
5858
6357
  */
5859
6358
  setCloseWarning(message: string | false): Promise<void>;
5860
6359
  /**
@@ -5878,7 +6377,7 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
5878
6377
  * @returns The component instance placeholder.
5879
6378
  */
5880
6379
  addComponentInstancePlaceholder(attributes?: ComponentInstancePlaceholderAttributes): Promise<ComponentInstancePlaceholder>;
5881
- [$framerInternal.getAiServiceInfo](): Promise<AiServiceInfo>;
6380
+ [$framerInternal.getAiServiceInfo](version?: AiServiceVersion): Promise<AiServiceInfo>;
5882
6381
  /** @internal */
5883
6382
  [$framerInternal.sendTrackingEvent](key: string, value: string, identifier: string): Promise<void>;
5884
6383
  /** @internal */
@@ -6034,6 +6533,12 @@ declare class FramerPluginAPIAlpha extends FramerPluginAPIBeta {
6034
6533
  [$framerApiOnly.applyAgentChanges](dsl: string, options?: {
6035
6534
  pagePath?: string;
6036
6535
  }): Promise<void>;
6536
+ /** @internal - Available only through framer-api */
6537
+ [$framerApiOnly.startAgentConversation](prompt: string, options?: StartAgentConversationOptions): Promise<StartAgentConversationResult>;
6538
+ /** @internal - Available only through framer-api */
6539
+ [$framerApiOnly.continueAgentConversation](prompt: string, options: ContinueAgentConversationOptions): Promise<ContinueAgentConversationResult>;
6540
+ /** @internal - Available only through framer-api */
6541
+ [$framerApiOnly.submitAgentClarification](options: SubmitAgentClarificationOptions): Promise<SubmitAgentClarificationResult>;
6037
6542
  }
6038
6543
  /**
6039
6544
  * Methods that are only available through framer-api (server API),
@@ -6330,14 +6835,20 @@ interface PluginMessageAPI {
6330
6835
  applyAgentChanges: (dsl: string, options?: {
6331
6836
  pagePath?: string;
6332
6837
  }) => Promise<void>;
6333
- [getAiServiceInfoMessageType]: () => Promise<AiServiceInfo>;
6838
+ /** @alpha */
6839
+ startAgentConversation: (prompt: string, options?: StartAgentConversationOptions) => Promise<StartAgentConversationResult>;
6840
+ /** @alpha */
6841
+ continueAgentConversation: (prompt: string, options: ContinueAgentConversationOptions) => Promise<ContinueAgentConversationResult>;
6842
+ /** @alpha */
6843
+ submitAgentClarification: (options: SubmitAgentClarificationOptions) => Promise<SubmitAgentClarificationResult>;
6844
+ [getAiServiceInfoMessageType]: (version?: AiServiceVersion) => Promise<AiServiceInfo>;
6334
6845
  [sendTrackingEventMessageType]: (key: string, value: string, identifier: string) => Promise<void>;
6335
6846
  [getCurrentUserMessageType]: () => Promise<User>;
6336
6847
  [getProjectInfoMessageType]: () => Promise<ProjectInfo>;
6337
6848
  [getHTMLForNodeMessageType]: (nodeId: NodeId) => Promise<string | null>;
6338
6849
  [setHTMLForNodeMessageType]: (nodeId: NodeId, html: string) => Promise<void>;
6339
6850
  /** @deprecated Use `getAiServiceInfoMessageType`. */
6340
- getAiServiceInfo: () => Promise<AiServiceInfo>;
6851
+ getAiServiceInfo: (version?: AiServiceVersion) => Promise<AiServiceInfo>;
6341
6852
  /** @deprecated Use `sendTrackingEventMessageType`. */
6342
6853
  sendTrackingEvent: (key: string, value: string, identifier: string) => Promise<void>;
6343
6854
  /** @alpha */
@@ -6457,7 +6968,10 @@ declare const fileAssetDiscriminator: "FileAsset";
6457
6968
  interface FileAssetData extends AssetIdentifier, FileAssetDataFields {
6458
6969
  [classKey]: typeof fileAssetDiscriminator;
6459
6970
  }
6460
- /** A file asset uploaded to the Framer project. */
6971
+ /**
6972
+ * A file asset uploaded to the Framer project.
6973
+ * @category canvas
6974
+ */
6461
6975
  declare class FileAsset implements AssetIdentifier, FileAssetDataFields {
6462
6976
  readonly id: AssetId;
6463
6977
  readonly url: string;
@@ -6500,6 +7014,7 @@ interface Size {
6500
7014
  /**
6501
7015
  * An image that has been uploaded to the Framer project. Provides methods
6502
7016
  * to access image data, measure dimensions, and load as bitmap or HTML element.
7017
+ * @category canvas
6503
7018
  */
6504
7019
  declare class ImageAsset implements ImageDataFields, AssetIdentifier {
6505
7020
  #private;
@@ -6737,6 +7252,7 @@ interface FramerConnectionMethods {
6737
7252
  /** @internal */
6738
7253
  reconnect(): Promise<void>;
6739
7254
  requestId?: string;
7255
+ sessionId?: string;
6740
7256
  [Symbol.dispose](): void;
6741
7257
  [Symbol.asyncDispose](): Promise<void>;
6742
7258
  }
@@ -6809,4 +7325,4 @@ declare function connect(projectUrlOrId: string, token?: string, options?: Conne
6809
7325
  */
6810
7326
  declare function withConnection<T>(projectUrlOrId: string, callback: (framer: Framer) => Promise<T>, token?: string, options?: ConnectOptions): Promise<T>;
6811
7327
 
6812
- export { type AllTraits, type AnyNode, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type ConnectOptions, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, type Deployment, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, ErrorCode, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, FramerAPIError, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, type Hostname, type HostnameType, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, type PublishResult, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScreenshotOptions, type ScreenshotResult, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isRetryableError, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };
7328
+ export { type AllTraits, type AnyNode, type ApiVersion1ProjectInfo, type ApiVersion1User, type ArrayControl, type ArrayFieldDataEntry, type ArrayFieldDataEntryInput, type ArrayItem, type ArrayItemData, type ArrayItemInput, type AxisOverflow, type BooleanControl, BooleanField, BooleanVariable, type Border, type BorderControl, type BorderRadius, type BorderRadiusControl, type BorderStyle, BorderVariable, type BorderWidth, type Breakpoint, type CanvasNode, type CanvasRootNode, CodeFile, type CodeFileComponentExport, type CodeFileExport, type CodeFileOverrideExport, CodeFileVersion, Collection, CollectionItem, type CollectionItemData, type CollectionItemInput, type CollectionReferenceControl, CollectionReferenceField, type ColorControl, ColorField, type ColorStop, ColorStyle, ColorVariable, ComponentInstanceNode, ComponentInstancePlaceholder, type ComponentInstancePlaceholderAttributes, type ComponentInstancePlaceholderData, ComponentNode, type ComponentVariable, type ComputedValue, ConicGradient, type ConnectOptions, type Control, type ControlAttributes, type CreateField, type CreateVariable, type CursorControl, type CustomCode, type CustomCodeLocation, type CustomCursorControl, type DateControl, DateField, DateVariable, type Deployment, DesignPageNode, type DiagnosticSpan, type EditableManagedCollectionField, EnumCase, type EnumCaseData, type EnumControl, EnumField, EnumVariable, ErrorCode, type Field, type FieldData, type FieldDataEntry, type FieldDataEntryInput, type FieldDataInput, FieldDivider, type FileControl, FileField, FileVariable, type FitContent, type FitImage, Font, type FontControl, type FormattedTextControl, FormattedTextField, FormattedTextVariable, FrameNode, type Framer, FramerAPIError, FramerPluginClosedError, FramerPluginError, type FusedNumberControl, type GapControl, type Gesture, type Gradient, type GridContentAlignment, type GridItemAlignment, type GridItemColumnSpan, type GridLayout, type HeightConstraint, type HeightLength, type Hostname, type HostnameType, ImageAsset, type ImageControl, ImageField, type ImageRendering, ImageVariable, type InlineLocalizationValueByLocale, type IsBreakpoint, type IsComponentGestureVariant, type IsComponentVariant, type LayoutType, type Length, LinearGradient, type LinkControl, LinkField, type LinkRelControl, LinkVariable, type LintConfig, type LintDiagnostic, type LintLink, type Locale, type LocaleId, type LocalizationData, type LocalizationGroup, type LocalizationGroupStatus, type LocalizationGroupStatusByLocale, type LocalizationSource, type LocalizationSourceId, type LocalizationSourceUpdate, type LocalizationValueByLocale, type LocalizedValueStatus, type LocalizedValueUpdate, ManagedCollection, type ManagedCollectionField, type ManagedCollectionFieldInput, type ManagedCollectionItemInput, type Mode, type MultiCollectionReferenceControl, MultiCollectionReferenceField, type NodeAttributeKey, type NodeId, type NodeRuntimeErrorResult, type NumberControl, NumberField, NumberVariable, type ObjectControl, type Overflow, type Ownership, type PaddingControl, type PageScopeControl, type Position, type ProjectInfo, type ProtectedMethod, type Publish, type PublishInfo, type PublishResult, RadialGradient, type Rect$1 as Rect, Redirect, type RedirectInput, SVGNode, type ScreenshotOptions, type ScreenshotResult, type ScrollSectionControl, type SetLocalizationDataResult, type ShadowControl, type ShowProgressOnInstancesAttributes, type StackAlignment, type StackDirection, type StackDistribution, type StackLayout, type StringControl, StringField, StringVariable, type SupportedLinkRelValue, type TextAlignment, type TextDecoration, TextNode, TextStyle, type TextStyleBreakpoint, type TextStyleTag, type TextTransform, type TrackingIdControl, type TraitVariant, type TraitVariantData, type TraitVariantNode, type TransitionControl, type TypecheckDiagnostic, UnsupportedComputedValue, UnsupportedField, UnsupportedVariable, type UpdateFieldAttributes, type User, type Variable, VectorSet, type VectorSetData, VectorSetItem, type VectorSetItemControl, type VectorSetItemData, VectorSetItemNode, type VectorSetItemVariable, VectorSetNode, WebPageNode, type WidthConstraint, type WidthLength, type WithAspectRatioTrait, type WithBackgroundColorTrait, type WithBackgroundGradientTrait, type WithBackgroundImageTrait, type WithBorderRadiusTrait, type WithBorderTrait, type WithBreakpointTrait, type WithComponentInfoTrait, type WithComponentVariantTrait, type WithControlAttributesTrait, type WithFontTrait, type WithGridItemTrait, type WithIdTrait, type WithImageRenderingTrait, type WithInlineTextStyleTrait, type WithLayoutTrait, type WithLinkTrait, type WithLockedTrait, type WithNameTrait, type WithNullableComponentInfoTrait, type WithOpacityTrait, type WithOverflowTrait, type WithPinsTrait, type WithPositionTrait, type WithReplicaInfoTrait, type WithRequiredComponentInfoTrait, type WithRotationTrait, type WithSVGTrait, type WithSizeConstraintsTrait, type WithSizeTrait, type WithTextTruncationTrait, type WithVisibleTrait, type WithWebPageInfoTrait, type WithZIndexTrait, configure, connect, framer, hasGridLayout, hasStackLayout, isBreakpoint, isCodeFileComponentExport, isCodeFileOverrideExport, isColorStyle, isComponentGestureVariant, isComponentInstanceNode, isComponentNode, isComponentVariable, isComponentVariant, isComputedValue, isDesignPageNode, isField, isFileAsset, isFrameNode, isImageAsset, isRetryableError, isSVGNode, isTextNode, isTextStyle, isVariable, isVectorSetItemNode, isVectorSetNode, isWebPageNode, supportsAspectRatio, supportsBackgroundColor, supportsBackgroundColorData, supportsBackgroundGradient, supportsBackgroundGradientData, supportsBackgroundImage, supportsBackgroundImageData, supportsBorder, supportsBorderRadius, supportsBreakpoint, supportsComponentInfo, supportsComponentVariant, supportsFont, supportsFontData, supportsImageRendering, supportsInlineTextStyle, supportsInlineTextStyleData, supportsLayout, supportsLink, supportsLocked, supportsName, supportsOpacity, supportsOverflow, supportsPins, supportsPosition, supportsRotation, supportsSVG, supportsSize, supportsSizeConstraints, supportsTextTruncation, supportsVisible, supportsZIndex, withConnection };