framer-api 0.1.4 → 0.1.6
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/LICENSE +21 -0
- package/dist/index.d.ts +950 -429
- package/dist/index.js +6 -10
- package/package.json +10 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import
|
|
2
|
+
import * as CSS from 'csstype';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This alias takes a type as its argument and returns a new type that has the same properties as
|
|
@@ -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;
|
|
@@ -292,6 +360,23 @@ interface SetLocalizationDataResult {
|
|
|
292
360
|
};
|
|
293
361
|
}
|
|
294
362
|
|
|
363
|
+
type Marshaled<T> = T extends {
|
|
364
|
+
[$framerInternal.marshal]: () => unknown;
|
|
365
|
+
} ? ReturnType<T[typeof $framerInternal.marshal]> : T extends string & {} ? T : T extends number & {} ? T : T extends object ? {
|
|
366
|
+
[K in keyof T]: Marshaled<T[K]>;
|
|
367
|
+
} : T;
|
|
368
|
+
|
|
369
|
+
declare enum CSSUnit {
|
|
370
|
+
Pixel = "px",
|
|
371
|
+
Rem = "rem",
|
|
372
|
+
Em = "em",
|
|
373
|
+
Percentage = "%",
|
|
374
|
+
Fraction = "fr",
|
|
375
|
+
ViewportWidth = "vw",
|
|
376
|
+
ViewportHeight = "vh"
|
|
377
|
+
}
|
|
378
|
+
type CSSDimension<U extends CSSUnit> = `${number}${U}`;
|
|
379
|
+
|
|
295
380
|
/**
|
|
296
381
|
* The opposite of Partial, can't omit it. Useful for making sure that you don't forget to handle a
|
|
297
382
|
* new property in all cases where objects are built.
|
|
@@ -308,25 +393,6 @@ type NullablePartialRecord<T> = Partial<NullableRecord<T>>;
|
|
|
308
393
|
declare const classKey: "__class";
|
|
309
394
|
type ClassKey = typeof classKey;
|
|
310
395
|
|
|
311
|
-
type ComputedValue = UnsupportedComputedValue;
|
|
312
|
-
declare abstract class ComputedValueBase {
|
|
313
|
-
abstract readonly type: typeof unsupportedComputedValueType;
|
|
314
|
-
}
|
|
315
|
-
declare const unsupportedComputedValueClass = "UnsupportedComputedValue";
|
|
316
|
-
declare const unsupportedComputedValueType = "unsupported";
|
|
317
|
-
interface WithUnsupportedComputedValueClass {
|
|
318
|
-
[classKey]: typeof unsupportedComputedValueClass;
|
|
319
|
-
}
|
|
320
|
-
type UnsupportedComputedValueData = WithUnsupportedComputedValueClass;
|
|
321
|
-
declare class UnsupportedComputedValue extends ComputedValueBase {
|
|
322
|
-
#private;
|
|
323
|
-
readonly type = "unsupported";
|
|
324
|
-
constructor(data: UnsupportedComputedValueData);
|
|
325
|
-
static [$framerInternal.unmarshal](_: PluginEngine, data: UnsupportedComputedValueData): UnsupportedComputedValue;
|
|
326
|
-
[$framerInternal.marshal](): UnsupportedComputedValueData;
|
|
327
|
-
}
|
|
328
|
-
declare function isComputedValue(value: unknown): value is ComputedValueBase;
|
|
329
|
-
|
|
330
396
|
declare const fontClassDiscriminator = "Font";
|
|
331
397
|
type FontSelector = string;
|
|
332
398
|
interface FontData {
|
|
@@ -358,7 +424,10 @@ declare const fontWeights: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900
|
|
|
358
424
|
* - `900` - Black (Heavy)
|
|
359
425
|
* */
|
|
360
426
|
type FontWeight = (typeof fontWeights)[number];
|
|
361
|
-
/**
|
|
427
|
+
/**
|
|
428
|
+
* A font available in the project, including custom uploaded fonts.
|
|
429
|
+
* @category canvas
|
|
430
|
+
*/
|
|
362
431
|
declare class Font {
|
|
363
432
|
/** An identifier used internally for differentiating fonts. */
|
|
364
433
|
readonly selector: string;
|
|
@@ -383,17 +452,6 @@ declare class Font {
|
|
|
383
452
|
[$framerInternal.marshal](): FontData;
|
|
384
453
|
}
|
|
385
454
|
|
|
386
|
-
declare enum CSSUnit {
|
|
387
|
-
Pixel = "px",
|
|
388
|
-
Rem = "rem",
|
|
389
|
-
Em = "em",
|
|
390
|
-
Percentage = "%",
|
|
391
|
-
Fraction = "fr",
|
|
392
|
-
ViewportWidth = "vw",
|
|
393
|
-
ViewportHeight = "vh"
|
|
394
|
-
}
|
|
395
|
-
type CSSDimension<U extends CSSUnit> = `${number}${U}`;
|
|
396
|
-
|
|
397
455
|
type TextNodeTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p";
|
|
398
456
|
type TextTransform = "none" | "inherit" | "capitalize" | "uppercase" | "lowercase";
|
|
399
457
|
type TextAlignment = "left" | "center" | "right" | "justify";
|
|
@@ -404,6 +462,29 @@ interface AddTextOptions {
|
|
|
404
462
|
tag: TextNodeTag;
|
|
405
463
|
}
|
|
406
464
|
|
|
465
|
+
type ComputedValue = UnsupportedComputedValue;
|
|
466
|
+
declare abstract class ComputedValueBase {
|
|
467
|
+
abstract readonly type: typeof unsupportedComputedValueType;
|
|
468
|
+
}
|
|
469
|
+
declare const unsupportedComputedValueClass = "UnsupportedComputedValue";
|
|
470
|
+
declare const unsupportedComputedValueType = "unsupported";
|
|
471
|
+
interface WithUnsupportedComputedValueClass {
|
|
472
|
+
[classKey]: typeof unsupportedComputedValueClass;
|
|
473
|
+
}
|
|
474
|
+
type UnsupportedComputedValueData = WithUnsupportedComputedValueClass;
|
|
475
|
+
/**
|
|
476
|
+
* A computed value type not yet supported by the plugin API.
|
|
477
|
+
* @category canvas
|
|
478
|
+
*/
|
|
479
|
+
declare class UnsupportedComputedValue extends ComputedValueBase {
|
|
480
|
+
#private;
|
|
481
|
+
readonly type = "unsupported";
|
|
482
|
+
constructor(data: UnsupportedComputedValueData);
|
|
483
|
+
static [$framerInternal.unmarshal](_: PluginEngine, data: UnsupportedComputedValueData): UnsupportedComputedValue;
|
|
484
|
+
[$framerInternal.marshal](): UnsupportedComputedValueData;
|
|
485
|
+
}
|
|
486
|
+
declare function isComputedValue(value: unknown): value is ComputedValueBase;
|
|
487
|
+
|
|
407
488
|
interface WithKey {
|
|
408
489
|
key: string;
|
|
409
490
|
}
|
|
@@ -508,7 +589,7 @@ interface LinkRelControl extends ControlBase {
|
|
|
508
589
|
type: "linkRel";
|
|
509
590
|
value?: readonly Rel[] | UnsupportedVariable | undefined;
|
|
510
591
|
}
|
|
511
|
-
type FontStyle = Pick<
|
|
592
|
+
type FontStyle = Pick<CSS.Properties<string | number>, "fontFamily" | "fontWeight" | "fontStyle" | "fontSize" | "lineHeight" | "textAlign" | "letterSpacing" | "fontFeatureSettings">;
|
|
512
593
|
interface FontControl extends ControlBase {
|
|
513
594
|
type: "font";
|
|
514
595
|
value?: FontStyle | undefined;
|
|
@@ -641,6 +722,135 @@ interface WithTypedControlsTrait {
|
|
|
641
722
|
readonly typedControls: Marshaled<Record<string, Control>>;
|
|
642
723
|
}
|
|
643
724
|
|
|
725
|
+
interface ColorStopData {
|
|
726
|
+
color: ColorStyleData | string;
|
|
727
|
+
position: number;
|
|
728
|
+
}
|
|
729
|
+
interface BaseGradientData {
|
|
730
|
+
stops: readonly ColorStopData[];
|
|
731
|
+
}
|
|
732
|
+
declare const linearGradientType: "LinearGradient";
|
|
733
|
+
type LinearGradientType = typeof linearGradientType;
|
|
734
|
+
interface LinearGradientData extends BaseGradientData {
|
|
735
|
+
[classKey]: LinearGradientType;
|
|
736
|
+
angle: number;
|
|
737
|
+
}
|
|
738
|
+
declare const radialGradientType: "RadialGradient";
|
|
739
|
+
type RadialGradientType = typeof radialGradientType;
|
|
740
|
+
interface RadialGradientData extends BaseGradientData {
|
|
741
|
+
[classKey]: RadialGradientType;
|
|
742
|
+
width: CSSDimension<CSSUnit.Percentage>;
|
|
743
|
+
height: CSSDimension<CSSUnit.Percentage>;
|
|
744
|
+
x: CSSDimension<CSSUnit.Percentage>;
|
|
745
|
+
y: CSSDimension<CSSUnit.Percentage>;
|
|
746
|
+
}
|
|
747
|
+
declare const conicGradientType: "ConicGradient";
|
|
748
|
+
type ConicGradientType = typeof conicGradientType;
|
|
749
|
+
interface ConicGradientData extends BaseGradientData {
|
|
750
|
+
[classKey]: ConicGradientType;
|
|
751
|
+
angle: number;
|
|
752
|
+
x: CSSDimension<CSSUnit.Percentage>;
|
|
753
|
+
y: CSSDimension<CSSUnit.Percentage>;
|
|
754
|
+
}
|
|
755
|
+
type GradientData = LinearGradientData | RadialGradientData | ConicGradientData;
|
|
756
|
+
interface ColorStop {
|
|
757
|
+
/** CSS color */
|
|
758
|
+
color: ColorStyle | string;
|
|
759
|
+
/** 0-1 */
|
|
760
|
+
position: number;
|
|
761
|
+
}
|
|
762
|
+
interface UnmarshaledGradientBase {
|
|
763
|
+
stops: readonly ColorStop[];
|
|
764
|
+
}
|
|
765
|
+
interface UnmarshaledLinearGradient extends UnmarshaledGradientBase {
|
|
766
|
+
[classKey]: LinearGradientType;
|
|
767
|
+
angle: number;
|
|
768
|
+
}
|
|
769
|
+
interface UnmarshaledRadialGradient extends UnmarshaledGradientBase {
|
|
770
|
+
[classKey]: RadialGradientType;
|
|
771
|
+
width: CSSDimension<CSSUnit.Percentage>;
|
|
772
|
+
height: CSSDimension<CSSUnit.Percentage>;
|
|
773
|
+
x: CSSDimension<CSSUnit.Percentage>;
|
|
774
|
+
y: CSSDimension<CSSUnit.Percentage>;
|
|
775
|
+
}
|
|
776
|
+
interface UnmarshaledConicGradient extends UnmarshaledGradientBase {
|
|
777
|
+
[classKey]: ConicGradientType;
|
|
778
|
+
angle: number;
|
|
779
|
+
x: CSSDimension<CSSUnit.Percentage>;
|
|
780
|
+
y: CSSDimension<CSSUnit.Percentage>;
|
|
781
|
+
}
|
|
782
|
+
type UnmarshaledGradient = UnmarshaledLinearGradient | UnmarshaledRadialGradient | UnmarshaledConicGradient;
|
|
783
|
+
type UnmarshaledGradientAttributes = Omit<UnmarshaledGradient, ClassKey>;
|
|
784
|
+
type ExtractUnmarshaledGradientAttributes<T extends {
|
|
785
|
+
[classKey]: UnmarshaledGradient[ClassKey];
|
|
786
|
+
}> = Omit<Extract<UnmarshaledGradient, {
|
|
787
|
+
[classKey]: T[ClassKey];
|
|
788
|
+
}>, ClassKey>;
|
|
789
|
+
declare abstract class GradientBase {
|
|
790
|
+
#private;
|
|
791
|
+
abstract readonly [classKey]: UnmarshaledGradient[ClassKey];
|
|
792
|
+
/** Color stops with position */
|
|
793
|
+
get stops(): readonly ColorStop[];
|
|
794
|
+
constructor(unmarshaledAttributes: UnmarshaledGradientAttributes);
|
|
795
|
+
cloneWithAttributes(attributes: Partial<ExtractUnmarshaledGradientAttributes<typeof this>>): typeof this;
|
|
796
|
+
}
|
|
797
|
+
type UnmarshaledLinearGradientAttributes = Omit<UnmarshaledLinearGradient, ClassKey>;
|
|
798
|
+
/**
|
|
799
|
+
* A linear gradient with two or more color stops.
|
|
800
|
+
* @category canvas
|
|
801
|
+
*/
|
|
802
|
+
declare class LinearGradient extends GradientBase {
|
|
803
|
+
#private;
|
|
804
|
+
readonly [classKey]: "LinearGradient";
|
|
805
|
+
/** 0-360 */
|
|
806
|
+
get angle(): number;
|
|
807
|
+
constructor(unmarshaledAttributes: UnmarshaledLinearGradientAttributes);
|
|
808
|
+
static [$framerInternal.unmarshal](engine: PluginEngine, data: LinearGradientData): LinearGradient;
|
|
809
|
+
[$framerInternal.marshal](): LinearGradientData;
|
|
810
|
+
toCSS(): string;
|
|
811
|
+
}
|
|
812
|
+
type UnmarshaledRadialGradientAttributes = Omit<UnmarshaledRadialGradient, ClassKey>;
|
|
813
|
+
/**
|
|
814
|
+
* A radial gradient with two or more color stops.
|
|
815
|
+
* @category canvas
|
|
816
|
+
*/
|
|
817
|
+
declare class RadialGradient extends GradientBase {
|
|
818
|
+
#private;
|
|
819
|
+
readonly [classKey]: "RadialGradient";
|
|
820
|
+
/** Relative width */
|
|
821
|
+
get width(): CSSDimension<CSSUnit.Percentage>;
|
|
822
|
+
/** Relative height */
|
|
823
|
+
get height(): CSSDimension<CSSUnit.Percentage>;
|
|
824
|
+
/** Relative horizontal position */
|
|
825
|
+
get x(): CSSDimension<CSSUnit.Percentage>;
|
|
826
|
+
/** Relative vertical position */
|
|
827
|
+
get y(): CSSDimension<CSSUnit.Percentage>;
|
|
828
|
+
constructor(unmarshaledAttributes: UnmarshaledRadialGradientAttributes);
|
|
829
|
+
static [$framerInternal.unmarshal](engine: PluginEngine, data: RadialGradientData): RadialGradient;
|
|
830
|
+
[$framerInternal.marshal](): RadialGradientData;
|
|
831
|
+
toCSS(): string;
|
|
832
|
+
}
|
|
833
|
+
type UnmarshaledConicGradientAttributes = Omit<UnmarshaledConicGradient, ClassKey>;
|
|
834
|
+
/**
|
|
835
|
+
* A conic (angular) gradient with two or more color stops.
|
|
836
|
+
* @category canvas
|
|
837
|
+
*/
|
|
838
|
+
declare class ConicGradient extends GradientBase {
|
|
839
|
+
#private;
|
|
840
|
+
readonly [classKey]: "ConicGradient";
|
|
841
|
+
/** 0-360 */
|
|
842
|
+
get angle(): number;
|
|
843
|
+
/** Relative horizontal position */
|
|
844
|
+
get x(): CSSDimension<CSSUnit.Percentage>;
|
|
845
|
+
/** Relative vertical position */
|
|
846
|
+
get y(): CSSDimension<CSSUnit.Percentage>;
|
|
847
|
+
constructor(unmarshaledAttributes: UnmarshaledConicGradientAttributes);
|
|
848
|
+
static [$framerInternal.unmarshal](engine: PluginEngine, data: ConicGradientData): ConicGradient;
|
|
849
|
+
[$framerInternal.marshal](): ConicGradientData;
|
|
850
|
+
toCSS(): string;
|
|
851
|
+
}
|
|
852
|
+
type Gradient = LinearGradient | RadialGradient | ConicGradient;
|
|
853
|
+
|
|
644
854
|
type NodeId = string;
|
|
645
855
|
interface WithIdTrait {
|
|
646
856
|
readonly id: NodeId;
|
|
@@ -670,6 +880,7 @@ interface IsComponentGestureVariant extends IsComponentVariant {
|
|
|
670
880
|
interface WithNameTrait {
|
|
671
881
|
/**
|
|
672
882
|
* The name of the node displayed in the layers panel.
|
|
883
|
+
*
|
|
673
884
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode,
|
|
674
885
|
* ComponentNode, VectorSetNode, VectorSetItemNode.
|
|
675
886
|
*/
|
|
@@ -677,14 +888,18 @@ interface WithNameTrait {
|
|
|
677
888
|
}
|
|
678
889
|
interface WithVisibleTrait {
|
|
679
890
|
/**
|
|
680
|
-
* Whether the node is visible on the canvas.
|
|
891
|
+
* Whether the node is visible on the canvas.
|
|
892
|
+
*
|
|
893
|
+
* Defaults to `true`.
|
|
681
894
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
682
895
|
*/
|
|
683
896
|
readonly visible: boolean;
|
|
684
897
|
}
|
|
685
898
|
interface WithLockedTrait {
|
|
686
899
|
/**
|
|
687
|
-
* Whether the node is locked for editing.
|
|
900
|
+
* Whether the node is locked for editing.
|
|
901
|
+
*
|
|
902
|
+
* Defaults to `false`.
|
|
688
903
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
689
904
|
*/
|
|
690
905
|
readonly locked: boolean;
|
|
@@ -702,6 +917,7 @@ interface IsBreakpoint {
|
|
|
702
917
|
interface WithBackgroundColorTrait<T extends TraitVariant> {
|
|
703
918
|
/**
|
|
704
919
|
* Background color in RGBA format (e.g. `rgba(242, 59, 57, 1)`) or as a {@link ColorStyle} instance.
|
|
920
|
+
*
|
|
705
921
|
* Setting to `null` removes the background color. Supported by FrameNode.
|
|
706
922
|
*/
|
|
707
923
|
readonly backgroundColor: (T extends TraitVariantData ? ColorStyleData : ColorStyle) | string | null;
|
|
@@ -716,22 +932,26 @@ interface WithBackgroundGradientTrait<T extends TraitVariant> {
|
|
|
716
932
|
}
|
|
717
933
|
interface WithRotationTrait {
|
|
718
934
|
/**
|
|
719
|
-
* Rotation angle in degrees.
|
|
720
|
-
*
|
|
935
|
+
* Rotation angle in degrees.
|
|
936
|
+
*
|
|
937
|
+
* Defaults to `0`. Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
|
|
721
938
|
*/
|
|
722
939
|
readonly rotation: number;
|
|
723
940
|
}
|
|
724
941
|
interface WithOpacityTrait {
|
|
725
942
|
/**
|
|
726
|
-
* Opacity of the node, from `0` (fully transparent) to `1` (fully opaque).
|
|
727
|
-
*
|
|
943
|
+
* Opacity of the node, from `0` (fully transparent) to `1` (fully opaque).
|
|
944
|
+
*
|
|
945
|
+
* Defaults to `1`. Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode.
|
|
728
946
|
*/
|
|
729
947
|
readonly opacity: number;
|
|
730
948
|
}
|
|
731
949
|
type BorderRadius = CSSDimension<CSSUnit.Percentage | CSSUnit.Pixel> | `${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>}` | null;
|
|
732
950
|
interface WithBorderRadiusTrait {
|
|
733
951
|
/**
|
|
734
|
-
* Border radius for rounded corners.
|
|
952
|
+
* Border radius for rounded corners.
|
|
953
|
+
*
|
|
954
|
+
* Single value (e.g. `"10px"` or `"50%"`)
|
|
735
955
|
* or per-corner (e.g. `"10px 20px 30px 40px"` for top-left, top-right, bottom-right, bottom-left).
|
|
736
956
|
* Setting to `null` removes the border radius. Supported by FrameNode.
|
|
737
957
|
*/
|
|
@@ -747,6 +967,7 @@ interface Border {
|
|
|
747
967
|
interface WithBorderTrait<T extends TraitVariant> {
|
|
748
968
|
/**
|
|
749
969
|
* Border properties including width, color, and style.
|
|
970
|
+
*
|
|
750
971
|
* Styles: `"solid"`, `"dashed"`, `"dotted"`, `"double"`.
|
|
751
972
|
* Width can be per-side (e.g. `"1px 2px 3px 4px"`).
|
|
752
973
|
* Setting to `null` removes the border. Supported by FrameNode.
|
|
@@ -758,6 +979,7 @@ type ImageRendering = "auto" | "pixelated";
|
|
|
758
979
|
interface WithImageRenderingTrait {
|
|
759
980
|
/**
|
|
760
981
|
* How images should be rendered when scaled: `"auto"` or `"pixelated"`.
|
|
982
|
+
*
|
|
761
983
|
* Only applies to frames with image backgrounds.
|
|
762
984
|
* Setting to `null` uses default rendering. Supported by FrameNode.
|
|
763
985
|
*/
|
|
@@ -769,24 +991,28 @@ type AxisOverflow = Overflow;
|
|
|
769
991
|
interface WithOverflowTrait {
|
|
770
992
|
/**
|
|
771
993
|
* Controls how content that exceeds the element's box is handled.
|
|
994
|
+
*
|
|
772
995
|
* Setting to `null` removes the overflow property. Will overwrite `overflowX` or `overflowY`.
|
|
773
996
|
* Supported by FrameNode, TextNode.
|
|
774
997
|
*/
|
|
775
998
|
readonly overflow: Overflow | null;
|
|
776
999
|
/**
|
|
777
1000
|
* Controls horizontal overflow behavior.
|
|
1001
|
+
*
|
|
778
1002
|
* Setting to `null` removes the overflow X property. Supported by FrameNode, TextNode.
|
|
779
1003
|
*/
|
|
780
1004
|
readonly overflowX: AxisOverflow | null;
|
|
781
1005
|
/**
|
|
782
1006
|
* Controls vertical overflow behavior.
|
|
1007
|
+
*
|
|
783
1008
|
* Setting to `null` removes the overflow Y property. Supported by FrameNode, TextNode.
|
|
784
1009
|
*/
|
|
785
1010
|
readonly overflowY: AxisOverflow | null;
|
|
786
1011
|
}
|
|
787
1012
|
interface WithTextTruncationTrait {
|
|
788
1013
|
/**
|
|
789
|
-
* Maximum number of lines
|
|
1014
|
+
* Maximum number of lines before text is truncated with an ellipsis.
|
|
1015
|
+
*
|
|
790
1016
|
* Must be used alongside `overflow`. Setting to `null` removes the text truncation property.
|
|
791
1017
|
* Supported by TextNode.
|
|
792
1018
|
*/
|
|
@@ -794,7 +1020,9 @@ interface WithTextTruncationTrait {
|
|
|
794
1020
|
}
|
|
795
1021
|
interface WithZIndexTrait {
|
|
796
1022
|
/**
|
|
797
|
-
* Stacking order of positioned elements.
|
|
1023
|
+
* Stacking order of positioned elements.
|
|
1024
|
+
*
|
|
1025
|
+
* Higher values appear on top of lower values.
|
|
798
1026
|
* Setting to `null` removes the z-index property. Supported by FrameNode, TextNode.
|
|
799
1027
|
*/
|
|
800
1028
|
readonly zIndex: number | null;
|
|
@@ -816,18 +1044,44 @@ interface WithWebPageInfoTrait {
|
|
|
816
1044
|
/** Collection ID for the web page. Supported by WebPageNode. */
|
|
817
1045
|
readonly collectionId: string | null;
|
|
818
1046
|
}
|
|
1047
|
+
/** Supported rel values for links. See https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/rel */
|
|
1048
|
+
type SupportedLinkRelValue = "nofollow" | "noreferrer" | "me" | "ugc" | "sponsored";
|
|
819
1049
|
interface WithLinkTrait {
|
|
820
1050
|
/**
|
|
821
|
-
* URL or internal page link.
|
|
1051
|
+
* URL or internal page link.
|
|
1052
|
+
*
|
|
1053
|
+
* External: `"https://example.com"`, internal: `"/about"`,
|
|
822
1054
|
* email: `"mailto:user@example.com"`. Setting to `null` removes the link.
|
|
823
1055
|
* Supported by FrameNode, TextNode.
|
|
824
1056
|
*/
|
|
825
1057
|
readonly link: string | null;
|
|
826
1058
|
/**
|
|
827
|
-
* Whether to open the link in a new tab.
|
|
1059
|
+
* Whether to open the link in a new tab.
|
|
1060
|
+
*
|
|
1061
|
+
* Default is automatically determined based on link type.
|
|
828
1062
|
* Supported by FrameNode, TextNode.
|
|
829
1063
|
*/
|
|
830
1064
|
readonly linkOpenInNewTab: boolean | null;
|
|
1065
|
+
/**
|
|
1066
|
+
* Whether to use smooth scrolling for scroll-to-section links.
|
|
1067
|
+
* Supported by FrameNode, TextNode.
|
|
1068
|
+
*/
|
|
1069
|
+
readonly linkSmoothScroll: boolean | null;
|
|
1070
|
+
/**
|
|
1071
|
+
* Click tracking identifier for analytics.
|
|
1072
|
+
* Supported by FrameNode, TextNode.
|
|
1073
|
+
*/
|
|
1074
|
+
readonly linkClickTrackingId: string | null;
|
|
1075
|
+
/**
|
|
1076
|
+
* Array of rel attribute values for the link.
|
|
1077
|
+
* Supported by FrameNode, TextNode.
|
|
1078
|
+
*/
|
|
1079
|
+
readonly linkRelValues: readonly SupportedLinkRelValue[] | null;
|
|
1080
|
+
/**
|
|
1081
|
+
* Whether to preserve URL query parameters when navigating.
|
|
1082
|
+
* Supported by FrameNode, TextNode.
|
|
1083
|
+
*/
|
|
1084
|
+
readonly linkPreserveParams: boolean | null;
|
|
831
1085
|
}
|
|
832
1086
|
type ControlAttributes = Record<string, unknown>;
|
|
833
1087
|
interface WithControlAttributesTrait {
|
|
@@ -857,36 +1111,42 @@ type FitImage = "fit-image";
|
|
|
857
1111
|
interface WithPinsTrait {
|
|
858
1112
|
/**
|
|
859
1113
|
* Distance from top edge when using absolute/fixed positioning.
|
|
1114
|
+
*
|
|
860
1115
|
* Only applies when position is not `"relative"`.
|
|
861
1116
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
862
1117
|
*/
|
|
863
1118
|
top: CSSDimension<CSSUnit.Pixel> | null;
|
|
864
1119
|
/**
|
|
865
1120
|
* Distance from right edge when using absolute/fixed positioning.
|
|
1121
|
+
*
|
|
866
1122
|
* Only applies when position is not `"relative"`.
|
|
867
1123
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
868
1124
|
*/
|
|
869
1125
|
right: CSSDimension<CSSUnit.Pixel> | null;
|
|
870
1126
|
/**
|
|
871
1127
|
* Distance from bottom edge when using absolute/fixed positioning.
|
|
1128
|
+
*
|
|
872
1129
|
* Only applies when position is not `"relative"`.
|
|
873
1130
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
874
1131
|
*/
|
|
875
1132
|
bottom: CSSDimension<CSSUnit.Pixel> | null;
|
|
876
1133
|
/**
|
|
877
1134
|
* Distance from left edge when using absolute/fixed positioning.
|
|
1135
|
+
*
|
|
878
1136
|
* Only applies when position is not `"relative"`.
|
|
879
1137
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
880
1138
|
*/
|
|
881
1139
|
left: CSSDimension<CSSUnit.Pixel> | null;
|
|
882
1140
|
/**
|
|
883
1141
|
* Center anchor horizontal position as percentage (e.g. `"50%"`).
|
|
1142
|
+
*
|
|
884
1143
|
* Used when pins are not set.
|
|
885
1144
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
886
1145
|
*/
|
|
887
1146
|
centerX: CSSDimension<CSSUnit.Percentage> | null;
|
|
888
1147
|
/**
|
|
889
1148
|
* Center anchor vertical position as percentage (e.g. `"50%"`).
|
|
1149
|
+
*
|
|
890
1150
|
* Used when pins are not set.
|
|
891
1151
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
892
1152
|
*/
|
|
@@ -897,12 +1157,16 @@ type WidthLength = Length | FitContent | FitImage;
|
|
|
897
1157
|
type HeightLength = Length | FitContent | CSSDimension<CSSUnit.ViewportHeight> | FitImage;
|
|
898
1158
|
interface WithSizeTrait {
|
|
899
1159
|
/**
|
|
900
|
-
* Width of the node.
|
|
1160
|
+
* Width of the node.
|
|
1161
|
+
*
|
|
1162
|
+
* Accepts pixel, percentage, fraction values, or `"fit-content"`.
|
|
901
1163
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
902
1164
|
*/
|
|
903
1165
|
width: WidthLength | null;
|
|
904
1166
|
/**
|
|
905
|
-
* Height of the node.
|
|
1167
|
+
* Height of the node.
|
|
1168
|
+
*
|
|
1169
|
+
* Accepts pixel, percentage, fraction, viewport-height values, or `"fit-content"`.
|
|
906
1170
|
* Supported by FrameNode, TextNode, SVGNode, ComponentInstanceNode, VectorSetItemNode.
|
|
907
1171
|
*/
|
|
908
1172
|
height: HeightLength | null;
|
|
@@ -910,6 +1174,7 @@ interface WithSizeTrait {
|
|
|
910
1174
|
interface WithAspectRatioTrait {
|
|
911
1175
|
/**
|
|
912
1176
|
* Width-to-height ratio (e.g. `1.5` for 3:2).
|
|
1177
|
+
*
|
|
913
1178
|
* Setting to `null` removes the aspect ratio constraint.
|
|
914
1179
|
* Supported by FrameNode, ComponentInstanceNode.
|
|
915
1180
|
*/
|
|
@@ -929,8 +1194,9 @@ interface WithSizeConstraintsTrait {
|
|
|
929
1194
|
}
|
|
930
1195
|
interface WithInlineTextStyleTrait<T extends TraitVariant> {
|
|
931
1196
|
/**
|
|
932
|
-
* Apply a text style preset.
|
|
933
|
-
*
|
|
1197
|
+
* Apply a text style preset.
|
|
1198
|
+
*
|
|
1199
|
+
* Setting to `null` removes the text style. Supported by TextNode.
|
|
934
1200
|
*/
|
|
935
1201
|
readonly inlineTextStyle: (T extends TraitVariantData ? TextStyleData : TextStyle) | null;
|
|
936
1202
|
}
|
|
@@ -979,18 +1245,24 @@ interface GridLayout {
|
|
|
979
1245
|
}
|
|
980
1246
|
interface WithLayoutTrait extends StackLayout, GridLayout {
|
|
981
1247
|
/**
|
|
982
|
-
* Enables stack or grid layout.
|
|
1248
|
+
* Enables stack or grid layout.
|
|
1249
|
+
*
|
|
1250
|
+
* Setting to `null` disables any applied layout.
|
|
983
1251
|
* Operation is deferred and applied after the current update cycle. Supported by FrameNode.
|
|
984
1252
|
*/
|
|
985
1253
|
layout: LayoutType | null;
|
|
986
1254
|
/**
|
|
987
|
-
* Spacing between items in a layout.
|
|
1255
|
+
* Spacing between items in a layout.
|
|
1256
|
+
*
|
|
1257
|
+
* Single value (e.g. `"10px"`) applies to both axes;
|
|
988
1258
|
* two values (e.g. `"10px 20px"`) set horizontal and vertical separately.
|
|
989
1259
|
* Only works with layout enabled. Supported by FrameNode.
|
|
990
1260
|
*/
|
|
991
1261
|
gap: CSSDimension<CSSUnit.Pixel> | `${CSSDimension<CSSUnit.Pixel>} ${CSSDimension<CSSUnit.Pixel>}` | null;
|
|
992
1262
|
/**
|
|
993
|
-
* Inner spacing of a container with layout.
|
|
1263
|
+
* Inner spacing of a container with layout.
|
|
1264
|
+
*
|
|
1265
|
+
* Single value (e.g. `"10px"`) applies to all sides;
|
|
994
1266
|
* four values (e.g. `"10px 20px 30px 40px"`) set top, right, bottom, left.
|
|
995
1267
|
* Only works with layout enabled. Supported by FrameNode.
|
|
996
1268
|
*/
|
|
@@ -999,17 +1271,41 @@ interface WithLayoutTrait extends StackLayout, GridLayout {
|
|
|
999
1271
|
type GridItemAlignment = "start" | "center" | "end";
|
|
1000
1272
|
type GridItemColumnSpan = number | "all";
|
|
1001
1273
|
interface WithGridItemTrait {
|
|
1002
|
-
/**
|
|
1274
|
+
/**
|
|
1275
|
+
* Whether to fill the grid cell width.
|
|
1276
|
+
*
|
|
1277
|
+
* For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode.
|
|
1278
|
+
*/
|
|
1003
1279
|
gridItemFillCellWidth: boolean | null;
|
|
1004
|
-
/**
|
|
1280
|
+
/**
|
|
1281
|
+
* Whether to fill the grid cell height.
|
|
1282
|
+
*
|
|
1283
|
+
* For nodes inside a grid container. Defaults to `true`. Supported by FrameNode, TextNode.
|
|
1284
|
+
*/
|
|
1005
1285
|
gridItemFillCellHeight: boolean | null;
|
|
1006
|
-
/**
|
|
1286
|
+
/**
|
|
1287
|
+
* Horizontal alignment within grid cell.
|
|
1288
|
+
*
|
|
1289
|
+
* For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode.
|
|
1290
|
+
*/
|
|
1007
1291
|
gridItemHorizontalAlignment: GridItemAlignment | null;
|
|
1008
|
-
/**
|
|
1292
|
+
/**
|
|
1293
|
+
* Vertical alignment within grid cell.
|
|
1294
|
+
*
|
|
1295
|
+
* For nodes inside a grid container. Defaults to `"center"`. Supported by FrameNode, TextNode.
|
|
1296
|
+
*/
|
|
1009
1297
|
gridItemVerticalAlignment: GridItemAlignment | null;
|
|
1010
|
-
/**
|
|
1298
|
+
/**
|
|
1299
|
+
* Number of columns to span, or `"all"` for all columns.
|
|
1300
|
+
*
|
|
1301
|
+
* For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode.
|
|
1302
|
+
*/
|
|
1011
1303
|
gridItemColumnSpan: GridItemColumnSpan | null;
|
|
1012
|
-
/**
|
|
1304
|
+
/**
|
|
1305
|
+
* Number of rows to span.
|
|
1306
|
+
*
|
|
1307
|
+
* For nodes inside a grid container. Defaults to `1`. Supported by FrameNode, TextNode.
|
|
1308
|
+
*/
|
|
1013
1309
|
gridItemRowSpan: number | null;
|
|
1014
1310
|
}
|
|
1015
1311
|
type TraitVariant = TraitVariantData | TraitVariantNode;
|
|
@@ -1110,6 +1406,7 @@ type ColorStyleAttributes = Prettify<RequiredColorStyleAttributes & Partial<Opti
|
|
|
1110
1406
|
* // Store plugin data on a color style.
|
|
1111
1407
|
* await colorStyle.setPluginData("key", "value")
|
|
1112
1408
|
* ```
|
|
1409
|
+
* @category canvas
|
|
1113
1410
|
*/
|
|
1114
1411
|
declare class ColorStyle {
|
|
1115
1412
|
#private;
|
|
@@ -1289,6 +1586,7 @@ type TextStyleAttributes = Prettify<Partial<Omit<TextStyleData, "id" | "color" |
|
|
|
1289
1586
|
* // Remove a text style from the project.
|
|
1290
1587
|
* await textStyle.remove()
|
|
1291
1588
|
* ```
|
|
1589
|
+
* @category canvas
|
|
1292
1590
|
*/
|
|
1293
1591
|
declare class TextStyle {
|
|
1294
1592
|
#private;
|
|
@@ -1382,215 +1680,92 @@ declare class TextStyle {
|
|
|
1382
1680
|
* */
|
|
1383
1681
|
readonly paragraphSpacing: number;
|
|
1384
1682
|
constructor(engine: PluginEngine, data: TextStyleData);
|
|
1385
|
-
static [$framerInternal.unmarshal](engine: PluginEngine, data: TextStyleData): TextStyle;
|
|
1386
|
-
[$framerInternal.marshal](): TextStyleData;
|
|
1387
|
-
/**
|
|
1388
|
-
* Set the attributes of the text style. All attributes except
|
|
1389
|
-
* `breakpoints` are merged with existing values. When setting
|
|
1390
|
-
* `breakpoints`, the provided array replaces any existing breakpoints
|
|
1391
|
-
* entirely. To update breakpoints without overriding them all, iterate
|
|
1392
|
-
* over the existing breakpoints and merge them.
|
|
1393
|
-
*
|
|
1394
|
-
* @param attributes - The attributes to update.
|
|
1395
|
-
* @returns The updated text style, or `null` if the style was not found.
|
|
1396
|
-
* @throws If the number of breakpoints is bigger than the limit of 4.
|
|
1397
|
-
* @throws If any of the font families used for `boldFont`, `italicFont` and
|
|
1398
|
-
* `boldItalicFont` do not match the family of `font`.
|
|
1399
|
-
*
|
|
1400
|
-
* Use `"TextStyle.setAttributes"` to check if this method is allowed.
|
|
1401
|
-
*
|
|
1402
|
-
* @example
|
|
1403
|
-
* ```ts
|
|
1404
|
-
* // Update the color of a text style.
|
|
1405
|
-
* const textStyle = await framer.getTextStyle("text-style-id")
|
|
1406
|
-
* if (textStyle) {
|
|
1407
|
-
* await textStyle.setAttributes({
|
|
1408
|
-
* color: "rgba(242, 59, 57, 1)"
|
|
1409
|
-
* })
|
|
1410
|
-
* }
|
|
1411
|
-
*
|
|
1412
|
-
* // Replace breakpoints on a text style.
|
|
1413
|
-
* await textStyle.setAttributes({
|
|
1414
|
-
* breakpoints: [
|
|
1415
|
-
* { minWidth: 320, fontSize: "24px" }
|
|
1416
|
-
* ]
|
|
1417
|
-
* })
|
|
1418
|
-
*
|
|
1419
|
-
* // Scale font sizes across all breakpoints without losing them.
|
|
1420
|
-
* await textStyle.setAttributes({
|
|
1421
|
-
* fontSize: parseInt(textStyle.fontSize) * 0.8 + "px",
|
|
1422
|
-
* breakpoints: textStyle.breakpoints.map((bp) => ({
|
|
1423
|
-
* ...bp,
|
|
1424
|
-
* fontSize: parseInt(bp.fontSize) * 0.8 + "px"
|
|
1425
|
-
* }))
|
|
1426
|
-
* })
|
|
1427
|
-
* ```
|
|
1428
|
-
*/
|
|
1429
|
-
setAttributes(attributes: TextStyleAttributes): Promise<TextStyle | null>;
|
|
1430
|
-
/**
|
|
1431
|
-
* Get plugin data for this text style by key.
|
|
1432
|
-
*
|
|
1433
|
-
* @param key - The plugin data key.
|
|
1434
|
-
* @returns The stored value, or `null` if no data exists for the key.
|
|
1435
|
-
*/
|
|
1436
|
-
getPluginData(key: string): Promise<string | null>;
|
|
1437
|
-
/**
|
|
1438
|
-
* Set plugin data on this text style by key.
|
|
1439
|
-
*
|
|
1440
|
-
* @param key - The plugin data key.
|
|
1441
|
-
* @param value - The value to set, or `null` to remove.
|
|
1442
|
-
*
|
|
1443
|
-
* Use `"TextStyle.setPluginData"` to check if this method is allowed.
|
|
1444
|
-
*
|
|
1445
|
-
* @example
|
|
1446
|
-
* ```ts
|
|
1447
|
-
* await textStyle.setPluginData("key", "value")
|
|
1448
|
-
* ```
|
|
1449
|
-
*/
|
|
1450
|
-
setPluginData(key: string, value: string | null): Promise<void>;
|
|
1451
|
-
/**
|
|
1452
|
-
* Get all plugin data keys for this text style.
|
|
1453
|
-
*
|
|
1454
|
-
* @returns An array of all plugin data keys set on this text style.
|
|
1455
|
-
*/
|
|
1456
|
-
getPluginDataKeys(): Promise<string[]>;
|
|
1457
|
-
/**
|
|
1458
|
-
* Deletes the text style from the project. You need a reference to
|
|
1459
|
-
* the style to call this method.
|
|
1460
|
-
*
|
|
1461
|
-
* Use `"TextStyle.remove"` to check if this method is allowed.
|
|
1462
|
-
*
|
|
1463
|
-
* @example
|
|
1464
|
-
* ```ts
|
|
1465
|
-
* await textStyle.remove()
|
|
1466
|
-
* ```
|
|
1467
|
-
*/
|
|
1468
|
-
remove(): Promise<void>;
|
|
1469
|
-
}
|
|
1470
|
-
declare function isTextStyle(value: unknown): value is TextStyle;
|
|
1471
|
-
|
|
1472
|
-
interface ColorStopData {
|
|
1473
|
-
color: ColorStyleData | string;
|
|
1474
|
-
position: number;
|
|
1475
|
-
}
|
|
1476
|
-
interface BaseGradientData {
|
|
1477
|
-
stops: readonly ColorStopData[];
|
|
1478
|
-
}
|
|
1479
|
-
declare const linearGradientType: "LinearGradient";
|
|
1480
|
-
type LinearGradientType = typeof linearGradientType;
|
|
1481
|
-
interface LinearGradientData extends BaseGradientData {
|
|
1482
|
-
[classKey]: LinearGradientType;
|
|
1483
|
-
angle: number;
|
|
1484
|
-
}
|
|
1485
|
-
declare const radialGradientType: "RadialGradient";
|
|
1486
|
-
type RadialGradientType = typeof radialGradientType;
|
|
1487
|
-
interface RadialGradientData extends BaseGradientData {
|
|
1488
|
-
[classKey]: RadialGradientType;
|
|
1489
|
-
width: CSSDimension<CSSUnit.Percentage>;
|
|
1490
|
-
height: CSSDimension<CSSUnit.Percentage>;
|
|
1491
|
-
x: CSSDimension<CSSUnit.Percentage>;
|
|
1492
|
-
y: CSSDimension<CSSUnit.Percentage>;
|
|
1493
|
-
}
|
|
1494
|
-
declare const conicGradientType: "ConicGradient";
|
|
1495
|
-
type ConicGradientType = typeof conicGradientType;
|
|
1496
|
-
interface ConicGradientData extends BaseGradientData {
|
|
1497
|
-
[classKey]: ConicGradientType;
|
|
1498
|
-
angle: number;
|
|
1499
|
-
x: CSSDimension<CSSUnit.Percentage>;
|
|
1500
|
-
y: CSSDimension<CSSUnit.Percentage>;
|
|
1501
|
-
}
|
|
1502
|
-
type GradientData = LinearGradientData | RadialGradientData | ConicGradientData;
|
|
1503
|
-
interface ColorStop {
|
|
1504
|
-
/** CSS color */
|
|
1505
|
-
color: ColorStyle | string;
|
|
1506
|
-
/** 0-1 */
|
|
1507
|
-
position: number;
|
|
1508
|
-
}
|
|
1509
|
-
interface UnmarshaledGradientBase {
|
|
1510
|
-
stops: readonly ColorStop[];
|
|
1511
|
-
}
|
|
1512
|
-
interface UnmarshaledLinearGradient extends UnmarshaledGradientBase {
|
|
1513
|
-
[classKey]: LinearGradientType;
|
|
1514
|
-
angle: number;
|
|
1515
|
-
}
|
|
1516
|
-
interface UnmarshaledRadialGradient extends UnmarshaledGradientBase {
|
|
1517
|
-
[classKey]: RadialGradientType;
|
|
1518
|
-
width: CSSDimension<CSSUnit.Percentage>;
|
|
1519
|
-
height: CSSDimension<CSSUnit.Percentage>;
|
|
1520
|
-
x: CSSDimension<CSSUnit.Percentage>;
|
|
1521
|
-
y: CSSDimension<CSSUnit.Percentage>;
|
|
1522
|
-
}
|
|
1523
|
-
interface UnmarshaledConicGradient extends UnmarshaledGradientBase {
|
|
1524
|
-
[classKey]: ConicGradientType;
|
|
1525
|
-
angle: number;
|
|
1526
|
-
x: CSSDimension<CSSUnit.Percentage>;
|
|
1527
|
-
y: CSSDimension<CSSUnit.Percentage>;
|
|
1528
|
-
}
|
|
1529
|
-
type UnmarshaledGradient = UnmarshaledLinearGradient | UnmarshaledRadialGradient | UnmarshaledConicGradient;
|
|
1530
|
-
type UnmarshaledGradientAttributes = Omit<UnmarshaledGradient, ClassKey>;
|
|
1531
|
-
type ExtractUnmarshaledGradientAttributes<T extends {
|
|
1532
|
-
[classKey]: UnmarshaledGradient[ClassKey];
|
|
1533
|
-
}> = Omit<Extract<UnmarshaledGradient, {
|
|
1534
|
-
[classKey]: T[ClassKey];
|
|
1535
|
-
}>, ClassKey>;
|
|
1536
|
-
declare abstract class GradientBase {
|
|
1537
|
-
#private;
|
|
1538
|
-
abstract readonly [classKey]: UnmarshaledGradient[ClassKey];
|
|
1539
|
-
/** Color stops with position */
|
|
1540
|
-
get stops(): readonly ColorStop[];
|
|
1541
|
-
constructor(unmarshaledAttributes: UnmarshaledGradientAttributes);
|
|
1542
|
-
cloneWithAttributes(attributes: Partial<ExtractUnmarshaledGradientAttributes<typeof this>>): typeof this;
|
|
1543
|
-
}
|
|
1544
|
-
type UnmarshaledLinearGradientAttributes = Omit<UnmarshaledLinearGradient, ClassKey>;
|
|
1545
|
-
declare class LinearGradient extends GradientBase {
|
|
1546
|
-
#private;
|
|
1547
|
-
readonly [classKey]: "LinearGradient";
|
|
1548
|
-
/** 0-360 */
|
|
1549
|
-
get angle(): number;
|
|
1550
|
-
constructor(unmarshaledAttributes: UnmarshaledLinearGradientAttributes);
|
|
1551
|
-
static [$framerInternal.unmarshal](engine: PluginEngine, data: LinearGradientData): LinearGradient;
|
|
1552
|
-
[$framerInternal.marshal](): LinearGradientData;
|
|
1553
|
-
toCSS(): string;
|
|
1554
|
-
}
|
|
1555
|
-
type UnmarshaledRadialGradientAttributes = Omit<UnmarshaledRadialGradient, ClassKey>;
|
|
1556
|
-
declare class RadialGradient extends GradientBase {
|
|
1557
|
-
#private;
|
|
1558
|
-
readonly [classKey]: "RadialGradient";
|
|
1559
|
-
/** Relative width */
|
|
1560
|
-
get width(): CSSDimension<CSSUnit.Percentage>;
|
|
1561
|
-
/** Relative height */
|
|
1562
|
-
get height(): CSSDimension<CSSUnit.Percentage>;
|
|
1563
|
-
/** Relative horizontal position */
|
|
1564
|
-
get x(): CSSDimension<CSSUnit.Percentage>;
|
|
1565
|
-
/** Relative vertical position */
|
|
1566
|
-
get y(): CSSDimension<CSSUnit.Percentage>;
|
|
1567
|
-
constructor(unmarshaledAttributes: UnmarshaledRadialGradientAttributes);
|
|
1568
|
-
static [$framerInternal.unmarshal](engine: PluginEngine, data: RadialGradientData): RadialGradient;
|
|
1569
|
-
[$framerInternal.marshal](): RadialGradientData;
|
|
1570
|
-
toCSS(): string;
|
|
1571
|
-
}
|
|
1572
|
-
type UnmarshaledConicGradientAttributes = Omit<UnmarshaledConicGradient, ClassKey>;
|
|
1573
|
-
declare class ConicGradient extends GradientBase {
|
|
1574
|
-
#private;
|
|
1575
|
-
readonly [classKey]: "ConicGradient";
|
|
1576
|
-
/** 0-360 */
|
|
1577
|
-
get angle(): number;
|
|
1578
|
-
/** Relative horizontal position */
|
|
1579
|
-
get x(): CSSDimension<CSSUnit.Percentage>;
|
|
1580
|
-
/** Relative vertical position */
|
|
1581
|
-
get y(): CSSDimension<CSSUnit.Percentage>;
|
|
1582
|
-
constructor(unmarshaledAttributes: UnmarshaledConicGradientAttributes);
|
|
1583
|
-
static [$framerInternal.unmarshal](engine: PluginEngine, data: ConicGradientData): ConicGradient;
|
|
1584
|
-
[$framerInternal.marshal](): ConicGradientData;
|
|
1585
|
-
toCSS(): string;
|
|
1683
|
+
static [$framerInternal.unmarshal](engine: PluginEngine, data: TextStyleData): TextStyle;
|
|
1684
|
+
[$framerInternal.marshal](): TextStyleData;
|
|
1685
|
+
/**
|
|
1686
|
+
* Set the attributes of the text style. All attributes except
|
|
1687
|
+
* `breakpoints` are merged with existing values. When setting
|
|
1688
|
+
* `breakpoints`, the provided array replaces any existing breakpoints
|
|
1689
|
+
* entirely. To update breakpoints without overriding them all, iterate
|
|
1690
|
+
* over the existing breakpoints and merge them.
|
|
1691
|
+
*
|
|
1692
|
+
* @param attributes - The attributes to update.
|
|
1693
|
+
* @returns The updated text style, or `null` if the style was not found.
|
|
1694
|
+
* @throws If the number of breakpoints is bigger than the limit of 4.
|
|
1695
|
+
* @throws If any of the font families used for `boldFont`, `italicFont` and
|
|
1696
|
+
* `boldItalicFont` do not match the family of `font`.
|
|
1697
|
+
*
|
|
1698
|
+
* Use `"TextStyle.setAttributes"` to check if this method is allowed.
|
|
1699
|
+
*
|
|
1700
|
+
* @example
|
|
1701
|
+
* ```ts
|
|
1702
|
+
* // Update the color of a text style.
|
|
1703
|
+
* const textStyle = await framer.getTextStyle("text-style-id")
|
|
1704
|
+
* if (textStyle) {
|
|
1705
|
+
* await textStyle.setAttributes({
|
|
1706
|
+
* color: "rgba(242, 59, 57, 1)"
|
|
1707
|
+
* })
|
|
1708
|
+
* }
|
|
1709
|
+
*
|
|
1710
|
+
* // Replace breakpoints on a text style.
|
|
1711
|
+
* await textStyle.setAttributes({
|
|
1712
|
+
* breakpoints: [
|
|
1713
|
+
* { minWidth: 320, fontSize: "24px" }
|
|
1714
|
+
* ]
|
|
1715
|
+
* })
|
|
1716
|
+
*
|
|
1717
|
+
* // Scale font sizes across all breakpoints without losing them.
|
|
1718
|
+
* await textStyle.setAttributes({
|
|
1719
|
+
* fontSize: parseInt(textStyle.fontSize) * 0.8 + "px",
|
|
1720
|
+
* breakpoints: textStyle.breakpoints.map((bp) => ({
|
|
1721
|
+
* ...bp,
|
|
1722
|
+
* fontSize: parseInt(bp.fontSize) * 0.8 + "px"
|
|
1723
|
+
* }))
|
|
1724
|
+
* })
|
|
1725
|
+
* ```
|
|
1726
|
+
*/
|
|
1727
|
+
setAttributes(attributes: TextStyleAttributes): Promise<TextStyle | null>;
|
|
1728
|
+
/**
|
|
1729
|
+
* Get plugin data for this text style by key.
|
|
1730
|
+
*
|
|
1731
|
+
* @param key - The plugin data key.
|
|
1732
|
+
* @returns The stored value, or `null` if no data exists for the key.
|
|
1733
|
+
*/
|
|
1734
|
+
getPluginData(key: string): Promise<string | null>;
|
|
1735
|
+
/**
|
|
1736
|
+
* Set plugin data on this text style by key.
|
|
1737
|
+
*
|
|
1738
|
+
* @param key - The plugin data key.
|
|
1739
|
+
* @param value - The value to set, or `null` to remove.
|
|
1740
|
+
*
|
|
1741
|
+
* Use `"TextStyle.setPluginData"` to check if this method is allowed.
|
|
1742
|
+
*
|
|
1743
|
+
* @example
|
|
1744
|
+
* ```ts
|
|
1745
|
+
* await textStyle.setPluginData("key", "value")
|
|
1746
|
+
* ```
|
|
1747
|
+
*/
|
|
1748
|
+
setPluginData(key: string, value: string | null): Promise<void>;
|
|
1749
|
+
/**
|
|
1750
|
+
* Get all plugin data keys for this text style.
|
|
1751
|
+
*
|
|
1752
|
+
* @returns An array of all plugin data keys set on this text style.
|
|
1753
|
+
*/
|
|
1754
|
+
getPluginDataKeys(): Promise<string[]>;
|
|
1755
|
+
/**
|
|
1756
|
+
* Deletes the text style from the project. You need a reference to
|
|
1757
|
+
* the style to call this method.
|
|
1758
|
+
*
|
|
1759
|
+
* Use `"TextStyle.remove"` to check if this method is allowed.
|
|
1760
|
+
*
|
|
1761
|
+
* @example
|
|
1762
|
+
* ```ts
|
|
1763
|
+
* await textStyle.remove()
|
|
1764
|
+
* ```
|
|
1765
|
+
*/
|
|
1766
|
+
remove(): Promise<void>;
|
|
1586
1767
|
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
type Marshaled<T> = T extends {
|
|
1590
|
-
[$framerInternal.marshal]: () => unknown;
|
|
1591
|
-
} ? ReturnType<T[typeof $framerInternal.marshal]> : T extends string & {} ? T : T extends number & {} ? T : T extends object ? {
|
|
1592
|
-
[K in keyof T]: Marshaled<T[K]>;
|
|
1593
|
-
} : T;
|
|
1768
|
+
declare function isTextStyle(value: unknown): value is TextStyle;
|
|
1594
1769
|
|
|
1595
1770
|
interface WithNodeId {
|
|
1596
1771
|
nodeId: string;
|
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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.
|
|
2807
|
-
*
|
|
2808
|
-
*
|
|
2809
|
-
*
|
|
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.
|
|
2874
|
-
*
|
|
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.
|
|
2902
|
-
*
|
|
2903
|
-
*
|
|
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.
|
|
2959
|
-
*
|
|
2960
|
-
*
|
|
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.
|
|
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.
|
|
2996
|
-
* managed by plugins. Use `managedBy` to check the owner.
|
|
3270
|
+
* A CMS Collection in the project.
|
|
2997
3271
|
*
|
|
2998
|
-
*
|
|
2999
|
-
*
|
|
3000
|
-
*
|
|
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.
|
|
3088
|
-
*
|
|
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.
|
|
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.
|
|
3223
|
-
*
|
|
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.
|
|
3238
|
-
*
|
|
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.
|
|
3360
|
-
*
|
|
3361
|
-
*
|
|
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.
|
|
3414
|
-
*
|
|
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.
|
|
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.
|
|
3453
|
-
*
|
|
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`.
|
|
3479
|
-
*
|
|
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
|
|
3508
|
-
*
|
|
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.
|
|
3513
|
-
*
|
|
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.
|
|
3521
|
-
*
|
|
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.
|
|
3545
|
-
*
|
|
3546
|
-
* can
|
|
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:
|
|
3577
|
-
readonly linkOpenInNewTab:
|
|
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.
|
|
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:
|
|
3656
|
-
readonly linkOpenInNewTab:
|
|
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.
|
|
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.
|
|
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.
|
|
3698
|
-
*
|
|
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
|
-
/**
|
|
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.
|
|
3749
|
-
*
|
|
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.
|
|
3807
|
-
*
|
|
3808
|
-
*
|
|
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.
|
|
3855
|
-
*
|
|
3856
|
-
*
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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 = "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.
|
|
5035
|
-
*
|
|
5036
|
-
*
|
|
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
|
-
*
|
|
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.
|
|
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
|
|
5169
|
-
*
|
|
5170
|
-
*
|
|
5171
|
-
*
|
|
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.
|
|
5178
|
-
*
|
|
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
|
-
/**
|
|
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.
|
|
5312
|
-
*
|
|
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.
|
|
5325
|
-
*
|
|
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.
|
|
5344
|
-
*
|
|
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.
|
|
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.
|
|
5443
|
-
*
|
|
5444
|
-
*
|
|
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.
|
|
5467
|
-
*
|
|
5468
|
-
*
|
|
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
|
|
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
|
-
*
|
|
5521
|
-
*
|
|
5994
|
+
* // Get only page groups
|
|
5995
|
+
* const pageGroups = await framer.getLocalizationGroups({ type: "page" })
|
|
5522
5996
|
*
|
|
5523
|
-
*
|
|
5524
|
-
*
|
|
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.
|
|
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.
|
|
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.
|
|
5683
|
-
*
|
|
5684
|
-
*
|
|
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.
|
|
5764
|
-
*
|
|
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.
|
|
5778
|
-
*
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
}
|
|
@@ -6746,6 +7262,11 @@ interface FramerScreenshotMethods {
|
|
|
6746
7262
|
}
|
|
6747
7263
|
type Framer = AvailablePluginMethods & FramerConnectionMethods & FramerScreenshotMethods & FramerApiOnlyMethods;
|
|
6748
7264
|
|
|
7265
|
+
/** @internal */
|
|
7266
|
+
declare const $framerApiInternal: {
|
|
7267
|
+
readonly pluginMarshalTag: "plugin-marshal";
|
|
7268
|
+
};
|
|
7269
|
+
|
|
6749
7270
|
/**
|
|
6750
7271
|
* Connect to a Framer project and start using the Framer API.
|
|
6751
7272
|
*
|
|
@@ -6809,4 +7330,4 @@ declare function connect(projectUrlOrId: string, token?: string, options?: Conne
|
|
|
6809
7330
|
*/
|
|
6810
7331
|
declare function withConnection<T>(projectUrlOrId: string, callback: (framer: Framer) => Promise<T>, token?: string, options?: ConnectOptions): Promise<T>;
|
|
6811
7332
|
|
|
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 };
|
|
7333
|
+
export { $framerApiInternal, 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 };
|