Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ClientInterface

Hierarchy

  • ClientInterface

Index

Properties

Readonly client

client: AxiosInstance

Readonly comments

comments: (fileId: string) => AxiosPromise<CommentsResponse>

A list of comments left on the file

param

File to get comments from

see

https://www.figma.com/developers/api#get-comments-endpoint

Type declaration

Readonly component

component: (key: string) => AxiosPromise<ComponentResponse>

Get metadata on a component by key.

param

unique identifier of the component.

see

https://www.figma.com/developers/api#get-component-endpoint

Type declaration

Readonly componentSet

componentSet: (key: string) => AxiosPromise<ComponentSetResponse>

Get metadata on a component set by key.

param

unique identifier of the component.

see

https://www.figma.com/developers/api#get-component-sets-endpoint

Type declaration

Readonly deleteComment

deleteComment: (fileId: string, commentId: string) => AxiosPromise<Comment>

Delete a comment from the file

param

File to delete comment from

param

id of the comment to be deleted

see

https://www.figma.com/developers/api#delete-comments-endpoint

Type declaration

    • (fileId: string, commentId: string): AxiosPromise<Comment>
    • Parameters

      • fileId: string
      • commentId: string

      Returns AxiosPromise<Comment>

Readonly file

file: (fileId: string, params?: FileParams) => AxiosPromise<FileResponse>

Returns the document refered to by :key as a JSON object. The file key can be parsed from any Figma file url: https://www.figma.com/file/:key/:title. The "document" attribute contains a Node of type DOCUMENT.

param

File to export JSON from

see

https://www.figma.com/developers/api#get-files-endpoint

Type declaration

Readonly fileComponentSets

fileComponentSets: (fileId: string) => AxiosPromise<FileComponentSetsResponse>

Get a list of published component sets within a file

param

Id of the file to list components from

see

https://www.figma.com/developers/api#get-team-component-sets-endpoint

Type declaration

Readonly fileComponents

fileComponents: (fileId: string) => AxiosPromise<FileComponentsResponse>

Get a list of published components within a file

param

Id of the file to list components from

see

https://www.figma.com/developers/api#get-file-components-endpoint

Type declaration

Readonly fileImageFills

fileImageFills: (fileId: string) => AxiosPromise<FileImageFillsResponse>

Returns download links for all images present in image fills in a document. Image fills are how Figma represents any user supplied images. When you drag an image into Figma, we create a rectangle with a single fill that represents the image, and the user is able to transform the rectangle (and properties on the fill) as they wish.

This endpoint returns a mapping from image references to the URLs at which the images may be download. Image URLs will expire after no more than 14 days. Image references are located in the output of the GET files endpoint under the imageRef attribute in a Paint.

param

File to export images from

see

https://www.figma.com/developers/api#get-image-fills-endpoint

Type declaration

Readonly fileImages

fileImages: (fileId: string, params: FileImageParams) => AxiosPromise<FileImageResponse>

If no error occurs, "images" will be populated with a map from node IDs to URLs of the rendered images, and "status" will be omitted. Important: the image map may contain values that are null. This indicates that rendering of that specific node has failed. This may be due to the node id not existing, or other reasons such has the node having no renderable components. It is guaranteed that any node that was requested for rendering will be represented in this map whether or not the render succeeded.

param

File to export images from

param
see

https://www.figma.com/developers/api#get-images-endpoint

Type declaration

Readonly fileNodes

fileNodes: (fileId: string, params: FileNodesParams) => AxiosPromise<FileNodesResponse>

Returns the nodes referenced to by :ids as a JSON object. The nodes are retrieved from the Figma file referenced to by :key. The node Id and file key can be parsed from any Figma node url: https://www.figma.com/file/:key/:title?node-id=:id.

param

File to export JSON from

param
see

https://www.figma.com/developers/api#get-file-nodes-endpoint

Type declaration

Readonly fileStyles

fileStyles: (fileId: string) => AxiosPromise<FileStylesResponse>

Get a list of published styles within a file

param

Id of the file to list styles from

see

https://www.figma.com/developers/api#get-file-styles-endpoint

Type declaration

Readonly fileVersions

fileVersions: (fileId: string) => AxiosPromise<FileVersionsResponse>

Returns a list of the versions of a file. The file key can be parsed from any Figma node url: https://www.figma.com/file/:key/:title.

param

File to get version history from

see

https://www.figma.com/developers/api#get-file-versions-endpoint

Type declaration

Readonly me

me: () => AxiosPromise<User & { email: string }>

Get user information for the authenticated user.

see

https://www.figma.com/developers/api#get-me-endpoint

Type declaration

    • (): AxiosPromise<User & { email: string }>
    • Returns AxiosPromise<User & { email: string }>

Readonly postComment

postComment: (fileId: string, params: PostCommentParams) => AxiosPromise<Comment>

Posts a new comment on the file.

param

File to post comment to

param
see

https://www.figma.com/developers/api#post-comments-endpoint

Type declaration

Readonly projectFiles

projectFiles: (projectId: string) => AxiosPromise<ProjectFilesResponse>

List the files in a given project.

param

Id of the project to list files from

see

https://www.figma.com/developers/api#get-project-files-endpoint

Type declaration

Readonly style

style: (key: string) => AxiosPromise<StyleResponse>

Get metadata on a style by key.

param

unique identifier of the style.

see

https://www.figma.com/developers/api#get-style-endpoint

Type declaration

Readonly teamComponentSets

teamComponentSets: (teamId: string, params?: PaginationParams) => AxiosPromise<TeamComponentSetsResponse>

Get a paginated list of published component sets within a team library

param

Id of the team to list components from

see

https://www.figma.com/developers/api#get-team-component-sets-endpoint

Type declaration

Readonly teamComponents

teamComponents: (teamId: string, params?: PaginationParams) => AxiosPromise<TeamComponentsResponse>

Get a paginated list of published components within a team library

param

Id of the team to list components from

see

https://www.figma.com/developers/api#get-team-components-endpoint

Type declaration

Readonly teamProjects

teamProjects: (teamId: string) => AxiosPromise<TeamProjectsResponse>

Lists the projects for a specified team. Note that this will only return projects visible to the authenticated user or owner of the developer token.

param

Id of the team to list projects from

see

https://www.figma.com/developers/api#get-team-projects-endpoint

Type declaration

Readonly teamStyles

teamStyles: (teamId: string, params?: PaginationParams) => AxiosPromise<TeamStylesResponse>

Get a paginated list of published styles within a team library

param

Id of the team to list styles from

see

https://www.figma.com/developers/api#get-team-styles-endpoint

Type declaration

Generated using TypeDoc