import { CSSProperties } from 'react'; import { FC } from 'react'; import { ReactElement } from 'react'; import { RefObject } from 'react'; import ts from 'typescript'; export declare const $framerApiOnly: { readonly publish: typeof publish; readonly getDeployments: typeof getDeployments; readonly deploy: typeof deploy; readonly getChangedPaths: typeof getChangedPaths; readonly getChangeContributors: typeof getChangeContributors; readonly createManagedCollection: typeof createManagedCollection; readonly rejectAllPending: typeof rejectAllPending; }; export declare const $framerInternal: { readonly getAiServiceInfo: typeof getAiServiceInfo; readonly sendTrackingEvent: typeof sendTrackingEvent; readonly environmentInfo: typeof environmentInfo; readonly initialState: typeof initialState; readonly showUncheckedPermissionToasts: typeof showUncheckedPermissionToasts; readonly marshal: typeof marshal; readonly unmarshal: typeof unmarshal; readonly getHTMLForNode: typeof getHTMLForNode; readonly setHTMLForNode: typeof setHTMLForNode; }; declare interface AddComponentInstanceOptions { /** The component module URL. Can be copied from the components panel. */ url: string; /** Optional component attributes. */ attributes?: Partial; } declare interface AddDetachedComponentLayersOptions { /** The component module URL. Can be copied from the components panel. */ url: string; /** Optional component attributes. */ attributes?: Partial; /** Insert the layers as a layout block and match variants with breakpoints. */ layout?: boolean; } declare interface AddTextOptions { tag: TextNodeTag; } export declare interface AiServiceInfo { endpoint: string; token: string; expiresAt: string; } declare type AllMembers = Omit & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers & NamespaceMembers; declare type AllMethods = keyof { [K in Method as (typeof methodToMessageTypes)[K] extends [] ? never : K]: (typeof methodToMessageTypes)[K]; }; declare const allModesRecord: { readonly canvas: true; readonly image: true; readonly editImage: true; readonly configureManagedCollection: true; readonly syncManagedCollection: true; readonly collection: true; readonly localization: true; readonly code: true; readonly api: true; }; export declare interface AllTraits extends WithIdTrait, WithNameTrait, WithVisibleTrait, WithLockedTrait, WithBackgroundColorTrait, WithBackgroundImageTrait, WithBackgroundGradientTrait, WithRotationTrait, WithOpacityTrait, WithBorderRadiusTrait, WithBorderTrait, WithOverflowTrait, WithComponentInfoTrait, WithControlAttributesTrait, WithTypedControlsTrait, WithSVGTrait, WithPositionTrait, WithPinsTrait, WithSizeTrait, WithSizeConstraintsTrait, WithAspectRatioTrait, WithTextTruncationTrait, WithImageRenderingTrait, WithZIndexTrait, WithFontTrait, WithInlineTextStyleTrait, WithWebPageInfoTrait, WithLayoutTrait, WithGridItemTrait, WithComponentVariantTrait, WithBreakpointTrait, WithLinkTrait { } declare interface AnyEditableAttributes extends EditableFrameNodeAttributes, EditableTextNodeAttributes, EditableSVGNodeAttributes, EditableComponentInstanceNodeAttributes, EditableComponentNodeAttributes, EditableWebPageNodeAttributes, EditableDesignPageNodeAttributes { } export declare type AnyNode = CanvasNode | CanvasRootNode; declare interface AnyNodeData extends Partial>, WithReplicaInfoTrait { [classKey]: PluginNodeClass; } declare interface ApiV2CollectionItemData extends BaseCollectionItemData { /** Unique ID. */ id: string; /** Unique slug. */ slug: string; /** Data for the fields. */ fieldData: ApiV2FieldData; } declare type ApiV2CollectionItemInput = ApiV2CreateCollectionItem | ApiV2EditableCollectionItemAttributesWithId; declare interface ApiV2CreateCollectionItem extends BaseCollectionItemData { /** The ID of an existing item if updating. Omit if adding. */ id?: undefined; /** Unique on collection level. Required if adding, optional if updating. */ slug: string; /** Data for the fields. */ fieldData?: ApiV2FieldData | undefined; } declare interface ApiV2EditableCollectionItemAttributes extends BaseCollectionItemData { /** Unique on collection level. Required if adding, optional if updating. */ slug?: string | undefined; /** Data for the fields. */ fieldData?: ApiV2FieldData | undefined; } declare interface ApiV2EditableCollectionItemAttributesWithId extends ApiV2EditableCollectionItemAttributes { /** The ID of an existing item if updating. Omit if adding. */ id: NodeId; } declare type ApiV2FieldData = Record; declare interface ApiV2ManagedCollectionItemInput extends BaseCollectionItemData { /** Required unique ID of your choice. Using an ID instead of the slug helps avoid data loss. */ id: string; /** Unique on collection level. */ slug: string; /** Data for the fields. */ fieldData: ApiV2FieldData; } export declare interface ApiVersion1ProjectInfo { name: string; /** Hashed project id */ id: string; } export declare interface ApiVersion1User { name: string; /** Hashed user id */ id: string; } export declare type ArrayControl = ArrayControlHelper; declare interface ArrayControlBase extends ControlBase { type: "array"; /** Use this to narrow the type of `value` and `itemControl`. */ itemType: T["type"]; value?: ArrayItem$1[] | UnsupportedComputedValue | undefined; itemControl: Omit; } declare type ArrayControlHelper = T extends unknown ? ArrayControlBase : never; declare class ArrayField extends FieldBaseWithRequired { readonly type = "array"; readonly fields: readonly [ArrayItemField]; constructor(engine: PluginEngine, collectionId: string, data: ArrayFieldDefinitionData); } declare interface ArrayFieldBase { type: ArrayFieldType; } export declare interface ArrayFieldDataEntry { type: ArrayFieldType; value: ArrayItem[]; } export declare interface ArrayFieldDataEntryInput { type: ArrayFieldType; value: ArrayItemInput[]; } declare interface ArrayFieldDataEntrySerializable { type: ArrayFieldType; value: ArrayItemSerializableData[]; } declare interface ArrayFieldDefinitionData extends ArrayFieldBase, WithFieldRequired, FieldDefinitionBase { fields: [ArrayItemFieldDefinitionData]; } declare type ArrayFieldType = typeof arrayFieldType; declare const arrayFieldType = "array"; declare interface ArrayItem$1 { id: string; value: T["value"]; } export declare interface ArrayItem { id: string; fieldData: Readonly; } declare type ArrayItemControl = BooleanControl | BorderControl | ColorControl | CursorControl | CustomCursorControl | DateControl | EnumControl | FileControl | FormattedTextControl | ImageControl | LinkControl | NumberControl | ObjectControl | ScrollSectionControl | SlotControl | StringControl | TransitionControl; export declare interface ArrayItemData { /** Unique ID. */ id: string; /** Data for the fields. */ fieldData: ArrayItemFieldData; } declare type ArrayItemField = ImageField; declare type ArrayItemFieldBase = ImageFieldBase; declare type ArrayItemFieldData = Record; declare type ArrayItemFieldDataEntry = ImageFieldDataEntry; declare type ArrayItemFieldDataEntryInput = ImageFieldDataEntryInput; declare type ArrayItemFieldDataInput = Record; declare interface ArrayItemFieldDefinitionData extends ArrayItemFieldBase, WithFieldRequired, FieldDefinitionBase { } export declare type ArrayItemInput = CreateArrayItem | UpdateArrayItem; declare interface ArrayItemSerializableData { /** Unique ID. */ id: string; /** Data for the fields. */ fieldData: FieldSerializableData; } declare interface AssetData extends WithOptionalName { /** Something that can be rendered within the iFrame. Always the original size of the image */ url: string; } declare type AssetDataTransfer = AssetURLDataTransfer | BytesDataTransfer; declare type AssetId = string; declare interface AssetIdentifier { id: string; } declare type AssetInput = string | File | BytesData; declare type AssetPath = WithAssetName | WithAssetPath; declare interface AssetURLDataTransfer { type: "url"; url: string; } export declare type AxisOverflow = Overflow; declare interface BaseCollectionItemData { /** Drafts are excluded from publishing. */ draft?: boolean | undefined; } declare interface BaseGradientData { stops: readonly ColorStopData[]; } declare interface BaseVariableData extends WithNodeId, WithNodeType, WithId, WithName, ExplicitPartial { } export declare interface BooleanControl extends ControlBase { type: "boolean"; value?: boolean | BooleanVariable | UnsupportedComputedValue | undefined; } export declare class BooleanField extends FieldBase { readonly type = "boolean"; } declare interface BooleanFieldBase { type: BooleanFieldType; } declare interface BooleanFieldDataEntry { type: BooleanFieldType; value: boolean; } declare type BooleanFieldDataEntryInput = BooleanFieldDataEntry; declare interface BooleanFieldDefinitionData extends BooleanFieldBase, FieldDefinitionBase { } declare type BooleanFieldType = typeof booleanFieldType; declare const booleanFieldType = "boolean"; export declare class BooleanVariable extends VariableBase { #private; readonly type: "boolean"; constructor(engine: PluginEngine, data: BooleanVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: BooleanVariableData): BooleanVariable; [$framerInternal.marshal](): BooleanVariableData; } declare const booleanVariableClass = "BooleanVariable"; declare interface BooleanVariableData extends WithBooleanVariableClass, BaseVariableData, WithBooleanDefaultValue { } declare const booleanVariableType: "boolean"; export declare interface Border { width: BorderWidth; color: ColorStyle | string; style: BorderStyle; } export declare interface BorderControl extends ControlBase { type: "border"; value?: Border | BorderVariable | undefined; } export declare type BorderRadius = CSSDimension | `${CSSDimension} ${CSSDimension} ${CSSDimension} ${CSSDimension}` | null; export declare interface BorderRadiusControl extends ControlBase { type: "borderRadius"; value?: RelativeOrFourPixelNumberShorthand | UnsupportedVariable | NumberVariable | UnsupportedComputedValue | undefined; } export declare type BorderStyle = "solid" | "dashed" | "dotted" | "double"; export declare class BorderVariable extends VariableBase { #private; readonly type: "border"; constructor(engine: PluginEngine, data: BorderVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: BorderVariableData): BorderVariable; [$framerInternal.marshal](): BorderVariableData; } declare const borderVariableClass = "BorderVariable"; declare interface BorderVariableData extends WithBorderVariableClass, BaseVariableData, ExplicitPartial { } declare const borderVariableType: "border"; export declare type BorderWidth = CSSDimension | `${CSSDimension} ${CSSDimension} ${CSSDimension} ${CSSDimension}`; declare interface BytesData { bytes: Uint8Array; mimeType: string; } declare type BytesDataTransfer = BytesData & { type: "bytes"; }; export declare type CanvasNode = FrameNode | TextNode | ComponentInstanceNode | SVGNode | VectorSetItemNode | UnknownNode; export declare type CanvasRootNode = WebPageNode | DesignPageNode | ComponentNode | VectorSetNode | UnknownNode; declare type ClassKey = typeof classKey; declare const classKey: "__class"; declare type Cleanup = VoidFunction; declare interface ClosePluginOptions { variant?: NotificationVariant; /** When true, closes the plugin without showing a toast. */ silent?: boolean; } declare interface CodeExportCommon { name: string; isDefaultExport: boolean; } export declare class CodeFile implements Navigable { #private; get id(): string; get name(): string; get path(): string; get content(): string; get exports(): readonly CodeFileExport[]; get versionId(): string; constructor(data: CodeFileData, engine: PluginEngine); /** * Set the content of this code file. * * Use `"CodeFile.setFileContent"` to check if this method is allowed. */ setFileContent(code: string): Promise; /** * Rename this code file. * * Use `"CodeFile.rename"` to check if this method is allowed. */ rename(newName: string): Promise; /** * Remove this code file. * * Use `"CodeFile.remove"` to check if this method is allowed. */ remove(): Promise; /** * Get all versions of this code file. */ getVersions(): Promise; /** * @deprecated The implementation of this method was removed. The method will always return an empty array. The method will be removed in the near future. */ lint(_rules: LintConfig): Promise; typecheck(compilerOptions?: ts.server.protocol.CompilerOptions): Promise; /** * Navigate to this code file. May switch modes to reveal the relevant view. */ navigateTo(): Promise; } export declare interface CodeFileComponentExport extends CodeExportCommon { insertURL: string; type: "component"; } declare interface CodeFileData { id: string; name: string; path: string; content: string; exports: readonly CodeFileExport[]; versionId: string; } export declare type CodeFileExport = CodeFileComponentExport | CodeFileOverrideExport; export declare interface CodeFileOverrideExport extends CodeExportCommon { type: "override"; } declare interface CodeFilePosition { /** Start line number (1-based) */ startLine: number; /** Start column number (1-based) */ startColumn?: number; /** End line number (1-based) */ endLine?: number; /** End column number (1-based) */ endColumn?: number; } export declare class CodeFileVersion { #private; get id(): string; get name(): string; get createdAt(): string; get createdBy(): Readonly; constructor(data: CodeFileVersionData, engine: PluginEngine); getContent(): Promise; } declare interface CodeFileVersionData extends Pick { fileId: string; createdAt: string; createdBy: User; } export declare class Collection implements Navigable { #private; readonly id: NodeId; readonly name: string; readonly slugFieldName: string | null; readonly slugFieldBasedOn: string | null; /** * @deprecated Use `managedBy` instead and the [Permissions * API](https://www.framer.com/developers/plugins-permissions) to check if users can edit the * collection. */ readonly readonly: boolean; /** * Collections managed by plugins are read-only. To be able to modify them use * `ManagedCollection` (which is only possible in `configureManagedCollection` or * `syncManagedCollection` modes). */ readonly managedBy: CollectionManagedBy; constructor(data: CollectionData, engine: PluginEngine); /** * Arrange items in a specific order. * * Use `"Collection.setItemOrder"` to check if this method is allowed. */ setItemOrder(ids: NodeId[]): Promise; /** * Get all fields. */ getFields(): Promise; /** * Create new fields. Use `Field.setAttributes` to update. * * Use `"Collection.addFields"` to check if this method is allowed. */ addFields(fields: CreateField[]): Promise; /** * Remove fields by their ID. * * Use `"Collection.removeFields"` to check if this method is allowed. */ removeFields(fieldIds: string[]): Promise; /** * Arrange fields in a specific order. * * Use `"Collection.setFieldOrder"` to check if this method is allowed. */ setFieldOrder(fieldIds: string[]): Promise; /** * Get all items in their set order. */ getItems(): Promise; /** * Add new items or update existing ones if their IDs are provided. * * This creates a new item with "foo" as its slug: * * ```ts * collection.addItems([{ slug: "foo" }]) * ``` * * This updates an existing item with ID "aBc123" to have "bar" as its slug: * * ```ts * collection.addItems([{ id: "aBc123", slug: "bar" }]) * ``` * * Use `"Collection.addItems"` to check if this method is allowed. */ addItems(items: CollectionItemInput[]): Promise; /** * Remove items by their ID. * * Use `"Collection.removeItems"` to check if this method is allowed. */ removeItems(itemIds: NodeId[]): Promise; /** * Make this the active collection. */ setAsActive(): Promise; /** * Set plugin data by key. * * Use `"Collection.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get plugin data by key. */ getPluginData(key: string): Promise; /** * Get all plugin data keys. */ getPluginDataKeys(): Promise; /** * Navigate to this collection. May switch modes to reveal the relevant view. */ navigateTo(opts?: NavigableOptions): Promise; } declare interface CollectionData { id: string; name: string; slugFieldName: string | null; slugFieldBasedOn: string | null; /** @deprecated Use `managedBy` instead. */ readonly: boolean; managedBy: CollectionManagedBy; } export declare class CollectionItem implements Navigable { #private; readonly id: NodeId; /** External ID for managed collections, unique node ID otherwise. */ readonly nodeId: NodeId; readonly slug: string; readonly slugByLocale: InlineLocalizationValueByLocale; readonly draft: boolean; readonly fieldData: Readonly; constructor(collectionItemData: CollectionItemSerializableData, engine: PluginEngine); /** * Remove this item. * * Use `"CollectionItem.remove"` to check if this method is allowed. */ remove(): Promise; /** * Update the item. * * Use `"CollectionItem.setAttributes"` to check if this method is allowed. */ setAttributes(update: EditableCollectionItemAttributes): Promise; /** * Set plugin data by key. * * Use `"CollectionItem.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get plugin data by key. */ getPluginData(key: string): Promise; /** * Get all plugin data keys. */ getPluginDataKeys(): Promise; /** * Navigate to this collection item. May switch modes to reveal the relevant view. */ navigateTo(opts?: NavigableOptions): Promise; } export declare interface CollectionItemData extends BaseCollectionItemData { /** Unique ID. */ id: string; /** Unique slug. */ slug: string; /** Slug by locale. */ slugByLocale: InlineLocalizationValueByLocale; /** Data for the fields. */ fieldData: FieldData; } export declare type CollectionItemInput = CreateCollectionItem | EditableCollectionItemAttributesWithId; declare interface CollectionItemSerializableData extends BaseCollectionItemData { /** @deprecated use `externalId ?? nodeId` to emulate the old behaviour, or use `nodeId` or `externalId` directly */ id: string; /** Node ID. This is a unique ID for the node that can be used to navigate to the node */ nodeId: string; /** External ID. This is the ID of the node in the external system */ externalId: string | undefined; /** Unique slug. */ slug: string; /** Slug by locale. */ slugByLocale: InlineLocalizationValueByLocale; /** Data for the fields. */ fieldData: FieldSerializableData; } declare type CollectionManagedBy = "user" | ManagedCollectionManagedBy; export declare interface CollectionReferenceControl extends ControlBase { type: "collectionReference"; value?: string | UnsupportedVariable | undefined; } export declare class CollectionReferenceField extends FieldBaseWithRequired implements WithFieldCollectionId { #private; readonly type = "collectionReference"; get collectionId(): string; constructor(engine: PluginEngine, collectionId: string, data: CollectionReferenceFieldDefinitionData); } declare interface CollectionReferenceFieldBase { type: CollectionReferenceFieldType; } declare interface CollectionReferenceFieldDataEntry { type: CollectionReferenceFieldType; value: string | undefined; } declare interface CollectionReferenceFieldDataEntryInput { type: CollectionReferenceFieldType; value: string | null; } declare interface CollectionReferenceFieldDefinitionData extends CollectionReferenceFieldBase, FieldDefinitionBase, WithFieldCollectionId, WithFieldRequired { } declare type CollectionReferenceFieldType = typeof collectionReferenceFieldType; declare const collectionReferenceFieldType = "collectionReference"; export declare interface ColorControl extends ControlBase { type: "color"; value?: string | ColorStyle | ColorVariable | UnsupportedComputedValue | undefined; } export declare class ColorField extends FieldBase { readonly type = "color"; } declare interface ColorFieldBase { type: ColorFieldType; } declare interface ColorFieldDataEntry { type: ColorFieldType; value: string | ColorStyle; } declare interface ColorFieldDataEntryInput { type: ColorFieldType; value: string | ColorStyleData | null; } declare interface ColorFieldDataEntrySerializable { type: ColorFieldType; value: string | ColorStyleData; } declare interface ColorFieldDefinitionData extends ColorFieldBase, FieldDefinitionBase { } declare type ColorFieldType = typeof colorFieldType; declare const colorFieldType = "color"; export declare interface ColorStop { /** CSS color */ color: ColorStyle | string; /** 0-1 */ position: number; } declare interface ColorStopData { color: ColorStyleData | string; position: number; } export declare class ColorStyle { #private; readonly id: NodeId; readonly name: string; /** * Hierarchical path to the color style in the assets folder structure, e.g. `ui/modals/background`. * Used for organizing color styles in the UI and for programmatic access. * Segments are separated by forward slashes. */ readonly path: string; /** Color used for the default or light theme in RGBA format, e.g `rgba(242, 59, 57, 1)` */ readonly light: string; /** Optional color used for the dark theme in RGBA format, e.g `rgba(242, 59, 57, 1)` */ readonly dark: string | null; constructor(engine: PluginEngine, data: ColorStyleData); static [$framerInternal.unmarshal](engine: PluginEngine, data: ColorStyleData): ColorStyle; [$framerInternal.marshal](): ColorStyleData; /** * Set the attributes of a color style. * * Use `"ColorStyle.setAttributes"` to check if this method is allowed. */ setAttributes(update: Partial): Promise; /** * Get plugin data for this color style by key. */ getPluginData(key: string): Promise; /** * Set plugin data on this color style by key. * * Use `"ColorStyle.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get all plugin data keys for this color style. */ getPluginDataKeys(): Promise; /** * Deletes the color style from the project. * * Use `"ColorStyle.remove"` to check if this method is allowed. */ remove(): Promise; } declare type ColorStyleAttributes = Prettify & AssetPath>; declare interface ColorStyleData extends RequiredColorStyleAttributes, OptionalColorStyleAttributes { [classKey]: typeof colorStyleDiscriminator; id: NodeId; name: string; path: string; } declare const colorStyleDiscriminator: "ColorStyle"; export declare class ColorVariable extends VariableBase { #private; readonly type: "color"; constructor(engine: PluginEngine, data: ColorVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: ColorVariableData): ColorVariable; [$framerInternal.marshal](): ColorVariableData; } declare const colorVariableClass = "ColorVariable"; declare interface ColorVariableData extends WithColorVariableClass, BaseVariableData, WithColorDefaultValueData { } declare const colorVariableType: "color"; declare interface CommonNodeData extends WithIdTrait, WithReplicaInfoTrait { [classKey]: PluginNodeClass; } declare type ComponentDragData = Omit, "attributes"> & { attributes?: Record; }; declare interface ComponentInstanceDragData extends WithOptionalName$1, WithOptionalPreviewImage { type: "componentInstance"; url: string; attributes?: Partial; } export declare class ComponentInstanceNode extends NodeMethods implements EditableComponentInstanceNodeAttributes, WithComponentInfoTrait { #private; readonly [classKey]: ComponentInstanceNodeData[ClassKey]; readonly name: string | null; readonly visible: boolean; readonly locked: boolean; readonly componentIdentifier: string; readonly insertURL: string | null; readonly componentName: string | null; readonly controls: ControlAttributes; readonly rotation: number; readonly opacity: number; readonly position: Position; readonly top: CSSDimension | null; readonly right: CSSDimension | null; readonly bottom: CSSDimension | null; readonly left: CSSDimension | null; readonly centerX: CSSDimension | null; readonly centerY: CSSDimension | null; readonly width: WidthLength | null; readonly height: HeightLength | null; readonly maxWidth: WidthConstraint | null; readonly minWidth: WidthConstraint | null; readonly maxHeight: HeightConstraint | null; readonly minHeight: HeightConstraint | null; readonly aspectRatio: number | null; constructor(rawData: ComponentInstanceNodeData, engine: PluginEngine); } declare interface ComponentInstanceNodeData extends CommonNodeData, Partial, WithPositionTrait, Partial, Partial, Partial, Partial, Partial, Partial, WithRequiredComponentInfoTrait, Partial, Partial { [classKey]: "ComponentInstanceNode"; } export declare class ComponentNode extends NodeMethods implements EditableComponentNodeAttributes, WithComponentInfoTrait { #private; readonly [classKey]: ComponentNodeData[ClassKey]; readonly name: string | null; readonly componentIdentifier: string; readonly insertURL: string | null; readonly componentName: string | null; constructor(rawData: ComponentNodeData, engine: PluginEngine); } declare interface ComponentNodeData extends CommonNodeData, Partial, WithRequiredComponentInfoTrait, Partial { [classKey]: "ComponentNode"; } export declare type ComponentVariable = BooleanVariable | NumberVariable | StringVariable | FormattedTextVariable | EnumVariable | ColorVariable | ImageVariable | FileVariable | LinkVariable | DateVariable | BorderVariable | UnsupportedVariable; export declare type ComputedValue = UnsupportedComputedValue; declare abstract class ComputedValueBase { abstract readonly type: typeof unsupportedComputedValueType; } export declare class ConicGradient extends GradientBase { #private; readonly [classKey]: "ConicGradient"; /** 0-360 */ get angle(): number; /** Relative horizontal position */ get x(): CSSDimension; /** Relative vertical position */ get y(): CSSDimension; constructor(unmarshaledAttributes: UnmarshaledConicGradientAttributes); static [$framerInternal.unmarshal](engine: PluginEngine, data: ConicGradientData): ConicGradient; [$framerInternal.marshal](): ConicGradientData; toCSS(): string; } declare interface ConicGradientData extends BaseGradientData { [classKey]: ConicGradientType; angle: number; x: CSSDimension; y: CSSDimension; } declare type ConicGradientType = typeof conicGradientType; declare const conicGradientType: "ConicGradient"; /** Controls how formatted text content is processed */ declare type ContentType = "auto" | "markdown" | "html"; declare interface ContextMenuConfig { /** * Coordinates of the anchor point. */ location: { x: number; y: number; }; /** * Placement of the menu relative to the anchor point. */ placement?: MenuPlacement; /** * Sets fixed width for the menu. If not set, the menu width is based on the content. */ width?: number; } export declare type Control = EnumControl | BooleanControl | BorderControl | ShadowControl | DateControl | NumberControl | TransitionControl | StringControl | ColorControl | FormattedTextControl | LinkControl | LinkRelControl | FontControl | PageScopeControl | ScrollSectionControl | CustomCursorControl | CursorControl | FileControl | GapControl | PaddingControl | BorderRadiusControl | CollectionReferenceControl | MultiCollectionReferenceControl | VectorSetItemControl | TrackingIdControl | ImageControl | FusedNumberControl | ObjectControl | ArrayControl | EventHandlerControl | SlotControl; export declare type ControlAttributes = Record; declare interface ControlBase extends WithKey, Partial, Partial { } declare const createableNodes: readonly ["FrameNode", "TextNode", "ComponentNode"]; declare interface CreateArrayField extends ArrayFieldBase, CreateFieldBase, WithOptionalFieldRequired { fields: [CreateArrayItemField]; } declare interface CreateArrayItem { /** Data for the fields. */ fieldData: ArrayItemFieldDataInput | undefined; } declare interface CreateArrayItemField extends ArrayItemFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateBooleanField extends BooleanFieldBase, CreateFieldBase { } declare interface CreateBooleanVariable extends WithBooleanVariableType, CreateVariableBase, Partial { } declare interface CreateBorderVariable extends WithBorderVariableType, CreateVariableBase, Partial { } declare interface CreateCollectionItem extends BaseCollectionItemData { /** The ID of an existing item if updating. Omit if adding. */ id?: undefined; /** Unique on collection level. Required if adding, optional if updating. */ slug: string; /** Localized values for the slug */ slugByLocale?: LocalizationSourceUpdate; /** Data for the fields. */ fieldData?: FieldDataInput | undefined; /** Status of each locale for the resulting localization group */ statusByLocale?: LocalizationGroupStatusByLocale; } declare interface CreateCollectionReferenceField extends CollectionReferenceFieldBase, CreateFieldBase, WithFieldCollectionId, WithOptionalFieldRequired { } declare interface CreateColorField extends ColorFieldBase, CreateFieldBase { } declare interface CreateColorVariable extends WithColorVariableType, CreateVariableBase, Partial { } declare interface CreateDateField extends DateFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateDateVariable extends WithDateVariableType, CreateVariableBase, Partial, Partial { } declare interface CreateEnumCase extends WithName, Partial { } declare interface CreateEnumField extends EnumFieldBase, CreateFieldBase { cases: CreateEnumCase[]; } declare interface CreateEnumVariable extends WithEnumVariableType, CreateVariableBase { defaultCaseIndex?: number | undefined; cases: CreateEnumCase[]; } export declare type CreateField = CreateBooleanField | CreateColorField | CreateNumberField | CreateStringField | CreateFormattedTextField | CreateImageField | CreateLinkField | CreateDateField | CreateFileField | CreateEnumField | CreateCollectionReferenceField | CreateMultiCollectionReferenceField | CreateFieldDivider | CreateArrayField; declare type CreateFieldBase = WithFieldName; declare interface CreateFieldDivider extends FieldDividerBase, CreateFieldBase { } declare interface CreateFileField extends FileFieldBase, CreateFieldBase, WithAllowedFileTypes, WithOptionalFieldRequired { } declare interface CreateFileVariable extends WithFileVariableType, CreateVariableBase, Partial, WithAllowedFileTypes { } declare interface CreateFormattedTextField extends FormattedTextFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateFormattedTextVariable extends WithFormattedTextVariableType, CreateVariableBase, Partial { } declare interface CreateImageField extends ImageFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateImageVariable extends WithImageVariableType, CreateVariableBase, Partial { } declare interface CreateLinkField extends LinkFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateLinkVariable extends WithLinkVariableType, CreateVariableBase { } declare const createManagedCollection: unique symbol; declare interface CreateMultiCollectionReferenceField extends MultiCollectionReferenceFieldBase, CreateFieldBase, WithFieldCollectionId, WithOptionalFieldRequired { } declare type CreateNodeType$1 = (typeof createableNodes)[number]; declare type CreateNodeType = Extends; declare interface CreateNumberField extends NumberFieldBase, CreateFieldBase { } declare interface CreateNumberVariable extends WithNumberVariableType, CreateVariableBase, Partial { } declare interface CreateRedirect extends RedirectAttributes, WithToField { /** The id of the redirect, if provided, the redirect will be updated, otherwise a new redirect will be created */ id?: never; } declare interface CreateStringField extends StringFieldBase, CreateFieldBase, WithOptionalFieldRequired { } declare interface CreateStringVariable extends WithStringVariableType, CreateVariableBase, Partial { } export declare type CreateVariable = CreateBooleanVariable | CreateNumberVariable | CreateStringVariable | CreateFormattedTextVariable | CreateEnumVariable | CreateColorVariable | CreateImageVariable | CreateFileVariable | CreateLinkVariable | CreateDateVariable | CreateBorderVariable; declare interface CreateVariableBase extends WithName, Partial { } declare type CSSCursor = "default" | "pointer" | "progress" | "copy" | "no-drop" | "not-allowed" | "grab" | "grabbing" | "context-menu" | "cell" | "crosshair" | "alias" | "zoom-in" | "zoom-out" | "help" | "nw-resize" | "n-resize" | "ne-resize" | "w-resize" | "move" | "e-resize" | "sw-resize" | "s-resize" | "se-resize" | "ew-resize" | "ns-resize" | "nwse-resize" | "nesw-resize" | "col-resize" | "row-resize" | "text" | "vertical-text" | "none"; declare type CSSDimension = `${number}${U}`; declare enum CSSUnit { Pixel = "px", Rem = "rem", Em = "em", Percentage = "%", Fraction = "fr", ViewportWidth = "vw", ViewportHeight = "vh" } export declare interface CursorControl extends ControlBase { type: "cursor"; value?: CSSCursor | UnsupportedVariable | undefined; } export declare type CustomCode = Record; export declare type CustomCodeLocation = "headStart" | "headEnd" | "bodyStart" | "bodyEnd"; declare interface CustomCursor { smartComponentId?: string | undefined; variant?: string | undefined; follow?: boolean | undefined; offsetX?: number | undefined; offsetY?: number | undefined; placement?: "top" | "right" | "bottom" | "left" | undefined; alignment?: "start" | "center" | "end" | undefined; transitionEnabled?: boolean | undefined; transition?: Transition | undefined; } export declare interface CustomCursorControl extends ControlBase { type: "customCursor"; value?: CustomCursor | UnsupportedVariable | undefined; } export declare interface DateControl extends ControlBase { type: "date"; value?: string | DateVariable | UnsupportedComputedValue | undefined; } export declare class DateField extends FieldBaseWithRequired { #private; readonly type = "date"; get displayTime(): boolean | undefined; constructor(engine: PluginEngine, collectionId: string, data: DateFieldDefinitionData); } declare interface DateFieldBase { type: DateFieldType; displayTime?: boolean; } declare interface DateFieldDataEntry { type: DateFieldType; value: string | undefined; } declare interface DateFieldDataEntryInput { type: DateFieldType; value: string | number | null; } declare interface DateFieldDefinitionData extends DateFieldBase, WithFieldRequired, FieldDefinitionBase { } declare type DateFieldType = typeof dateFieldType; declare const dateFieldType = "date"; export declare class DateVariable extends VariableBase { #private; readonly type: "date"; get displayTime(): boolean | undefined; constructor(engine: PluginEngine, data: DateVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: DateVariableData): DateVariable; [$framerInternal.marshal](): DateVariableData; } declare const dateVariableClass = "DateVariable"; declare interface DateVariableData extends WithDateVariableClass, BaseVariableData, ExplicitPartial, WithDisplayTime { } declare const dateVariableType: "date"; declare const deploy: unique symbol; export declare interface Deployment { id: string; createdAt: string; updatedAt: string; } export declare class DesignPageNode extends NodeMethods implements EditableDesignPageNodeAttributes { readonly [classKey]: DesignPageNodeData[ClassKey]; readonly name: string | null; constructor(rawData: DesignPageNodeData, engine: PluginEngine); } declare interface DesignPageNodeData extends CommonNodeData, Partial { [classKey]: "DesignPageNode"; } declare interface DetachedComponentLayersDragData extends WithOptionalName$1, WithOptionalPreviewImage { type: "detachedComponentLayers"; url: string; layout?: boolean; attributes?: Partial; } declare interface DiagnosticBase { message: string; span?: DiagnosticSpan; } export declare interface DiagnosticSpan { /** The first character, counted from the beginning of the file, 0-based. */ offset: number; length: number; /** The first character, 0-based. */ start: ts.LineAndCharacter; /** The last character, 0-based. */ end: ts.LineAndCharacter; } declare type DragCompleteCallback = (result: DragCompleteResult) => void; declare interface DragCompleteError { /** Whether the drag was successful or not. */ status: "error"; /** Reason for the error, if available. */ reason?: string; } export declare type DragCompleteResult = DragCompleteSuccess | DragCompleteError; declare interface DragCompleteSuccess { /** Whether the drag was successful or not. */ status: "success"; /** The inserted node id. */ nodeId: NodeId; } declare type DragData = SvgDragData | ImageDragData | ComponentInstanceDragData | DetachedComponentLayersDragData; declare type DragEndInfo = DragSessionId & { cancelled: boolean; }; export declare const Draggable: FC; declare interface DraggableProps { data: DragData | (() => DragData); onDragComplete?: DragCompleteCallback; children: ReactElement; } declare type DragInfo = DragSessionId & Mouse; declare interface DragSessionId { dragSessionId: string; } declare type DragStartInfo = DragSessionId & ElementRect & Mouse; declare interface DrawableNode extends WithNameTrait, WithVisibleTrait, WithLockedTrait, WithOpacityTrait { } declare interface EditableArrayItemAttributes { /** Data for the fields. */ fieldData?: ArrayItemFieldDataInput | undefined; } declare interface EditableCollectionItemAttributes extends BaseCollectionItemData { /** Unique on collection level. Required if adding, optional if updating. */ slug?: string | undefined; /** Localized values for the slug */ slugByLocale?: LocalizationSourceUpdate; /** Data for the fields. */ fieldData?: FieldDataInput | undefined; /** Status of each locale for the resulting localization group */ statusByLocale?: Record; } declare interface EditableCollectionItemAttributesWithId extends EditableCollectionItemAttributes { /** The ID of an existing item if updating. Omit if adding. */ id: NodeId; } declare interface EditableComponentInstanceNodeAttributes extends DrawableNode, WithPositionTrait, WithPinsTrait, WithSizeTrait, WithSizeConstraintsTrait, WithAspectRatioTrait, WithControlAttributesTrait, WithRotationTrait { } declare type EditableComponentNodeAttributes = WithNameTrait; declare type EditableDesignPageNodeAttributes = WithNameTrait; declare interface EditableFrameNodeAttributes extends DrawableNode, WithPositionTrait, WithPinsTrait, WithSizeTrait, WithSizeConstraintsTrait, WithAspectRatioTrait, WithZIndexTrait, WithOverflowTrait, WithBackgroundColorTrait, WithBackgroundImageTrait, WithBackgroundGradientTrait, WithRotationTrait, WithLinkTrait, WithBorderRadiusTrait, WithBorderTrait, WithLayoutTrait, WithGridItemTrait, WithImageRenderingTrait { } /** @deprecated Use `ManagedCollectionFieldInput` instead. */ export declare type EditableManagedCollectionField = ManagedCollectionFieldInputData; declare interface EditableSVGNodeAttributes extends DrawableNode, WithPositionTrait, WithPinsTrait, WithSizeTrait, WithSVGTrait, WithRotationTrait { } declare interface EditableTextNodeAttributes extends DrawableNode, WithPositionTrait, WithPinsTrait, WithSizeTrait, WithSizeConstraintsTrait, WithRotationTrait, WithZIndexTrait, WithOverflowTrait, WithTextTruncationTrait, WithFontTrait, WithLinkTrait, WithInlineTextStyleTrait, WithGridItemTrait { } declare interface EditableVectorSetItemNodeAttributes extends WithNameTrait, WithVisibleTrait, WithLockedTrait, WithPinsTrait, WithSizeTrait { } declare type EditableVectorSetNodeAttributes = WithNameTrait; declare type EditableWebPageNodeAttributes = object; declare interface ElementRect { elementRect: Rect_2; svgRect?: Rect_2; } export declare class EnumCase { #private; get id(): string; get name(): string; get nameByLocale(): InlineLocalizationValueByLocale; constructor(engine: PluginEngine, nodeId: string, variableId: string, enumCaseData: EnumCaseData); /** * Update a mutable enum case property, for example the name. * * Use `"EnumCase.setAttributes"` to check if this method is allowed. */ setAttributes(attributes: UpdateEnumCase): Promise; /** * Remove the enum case. * * Use `"EnumCase.remove"` to check if this method is allowed. */ remove(): Promise; } export declare interface EnumCaseData extends WithId, WithName, WithNameByLocale { } declare interface EnumCaseDataInput extends WithEnumCaseId, WithEnumCaseNameInput { } declare interface EnumCaseDataInputForUpdate extends WithEnumCaseId, WithEnumCaseNameInputForUpdate { } export declare interface EnumControl extends ControlBase { type: "enum"; /** The ID of the selected option */ value?: string | boolean | number | null | UnsupportedVariable | UnsupportedComputedValue | undefined; options: EnumOption[]; } export declare class EnumField extends FieldBase { #private; readonly type = "enum"; get cases(): readonly EnumCase[]; constructor(engine: PluginEngine, collectionId: string, data: EnumFieldDefinitionData); /** * Add a new enum case. * * Use `"EnumField.addCase"` to check if this method is allowed. */ addCase(attributes: CreateEnumCase): Promise; /** * Arrange enum cases in a specific order. * * Use `"EnumField.setCaseOrder"` to check if this method is allowed. */ setCaseOrder(caseIds: string[]): Promise; } declare interface EnumFieldBase { type: EnumFieldType; } declare interface EnumFieldDataEntry { type: EnumFieldType; value: string; } declare interface EnumFieldDataEntryInput { type: EnumFieldType; value: string; } declare interface EnumFieldDefinitionData extends EnumFieldBase, FieldDefinitionBase { cases: EnumCaseData[]; } declare type EnumFieldType = typeof enumFieldType; declare const enumFieldType = "enum"; declare interface EnumOption extends Partial { id: string | boolean | number | null; } export declare class EnumVariable extends VariableBase { #private; readonly type: "enum"; get cases(): readonly EnumCase[]; constructor(engine: PluginEngine, data: EnumVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: EnumVariableData): EnumVariable; [$framerInternal.marshal](): EnumVariableData; /** * Add a new enum case. * * Use `"EnumVariable.addCase"` to check if this method is allowed. */ addCase(attributes: CreateEnumCase): Promise; /** * Arrange enum cases in a specific order. * * Use `"EnumVariable.setCaseOrder"` to check if this method is allowed. */ setCaseOrder(caseIds: string[]): Promise; } declare const enumVariableClass = "EnumVariable"; declare interface EnumVariableData extends WithEnumVariableClass, BaseVariableData, ExplicitPartial { cases: EnumCaseData[]; } declare const enumVariableType: "enum"; declare interface EnvironmentInfo { releaseChannel: ReleaseChannel | null; isEmployee: boolean; } declare const environmentInfo: unique symbol; declare interface EventHandlerControl extends ControlBase { type: "eventHandler"; value?: undefined; } /** * The opposite of Partial, can't omit it. Useful for making sure that you don't forget to handle a * new property in all cases where objects are built. */ declare type ExplicitPartial = { [P in keyof T]: T[P] | undefined; }; declare type Extends = U; declare type ExtractUnmarshaledGradientAttributes = Omit, ClassKey>; export declare type Field = BooleanField | ColorField | NumberField | StringField | FormattedTextField | ImageField | LinkField | DateField | FieldDivider | UnsupportedField | FileField | EnumField | CollectionReferenceField | MultiCollectionReferenceField | ArrayField; declare abstract class FieldBase { #private; abstract readonly type: FieldDefinitionData["type"]; get id(): string; get name(): string; constructor(engine: PluginEngine, collectionId: string, data: FieldDefinitionBase); /** * Use to rename any field: * * ```ts * const updatedField = await field.setAttributes({ name: "New Name" }) * ``` * * And to set other attributes too, but make sure to narrow based on field's `type` first, as to * avoid potential bugs: * * ```ts * if (field.type === "file") await field.setAttributes({ allowedFileTypes: ["txt", "md"] }) * ``` * * Returns the updated field on success, and `null` in the unlikely event of it being removed * between getting it and calling this method. * * Use `"Field.setAttributes"` to check if this method is allowed. */ setAttributes(attributes: UpdateFieldAttributes): Promise; /** * Remove this field. * * Use `"Field.remove"` to check if this method is allowed. */ remove(): Promise; } declare abstract class FieldBaseWithRequired extends FieldBase implements WithFieldRequired { #private; get required(): boolean; constructor(engine: PluginEngine, collectionId: string, data: FieldDefinitionBase & WithFieldRequired); } export declare type FieldData = Record; export declare type FieldDataEntry = BooleanFieldDataEntry | ColorFieldDataEntry | DateFieldDataEntry | EnumFieldDataEntry | FileFieldDataEntry | LinkFieldDataEntry | NumberFieldDataEntry | FormattedTextFieldDataEntry | StringFieldDataEntry | ImageFieldDataEntry | CollectionReferenceFieldDataEntry | MultiCollectionReferenceFieldDataEntry | ArrayFieldDataEntry; export declare type FieldDataEntryInput = BooleanFieldDataEntryInput | ColorFieldDataEntryInput | DateFieldDataEntryInput | EnumFieldDataEntryInput | FileFieldDataEntryInput | LinkFieldDataEntryInput | NumberFieldDataEntryInput | FormattedTextFieldDataEntryInput | StringFieldDataEntryInput | ImageFieldDataEntryInput | CollectionReferenceFieldDataEntryInput | MultiCollectionReferenceFieldDataEntryInput | ArrayFieldDataEntryInput; declare type FieldDataEntrySerializable = Exclude | ImageFieldDataEntrySerializable | FileFieldDataEntrySerializable | ColorFieldDataEntrySerializable | ArrayFieldDataEntrySerializable; export declare type FieldDataInput = Record; declare interface FieldDefinitionBase extends WithFieldId, WithFieldName { } /** * Any kind of collection field definition. The field may be unsupported by the * plugin API. */ declare type FieldDefinitionData = SupportedFieldDefinitionData | FieldDividerDefinitionData | UnsupportedFieldDefinitionData; export declare class FieldDivider extends FieldBase { readonly type = "divider"; } declare interface FieldDividerBase { type: FieldDividerType; } declare interface FieldDividerDefinitionData extends FieldDividerBase, FieldDefinitionBase { } declare type FieldDividerType = typeof fieldDividerType; declare const fieldDividerType = "divider"; declare type FieldInput = Prettify; declare type FieldSerializableData = Record; declare class FileAsset implements AssetIdentifier, FileAssetDataFields { readonly id: AssetId; readonly url: string; readonly extension: string | null; constructor(data: FileAssetData); static [$framerInternal.unmarshal](_: PluginEngine, data: FileAssetData): FileAsset; [$framerInternal.marshal](): FileAssetData; } declare interface FileAssetData extends AssetIdentifier, FileAssetDataFields { [classKey]: typeof fileAssetDiscriminator; } declare interface FileAssetDataFields extends AssetData { extension: string | null; } declare const fileAssetDiscriminator: "FileAsset"; export declare interface FileControl extends ControlBase { type: "file"; value?: FileAsset | FileVariable | UnsupportedVariable | UnsupportedComputedValue | undefined; } export declare class FileField extends FieldBaseWithRequired implements WithAllowedFileTypes { #private; readonly type = "file"; /** @inheritdoc */ get allowedFileTypes(): string[]; constructor(engine: PluginEngine, collectionId: string, data: FileFieldDefinitionData); } declare interface FileFieldBase { type: FileFieldType; } declare interface FileFieldDataEntry { type: FileFieldType; value: FileAsset | undefined; } declare interface FileFieldDataEntryInput { type: FileFieldType; value: string | null; } declare interface FileFieldDataEntrySerializable { type: FileFieldType; value: FileAssetData | undefined; } declare interface FileFieldDefinitionData extends FileFieldBase, FieldDefinitionBase, WithAllowedFileTypes, WithFieldRequired { } declare type FileFieldType = typeof fileFieldType; declare const fileFieldType = "file"; export declare class FileVariable extends VariableBase { #private; readonly type: "file"; get allowedFileTypes(): readonly string[]; constructor(engine: PluginEngine, data: FileVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: FileVariableData): FileVariable; [$framerInternal.marshal](): FileVariableData; } declare const fileVariableClass = "FileVariable"; declare interface FileVariableData extends WithFileVariableClass, BaseVariableData, ExplicitPartial, WithAllowedFileTypes { } declare const fileVariableType: "file"; export declare type FitContent = "fit-content"; export declare type FitImage = "fit-image"; export declare class Font { /** An identifier used internally for differentiating fonts. */ readonly selector: string; /** Name of the family the font belongs to. */ readonly family: string; /** * Specifies how thin or bold the font appears. * * Note: This will be `null` for custom fonts since their weight isn't * calculated. * */ readonly weight: FontWeight | null; /** * Specifies if the font is normal or _italic_. * * Note: This will be `null` for custom fonts since their weight isn't * calculated. * */ readonly style: FontStyle$1 | null; constructor(data: FontData); static [$framerInternal.unmarshal](_: PluginEngine, data: FontData): Font; [$framerInternal.marshal](): FontData; } declare type FontAttributes = Prettify>; declare const fontClassDiscriminator = "Font"; export declare interface FontControl extends ControlBase { type: "font"; value?: FontStyle | undefined; } declare interface FontData { [classKey]: typeof fontClassDiscriminator; selector: FontSelector; family: string; weight: FontWeight | null; style: FontStyle$1 | null; } declare type FontSelector = string; declare type FontStyle$1 = (typeof fontStyles)[number]; declare type FontStyle = Pick; declare const fontStyles: readonly ["normal", "italic"]; /** * Boldness as an absolute value. * * These values are usually associated with the following names: * - `100` - Thin * - `200` - Extra Light (Ultra Light) * - `300` - Light * - `400` - Normal * - `500` - Medium * - `600` - Semi Bold (Demi Bold) * - `700` - Bold * - `800` - Extra Bold * - `900` - Black (Heavy) * */ declare type FontWeight = (typeof fontWeights)[number]; declare const fontWeights: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900]; export declare interface FormattedTextControl extends ControlBase { type: "formattedText"; value?: string | FormattedTextVariable | UnsupportedComputedValue | undefined; } export declare class FormattedTextField extends FieldBaseWithRequired { readonly type = "formattedText"; } declare interface FormattedTextFieldBase { type: FormattedTextFieldType; /** Controls how formatted text content is processed: "auto" (detect), "markdown", or "html" */ contentType?: ContentType; } declare interface FormattedTextFieldDataEntry { type: FormattedTextFieldType; value: string; valueByLocale: InlineLocalizationValueByLocale; } declare interface FormattedTextFieldDataEntryInput { type: FormattedTextFieldType; value: string; /** @default "html" */ contentType?: ContentType; valueByLocale?: LocalizationSourceUpdate; } declare interface FormattedTextFieldDefinitionData extends FormattedTextFieldBase, WithFieldRequired, FieldDefinitionBase { } declare interface FormattedTextFieldInput extends CreateFormattedTextField, WithIdAndOptionalUserEditable { } declare type FormattedTextFieldType = typeof formattedTextFieldType; declare const formattedTextFieldType = "formattedText"; export declare class FormattedTextVariable extends VariableBase { #private; readonly type: "formattedText"; constructor(engine: PluginEngine, data: FormattedTextVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: FormattedTextVariableData): FormattedTextVariable; [$framerInternal.marshal](): FormattedTextVariableData; } declare const formattedTextVariableClass = "FormattedTextVariable"; declare interface FormattedTextVariableData extends WithFormattedTextVariableClass, BaseVariableData, WithStringDefaultValue { } declare const formattedTextVariableType: "formattedText"; declare type FourPixelNumberShorthand = PixelNumber | `${PixelNumber} ${PixelNumber} ${PixelNumber} ${PixelNumber}`; export declare class FrameNode extends NodeMethods implements EditableFrameNodeAttributes, WithBreakpointTrait { readonly [classKey]: FrameNodeData[ClassKey]; readonly name: string | null; readonly visible: boolean; readonly locked: boolean; readonly backgroundColor: ColorStyle | string | null; readonly backgroundImage: ImageAsset | null; readonly backgroundGradient: LinearGradient | RadialGradient | ConicGradient | null; readonly rotation: number; readonly opacity: number; readonly borderRadius: BorderRadius; readonly border: Border | null; readonly imageRendering: ImageRendering | null; readonly position: Position; readonly top: CSSDimension | null; readonly right: CSSDimension | null; readonly bottom: CSSDimension | null; readonly left: CSSDimension | null; readonly centerX: CSSDimension | null; readonly centerY: CSSDimension | null; readonly width: WidthLength | null; readonly height: HeightLength | null; readonly maxWidth: WidthConstraint | null; readonly minWidth: WidthConstraint | null; readonly maxHeight: HeightConstraint | null; readonly minHeight: HeightConstraint | null; readonly aspectRatio: number | null; readonly zIndex: WithZIndexTrait["zIndex"]; readonly link: string | null; readonly linkOpenInNewTab: boolean | null; readonly overflow: WithOverflowTrait["overflow"]; readonly overflowX: WithOverflowTrait["overflowX"]; readonly overflowY: WithOverflowTrait["overflowY"]; readonly layout: WithLayoutTrait["layout"]; readonly gap: WithLayoutTrait["gap"]; readonly padding: WithLayoutTrait["padding"]; readonly stackDirection: WithLayoutTrait["stackDirection"]; readonly stackDistribution: WithLayoutTrait["stackDistribution"]; readonly stackAlignment: WithLayoutTrait["stackAlignment"]; readonly stackWrapEnabled: WithLayoutTrait["stackWrapEnabled"]; readonly gridColumnCount: WithLayoutTrait["gridColumnCount"]; readonly gridRowCount: WithLayoutTrait["gridRowCount"]; readonly gridAlignment: WithLayoutTrait["gridAlignment"]; readonly gridColumnWidthType: WithLayoutTrait["gridColumnWidthType"]; readonly gridColumnWidth: WithLayoutTrait["gridColumnWidth"]; readonly gridColumnMinWidth: WithLayoutTrait["gridColumnMinWidth"]; readonly gridRowHeightType: WithLayoutTrait["gridRowHeightType"]; readonly gridRowHeight: WithLayoutTrait["gridRowHeight"]; readonly gridItemFillCellWidth: WithGridItemTrait["gridItemFillCellWidth"]; readonly gridItemFillCellHeight: WithGridItemTrait["gridItemFillCellHeight"]; readonly gridItemHorizontalAlignment: WithGridItemTrait["gridItemHorizontalAlignment"]; readonly gridItemVerticalAlignment: WithGridItemTrait["gridItemVerticalAlignment"]; readonly gridItemColumnSpan: WithGridItemTrait["gridItemColumnSpan"]; readonly gridItemRowSpan: WithGridItemTrait["gridItemRowSpan"]; readonly isVariant: boolean; readonly isPrimaryVariant: boolean; readonly isBreakpoint: boolean; readonly isPrimaryBreakpoint: boolean; readonly inheritsFromId: string | null; readonly gesture: Gesture | null; constructor(rawData: FrameNodeData, engine: PluginEngine); } declare interface FrameNodeData extends CommonNodeData, Partial, WithPositionTrait, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial>, Partial>, Partial>, Partial, Partial, Partial, Partial>, Partial, Partial, Partial, Partial { [classKey]: "FrameNode"; } export declare const framer: FramerPluginAPI; /** * Methods that are only available through framer-api (server API), * not through the plugin API. */ export declare type FramerApiOnlyMethods = { [K in keyof typeof $framerApiOnly]: FramerPluginAPI[(typeof $framerApiOnly)[K]]; }; declare class FramerPluginAPI { #private; constructor(engine: PluginEngine); /** Get the current mode. A plugin can launch in a special mode where only a subset of the API is allowed. */ get mode(): Mode; /** * Find out if user's permissions allow them to execute all of `methods`: * * ```ts * if (framer.isAllowedTo("addImage")) await framer.addImage(...) * if (framer.isAllowedTo("Collection.setItemOrder")) await collection.setItemOrder(...) * ``` * * Note that when the result of the permission check affects the UI, it's better to use the * `subscribeToIsAllowedTo` method, or `useIsAllowedTo` if using React. */ isAllowedTo(...methods: [ProtectedMethod, ...ProtectedMethod[]]): boolean; /** * Subscribe to changes in `framer.isAllowedTo(...methods)`: * * ```ts * console.log(`Initial isAllowed: ${framer.isAllowedTo("addImage")}`) * framer.subscribeToIsAllowedTo("addImage", (isAllowed) => { * console.log(`New isAllowed: ${isAllowed}`) * }) * ``` * * Refer to `useIsAllowedTo` for a React hook version of this. */ subscribeToIsAllowedTo(...args: [...methods: [ProtectedMethod, ...ProtectedMethod[]], callback: (isAllowed: boolean) => void]): Unsubscribe$1; /** Show the plugin UI. */ showUI(options?: UIOptions): Promise; /** Hide the plugin window, without stopping the plugin. */ hideUI(): Promise; /** Update the background status text shown while the plugin UI is hidden. */ setBackgroundMessage(status: string | null): Promise; /** * Stop the plugin. Throws `FramerPluginClosedError`, which should be ignored. * @param message - Optional message to show in the notification (ignored if options.silent is true) * @param options - Options to control the close behaviour */ closePlugin(message?: string, options?: ClosePluginOptions): never; /** Get the current user info like name and id. */ getCurrentUser(): Promise; /** Get the project info like name and id. */ getProjectInfo(): Promise; /** Get the current selection. */ getSelection(): Promise; /** Set the current selection. */ setSelection(nodeIds: string | Iterable): Promise; /** Subscribe to selection changes. */ subscribeToSelection(selectionUpdate: (nodes: CanvasNode[]) => void): Unsubscribe$1; /** Get the root of the current canvas. */ getCanvasRoot(): Promise; /** Subscribe to canvas root changes */ subscribeToCanvasRoot(rootUpdate: (root: CanvasRootNode) => void): Unsubscribe$1; /** Get the current publish info. */ getPublishInfo(): Promise; /** Subscribe to publish info changes. */ subscribeToPublishInfo(publishInfoUpdate: (info: PublishInfo) => void): Unsubscribe$1; /** Create a new node on the canvas. */ createFrameNode(attributes: Partial, parentId?: string): Promise; /** Remove nodes from the canvas. */ removeNodes(nodeIds: NodeId[]): Promise; /** @deprecated Use `removeNodes` directly. */ removeNode(nodeId: NodeId): Promise; /** Clone a node. */ cloneNode(nodeId: NodeId): Promise; /** Get a node by its id. */ getNode(nodeId: NodeId): Promise; /** Get the parent of a node. */ getParent(nodeId: NodeId): Promise; /** Get the children of a node. */ getChildren(nodeId: NodeId): Promise; /** Get the rect of a node */ getRect(nodeId: NodeId): Promise; /** Pans and zooms the viewport to center a single or group of nodes. */ zoomIntoView(nodeIds: NodeId | Iterable, options?: ZoomIntoViewOptions): Promise; /** Set the attributes of a node. */ setAttributes(nodeId: NodeId, attributes: Partial): Promise; /** Set the parent of a node. */ setParent(nodeId: NodeId, parentId: NodeId, index?: number | undefined): Promise; /** Get all nodes of a certain class. */ getNodesWithType(type: "FrameNode"): Promise; getNodesWithType(type: "TextNode"): Promise; getNodesWithType(type: "SVGNode"): Promise; getNodesWithType(type: "ComponentInstanceNode"): Promise; getNodesWithType(type: "WebPageNode"): Promise; getNodesWithType(type: "DesignPageNode"): Promise; getNodesWithType(type: "ComponentNode"): Promise; /** Get all nodes with a certain attribute. */ getNodesWithAttribute>(attribute: T): Promise; /** Get all nodes with a certain attribute which value is set. */ getNodesWithAttributeSet>(attribute: T): Promise; /** Get the image of the current selection or null if there is no image. */ getImage(): Promise; /** Subscribe to single image selection changes. */ subscribeToImage(imageUpdate: (image: ImageAsset | null) => void): Unsubscribe$1; /** Upload an image, and insert on the canvas. */ addImage(image: NamedImageAssetInput | File): Promise; /** Upload an image, and set on the selected node. */ setImage(image: NamedImageAssetInput | File): Promise; /** Upload an image without assigning it to a property. */ uploadImage(image: NamedImageAssetInput | File): Promise; /** Add multiple images, replacing the selected images, or insert on the canvas. */ addImages(images: readonly NamedImageAssetInput[]): Promise; /** Upload multiple images without assigning them to properties. */ uploadImages(images: readonly NamedImageAssetInput[]): Promise; /** Uploads a file without assigning it to a property. */ uploadFile(file: NamedFileAssetInput | File): Promise; /** Upload multiple files without assigning them to properties. */ uploadFiles(files: readonly NamedFileAssetInput[]): Promise; /** Add an SVG, replacing the selected SVG, or insert on the canvas. */ addSVG(svg: SVGData): Promise; /** Add a component instance by module URL. */ addComponentInstance({ url, attributes, parentId, }: AddComponentInstanceOptions): Promise; /** Adds the layers of a component by module URL. */ addDetachedComponentLayers({ url, layout, attributes }: AddDetachedComponentLayersOptions): Promise; /** Preload the component layers for detached insertion. */ preloadDetachedComponentLayers(url: string): Promise; preloadImageUrlForInsertion(url: string): Promise; preloadDragPreviewImage(url: string): Promise; /** Get plaintext of the current selection or null if there is no text. */ getText(): Promise; /** Set the text of the current selection or insert it onto the canvas. */ setText(text: string): Promise; /** Add a new text node to the canvas. */ addText(text: string, options?: AddTextOptions): Promise; /** * Set Custom HTML to be loaded in the document. A plugin can only set custom HTML once per * location. */ setCustomCode(options: SetCustomCodeOptions): Promise; /** Get custom HTML settings set by the plugin. */ getCustomCode(): Promise; /** Subscribe to custom HTML changes set by the plugin. */ subscribeToCustomCode(callback: (customHTML: CustomCode) => void): Unsubscribe$1; /** Subscribe to the current text selection. */ subscribeToText(callback: (text: string | null) => void): Unsubscribe$1; /** * Allow any HTML element to become draggable. Different types of drag data can be dropped onto * Framer. A function is returned to remove the draggable behavior from the element and to stop * all of the added listeners. */ makeDraggable(element: HTMLElement, getDragData: () => DragData, onDragComplete?: DragCompleteCallback): Cleanup; /** Get the managed collection that is currently active and selected in the UI. */ getActiveManagedCollection(): Promise; /** @deprecated Use `getActiveManagedCollection` */ getManagedCollection(): Promise; /** Get all collections managed by your plugin. */ getManagedCollections(): Promise; /** Get a collection by its id. */ getCollection(id: NodeId): Promise; /** Get the collection that is currently selected in the UI. */ getActiveCollection(): Promise; /** * Get all collections in the project. This includes collections created by the user or a * plugin. */ getCollections(): Promise; /** * Display a notification message. The message will be truncated if longer than 120 characters. */ notify: Notify; /** Get plugin data by key. */ getPluginData(key: string): Promise; /** Set plugin data by key. */ setPluginData(key: string, value: string | null): Promise; /** Get all plugin data keys. */ getPluginDataKeys(): Promise; /** Get all color styles in the project. */ getColorStyles(): Promise; /** Get a specific color style. */ getColorStyle(id: NodeId): Promise; /** Add a new color style to the project. */ createColorStyle(attributes: ColorStyleAttributes): Promise; /** Fired when a color style is added, edited or removed. */ subscribeToColorStyles(callback: (styles: ColorStyle[]) => void): Unsubscribe$1; /** Get all text styles in the project. */ getTextStyles(): Promise; /** Get a specific text style. */ getTextStyle(id: NodeId): Promise; /** Add a new text style to the project. */ createTextStyle(attributes: TextStyleAttributes): Promise; /** Fired when a text style is added, edited or removed. */ subscribeToTextStyles(callback: (styles: TextStyle[]) => void): Unsubscribe$1; /** Get a specific font via it's family name, and optionally weight and style. */ getFont(family: string, attributes?: FontAttributes): Promise; /** Get all available fonts. */ getFonts(): Promise; /** Get all locales in the current Project */ getLocales(): Promise; /** Get the default locale of the current Project */ getDefaultLocale(): Promise; /** * Get the currently active locale. * * - In "localization" mode, the active locale is the locale selected in the Localizations panel. * - In "canvas" mode, the active locale is the locale selected in the toolbar. * - Otherwise, the active locale is null. */ getActiveLocale(): Promise; /** Get all localization groups in the current Project */ getLocalizationGroups(): Promise; /** Update localization data */ setLocalizationData(update: LocalizationData): Promise; /** Get all redirects in the project */ getRedirects(): Promise; /** Add new redirects or update existing ones if their IDs match */ subscribeToRedirects(callback: (redirects: Redirect[]) => void): Unsubscribe$1; /** Add new redirects or update existing ones if their IDs match */ addRedirects(redirects: RedirectInput[]): Promise; /** Remove a redirect from the project */ removeRedirects(redirectIds: string[]): Promise; /** Set the order of redirects */ setRedirectOrder(redirectIds: string[]): Promise; /** Create a new code file */ createCodeFile(name: string, code: string, options?: { editViaPlugin?: boolean; }): Promise; /** Get an array of all code files */ getCodeFiles(): Promise; /** Get a specific code file */ getCodeFile(id: string): Promise; /** * Lint a code file and return the diagnostics. * * @param fileName - The name of the code file, must include the extension. Use `*.tsx` for TSX files, otherwise the React JSX syntax will be rejected. * @param content - The content of the code file. * @param rules - The rules to use for linting. * * @deprecated The implementation of this method was removed. The method will always return an empty array. The method will be removed in the near future. */ lintCode(_fileName: string, _content: string, _rules: LintConfig): Promise; /** * Type check a code file and return the diagnostics. * * @param fileName - The name of the code file, must include the extension. Use `*.tsx` for TSX files, otherwise the React JSX syntax will be rejected. * @param content - The content of the code file. * @param compilerOptions - Optional compiler options to override the default compiler options for type checking. * @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. */ typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions, sessionId?: string): Promise; /** * Subscribe to changes in code files. * This will be called when code files are added, removed, or updated and will return an array of * all code files in the project. */ subscribeToCodeFiles(callback: (codeFiles: readonly CodeFile[]) => void): Unsubscribe$1; /** * Set the plugin's menu, which is shown in the plugin window header. */ setMenu(menuItems: MenuItem[]): Promise; /** * Show a context menu at the given location. */ showContextMenu(menuItems: MenuItem[], config: ContextMenuConfig): Promise; /** * Updates the version of the given dependency to the * specified version. * * WARNING: This API is unstable and may change or break in the future */ unstable_ensureMinimumDependencyVersion(packageName: string, version: string): Promise; /** * Navigate to a node by ID with optional selection and zoom behaviour. * * @param nodeId - The ID of the node to navigate to. * @param opts - The options for the navigation. * @returns A promise that resolves when the navigation is complete. */ navigateTo(nodeId: string, opts?: NavigableOptions): Promise; /** * Subscribe to the currently open code file in the Code Editor. * * @param callback - The callback to call when the code file changes. * @returns A function to unsubscribe from the subscription. */ subscribeToOpenCodeFile(callback: (codeFile: CodeFile | null) => void): Unsubscribe$1; /** * Create a new design page. * * If you want to open the newly created design page, you can `.navigateTo()` the page after creation. * * @example * ```ts * const designPage = await framer.createDesignPage("About") * await designPage.navigateTo() * ``` */ createDesignPage(pageName: string): Promise; /** * Create a new web page. * * If you want to open the newly created web page, you can `.navigateTo()` the page after creation. * * @example * ```ts * const webPage = await framer.createWebPage("/about") * await webPage.navigateTo() * ``` */ createWebPage(pagePath: string): Promise; /** * Create a new collection. */ createCollection(name: string): Promise; /** * Create a new managed collection. */ createManagedCollection(name: string): Promise; /** * Set a warning message to show when the user attempts to close the plugin. Set to false to disable. * - `string` to enable with a custom message. * - `false` to disable. * */ setCloseWarning(message: string | false): Promise; /** * Initial state data passed from Vekter during handshake. */ get [$framerInternal.initialState](): InitialState; } export declare class FramerPluginClosedError extends Error { name: string; } export declare class FramerPluginError extends Error { name: string; } declare interface FusedNumber { single: number; fused: [number, number, number, number]; isFused: boolean; } export declare interface FusedNumberControl extends ControlBase { type: "fusedNumber"; value?: FusedNumber | undefined; } export declare interface GapControl extends ControlBase { type: "gap"; value?: TwoPixelNumberShorthand | UnsupportedVariable | NumberVariable | UnsupportedComputedValue | undefined; } export declare type Gesture = "hover" | "pressed" | "loading" | "error"; declare const getAiServiceInfo: unique symbol; declare const getAiServiceInfoMessageType = "INTERNAL_getAiServiceInfo"; declare const getChangeContributors: unique symbol; declare const getChangedPaths: unique symbol; declare const getDeployments: unique symbol; declare const getHTMLForNode: unique symbol; declare const getHTMLForNodeMessageType = "INTERNAL_getHTMLForNode"; export declare type Gradient = LinearGradient | RadialGradient | ConicGradient; declare abstract class GradientBase { #private; abstract readonly [classKey]: UnmarshaledGradient[ClassKey]; /** Color stops with position */ get stops(): readonly ColorStop[]; constructor(unmarshaledAttributes: UnmarshaledGradientAttributes); cloneWithAttributes(attributes: Partial>): typeof GradientBase; } declare type GradientData = LinearGradientData | RadialGradientData | ConicGradientData; export declare type GridContentAlignment = "start" | "center" | "end"; export declare type GridItemAlignment = "start" | "center" | "end"; export declare type GridItemColumnSpan = number | "all"; export declare interface GridLayout { gridColumnCount: number | "auto-fill" | null; gridRowCount: number | null; gridAlignment: GridContentAlignment | null; gridColumnWidthType: "fixed" | "minmax" | null; gridColumnWidth: number | null; gridColumnMinWidth: number | null; gridRowHeightType: "fixed" | "auto" | "fit" | null; gridRowHeight: number | null; } export declare function hasGridLayout(node: T): node is T & WithLayoutTrait & GridLayout; export declare function hasStackLayout(node: T): node is T & WithLayoutTrait & StackLayout; export declare type HeightConstraint = CSSDimension; export declare type HeightLength = Length | FitContent | CSSDimension | FitImage; export declare interface Hostname { hostname: string; type: HostnameType; isPrimary: boolean; isPublished: boolean; deploymentId: string; } export declare type HostnameType = "default" | "custom" | "version"; export declare class ImageAsset implements ImageDataFields, AssetIdentifier { #private; readonly id: AssetId; readonly url: string; readonly thumbnailUrl: string; readonly altText: string | undefined; readonly resolution: Resolution; constructor(engine: PluginEngine, data: ImageAssetData); static [$framerInternal.unmarshal](engine: PluginEngine, data: ImageAssetData): ImageAsset; [$framerInternal.marshal](): ImageAssetData; /** * Clone this image, optionally overriding its attributes. */ cloneWithAttributes({ altText, resolution, }: Prettify>>): ImageAsset; /** * Measure this image. */ measure(): Promise; /** * Get the data such as the bytes of the image. The bytes can be used to manipulate the pixels * of the image. */ getData(): Promise; /** * Load this image as `ImageBitmap`. */ loadBitmap(): Promise; /** * Load this image as `HTMLImageElement`. */ loadImage(): Promise; } declare interface ImageAssetData extends AssetIdentifier, ImageDataFields { [classKey]: typeof imageAssetDiscriminator; } declare const imageAssetDiscriminator: "ImageAsset"; export declare interface ImageControl extends ControlBase { type: "image"; value?: ImageAsset | ImageVariable | UnsupportedComputedValue | undefined; } declare interface ImageData_2 extends WithOptionalName, ImageOptions { } declare interface ImageDataFields extends AssetData { /** * Thumbnail URL of the image. */ thumbnailUrl: string; /** * Optional Alt Text of the image. */ altText?: string; /** * The resolution set on the image. Defaults to "auto" */ resolution: Resolution; } declare interface ImageDragData extends WithOptionalName$1, WithOptionalPreviewImage, ImageOptions { type: "image"; image: string; } export declare class ImageField extends FieldBaseWithRequired { readonly type = "image"; } declare interface ImageFieldBase { type: ImageFieldType; } declare interface ImageFieldDataEntry { type: ImageFieldType; value: ImageAsset | undefined; } declare interface ImageFieldDataEntryInput { type: ImageFieldType; value: string | null; alt?: string; altByLocale?: LocalizationSourceUpdate; } declare interface ImageFieldDataEntrySerializable { type: ImageFieldType; value: ImageAssetData | undefined; } declare interface ImageFieldDefinitionData extends ImageFieldBase, WithFieldRequired, FieldDefinitionBase { } declare type ImageFieldType = typeof imageFieldType; declare const imageFieldType = "image"; declare interface ImageOptions { /** * The image rendering to use. * Defaults to "auto" */ preferredImageRendering?: ImageRendering; /** * The alt text to use for the image. */ altText?: string; /** * The resolution to use for the image. * Defaults to "auto" */ resolution?: Resolution; } export declare type ImageRendering = "auto" | "pixelated"; export declare class ImageVariable extends VariableBase { #private; readonly type: "image"; constructor(engine: PluginEngine, data: ImageVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: ImageVariableData): ImageVariable; [$framerInternal.marshal](): ImageVariableData; } declare const imageVariableClass = "ImageVariable"; declare interface ImageVariableData extends WithImageVariableClass, BaseVariableData, ExplicitPartial { } declare const imageVariableType: "image"; declare type InitialState = { mode: Mode; intent: "plugin/open"; } | { mode: PickModes<"collection" | "syncManagedCollection" | "configureManagedCollection">; intent: "collection/add"; }; declare const initialState: unique symbol; export declare type InlineLocalizationValueByLocale = Record; export declare interface IsBreakpoint { readonly isBreakpoint: true; readonly isPrimaryBreakpoint: boolean; } export declare function isBreakpoint(node: T): node is T & IsBreakpoint; export declare function isCodeFileComponentExport(exportItem: CodeFileExport): exportItem is CodeFileComponentExport; export declare function isCodeFileOverrideExport(exportItem: CodeFileExport): exportItem is CodeFileOverrideExport; export declare function isColorStyle(value: unknown): value is ColorStyle; export declare interface IsComponentGestureVariant extends IsComponentVariant { readonly gesture: Gesture; } export declare function isComponentGestureVariant(node: T): node is T & IsComponentGestureVariant; export declare function isComponentInstanceNode(node: unknown): node is ComponentInstanceNode; export declare function isComponentNode(node: unknown): node is ComponentNode; export declare function isComponentVariable(value: unknown): value is ComponentVariable; export declare interface IsComponentVariant { readonly isVariant: true; readonly isPrimaryVariant: boolean; readonly inheritsFromId: string; } export declare function isComponentVariant(node: T): node is T & IsComponentVariant; export declare function isComputedValue(value: unknown): value is ComputedValueBase; export declare function isDesignPageNode(node: unknown): node is DesignPageNode; export declare function isField(value: unknown): value is FieldBase; export declare function isFileAsset(value: unknown): value is FileAsset; export declare function isFrameNode(node: unknown): node is FrameNode; export declare function isImageAsset(value: unknown): value is ImageAsset; export declare function isSVGNode(node: unknown): node is SVGNode; export declare function isTextNode(node: unknown): node is TextNode; export declare function isTextStyle(value: unknown): value is TextStyle; export declare function isVariable(value: unknown): value is Variable; export declare function isVectorSetItemNode(node: unknown): node is VectorSetItemNode; export declare function isVectorSetNode(node: unknown): node is VectorSetNode; export declare function isWebPageNode(node: unknown): node is WebPageNode; declare type KnownNodeClass = Exclude; export declare type LayoutType = "stack" | "grid"; export declare type Length = CSSDimension; export declare class LinearGradient extends GradientBase { #private; readonly [classKey]: "LinearGradient"; /** 0-360 */ get angle(): number; constructor(unmarshaledAttributes: UnmarshaledLinearGradientAttributes); static [$framerInternal.unmarshal](engine: PluginEngine, data: LinearGradientData): LinearGradient; [$framerInternal.marshal](): LinearGradientData; toCSS(): string; } declare interface LinearGradientData extends BaseGradientData { [classKey]: LinearGradientType; angle: number; } declare type LinearGradientType = typeof linearGradientType; declare const linearGradientType: "LinearGradient"; declare type Link = LinkToWebPage | LinkToUrl; export declare interface LinkControl extends ControlBase { type: "link"; value?: Link | LinkVariable | FileVariable | UnsupportedComputedValue | undefined; } export declare class LinkField extends FieldBaseWithRequired { readonly type = "link"; } declare interface LinkFieldBase { type: LinkFieldType; } declare interface LinkFieldDataEntry { type: LinkFieldType; value: string | undefined; valueByLocale: InlineLocalizationValueByLocale; } declare interface LinkFieldDataEntryInput { type: LinkFieldType; value: string | null; valueByLocale?: LocalizationSourceUpdate; } declare interface LinkFieldDefinitionData extends LinkFieldBase, WithFieldRequired, FieldDefinitionBase { } declare type LinkFieldType = typeof linkFieldType; declare const linkFieldType = "link"; export declare interface LinkRelControl extends ControlBase { type: "linkRel"; value?: readonly Rel[] | UnsupportedVariable | undefined; } declare interface LinkToUrl { type: "url"; url: string; } declare interface LinkToWebPage extends Partial { type: "webPage"; webPageId: string; scrollSection?: ScrollSectionSelector | undefined; } export declare class LinkVariable extends VariableBase { #private; readonly type: "link"; constructor(engine: PluginEngine, data: LinkVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: LinkVariableData): LinkVariable; [$framerInternal.marshal](): LinkVariableData; } declare const linkVariableClass = "LinkVariable"; declare interface LinkVariableData extends WithLinkVariableClass, BaseVariableData { } declare const linkVariableType: "link"; /** @deprecated The lintCode API was removed. This type will be removed in the near future. */ export declare type LintConfig = Record; /** @deprecated The lintCode API was removed. This type will be removed in the near future. */ export declare interface LintDiagnostic extends DiagnosticBase { /** The span of the invalid code in the file. */ span: DiagnosticSpan; severity: LintIssueSeverityValue; link?: LintLink; } declare type LintIssueSeverityValue = "error" | "warning"; /** @deprecated The lintCode API was removed. This type will be removed in the near future. */ export declare interface LintLink { url: string; text: string; } declare type LintRuleNameValue = "forbid-browser-apis"; export declare interface Locale { id: LocaleId; code: string; name: string; slug: string; fallbackLocaleId?: string; } export declare type LocaleId = string; export declare interface LocalizationData { valuesBySource?: Record; statusByLocaleByGroup?: Record; } export declare interface LocalizationGroup { id: LocalizationGroupId; name: string; type: "collection" | "collection-item" | "component" | "page" | "settings" | "template"; supportsExcludedStatus: boolean; sources: LocalizationSource[]; statusByLocale: LocalizationGroupStatusByLocale; } declare type LocalizationGroupId = string; export declare type LocalizationGroupStatus = "excluded" | "ready"; export declare type LocalizationGroupStatusByLocale = Record; export declare interface LocalizationSource { /** A stable ID of the localization source that can be used for updating and synchronizing */ id: LocalizationSourceId; /** The type of value for this source */ type: LocalizationSourceType; /** Current Source value */ value: string; /** Localized values and metadata for each locale */ valueByLocale: LocalizationValueByLocale; } export declare type LocalizationSourceId = string; declare type LocalizationSourceType = "string" | "formattedText" | "altText" | "slug" | "link"; export declare type LocalizationSourceUpdate = Record; declare interface LocalizationStatusByLocaleError { groupId: LocalizationGroupId; error: string; } declare type LocalizationValue = LocalizationValueNew | LocalizationValueNeedsReview | LocalizationValueDone | LocalizationValueWarning; declare interface LocalizationValueBase { /** A `value` of `null` means that the value explicitly falls back to the fallback locale */ value: string | null; lastEdited: number; /** * Whether the value is read only and therefore cannot be updated. * * For example, this is the case for localized values that were set * when syncing a managed collection. To update these values, you must * sync using the plugin that manages the collection. */ readonly: boolean; } export declare type LocalizationValueByLocale = Record; declare interface LocalizationValueDone extends LocalizationValueBase { status: "done"; } declare interface LocalizationValueError { sourceId: LocalizationSourceId; localeId: LocaleId | null; error: string; } declare interface LocalizationValueNeedsReview extends LocalizationValueBase { status: "needsReview"; } declare interface LocalizationValueNew { value: null; status: "new"; } declare interface LocalizationValueWarning extends LocalizationValueBase { status: "warning"; warning: string; } export declare type LocalizedValueStatus = LocalizationValue["status"]; export declare type LocalizedValueUpdate = { action: "set"; value: string; needsReview?: boolean; } | { action: "clear"; } | { action: "ignore"; needsReview?: boolean; }; declare interface ManagedArrayFieldInput extends CreateArrayField, WithIdAndOptionalUserEditable { fields: [ManagedArrayItemFieldInput]; } declare interface ManagedArrayItemFieldInput extends CreateArrayItemField, WithIdAndOptionalUserEditable { } declare interface ManagedBooleanFieldInput extends CreateBooleanField, WithIdAndOptionalUserEditable { } export declare class ManagedCollection implements Navigable { #private; readonly id: NodeId; readonly name: string; /** * @deprecated Use `managedBy` instead and the [Permissions * API](https://www.framer.com/developers/plugins-permissions) to check if users can edit the * collection. */ readonly readonly: boolean; /** * Collections managed by other plugins should are read-only. */ readonly managedBy: ManagedCollectionManagedBy; constructor(data: CollectionData, engine: PluginEngine); /** * Get item keys in their set order. */ getItemIds(): Promise; /** * Arrange items in a specific order. * * Use `"ManagedCollection.setItemOrder"` to check if this method is allowed. */ setItemOrder(ids: string[]): Promise; /** * Get all fields. */ getFields(): Promise; /** * Create, update or remove all fields in one go. * * Use `"ManagedCollection.setFields"` to check if this method is allowed. */ setFields(fields: ManagedCollectionFieldInput[]): Promise; /** * Add new items or update existing ones if their IDs match. * * Use `"ManagedCollection.addItems"` to check if this method is allowed. */ addItems(items: ManagedCollectionItemInput[]): Promise; /** * Remove items by their ID. * * Use `"ManagedCollection.removeItems"` to check if this method is allowed. */ removeItems(itemIds: string[]): Promise; /** * Make this the active collection. */ setAsActive(): Promise; /** * Set plugin data by key. * * Use `"ManagedCollection.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get plugin data by key. */ getPluginData(key: string): Promise; /** * Get all plugin data keys. */ getPluginDataKeys(): Promise; /** * Navigate to this collection. May switch modes to reveal the relevant view. */ navigateTo(opts?: NavigableOptions): Promise; } /** * Any kind of collection field definition that was created by a plugin and is * supported by the API. */ export declare type ManagedCollectionField = SupportedFieldDefinitionData & WithUserEditable; export declare type ManagedCollectionFieldInput = Exclude | ManagedEnumFieldInputForSetFields; declare type ManagedCollectionFieldInputData = ManagedBooleanFieldInput | ManagedColorFieldInput | ManagedNumberFieldInput | ManagedStringFieldInput | FormattedTextFieldInput | ManagedImageFieldInput | ManagedLinkFieldInput | ManagedDateFieldInput | ManagedFileFieldInput | ManagedEnumFieldInput | ManagedCollectionReferenceFieldInput | ManagedMultiCollectionReferenceFieldInput | ManagedArrayFieldInput; export declare interface ManagedCollectionItemInput extends BaseCollectionItemData { /** Required unique ID of your choice. Using an ID instead of the slug helps avoid data loss. */ id: string; /** Unique on collection level. */ slug: string; /** Localized values for the slug */ slugByLocale?: LocalizationSourceUpdate; /** Data for the fields. */ fieldData: FieldDataInput; /** Status of each locale for the resulting localization group */ statusByLocale?: LocalizationGroupStatusByLocale; } declare type ManagedCollectionManagedBy = "thisPlugin" | "anotherPlugin"; declare interface ManagedCollectionReferenceFieldInput extends CreateCollectionReferenceField, WithIdAndOptionalUserEditable { } declare interface ManagedColorFieldInput extends CreateColorField, WithIdAndOptionalUserEditable { } declare interface ManagedDateFieldInput extends CreateDateField, WithIdAndOptionalUserEditable { } declare interface ManagedEnumFieldInput extends EnumFieldBase, CreateFieldBase, WithIdAndOptionalUserEditable { cases: EnumCaseDataInput[]; } declare interface ManagedEnumFieldInputForSetFields extends Omit { cases: EnumCaseDataInputForUpdate[]; } declare interface ManagedFileFieldInput extends CreateFileField, WithIdAndOptionalUserEditable { } declare interface ManagedImageFieldInput extends CreateImageField, WithIdAndOptionalUserEditable { } declare interface ManagedLinkFieldInput extends CreateLinkField, WithIdAndOptionalUserEditable { } declare interface ManagedMultiCollectionReferenceFieldInput extends CreateMultiCollectionReferenceField, WithIdAndOptionalUserEditable { } declare interface ManagedNumberFieldInput extends CreateNumberField, WithIdAndOptionalUserEditable { } declare interface ManagedStringFieldInput extends CreateStringField, WithIdAndOptionalUserEditable { } declare const marshal: unique symbol; declare type Marshaled = T extends { [$framerInternal.marshal]: () => unknown; } ? ReturnType : T extends string & {} ? T : T extends number & {} ? T : T extends object ? { [K in keyof T]: Marshaled; } : T; export declare type MenuItem = NormalMenuItem | SeparatorMenuItem; declare type MenuItemSerializable = NormalMenuItemSerializable | SeparatorMenuItem; declare type MenuPlacement = MenuPlacementVertical | MenuPlacementHorizontal | `${MenuPlacementVertical}-${MenuPlacementHorizontal}`; declare type MenuPlacementHorizontal = "left" | "right"; declare type MenuPlacementVertical = "top" | "bottom"; declare type MessageApiDragData = ComponentDragData | OtherDragData; declare type Method = keyof { [K in keyof AllMembers as AllMembers[K] extends (...args: any) => unknown ? K : never]: string; }; declare const methodToMessageTypes: { readonly addComponentInstance: ["addComponentInstance"]; readonly addDetachedComponentLayers: ["addDetachedComponentLayers"]; readonly addImage: ["addImage"]; readonly addImages: ["addImages"]; readonly addSVG: ["addSVG"]; readonly addText: ["addText"]; readonly addRedirects: ["addRedirects"]; readonly getRedirects: []; readonly removeRedirects: ["removeRedirects"]; readonly setRedirectOrder: ["setRedirectOrder"]; readonly subscribeToRedirects: []; readonly cloneNode: ["cloneNode"]; readonly closePlugin: []; readonly createColorStyle: ["createColorStyle"]; readonly createFrameNode: ["createNode"]; readonly createTextNode: ["createNode"]; readonly createComponentNode: ["createNode"]; readonly createTextStyle: ["createTextStyle"]; readonly createDesignPage: ["createDesignPage"]; readonly createWebPage: ["createWebPage"]; readonly getActiveCollection: []; readonly getActiveLocale: []; readonly getActiveManagedCollection: []; readonly getCanvasRoot: []; readonly getChildren: []; readonly getCollection: []; readonly getCollections: []; readonly getColorStyle: []; readonly getColorStyles: []; readonly getCurrentUser: []; readonly getCustomCode: []; readonly getDefaultLocale: []; readonly getFont: []; readonly getFonts: []; readonly getImage: []; readonly getLocales: []; readonly getLocalizationGroups: []; readonly getManagedCollection: []; readonly getManagedCollections: []; readonly getNode: []; readonly getNodesWithAttribute: []; readonly getNodesWithAttributeSet: []; readonly getNodesWithType: []; readonly getParent: []; readonly getPluginData: []; readonly getPluginDataKeys: []; readonly getProjectInfo: []; readonly getPublishInfo: []; readonly getRect: []; readonly getSelection: []; readonly getText: []; readonly getTextStyle: []; readonly getTextStyles: []; readonly hideUI: []; readonly setCloseWarning: []; /** @deprecated The lintCode API was removed. */ readonly lintCode: []; readonly makeDraggable: ["onDragEnd", "onDragStart", "onDrag", "setDragData", "preloadDetachedComponentLayers", "preloadImageUrlForInsertion", "preloadDragPreviewImage"]; readonly notify: []; readonly preloadDetachedComponentLayers: ["preloadDetachedComponentLayers"]; readonly preloadDragPreviewImage: ["preloadDragPreviewImage"]; readonly preloadImageUrlForInsertion: ["preloadImageUrlForInsertion"]; readonly removeNode: ["removeNodes2"]; readonly removeNodes: ["removeNodes2"]; readonly setAttributes: ["setAttributes"]; readonly setCustomCode: ["setCustomCode"]; readonly setImage: ["setImage"]; readonly setLocalizationData: ["setLocalizationData"]; readonly setMenu: []; readonly showContextMenu: []; readonly setParent: ["setParent"]; readonly setPluginData: ["setPluginData"]; readonly setSelection: []; readonly setText: ["setText"]; readonly showUI: []; readonly subscribeToCanvasRoot: []; readonly subscribeToColorStyles: []; readonly subscribeToCustomCode: []; readonly subscribeToImage: []; readonly subscribeToPublishInfo: []; readonly subscribeToSelection: []; readonly subscribeToText: []; readonly subscribeToTextStyles: []; readonly createCodeFile: ["createCodeFile"]; readonly unstable_ensureMinimumDependencyVersion: ["unstable_ensureMinimumDependencyVersion"]; readonly getCodeFiles: []; readonly getCodeFile: []; readonly subscribeToCodeFiles: []; readonly subscribeToOpenCodeFile: []; readonly uploadFile: []; readonly uploadFiles: []; readonly uploadImage: []; readonly uploadImages: []; readonly zoomIntoView: []; readonly navigateTo: []; readonly getVectorSets: []; readonly "VectorSet.getItems": []; readonly "VectorSetItem.getVariables": []; readonly "Node.navigateTo": []; readonly "CodeFile.navigateTo": []; readonly "Collection.navigateTo": []; readonly "ManagedCollection.navigateTo": []; readonly "CollectionItem.navigateTo": []; readonly "ComponentInstanceNode.getRuntimeError": []; readonly "ImageAsset.cloneWithAttributes": []; readonly "ImageAsset.getData": []; readonly "ImageAsset.loadBitmap": []; readonly "ImageAsset.loadImage": []; readonly "ImageAsset.measure": []; readonly "CodeFile.remove": ["removeCodeFile"]; readonly "CodeFile.rename": ["renameCodeFile"]; readonly "CodeFile.setFileContent": ["setCodeFileContent"]; readonly "CodeFile.getVersions": []; readonly "CodeFile.lint": []; readonly "CodeFile.typecheck": []; readonly "CodeFileVersion.getContent": []; readonly "Field.remove": ["removeCollectionFields"]; readonly "Field.setAttributes": ["addCollectionFields2"]; readonly "EnumField.addCase": ["addEnumCase"]; readonly "EnumField.setCaseOrder": ["setEnumCaseOrder"]; readonly "Collection.addFields": ["addCollectionFields2"]; readonly "Collection.addItems": ["addCollectionItems2"]; readonly "Collection.getFields": []; readonly "Collection.getItems": []; readonly "Collection.getPluginData": []; readonly "Collection.getPluginDataKeys": []; readonly "Collection.removeFields": ["removeCollectionFields"]; readonly "Collection.removeItems": ["removeCollectionItems"]; readonly "Collection.setAsActive": []; readonly "Collection.setFieldOrder": ["setCollectionFieldOrder"]; readonly "Collection.setItemOrder": ["setCollectionItemOrder"]; readonly "Collection.setPluginData": ["setPluginDataForNode"]; readonly "CollectionItem.getPluginData": []; readonly "CollectionItem.getPluginDataKeys": []; readonly "CollectionItem.remove": ["removeCollectionItems"]; readonly "CollectionItem.setAttributes": ["setCollectionItemAttributes2"]; readonly "CollectionItem.setPluginData": ["setPluginDataForNode"]; readonly "ManagedCollection.addItems": ["addManagedCollectionItems2"]; readonly "ManagedCollection.getFields": []; readonly "ManagedCollection.getItemIds": []; readonly "ManagedCollection.getPluginData": []; readonly "ManagedCollection.getPluginDataKeys": []; readonly "ManagedCollection.removeItems": ["removeManagedCollectionItems"]; readonly "ManagedCollection.setAsActive": []; readonly "ManagedCollection.setFields": ["setManagedCollectionFields"]; readonly "ManagedCollection.setItemOrder": ["setManagedCollectionItemOrder"]; readonly "ManagedCollection.setPluginData": ["setPluginDataForNode"]; readonly "Node.clone": ["cloneNode"]; readonly "Node.getChildren": []; readonly "Node.getNodesWithAttribute": []; readonly "Node.getNodesWithAttributeSet": []; readonly "Node.getNodesWithType": []; readonly "Node.getParent": []; readonly "Node.getPluginData": []; readonly "Node.getPluginDataKeys": []; readonly "Node.getRect": []; readonly "Node.remove": ["removeNodes2"]; readonly "Node.select": []; readonly "Node.setAttributes": ["setAttributes"]; readonly "Node.setPluginData": ["setPluginDataForNode"]; readonly "Node.walk": []; readonly "Node.zoomIntoView": []; readonly "TextNode.getText": []; readonly "TextNode.setText": ["setTextForNode"]; readonly "TextNode.setHTML": ["INTERNAL_setHTMLForNode"]; readonly "TextNode.getHTML": []; readonly "WebPageNode.getBreakpointSuggestions": []; readonly "WebPageNode.addBreakpoint": ["addBreakpointToWebPage"]; readonly "ColorStyle.getPluginData": []; readonly "ColorStyle.getPluginDataKeys": []; readonly "ColorStyle.remove": ["removeColorStyle"]; readonly "ColorStyle.setAttributes": ["setColorStyleAttributes"]; readonly "ColorStyle.setPluginData": ["setPluginDataForNode"]; readonly "TextStyle.getPluginData": []; readonly "TextStyle.getPluginDataKeys": []; readonly "TextStyle.remove": ["removeTextStyle"]; readonly "TextStyle.setAttributes": ["setTextStyleAttributes"]; readonly "TextStyle.setPluginData": ["setPluginDataForNode"]; readonly "EnumCase.remove": ["removeEnumCase"]; readonly "EnumCase.setAttributes": ["updateEnumCase"]; readonly createCollection: ["createCollection"]; readonly createManagedCollection: ["createManagedCollection"]; readonly [getAiServiceInfo]: []; readonly [sendTrackingEvent]: []; readonly [getHTMLForNode]: []; readonly [setHTMLForNode]: []; readonly [publish]: ["publish"]; readonly [getDeployments]: []; readonly [deploy]: ["deploy"]; readonly [getChangedPaths]: []; readonly [getChangeContributors]: []; readonly [createManagedCollection]: ["createManagedCollection"]; readonly [rejectAllPending]: []; }; export declare type Mode = keyof typeof allModesRecord; declare interface Mouse { mouse: Point; } export declare interface MultiCollectionReferenceControl extends ControlBase { type: "multiCollectionReference"; value?: readonly string[] | UnsupportedVariable | UnsupportedComputedValue | undefined; } export declare class MultiCollectionReferenceField extends FieldBaseWithRequired implements WithFieldCollectionId { #private; readonly type = "multiCollectionReference"; get collectionId(): string; constructor(engine: PluginEngine, collectionId: string, data: MultiCollectionReferenceFieldDefinitionData); } declare interface MultiCollectionReferenceFieldBase { type: MultiCollectionReferenceFieldType; } declare interface MultiCollectionReferenceFieldDataEntry { type: MultiCollectionReferenceFieldType; value: readonly string[]; } declare interface MultiCollectionReferenceFieldDataEntryInput { type: MultiCollectionReferenceFieldType; value: readonly string[] | null; } declare interface MultiCollectionReferenceFieldDefinitionData extends MultiCollectionReferenceFieldBase, FieldDefinitionBase, WithFieldCollectionId, WithFieldRequired { } declare type MultiCollectionReferenceFieldType = typeof multiCollectionReferenceFieldType; declare const multiCollectionReferenceFieldType = "multiCollectionReference"; declare type NamedAssetTransfer = AssetDataTransfer & WithOptionalName; declare interface NamedFileAssetInput extends WithOptionalName { file: AssetInput; } declare interface NamedImageAssetInput extends ImageData_2 { image: AssetInput; } declare type NamedImageTransfer = AssetDataTransfer & ImageData_2; declare type NamespaceMembers = { [Member in Exclude as Member extends string ? `${Namespace}.${Member}` : never]: Class[Member]; }; /** * Represents any object in Framer that can be navigated to, such as FramerNode, CollectionItem, or CodeFile. */ declare interface Navigable { /** * Navigates to the item in the Framer UI. May switch modes to reveal the relevant view. * @param opts Configuration options for the navigation behaviour. */ navigateTo(opts?: NavigableOptions): Promise; } /** * Options for the `navigateTo` method. */ declare interface NavigableOptions { /** * Selects the item after navigation (e.g., opens the editor for a CollectionItem or selects it on the canvas). * @default true */ select?: boolean | undefined; /** * Zooms and centers the item after scrolling it into view (only applicable to canvas nodes). * @default true */ zoomIntoView?: boolean | ZoomIntoViewOptions | undefined; /** * Scrolls to and highlights a specific part of the content. */ scrollTo?: NavigableScrollToOptions | undefined; } declare interface NavigableScrollToOptions { collectionFieldId?: string; codeFilePosition?: CodeFilePosition; } export declare type NodeAttributeKey = Prettify, "id" | "children">>; declare interface NodeClassToEditableAttributes { FrameNode: EditableFrameNodeAttributes; TextNode: EditableTextNodeAttributes; SVGNode: EditableSVGNodeAttributes; ComponentInstanceNode: EditableComponentInstanceNodeAttributes; DesignPageNode: EditableDesignPageNodeAttributes; WebPageNode: EditableWebPageNodeAttributes; ComponentNode: EditableComponentNodeAttributes; VectorSetNode: EditableVectorSetNodeAttributes; VectorSetItemNode: EditableVectorSetItemNodeAttributes; UnknownNode: object; } export declare type NodeId = string; declare abstract class NodeMethods implements WithIdTrait, Navigable { #private; abstract readonly [classKey]: PluginNodeClass; readonly id: NodeId; readonly originalId: NodeId | null; constructor(data: SomeNodeData, engine: PluginEngine); get isReplica(): boolean; /** * Remove this node. * * Use `"Node.remove"` to check if this method is allowed. */ remove(): Promise; /** * Select this node. */ select(): Promise; /** * Clone this node. * * Use `"Node.clone"` to check if this method is allowed. */ clone(): Promise<(typeof NodeMethods)[ClassKey] extends "UnknownNode" ? never : typeof NodeMethods | null>; /** * Set the attributes of this node. * * Use `"Node.setAttributes"` to check if this method is allowed. */ setAttributes(update: Partial): Promise<(typeof NodeMethods)[ClassKey] extends "UnknownNode" ? never : typeof NodeMethods | null>; /** * Get the bounding box of this node. */ getRect(): Promise; /** * Pans and zooms the viewport to center the node. */ zoomIntoView(options?: ZoomIntoViewOptions): Promise; /** * Navigate to this node. May switch modes to reveal the relevant view. */ navigateTo(opts?: Pick): Promise; /** * Get the parent of this node. */ getParent(): Promise; /** * Get the children of this node. */ getChildren(): Promise; /** * Get `type` descendants of this node. */ getNodesWithType(type: "FrameNode"): Promise; getNodesWithType(type: "TextNode"): Promise; getNodesWithType(type: "SVGNode"): Promise; getNodesWithType(type: "ComponentInstanceNode"): Promise; getNodesWithType(type: "DesignPageNode"): Promise; getNodesWithType(type: "WebPageNode"): Promise; getNodesWithType(type: "ComponentNode"): Promise; /** * Get the descendants of this node that support `attribute`. */ getNodesWithAttribute>(attribute: T): Promise; /** * Get the descendants of this node that have `attribute` set. */ getNodesWithAttributeSet>(attribute: T): Promise; /** * Walk this node and its descendants recursively. */ walk(this: AnyNode): AsyncGenerator; /** * Get plugin data by key. */ getPluginData(key: string): Promise; /** * Set plugin data by key. * * Use `"Node.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get all plugin data keys. */ getPluginDataKeys(): Promise; } export declare type NodeRuntimeErrorResult = { type: "ModuleRuntimeError" | "ReactRenderingError"; message: string; }; declare type NodeType = "component" | "collection"; declare type NodeWithAttribute = Extract>; export declare interface NormalMenuItem { type?: never; label: string; secondaryLabel?: string; enabled?: boolean; visible?: boolean; checked?: boolean; submenu?: MenuItem[]; onAction?: () => void; } declare type NormalMenuItemSerializable = Omit & { actionId?: number; submenu?: MenuItemSerializable[]; }; declare interface Notification_2 { close: () => Promise; } export { Notification_2 as Notification } declare type NotificationCloseReason = "timeoutReachedOrDismissed" | "actionButtonClicked"; declare type NotificationVariant = "info" | "success" | "error" | "warning"; declare type Notify = (message: string, options?: NotifyOptions) => Notification_2; declare interface NotifyOptions extends NotifyOptionsBase { /** A button to be displayed on the notification */ button?: { /** The text of the button */ text: string; /** Click handler when the button is pressed */ onClick: () => void; }; /** A function that is called when the notification disappears */ onDisappear?: VoidFunction; } declare interface NotifyOptionsBase { /** The Notification variant for styling of the notification. Defaults to "info" */ variant?: NotificationVariant; durationMs?: number; } declare interface NotifyOptionsData extends NotifyOptionsBase { buttonText?: string; notificationId: string; } /** Type helper to transform a interface so that each value can be null or undefined. */ declare type NullablePartialRecord = Partial>; /** Type helper to transform a interface so that each value can be null. */ declare type NullableRecord = { [P in keyof T]-?: T[P] | null; }; export declare interface NumberControl extends ControlBase { type: "number"; value?: number | NumberVariable | UnsupportedComputedValue | undefined; } export declare class NumberField extends FieldBase { readonly type = "number"; } declare interface NumberFieldBase { type: NumberFieldType; } declare interface NumberFieldDataEntry { type: NumberFieldType; value: number; } declare type NumberFieldDataEntryInput = NumberFieldDataEntry; declare interface NumberFieldDefinitionData extends NumberFieldBase, FieldDefinitionBase { } declare type NumberFieldType = typeof numberFieldType; declare const numberFieldType = "number"; export declare class NumberVariable extends VariableBase { #private; readonly type: "number"; constructor(engine: PluginEngine, data: NumberVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: NumberVariableData): NumberVariable; [$framerInternal.marshal](): NumberVariableData; } declare const numberVariableClass = "NumberVariable"; declare interface NumberVariableData extends WithNumberVariableClass, BaseVariableData, WithNumberDefaultValue { } declare const numberVariableType: "number"; export declare interface ObjectControl extends ControlBase { type: "object"; value?: Record | undefined; } declare type OptimizationStatus = "optimizing" | "optimized" | "error"; declare interface OptionalColorStyleAttributes { dark: string | null; } declare type OtherDragData = Exclude; declare const otherNodes: readonly ["SVGNode", "DesignPageNode", "WebPageNode", "ComponentNode", "VectorSetNode", "VectorSetItemNode", "UnknownNode", "ComponentInstanceNode"]; declare type OtherNodeType = (typeof otherNodes)[number]; export declare type Overflow = "visible" | "hidden" | "auto" | "clip"; export declare type Ownership = { type: "project"; } | { type: "external"; name: string; }; export declare interface PaddingControl extends ControlBase { type: "padding"; value?: FourPixelNumberShorthand | UnsupportedVariable | NumberVariable | UnsupportedComputedValue | undefined; } export declare interface PageScopeControl extends ControlBase { type: "pageScope"; value?: LinkToWebPage | undefined; } declare type PartialNodeData = AnyNode | Partial; declare type PerMethodPermissionMap = { [K in ProtectedMethod]: boolean; }; declare type PermissionMap = { [K in keyof PluginMessageAPI]: boolean; }; declare type PickModes = Extract; declare type PixelNumber = `${number}px`; declare interface PluginApiContext { transport: PluginApiTransport; mode: Mode; permissionMap: PermissionMap; environmentInfo: EnvironmentInfo | null; origin: string | null; theme: Theme | null; initialState: InitialState | null; } declare interface PluginApiTransport { send: (message: PluginToVekterMessage, transfer?: Transferable[]) => void; onMessage: (handler: (event: unknown) => void) => void; } declare class PluginEngine { methodInvocationId: number; notificationId: number; readonly postMessage: PostMessage; readonly methodResponseHandlers: Map void; reject: (error: FramerPluginError) => void; }>; readonly mode: Mode; readonly subscriptions: Map<"text" | "image" | "publishInfo" | "selection" | "canvasRoot" | "theme" | "customCode" | "colorStyles" | "textStyles" | "redirects" | "codeFiles" | "openCodeFile", Set<(value: any) => void>>; perMethodPermissionMap: PerMethodPermissionMap; readonly permissionSubscriptions: Set; readonly messageTypesCheckedInIsAllowedTo: Set; showUncheckedPermissionToasts: boolean; readonly environmentInfo: EnvironmentInfo | null; menuItemOnActionCallbackMap: Map void>; contextMenuItemOnActionCallbackMap: Map void>; rejectAllPending(error: Error): void; constructor(context?: PluginApiContext); invoke(messageType: MessageType, ...args: Parameters): Promise>>; invokeTransferable(messageType: MessageType, transfer: Transferable[] | undefined, ...args: Parameters): Promise>>; subscribe(topic: Topic, callback: (data: Extract["payload"]) => void): Unsubscribe; onMessage: (eventOrMessage: unknown) => void; private getOnActionFromCallbackMap; applyPluginTheme: (theme: Theme) => void; cloneNode(nodeId: NodeId): Promise; setAttributes(nodeId: NodeId, attributes: Partial): Promise; getParent(nodeId: NodeId): Promise; getChildren(nodeId: NodeId): Promise; notify: Notify; setMenu(menuItems: MenuItem[]): Promise; showContextMenu(menuItems: MenuItem[], config: ContextMenuConfig): Promise; } declare interface PluginMessageAPI { hideUI: FramerPluginAPI["hideUI"]; setBackgroundMessage: FramerPluginAPI["setBackgroundMessage"]; setCloseWarning: (message: string | false) => Promise; closePlugin: (...parameters: Parameters) => Promise; removeNode: FramerPluginAPI["removeNode"]; removeNodes: FramerPluginAPI["removeNodes"]; addSVG: FramerPluginAPI["addSVG"]; getRect: FramerPluginAPI["getRect"]; setText: FramerPluginAPI["setText"]; getText: FramerPluginAPI["getText"]; addText: FramerPluginAPI["addText"]; preloadDetachedComponentLayers: FramerPluginAPI["preloadDetachedComponentLayers"]; preloadImageUrlForInsertion: FramerPluginAPI["preloadImageUrlForInsertion"]; preloadDragPreviewImage: FramerPluginAPI["preloadDragPreviewImage"]; setCustomCode: FramerPluginAPI["setCustomCode"]; getCustomCode: FramerPluginAPI["getCustomCode"]; setPluginData: FramerPluginAPI["setPluginData"]; getPluginData: FramerPluginAPI["getPluginData"]; getPluginDataKeys: FramerPluginAPI["getPluginDataKeys"]; getLocales: FramerPluginAPI["getLocales"]; getDefaultLocale: FramerPluginAPI["getDefaultLocale"]; getActiveLocale: FramerPluginAPI["getActiveLocale"]; getLocalizationGroups: FramerPluginAPI["getLocalizationGroups"]; setLocalizationData: FramerPluginAPI["setLocalizationData"]; unstable_ensureMinimumDependencyVersion: FramerPluginAPI["unstable_ensureMinimumDependencyVersion"]; showUI: (options?: UIOptions) => Promise; notify: (message: string, options: NotifyOptionsData) => Promise; closeNotification: (notificationId: string) => Promise; getCurrentUser(): Promise; getCurrentUser2(): Promise; getProjectInfo(): Promise; getProjectInfo2(): Promise; getSelection: () => Promise; setSelection: (nodeIds: NodeId[]) => Promise; getCanvasRoot: () => Promise; getPublishInfo: () => Promise; createNode: (type: CreateNodeType, parentId: NodeId | null, attributes: Record) => Promise; cloneNode: (nodeId: NodeId) => Promise; getNode: (nodeId: NodeId) => Promise; getParent: (nodeId: NodeId) => Promise; getChildren: (nodeId: NodeId) => Promise; removeNodes2: (ids: NodeId[]) => Promise; zoomIntoView: (nodeIds: NodeId[], options?: ZoomIntoViewOptions) => Promise; navigateTo: (nodeId: string, opts?: NavigableOptions) => Promise; setAttributes: (nodeId: NodeId, attributes: Record) => Promise; getTextForNode(nodeId: NodeId): Promise; setTextForNode(nodeId: NodeId, text: string): Promise; getSVGForNode: (nodeId: NodeId) => Promise; getNodesWithType: (nodeId: NodeId | null, type: KnownNodeClass) => Promise; getNodesWithAttribute: (nodeId: NodeId | null, attribute: string) => Promise; getNodesWithAttributeSet: (nodeId: NodeId | null, attribute: string) => Promise; addImages: (image: readonly NamedImageTransfer[]) => Promise; getImage(): Promise; addImage(image: NamedImageTransfer): Promise; setImage(image: NamedImageTransfer): Promise; uploadImage(image: NamedImageTransfer): Promise; uploadImages: (image: readonly NamedImageTransfer[]) => Promise; uploadFile: (file: NamedAssetTransfer) => Promise; uploadFiles: (files: readonly NamedAssetTransfer[]) => Promise; getImageData: (image: AssetIdentifier & Partial>) => Promise; setParent: (nodeId: NodeId, parentId: NodeId, index?: number) => Promise; addComponentInstance: (options: { url: string; attributes?: Partial>; parentId?: string; }) => Promise; addDetachedComponentLayers: (options: { url: string; layout?: boolean; attributes?: Partial>; }) => Promise; setDragData: (dragSessionId: string, dragData: MessageApiDragData) => Promise; onDragStart: (info: DragStartInfo) => Promise; onDrag: (info: DragInfo) => Promise; onDragEnd: (info: DragEndInfo) => Promise; onPointerDown: () => Promise; getActiveManagedCollection: () => Promise; /** @deprecated Use getActiveManagedCollection */ getManagedCollection: () => Promise; getManagedCollections: () => Promise; getManagedCollectionItemIds: (id: NodeId) => Promise; setManagedCollectionItemOrder: (id: NodeId, ids: string[]) => Promise; setManagedCollectionFields: (id: NodeId, fields: ManagedCollectionFieldInputData[]) => Promise; getManagedCollectionFields: (id: NodeId) => Promise; getManagedCollectionFields2: (id: NodeId) => Promise; addManagedCollectionItems: (id: NodeId, items: ApiV2ManagedCollectionItemInput[]) => Promise; addManagedCollectionItems2: (id: NodeId, items: ManagedCollectionItemInput[]) => Promise; removeManagedCollectionItems: (id: NodeId, itemIds: string[]) => Promise; createCollection: (name: string) => Promise; getCollection: (id: NodeId) => Promise; getActiveCollection: () => Promise; getCollections: () => Promise; getCollectionItems: (id: NodeId) => Promise; getCollectionItems2: (id: NodeId) => Promise; setCollectionItemOrder: (collectionId: NodeId, itemIds: NodeId[]) => Promise; getCollectionFields: (collectionId: string, includeDividers?: true) => Promise; getCollectionFields2: (collectionId: string, includeDividers?: true) => Promise; addCollectionFields: (collectionId: string, fields: FieldInput[]) => Promise<(FieldDefinitionData | null)[]>; addCollectionFields2: (collectionId: string, fields: FieldInput[]) => Promise<(FieldDefinitionData | null)[]>; removeCollectionFields: (collectionId: string, fieldIds: string[]) => Promise; setCollectionFieldOrder: (collectionId: string, fieldIds: string[]) => Promise; addCollectionItems: (id: NodeId, items: ApiV2CollectionItemInput[]) => Promise; addCollectionItems2: (id: NodeId, items: CollectionItemInput[]) => Promise; setCollectionItemAttributes: (id: NodeId, attributes: ApiV2EditableCollectionItemAttributes) => Promise; setCollectionItemAttributes2: (id: NodeId, attributes: EditableCollectionItemAttributes) => Promise; setActiveCollection: (collectionId: NodeId) => Promise; removeCollectionItems: (ids: NodeId[]) => Promise; addEnumCase: (collectionId: string, fieldId: string, attributes: CreateEnumCase) => Promise; updateEnumCase: (collectionId: string, fieldId: string, caseId: string, attributes: UpdateEnumCase) => Promise; removeEnumCase: (collectionId: string, fieldId: string, caseId: string) => Promise; setEnumCaseOrder: (collectionId: string, fieldId: string, caseIds: string[]) => Promise; getPluginDataForNode: (id: NodeId, key: string) => Promise; setPluginDataForNode: (id: NodeId, key: string, value: string | null) => Promise; getPluginDataKeysForNode: (id: NodeId) => Promise; getColorStyle(id: NodeId): Promise; getColorStyles(): Promise; createColorStyle(attributes: Record): Promise; setColorStyleAttributes(id: NodeId, update: Record): Promise; removeColorStyle(id: NodeId): Promise; getTextStyle: (id: NodeId) => Promise; getTextStyles: () => Promise; createTextStyle: (attributes: Record) => Promise; setTextStyleAttributes: (id: NodeId, update: Record) => Promise; removeTextStyle: (id: NodeId) => Promise; getFont: (family: string, attributes?: Record) => Promise; getFonts: () => Promise; /** @deprecated */ unstable_createCodeFile: (name: string, code: string) => Promise; /** @deprecated */ unstable_getCodeFiles: () => Promise; /** @deprecated */ unstable_getCodeFile: (id: string) => Promise; /** @deprecated */ unstable_renameCodeFile: (id: string, newName: string) => Promise; /** @deprecated */ unstable_removeCodeFile: (id: string) => Promise; /** @deprecated */ unstable_setCodeFileContent: (id: string, code: string) => Promise; /** @deprecated */ unstable_getCodeFileVersions: (id: string) => Promise; /** @deprecated */ unstable_getCodeFileVersionContent: (fileId: string, versionId: string) => Promise; /** @deprecated */ unstable_getCodeFileLint2(fileName: string, content: string, rules: LintConfig): Promise; /** @deprecated */ unstable_getCodeFileTypecheck2(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions): Promise; createCodeFile: (name: string, code: string, options?: { editViaPlugin?: boolean; }) => Promise; getCodeFiles: () => Promise; getCodeFile: (id: string) => Promise; renameCodeFile: (id: string, newName: string) => Promise; removeCodeFile: (id: string) => Promise; setCodeFileContent: (id: string, code: string) => Promise; getCodeFileVersions: (id: string) => Promise; getCodeFileVersionContent: (fileId: string, versionId: string) => Promise; /** @deprecated The lintCode API was removed. */ lintCode(fileName: string, content: string, rules: LintConfig): Promise; typecheckCode(fileName: string, content: string, compilerOptions?: ts.server.protocol.CompilerOptions, sessionId?: string): Promise; addRedirects: (redirects: RedirectInput[]) => Promise; getRedirects: () => Promise; setRedirectOrder: (redirectIds: string[]) => Promise; removeRedirects: (redirectIds: string[]) => Promise; /** @deprecated Use `getRuntimeErrorForCodeComponentNode` instead. Can be removed when Workshop is updated. */ getRuntimeErrorForModule: (moduleIdentifier: string) => Promise; getRuntimeErrorForCodeComponentNode: (nodeId: NodeId) => Promise; addComponentInstancePlaceholder: (attributes?: ComponentInstancePlaceholderAttributes) => Promise; updateComponentInstancePlaceholder: (id: string, attributes: ComponentInstancePlaceholderAttributes) => Promise; removeComponentInstancePlaceholder: (id: string) => Promise; replaceComponentInstancePlaceholderWithComponentInstance: (id: string, url: string, attributes?: Partial) => Promise; showProgressOnInstances: (codeFileId: string, attributes?: ShowProgressOnInstancesAttributes) => Promise; removeProgressFromInstances: (codeFileId: string) => Promise; setMenu: (menuItems: MenuItemSerializable[]) => Promise; showContextMenu: (menuItems: MenuItemSerializable[], config: ContextMenuConfig) => Promise; [getAiServiceInfoMessageType]: () => Promise; [sendTrackingEventMessageType]: (key: string, value: string, identifier: string) => Promise; [getHTMLForNodeMessageType]: (nodeId: NodeId) => Promise; [setHTMLForNodeMessageType]: (nodeId: NodeId, html: string) => Promise; /** @deprecated Use `getAiServiceInfoMessageType`. */ getAiServiceInfo: () => Promise; /** @deprecated Use `sendTrackingEventMessageType`. */ sendTrackingEvent: (key: string, value: string, identifier: string) => Promise; createDesignPage: (pageName: string) => Promise; createWebPage: (pagePath: string) => Promise; } declare type PluginMessageId = number; declare interface PluginMethodInvocation { [typeKey]: "methodInvocation"; methodName: keyof PluginMessageAPI; id: PluginMessageId; args: unknown[]; } declare type PluginNodeClass = OtherNodeType | CreateNodeType$1; declare type PluginReadySignal = typeof readySignal; declare interface PluginSubscribe { [typeKey]: "subscribe"; topic: PluginSubscriptionTopic; } declare interface PluginSubscription { [typeKey]: PluginSubscribe[TypeKey] | PluginUnsubscribe[TypeKey]; topic: PluginSubscriptionTopic; } declare interface PluginSubscriptionBase { [typeKey]: "subscriptionMessage"; payload: unknown; } declare interface PluginSubscriptionCanvasRoot extends PluginSubscriptionBase { topic: "canvasRoot"; payload: SomeNodeData; } declare interface PluginSubscriptionCodeFiles extends PluginSubscriptionBase { topic: "codeFiles"; payload: readonly CodeFileData[]; } declare interface PluginSubscriptionColorStyle extends PluginSubscriptionBase { topic: "colorStyles"; payload: ColorStyleData[]; } declare interface PluginSubscriptionCustomHTML extends PluginSubscriptionBase { topic: "customCode"; payload: CustomCode; } declare type PluginSubscriptionEvent = PluginSubscriptionPublishInfo | PluginSubscriptionSelection | PluginSubscriptionCanvasRoot | PluginSubscriptionImage | PluginSubscriptionTheme | PluginSubscriptionText | PluginSubscriptionCustomHTML | PluginSubscriptionColorStyle | PluginSubscriptionTextStyle | /** @alpha */ PluginSubscriptionRedirects | PluginSubscriptionCodeFiles | /** @alpha */ PluginSubscriptionOpenCodeFile; declare interface PluginSubscriptionImage extends PluginSubscriptionBase { topic: "image"; payload: ImageAssetData | null; } declare interface PluginSubscriptionPublishInfo extends PluginSubscriptionBase { topic: "publishInfo"; payload: PublishInfo; } declare interface PluginSubscriptionSelection extends PluginSubscriptionBase { topic: "selection"; payload: SomeNodeData[]; } declare interface PluginSubscriptionText extends PluginSubscriptionBase { topic: "text"; payload: string | null; } declare interface PluginSubscriptionTextStyle extends PluginSubscriptionBase { topic: "textStyles"; payload: TextStyleData[]; } declare interface PluginSubscriptionTheme extends PluginSubscriptionBase { topic: "theme"; payload: Theme; } declare type PluginSubscriptionTopic = PluginSubscriptionEvent["topic"]; declare type PluginToVekterMessage = PluginMethodInvocation | PluginSubscription | PluginReadySignal; declare interface PluginUnsubscribe { [typeKey]: "unsubscribe"; topic: PluginSubscriptionTopic; } declare interface Point { x: number; y: number; } export declare type Position = "relative" | "absolute" | "fixed" | "sticky"; declare type PostMessage = (message: PluginToVekterMessage, transfer?: Transferable[] | undefined) => void; /** * This alias takes a type as its argument and returns a new type that has the same properties as * the original, but the properties are not intersected. This makes the new type easier to read and * understand. * * Example: * ```ts * // Original type: * { a: string; } & { b: number; } & { c: boolean; } * * // New type: * { a: string; b: number; c: boolean; } * ``` */ declare type Prettify = { [K in keyof T]: T[K] extends object ? Prettify : T[K]; } & {}; export declare interface ProjectInfo extends ApiVersion1ProjectInfo { /** Hashed project id served by API version 1, use for migration only */ apiVersion1Id: string; } declare type ProtectedMessageType = Exclude; export declare type ProtectedMethod = AllMethods & string; export declare interface Publish { deploymentTime: number; optimizationStatus: OptimizationStatus; url: string; currentPageUrl: string; } declare const publish: unique symbol; export declare interface PublishInfo { production: Publish | null; staging: Publish | null; } export declare interface PublishResult { deployment: Deployment; hostnames: Hostname[]; } export declare class RadialGradient extends GradientBase { #private; readonly [classKey]: "RadialGradient"; /** Relative width */ get width(): CSSDimension; /** Relative height */ get height(): CSSDimension; /** Relative horizontal position */ get x(): CSSDimension; /** Relative vertical position */ get y(): CSSDimension; constructor(unmarshaledAttributes: UnmarshaledRadialGradientAttributes); static [$framerInternal.unmarshal](engine: PluginEngine, data: RadialGradientData): RadialGradient; [$framerInternal.marshal](): RadialGradientData; toCSS(): string; } declare interface RadialGradientData extends BaseGradientData { [classKey]: RadialGradientType; width: CSSDimension; height: CSSDimension; x: CSSDimension; y: CSSDimension; } declare type RadialGradientType = typeof radialGradientType; declare const radialGradientType: "RadialGradient"; declare const readySignal: { readonly type: "pluginReadySignal"; }; export declare interface Rect { x: number; y: number; width: number; height: number; } declare type Rect_2 = Point & Size$1; export declare class Redirect { #private; /** The id of the redirect. */ get id(): string; /** The source path to redirect from. */ get from(): string; /** The destination path to redirect to. */ get to(): string | null; /** Whether to expand the redirect to all locales. */ get expandToAllLocales(): boolean; constructor(data: RedirectData, engine: PluginEngine); /** * Remove the redirect. */ remove(): Promise; /** * Update the redirect attributes. * * @returns The updated redirect, or `null` if the redirect was not found. */ setAttributes(attributes: Partial): Promise; } declare interface RedirectAttributes { /** The source path to redirect from */ from: string; /** Whether to expand the redirect to all locales */ expandToAllLocales: boolean; } declare interface RedirectData extends RedirectAttributes, WithNullableToField { /** The id of the redirect */ id: string; } export declare type RedirectInput = Prettify; declare const rejectAllPending: unique symbol; declare type Rel = "nofollow" | "noreferrer" | "me" | "ugc" | "sponsored"; declare type RelativeNumber = `${number}%`; declare type RelativeOrFourPixelNumberShorthand = RelativeNumber | FourPixelNumberShorthand; declare type ReleaseChannel = "alpha" | "beta" | "stable"; declare interface RequiredColorStyleAttributes { light: string; } declare type Resolution = "auto" | "lossless" | "small" | "medium" | "large" | "full"; export declare interface ScrollSectionControl extends ControlBase { type: "scrollSection"; value?: ScrollSectionSelector | UnsupportedVariable | undefined; } declare interface ScrollSectionSelector extends Partial { targetNodeId: string; } declare const sendTrackingEvent: unique symbol; declare const sendTrackingEventMessageType = "INTERNAL_sendTrackingEvent"; export declare interface SeparatorMenuItem { type: "separator"; } declare interface SetCustomCodeOptions { html: string | null; location: CustomCodeLocation; } declare const setHTMLForNode: unique symbol; declare const setHTMLForNodeMessageType = "INTERNAL_setHTMLForNode"; export declare interface SetLocalizationDataResult { /** Set one or more localized values */ valuesBySource: { errors: readonly LocalizationValueError[]; }; /** Set the hidden locale IDs of one or more localization groups */ statusByLocaleByGroup: { errors: readonly LocalizationStatusByLocaleError[]; }; } declare interface Shadow { type: "box" | "realistic"; inset: boolean; color: string | ColorStyle; x: number; y: number; blur: number; spread: number; diffusion: number; focus: number; } export declare interface ShadowControl extends ControlBase { type: "shadow"; value?: readonly Shadow[] | UnsupportedVariable | UnsupportedComputedValue | undefined; } declare const showUncheckedPermissionToasts: unique symbol; declare interface Size$1 { width: number; height: number; } declare interface Size { /** Same as [HTMLImageElement.naturalWidth](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalWidth). * * **Warning**: May be zero! */ width: number; /** Same as [HTMLImageElement.naturalHeight](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/naturalHeight). * * **Warning**: May be zero! */ height: number; } declare interface SlotControl extends ControlBase { type: "slot"; value?: readonly SlotItem[] | undefined; } declare interface SlotItem { id: string; nodeId?: string | undefined; } declare type SomeNodeData = FrameNodeData | TextNodeData | ComponentInstanceNodeData | SVGNodeData | DesignPageNodeData | WebPageNodeData | ComponentNodeData | VectorSetNodeData | VectorSetItemNodeData | UnknownNodeData; export declare type StackAlignment = "start" | "center" | "end"; export declare type StackDirection = "horizontal" | "vertical"; export declare type StackDistribution = "start" | "center" | "end" | "space-between" | "space-around" | "space-evenly"; export declare interface StackLayout { stackDirection: StackDirection | null; stackDistribution: StackDistribution | null; stackAlignment: StackAlignment | null; stackWrapEnabled: boolean | null; } export declare interface StringControl extends ControlBase { type: "string"; value?: string | StringVariable | UnsupportedVariable | UnsupportedComputedValue | undefined; } export declare class StringField extends FieldBaseWithRequired implements WithFieldBasedOn { #private; readonly type = "string"; constructor(engine: PluginEngine, collectionId: string, data: StringFieldDefinitionData); get basedOn(): string | null; } declare interface StringFieldBase { type: StringFieldType; } declare interface StringFieldDataEntry { type: StringFieldType; value: string; valueByLocale: InlineLocalizationValueByLocale; } declare interface StringFieldDataEntryInput { type: StringFieldType; value: string; valueByLocale?: LocalizationSourceUpdate; } declare interface StringFieldDefinitionData extends StringFieldBase, WithFieldRequired, WithFieldBasedOn, FieldDefinitionBase { } declare type StringFieldType = typeof stringFieldType; declare const stringFieldType = "string"; export declare class StringVariable extends VariableBase { #private; readonly type: "string"; constructor(engine: PluginEngine, data: StringVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: StringVariableData): StringVariable; [$framerInternal.marshal](): StringVariableData; } declare const stringVariableClass = "StringVariable"; declare interface StringVariableData extends WithStringVariableClass, BaseVariableData, WithStringDefaultValue { } declare const stringVariableType: "string"; /** * A collection field that Framer knows about and the plugin API fully supports. */ declare type SupportedFieldDefinitionData = BooleanFieldDefinitionData | ColorFieldDefinitionData | NumberFieldDefinitionData | StringFieldDefinitionData | FormattedTextFieldDefinitionData | ImageFieldDefinitionData | LinkFieldDefinitionData | DateFieldDefinitionData | FileFieldDefinitionData | EnumFieldDefinitionData | CollectionReferenceFieldDefinitionData | MultiCollectionReferenceFieldDefinitionData | ArrayFieldDefinitionData; export declare function supportsAspectRatio(node: T): node is T & WithAspectRatioTrait; export declare function supportsBackgroundColor(node: T): node is T & WithBackgroundColorTrait; export declare function supportsBackgroundColorData>(node: T): node is T & WithBackgroundColorTrait; export declare function supportsBackgroundGradient(node: T): node is T & WithBackgroundGradientTrait; export declare function supportsBackgroundGradientData(node: T): node is T & WithBackgroundGradientTrait; export declare function supportsBackgroundImage(node: T): node is T & WithBackgroundImageTrait; export declare function supportsBackgroundImageData>(node: T): node is T & WithBackgroundImageTrait; export declare function supportsBorder(node: T): node is T & WithBorderTrait; export declare function supportsBorderRadius(node: T): node is T & WithBorderRadiusTrait; export declare function supportsBreakpoint(node: T): node is T & WithBreakpointTrait; export declare function supportsComponentInfo(node: T): node is T & WithComponentInfoTrait; export declare function supportsComponentVariant(node: T): node is T & WithComponentVariantTrait; export declare function supportsFont(node: T): node is T & WithFontTrait; export declare function supportsFontData(node: T): node is T & WithFontTrait; export declare function supportsImageRendering(node: T): node is T & WithImageRenderingTrait; export declare function supportsInlineTextStyle(node: T): node is T & WithInlineTextStyleTrait; export declare function supportsInlineTextStyleData(node: T): node is T & WithInlineTextStyleTrait; export declare function supportsLayout(node: T): node is T & WithLayoutTrait; export declare function supportsLink(node: T): node is T & WithLinkTrait; export declare function supportsLocked(node: T): node is T & WithLockedTrait; export declare function supportsName(node: T): node is T & WithNameTrait; export declare function supportsOpacity(node: T): node is T & WithOpacityTrait; export declare function supportsOverflow(node: T): node is T & WithOverflowTrait; export declare function supportsPins(node: T): node is T & WithPinsTrait; export declare function supportsPosition(node: T): node is T & WithPositionTrait; export declare function supportsRotation(node: T): node is T & WithRotationTrait; export declare function supportsSize(node: T): node is T & WithSizeTrait; export declare function supportsSizeConstraints(node: T): node is T & WithSizeConstraintsTrait; export declare function supportsSVG(node: T): node is T & WithSVGTrait; export declare function supportsTextTruncation(node: T): node is T & WithTextTruncationTrait; export declare function supportsVisible(node: T): node is T & WithVisibleTrait; export declare function supportsZIndex(node: T): node is T & WithZIndexTrait; declare interface SVGData extends WithOptionalName { svg: string; } declare interface SvgDragData extends WithOptionalName$1, WithOptionalPreviewImage { type: "svg"; svg: string; /** Inverts SVG drag preview in dark mode. Defaults to true. */ invertInDarkMode?: boolean; } export declare class SVGNode extends NodeMethods implements EditableSVGNodeAttributes { readonly [classKey]: SVGNodeData[ClassKey]; readonly name: string | null; readonly visible: boolean; readonly locked: boolean; readonly svg: string; readonly rotation: number; readonly opacity: number; readonly position: Position; readonly top: CSSDimension | null; readonly right: CSSDimension | null; readonly bottom: CSSDimension | null; readonly left: CSSDimension | null; readonly centerX: CSSDimension | null; readonly centerY: CSSDimension | null; readonly width: WidthLength | null; readonly height: HeightLength | null; constructor(rawData: SVGNodeData, engine: PluginEngine); } declare interface SVGNodeData extends CommonNodeData, Partial, WithPositionTrait, Partial, Partial, WithSVGTrait, Partial { [classKey]: "SVGNode"; } export declare type TextAlignment = "left" | "center" | "right" | "justify"; export declare type TextDecoration = "none" | "underline" | "line-through"; declare type TextDecorationSkipInk = "none" | "all" | "auto"; declare type TextDecorationStyle = "solid" | "double" | "dotted" | "dashed" | "wavy"; export declare class TextNode extends NodeMethods implements EditableTextNodeAttributes { #private; readonly [classKey]: TextNodeData[ClassKey]; readonly name: string | null; readonly visible: boolean; readonly locked: boolean; readonly rotation: number; readonly opacity: number; readonly zIndex: WithZIndexTrait["zIndex"]; readonly font: Font | null; readonly inlineTextStyle: TextStyle | null; readonly position: Position; readonly top: CSSDimension | null; readonly right: CSSDimension | null; readonly bottom: CSSDimension | null; readonly left: CSSDimension | null; readonly centerX: CSSDimension | null; readonly centerY: CSSDimension | null; readonly width: WidthLength | null; readonly height: HeightLength | null; readonly maxWidth: WidthConstraint | null; readonly minWidth: WidthConstraint | null; readonly maxHeight: HeightConstraint | null; readonly minHeight: HeightConstraint | null; readonly link: string | null; readonly linkOpenInNewTab: boolean | null; readonly gridItemFillCellWidth: WithGridItemTrait["gridItemFillCellWidth"]; readonly gridItemFillCellHeight: WithGridItemTrait["gridItemFillCellHeight"]; readonly gridItemHorizontalAlignment: WithGridItemTrait["gridItemHorizontalAlignment"]; readonly gridItemVerticalAlignment: WithGridItemTrait["gridItemVerticalAlignment"]; readonly gridItemColumnSpan: WithGridItemTrait["gridItemColumnSpan"]; readonly gridItemRowSpan: WithGridItemTrait["gridItemRowSpan"]; readonly overflow: WithOverflowTrait["overflow"]; readonly overflowX: WithOverflowTrait["overflowX"]; readonly overflowY: WithOverflowTrait["overflowY"]; readonly textTruncation: WithTextTruncationTrait["textTruncation"]; constructor(rawData: TextNodeData, engine: PluginEngine); /** * Set the text of this node. Plain text content, not HTML. * * Use `"TextNode.setText"` to check if this method is allowed. */ setText(text: string): Promise; /** * Get the text of this node. Plain text content, not HTML. */ getText(): Promise; } declare interface TextNodeData extends CommonNodeData, Partial, WithPositionTrait, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial, Partial>, Partial>, Partial { [classKey]: "TextNode"; } declare type TextNodeTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p"; export declare class TextStyle { #private; readonly id: NodeId; readonly name: string; /** * Hierarchical path to the text style in the assets folder structure, e.g. `ui/modals/text`. * Used for organizing text styles in the UI and for programmatic access. * Segments are separated by forward slashes. */ readonly path: string; /** HTML tag that the style will use. */ readonly tag: TextStyleTag; /** * Base font of the text. * * Setting this will automatically update `boldFont`, `italicFont` or * `boldItalicFont` with the appropriate variants if they are not already * specified. * */ readonly font: Font; /** * Font to use for bold text. * * Note: This must have the same family name as the base `font` attribute. * */ readonly boldFont: Font | null; /** * Font to use for italic text. * * Note: This must be the same family name as the base `font` attribute. * */ readonly italicFont: Font | null; /** * Font to use for bold italic text. * * Note: This must have the same family name as the base `font` attribute. * */ readonly boldItalicFont: Font | null; /** Color of the text in RGBA format for all breakpoints, e.g `rgba(242, 59, 57, 1)` */ readonly color: ColorStyle | string; /** Specifies how to capitalize the text for all breakpoints. */ readonly transform: TextTransform; /** Specifies the horizontal direction of the text for all breakpoints. */ readonly alignment: TextAlignment; /** Appearance of any decorative lines on the text for all breakpoints. */ readonly decoration: TextDecoration; /** Color of the text decoration in RGBA format for all breakpoints, e.g `rgba(242, 59, 57, 1)` */ readonly decorationColor: ColorStyle | string; /** Thickness of the text decoration for all breakpoints. */ readonly decorationThickness: "auto" | CSSDimension; /** Style of the text decoration for all breakpoints. */ readonly decorationStyle: TextDecorationStyle; /** Whether to skip ink when drawing the text decoration for all breakpoints. */ readonly decorationSkipInk: TextDecorationSkipInk; /** Offset of the text decoration for all breakpoints. */ readonly decorationOffset: "auto" | CSSDimension; /** When enabled, use a text wrap method that tries to balance the number of characters on each line for legibility. */ readonly balance: boolean; /** A list of style overrides that take affect at specific window widths. Breakpoints are automatically sorted by `minWidth` from largest to smallest. */ readonly breakpoints: TextStyleBreakpoint[]; /** * How big does the window width need to be for primary breakpoint styles to * take affect. * * Note: This is ignored if the text style has no breakpoints. * */ readonly minWidth: number; /** * Size of the text of the primary breakpoint. * * Note: This is used by default when there are no breakpoints. * */ readonly fontSize: CSSDimension; /** * Size of the space between each letter for the primary breakpoint. * * Note: This is used by default when there are no breakpoints. * */ readonly letterSpacing: CSSDimension; /** * Size of the space between each line of text for the primary breakpoint. * * Note: This is used by default when there are no breakpoints. * */ readonly lineHeight: CSSDimension; /** * Size of the space between each paragraph for the primary breakpoint. * * Note: This is used by default when there are no breakpoints. * */ readonly paragraphSpacing: number; constructor(engine: PluginEngine, data: TextStyleData); static [$framerInternal.unmarshal](engine: PluginEngine, data: TextStyleData): TextStyle; [$framerInternal.marshal](): TextStyleData; /** * Set the attributes of the text style. * * @throws If the number of breakpoints is bigger than the limit of 4. * @throws If any of the font families used for `boldFont`, `italicFont` and * `boldItalicFont` do not match the family of `font`. * * Use `"TextStyle.setAttributes"` to check if this method is allowed. */ setAttributes(attributes: TextStyleAttributes): Promise; /** * Get plugin data for this text style by key. */ getPluginData(key: string): Promise; /** * Set plugin data on this text style by key. * * Use `"TextStyle.setPluginData"` to check if this method is allowed. */ setPluginData(key: string, value: string | null): Promise; /** * Get all plugin data keys for this text style. */ getPluginDataKeys(): Promise; /** * Deletes the text style from the project. * * Use `"TextStyle.remove"` to check if this method is allowed. */ remove(): Promise; } declare type TextStyleAttributes = Prettify & { color: ColorStyle | string; font: Font; boldFont: Font | null; italicFont: Font | null; boldItalicFont: Font | null; breakpoints: TextStyleBreakpointAttributes[]; }> & AssetPath>; export declare type TextStyleBreakpoint = Prettify; declare type TextStyleBreakpointAttributes = Prettify & Pick>; declare interface TextStyleBreakpointData { /** * How big does the window width need to be for this breakpoint's styles to * take affect. * * This must be unique for each breakpoint. * */ minWidth: number; /** Size of the text at this breakpoint. */ fontSize: CSSDimension; /** Size of the space between each letter at this breakpoint. */ letterSpacing: CSSDimension; /** Size of the space between each line of text at this breakpoint. */ lineHeight: CSSDimension; /** Size of the space between each paragraph at this breakpoint. */ paragraphSpacing: number; } declare interface TextStyleData extends TextStyleBreakpointData { [classKey]: typeof textStyleDiscriminator; id: NodeId; name: string; path: string; tag: TextStyleTag; color: ColorStyleData | string; font: FontData; boldFont: FontData | null; italicFont: FontData | null; boldItalicFont: FontData | null; transform: TextTransform; alignment: TextAlignment; decoration: TextDecoration; decorationColor: ColorStyleData | string; decorationThickness: "auto" | CSSDimension; decorationStyle: TextDecorationStyle; decorationSkipInk: TextDecorationSkipInk; decorationOffset: "auto" | CSSDimension; balance: boolean; breakpoints: TextStyleBreakpointData[]; } declare const textStyleDiscriminator: "TextStyle"; export declare type TextStyleTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p"; export declare type TextTransform = "none" | "inherit" | "capitalize" | "uppercase" | "lowercase"; declare interface Theme { mode: ThemeMode; tokens: ThemeTokens; } declare type ThemeMode = "light" | "dark"; declare interface ThemeTokens { "--framer-color-tint": string; "--framer-color-tint-dimmed": string; "--framer-color-tint-dark": string; "--framer-color-text": string; "--framer-color-text-secondary": string; "--framer-color-text-tertiary": string; "--framer-color-text-reversed": string; "--framer-color-bg": string; "--framer-color-bg-secondary": string; "--framer-color-bg-tertiary": string; "--framer-color-divider": string; "--framer-color-tint-extra-dark": string; } export declare interface TrackingIdControl extends ControlBase { type: "trackingId"; value?: string | UnsupportedVariable | undefined; } export declare type TraitVariant = TraitVariantData | TraitVariantNode; export declare type TraitVariantData = "data"; export declare type TraitVariantNode = "node"; declare interface Transition { type: "spring" | "tween" | "inertia" | false; ease: [number, number, number, number]; duration: number; delay: number; stiffness: number; damping: number; mass: number; durationBasedSpring?: boolean; bounce?: number; stagger?: number; } export declare interface TransitionControl extends ControlBase { type: "transition"; value?: Transition | UnsupportedVariable | undefined; } declare type TwoPixelNumberShorthand = PixelNumber | `${PixelNumber} ${PixelNumber}`; export declare interface TypecheckDiagnostic extends DiagnosticBase { /** * The span of the invalid code in the file. * Could be undefined if the diagnostic is system-level (and not file-specific), like e.g. an error about invalid TS options. */ span?: DiagnosticSpan; /** Could be undefined if the diagnostic is system-level (and not file-specific), like e.g. an error about invalid TS options */ fileName?: string; code: number; category: ts.DiagnosticCategory; } declare type TypeKey = typeof typeKey; declare const typeKey = "type"; export declare interface UIOptions { /** The preferred UI width. */ width?: number; /** The preferred UI height. */ height?: number; /** The initial window position, defaults to top left. */ position?: "center" | "top left" | "bottom left" | "top right" | "bottom right"; /** Whether the UI is resizable. */ resizable?: true | false | "width" | "height"; /** Minimum UI width. */ minWidth?: number; /** Minimum UI height. */ minHeight?: number; /** Maximum UI width. */ maxWidth?: number; /** Maximum UI height. */ maxHeight?: number; } declare class UnknownNode extends NodeMethods { readonly [classKey]: UnknownNodeData[ClassKey]; constructor(rawData: UnknownNodeData, engine: PluginEngine); } declare interface UnknownNodeData extends CommonNodeData { [classKey]: "UnknownNode"; } declare const unmarshal: unique symbol; declare interface UnmarshaledConicGradient extends UnmarshaledGradientBase { [classKey]: ConicGradientType; angle: number; x: CSSDimension; y: CSSDimension; } declare type UnmarshaledConicGradientAttributes = Omit; declare type UnmarshaledGradient = UnmarshaledLinearGradient | UnmarshaledRadialGradient | UnmarshaledConicGradient; declare type UnmarshaledGradientAttributes = Omit; declare interface UnmarshaledGradientBase { stops: readonly ColorStop[]; } declare interface UnmarshaledLinearGradient extends UnmarshaledGradientBase { [classKey]: LinearGradientType; angle: number; } declare type UnmarshaledLinearGradientAttributes = Omit; declare interface UnmarshaledRadialGradient extends UnmarshaledGradientBase { [classKey]: RadialGradientType; width: CSSDimension; height: CSSDimension; x: CSSDimension; y: CSSDimension; } declare type UnmarshaledRadialGradientAttributes = Omit; declare type UnprotectedMessageType = (typeof unprotectedMessageTypesSource)[number]; declare const unprotectedMessageTypesSource: ["closeNotification", "closePlugin", "setCloseWarning", "getActiveCollection", "getActiveLocale", "getActiveManagedCollection", "getCanvasRoot", "getChildren", "getCollection", "getCollectionFields", "getCollectionFields2", "getCollectionItems", "getCollectionItems2", "getCollections", "getColorStyle", "getColorStyles", "getCurrentUser", "getCurrentUser2", "getCustomCode", "getDefaultLocale", "getFont", "getFonts", "getImage", "getImageData", "getLocales", "getLocalizationGroups", "getManagedCollection", "getManagedCollectionFields", "getManagedCollectionFields2", "getManagedCollectionItemIds", "getManagedCollections", "getNode", "getNodesWithAttribute", "getNodesWithAttributeSet", "getNodesWithType", "getParent", "getPluginData", "getPluginDataForNode", "getPluginDataKeys", "getPluginDataKeysForNode", "getProjectInfo", "getProjectInfo2", "getPublishInfo", "getRect", "getSelection", "getSVGForNode", "getText", "getTextForNode", "getTextStyle", "getTextStyles", "hideUI", "setBackgroundMessage", "notify", "onPointerDown", "setActiveCollection", "setSelection", "showUI", "getCodeFileVersionContent", "typecheckCode", "getCodeFileVersions", "getCodeFiles", "getCodeFile", "getRedirects", "uploadFile", "uploadFiles", "uploadImage", "uploadImages", "zoomIntoView", "navigateTo", "getRuntimeErrorForModule", "getRuntimeErrorForCodeComponentNode", "showProgressOnInstances", "removeProgressFromInstances", "addComponentInstancePlaceholder", "updateComponentInstancePlaceholder", "removeComponentInstancePlaceholder", "setMenu", "showContextMenu", "getBreakpointSuggestionsForWebPage", "getActiveCollectionItemForWebPage", "getVariables", "getVectorSets", "getVectorSetItems", "getVectorSetItemVariables", "getChangedPaths", "getChangeContributors", "getDeployments", "INTERNAL_getAiServiceInfo", "INTERNAL_sendTrackingEvent", "INTERNAL_getHTMLForNode", "getAiServiceInfo", "sendTrackingEvent", "unstable_getCodeFile", "unstable_getCodeFiles", "unstable_getCodeFileVersionContent", "unstable_getCodeFileLint2", "unstable_getCodeFileTypecheck2", "unstable_getCodeFileVersions", "lintCode"]; declare type Unsubscribe$1 = VoidFunction; declare type Unsubscribe = VoidFunction; export declare class UnsupportedComputedValue extends ComputedValueBase { #private; readonly type = "unsupported"; constructor(data: UnsupportedComputedValueData); static [$framerInternal.unmarshal](_: PluginEngine, data: UnsupportedComputedValueData): UnsupportedComputedValue; [$framerInternal.marshal](): UnsupportedComputedValueData; } declare const unsupportedComputedValueClass = "UnsupportedComputedValue"; declare type UnsupportedComputedValueData = WithUnsupportedComputedValueClass; declare const unsupportedComputedValueType = "unsupported"; export declare class UnsupportedField extends FieldBase { readonly type = "unsupported"; } declare interface UnsupportedFieldBase { type: UnsupportedFieldType; } declare interface UnsupportedFieldDefinitionData extends UnsupportedFieldBase, FieldDefinitionBase { } declare type UnsupportedFieldType = typeof unsupportedFieldType; declare const unsupportedFieldType = "unsupported"; export declare class UnsupportedVariable extends VariableBase { #private; readonly type: "unsupported"; constructor(engine: PluginEngine, data: UnsupportedVariableData); static [$framerInternal.unmarshal](engine: PluginEngine, data: UnsupportedVariableData): UnsupportedVariable; [$framerInternal.marshal](): UnsupportedVariableData; } declare const unsupportedVariableClass = "UnsupportedVariable"; declare interface UnsupportedVariableData extends WithUnsupportedVariableClass, BaseVariableData { } declare const unsupportedVariableType: "unsupported"; declare interface UpdateArrayField extends ArrayFieldBase, UpdateFieldBase, WithOptionalFieldRequired { fields?: [CreateArrayItemField]; } declare interface UpdateArrayItem extends EditableArrayItemAttributes { /** The ID of an existing item if updating. Omit if adding. */ id: string; } declare interface UpdateBooleanField extends BooleanFieldBase, UpdateFieldBase { } declare interface UpdateBooleanVariable extends WithBooleanVariableType, UpdateVariableBase, Partial { } declare interface UpdateBorderVariable extends WithBorderVariableType, UpdateVariableBase, Partial { } declare interface UpdateCollectionReferenceField extends CollectionReferenceFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateColorField extends ColorFieldBase, UpdateFieldBase { } declare interface UpdateColorVariable extends WithColorVariableType, UpdateVariableBase, Partial { } declare interface UpdateDateField extends DateFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateDateVariable extends WithDateVariableType, UpdateVariableBase, Partial, Partial { } declare interface UpdateEnumCase extends Partial, Partial { } declare interface UpdateEnumField extends EnumFieldBase, UpdateFieldBase { } declare interface UpdateEnumVariable extends WithEnumVariableType, UpdateVariableBase, Partial { } declare type UpdateField = UpdateBooleanField | UpdateColorField | UpdateNumberField | UpdateStringField | UpdateFormattedTextField | UpdateImageField | UpdateLinkField | UpdateDateField | UpdateFileField | UpdateEnumField | UpdateCollectionReferenceField | UpdateMultiCollectionReferenceField | UpdateFieldDivider | UpdateUnsupportedField | UpdateArrayField; /** * The type of the `attributes` parameter of `Field.setAttributes`: * * ```ts * const fileFieldAttributes: UpdateFieldAttributes = {} * fileFieldAttributes.allowedFileTypes = [] * fileField.setAttributes(fileFieldAttributes) * ``` * * Can also use `typeof`: * * ```ts * const fileFieldAttributes: UpdateFieldAttributes = {} * ``` */ export declare type UpdateFieldAttributes = Omit, // This is NOT the same as Extract // This is NOT the same as Extract "id" | "type">; declare interface UpdateFieldBase extends WithFieldId, Partial { } declare interface UpdateFieldDivider extends FieldDividerBase, UpdateFieldBase { } declare interface UpdateFileField extends FileFieldBase, UpdateFieldBase, Partial, WithOptionalFieldRequired { } declare interface UpdateFileVariable extends WithFileVariableType, UpdateVariableBase, Partial, Partial { } declare interface UpdateFormattedTextField extends FormattedTextFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateFormattedTextVariable extends WithFormattedTextVariableType, UpdateVariableBase, Partial { } declare interface UpdateImageField extends ImageFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateImageVariable extends WithImageVariableType, UpdateVariableBase, Partial { } declare interface UpdateLinkField extends LinkFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateLinkVariable extends WithLinkVariableType, UpdateVariableBase { } declare interface UpdateMultiCollectionReferenceField extends MultiCollectionReferenceFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateNumberField extends NumberFieldBase, UpdateFieldBase { } declare interface UpdateNumberVariable extends WithNumberVariableType, UpdateVariableBase, Partial { } declare interface UpdateRedirect extends Partial, Partial { /** The id of the redirect, if provided, the redirect will be updated, otherwise a new redirect will be created */ id: string; } declare interface UpdateStringField extends StringFieldBase, UpdateFieldBase, WithOptionalFieldRequired { } declare interface UpdateStringVariable extends WithStringVariableType, UpdateVariableBase, Partial { } declare interface UpdateUnsupportedField extends UnsupportedFieldBase, UpdateFieldBase { } declare interface UpdateUnsupportedVariable extends WithUnsupportedVariableType, UpdateVariableBase { } declare type UpdateVariable = UpdateBooleanVariable | UpdateNumberVariable | UpdateStringVariable | UpdateFormattedTextVariable | UpdateEnumVariable | UpdateColorVariable | UpdateImageVariable | UpdateFileVariable | UpdateLinkVariable | UpdateDateVariable | UpdateBorderVariable | UpdateUnsupportedVariable; declare type UpdateVariableAttributes = Omit, "type">; declare interface UpdateVariableBase extends Partial, NullablePartialRecord { } /** * Find out if user's permissions allow them to execute all of `methods`: * * ```tsx * const isAllowedToRemoveItem = useIsAllowedTo("CollectionItem.remove") * * ``` * * This is a thin wrapper around `framer.subscribeToIsAllowedTo`. */ export declare function useIsAllowedTo(...methods: [ProtectedMethod, ...ProtectedMethod[]]): boolean; export declare function useMakeDraggable(ref: RefObject, data: DragData | (() => DragData), onDragComplete?: DragCompleteCallback): void; export declare interface User extends ApiVersion1User { /** Hashed user id served by API version 1, use for migration only */ apiVersion1Id: string; avatarUrl?: string | undefined; /** For when there is no avatar. */ initials: string; } export declare type Variable = ComponentVariable; declare abstract class VariableBase { #private; abstract readonly type: UpdateVariable["type"]; get nodeId(): string; get nodeType(): NodeType; get id(): string; get name(): string; get description(): string | null; constructor(engine: PluginEngine, data: VariableData); /** * Use to rename or change the description of this variable: * * ```ts * const updatedVariable = await variable.setAttributes({ name: "New Name" }) * ``` * * And to update other attributes too, but make sure to narrow using `instanceof` first, as to * avoid potential bugs: * * ```ts * if (variable instanceof FileVariable) await variable.setAttributes({ allowedFileTypes: ["txt", "md"] }) * ``` * * Returns the updated variable on success, and `null` in the unlikely event of it being removed * between getting it and calling this method. * * Use `"Variable.setAttributes"` to check if this method is allowed. */ setAttributes(attributes: UpdateVariableAttributes): Promise; /** * Remove this variable. * * Use `"Variable.remove"` to check if this method is allowed. */ remove(): Promise; } declare type VariableData = BooleanVariableData | NumberVariableData | StringVariableData | FormattedTextVariableData | EnumVariableData | ColorVariableData | ImageVariableData | FileVariableData | LinkVariableData | DateVariableData | BorderVariableData | UnsupportedVariableData; export declare class VectorSet { #private; id: string; name: string; owner: Ownership; constructor(data: VectorSetData, engine: PluginEngine); getItems(): Promise; } export declare interface VectorSetData { id: string; name: string; owner: Ownership; } export declare class VectorSetItem { #private; id: string; name: string; insertUrl: string; iconUrl: string; constructor(data: VectorSetItemData, engine: PluginEngine); getVariables(): Promise; } export declare interface VectorSetItemControl extends ControlBase { type: "vectorSetItem"; value?: string | UnsupportedVariable | undefined; } export declare interface VectorSetItemData { id: string; name: string; insertUrl: string; iconUrl: string; moduleId: string; } export declare class VectorSetItemNode extends NodeMethods implements EditableVectorSetItemNodeAttributes { #private; readonly [classKey]: VectorSetItemNodeData[ClassKey]; readonly name: string | null; readonly visible: boolean; readonly locked: boolean; readonly top: CSSDimension | null; readonly right: CSSDimension | null; readonly bottom: CSSDimension | null; readonly left: CSSDimension | null; readonly centerX: CSSDimension | null; readonly centerY: CSSDimension | null; readonly width: WidthLength | null; readonly height: HeightLength | null; constructor(rawData: VectorSetItemNodeData, engine: PluginEngine); getSVG(): Promise; } declare interface VectorSetItemNodeData extends CommonNodeData, Partial, Partial, Partial, Partial, Partial { [classKey]: "VectorSetItemNode"; } export declare interface VectorSetItemVariable { type: "number" | "color"; id: string; name: string; } export declare class VectorSetNode extends NodeMethods implements EditableVectorSetNodeAttributes { readonly [classKey]: VectorSetNodeData[ClassKey]; readonly name: string | null; constructor(rawData: VectorSetNodeData, engine: PluginEngine); } declare interface VectorSetNodeData extends CommonNodeData, Partial { [classKey]: "VectorSetNode"; } export declare class WebPageNode extends NodeMethods implements EditableWebPageNodeAttributes, WithWebPageInfoTrait { #private; readonly [classKey]: WebPageNodeData[ClassKey]; /** * The relative path to the WebPage */ readonly path: string | null; /** * The Collection ID of the CMS Collection if the WebPage is a CMS Detail Page */ readonly collectionId: string | null; constructor(rawData: WebPageNodeData, engine: PluginEngine); } declare interface WebPageNodeData extends CommonNodeData, Partial { [classKey]: "WebPageNode"; } export declare type WidthConstraint = CSSDimension; export declare type WidthLength = Length | FitContent | FitImage; declare interface WithAllowedFileTypes { /** * Supported types are: * 1. Valid media types (`"image/png"`, `"audio/*"`, `"✱/✱"`) * 2. File extensions with a leading dot (`".png"`) * 3. `"*"` (`.*` as a pseudo file extension was confirmed to allow everything in file pickers of all three major browser engines) * 4. File extensions WITHOUT a leading dot (`"png"`) – unlike in browser APIs – for backward compatibility and in case something doesn't parse as a media type * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/file#unique_file_type_specifiers */ allowedFileTypes: string[]; } export declare interface WithAspectRatioTrait { aspectRatio: number | null; } declare interface WithAssetName { name?: string; path?: never; } declare interface WithAssetPath { name?: never; path?: string; } export declare interface WithBackgroundColorTrait { /** Color of the frame in RGBA format, e.g `rgba(242, 59, 57, 1)`, or as a `ColorStyle` instance. */ readonly backgroundColor: (T extends TraitVariantData ? ColorStyleData : ColorStyle) | string | null; } export declare interface WithBackgroundGradientTrait { readonly backgroundGradient: (T extends TraitVariantData ? GradientData : Gradient) | null; } export declare interface WithBackgroundImageTrait { readonly backgroundImage: (T extends TraitVariantData ? ImageAssetData : ImageAsset) | null; } declare interface WithBooleanDefaultValue { defaultValue: boolean; } declare interface WithBooleanVariableClass { [classKey]: typeof booleanVariableClass; } declare interface WithBooleanVariableType { type: typeof booleanVariableType; } declare interface WithBorderDefaultValue { defaultValue: Border; } declare interface WithBorderDefaultValueData { defaultValue: Marshaled; } export declare interface WithBorderRadiusTrait { readonly borderRadius: BorderRadius; } export declare interface WithBorderTrait { readonly border: (T extends TraitVariantData ? Marshaled : Border) | null; } declare interface WithBorderVariableClass { [classKey]: typeof borderVariableClass; } declare interface WithBorderVariableType { type: typeof borderVariableType; } export declare interface WithBreakpointTrait { readonly isBreakpoint: boolean; readonly isPrimaryBreakpoint: boolean; } declare interface WithCollectionItemId { collectionItemId: string; } declare interface WithColorDefaultValue { defaultValue: string | ColorStyle; } declare interface WithColorDefaultValueData { defaultValue: string | ColorStyleData; } declare interface WithColorVariableClass { [classKey]: typeof colorVariableClass; } declare interface WithColorVariableType { type: typeof colorVariableType; } export declare interface WithComponentInfoTrait extends WithRequiredComponentInfoTrait, WithNullableComponentInfoTrait { } export declare interface WithComponentVariantTrait { readonly isVariant: boolean; readonly isPrimaryVariant: boolean; readonly gesture: Gesture | null; readonly inheritsFromId: string | null; } export declare interface WithControlAttributesTrait { readonly controls: ControlAttributes; } declare interface WithDateVariableClass { [classKey]: typeof dateVariableClass; } declare interface WithDateVariableType { type: typeof dateVariableType; } declare interface WithDescription$1 { description: string; } declare interface WithDescription { description: string; } declare interface WithDisplayTime { displayTime?: boolean; } declare interface WithEnumCaseId { id: string; } declare interface WithEnumCaseNameInput { name: string; nameByLocale?: LocalizationSourceUpdate; } declare interface WithEnumCaseNameInputForUpdate { name: string; nameByLocale?: Record; } declare interface WithEnumVariableClass { [classKey]: typeof enumVariableClass; } declare interface WithEnumVariableType { type: typeof enumVariableType; } declare interface WithFieldBasedOn { /** * The ID of the field on which this field is based. * * When set, this field will use the referenced field's value as a fallback * when no value is provided. */ basedOn: string | null; } declare interface WithFieldCollectionId { collectionId: string; } declare interface WithFieldId { /** Required unique ID. Use a unique identifier to prevent data loss when the field is renamed. */ id: string; } declare interface WithFieldName { /** The name of the field as displayed in the UI. */ name: string; } declare interface WithFieldRequired { required: boolean; } declare interface WithFileDefaultValue { defaultValue: FileAsset; } declare interface WithFileDefaultValueData { defaultValue: FileAssetData; } declare interface WithFileVariableClass { [classKey]: typeof fileVariableClass; } declare interface WithFileVariableType { type: typeof fileVariableType; } export declare interface WithFontTrait { readonly font: (T extends TraitVariantData ? FontData : Font) | null; } declare interface WithFormattedTextVariableClass { [classKey]: typeof formattedTextVariableClass; } declare interface WithFormattedTextVariableType { type: typeof formattedTextVariableType; } export declare interface WithGridItemTrait { gridItemFillCellWidth: boolean | null; gridItemFillCellHeight: boolean | null; gridItemHorizontalAlignment: GridItemAlignment | null; gridItemVerticalAlignment: GridItemAlignment | null; gridItemColumnSpan: GridItemColumnSpan | null; gridItemRowSpan: number | null; } declare interface WithId { id: string; } declare interface WithIdAndOptionalUserEditable extends WithFieldId, Partial { } export declare interface WithIdTrait { readonly id: NodeId; } declare interface WithImageDefaultValue { defaultValue: ImageAsset; } declare interface WithImageDefaultValueData { defaultValue: ImageAssetData; } export declare interface WithImageRenderingTrait { readonly imageRendering: ImageRendering | null; } declare interface WithImageVariableClass { [classKey]: typeof imageVariableClass; } declare interface WithImageVariableType { type: typeof imageVariableType; } export declare interface WithInlineTextStyleTrait { readonly inlineTextStyle: (T extends TraitVariantData ? TextStyleData : TextStyle) | null; } declare interface WithKey { key: string; } export declare interface WithLayoutTrait extends StackLayout, GridLayout { layout: LayoutType | null; gap: CSSDimension | `${CSSDimension} ${CSSDimension}` | null; padding: CSSDimension | `${CSSDimension} ${CSSDimension} ${CSSDimension} ${CSSDimension}` | null; } export declare interface WithLinkTrait { readonly link: string | null; readonly linkOpenInNewTab: boolean | null; } declare interface WithLinkVariableClass { [classKey]: typeof linkVariableClass; } declare interface WithLinkVariableType { type: typeof linkVariableType; } export declare interface WithLockedTrait { readonly locked: boolean; } declare interface WithName { name: string; } declare interface WithNameByLocale { nameByLocale: InlineLocalizationValueByLocale; } declare interface WithNameByLocaleUpdate { nameByLocale: LocalizationSourceUpdate; } export declare interface WithNameTrait { readonly name: string | null; } declare interface WithNodeId { nodeId: string; } declare interface WithNodeType { nodeType: NodeType; } export declare interface WithNullableComponentInfoTrait { readonly insertURL: string | null; readonly componentName: string | null; } declare interface WithNullableToField { /** The destination path to redirect to. If the page was removed and the redirect is no longer valid, the value * will be set to null */ to: string | null; } declare interface WithNumberDefaultValue { defaultValue: number; } declare interface WithNumberVariableClass { [classKey]: typeof numberVariableClass; } declare interface WithNumberVariableType { type: typeof numberVariableType; } export declare interface WithOpacityTrait { readonly opacity: number; } declare type WithOptionalFieldRequired = Partial; declare interface WithOptionalName$1 { name?: string; } declare interface WithOptionalName { name?: string; } declare interface WithOptionalPreviewImage { previewImage?: string; } export declare interface WithOverflowTrait { readonly overflow: Overflow | null; readonly overflowX: AxisOverflow | null; readonly overflowY: AxisOverflow | null; } export declare interface WithPinsTrait { top: CSSDimension | null; right: CSSDimension | null; bottom: CSSDimension | null; left: CSSDimension | null; centerX: CSSDimension | null; centerY: CSSDimension | null; } export declare interface WithPositionTrait { position: Position; } export declare interface WithReplicaInfoTrait { readonly originalId: string | null; } export declare interface WithRequiredComponentInfoTrait { readonly componentIdentifier: string; } export declare interface WithRotationTrait { readonly rotation: number; } export declare interface WithSizeConstraintsTrait { maxWidth: WidthConstraint | null; minWidth: WidthConstraint | null; maxHeight: HeightConstraint | null; minHeight: HeightConstraint | null; } export declare interface WithSizeTrait { width: WidthLength | null; height: HeightLength | null; } declare interface WithStringDefaultValue { defaultValue: string; } declare interface WithStringVariableClass { [classKey]: typeof stringVariableClass; } declare interface WithStringVariableType { type: typeof stringVariableType; } export declare interface WithSVGTrait { readonly svg: string; } export declare interface WithTextTruncationTrait { readonly textTruncation: number | null; } declare interface WithTitle { title: string; } declare interface WithToField { /** The destination path to redirect to */ to: string; } declare interface WithTypedControlsTrait { readonly typedControls: Marshaled>; } declare interface WithUnsupportedComputedValueClass { [classKey]: typeof unsupportedComputedValueClass; } declare interface WithUnsupportedVariableClass { [classKey]: typeof unsupportedVariableClass; } declare interface WithUnsupportedVariableType { type: typeof unsupportedVariableType; } declare interface WithUserEditable { /** Is the user able to edit the field within the UI. */ userEditable: boolean; } export declare interface WithVisibleTrait { readonly visible: boolean; } export declare interface WithWebPageInfoTrait { readonly path: string | null; readonly collectionId: string | null; } export declare interface WithZIndexTrait { readonly zIndex: number | null; } declare interface ZoomIntoViewOptions { /** * Set a percentage limit for the maximum zoom level. * * For example, use a value of `1.0` to ensure the zoom does not exceed 100%. */ maxZoom?: number; /** * If the nodes are already visible, skip the zoom. * @default false */ skipIfVisible?: boolean; } export { }