Understand the TypeScript type naming conventions
mainThe TypeScript types are generated from the OpenAPI specification using a custom generator optimized for the Figma REST API. They follow specific naming patterns:
- Named Types: All OpenAPI schemas, responses, and request parameters are exported as named types (e.g.,
Paint,VariableAlias). - Endpoint-Associated Types: Types related to specific API endpoints are prefixed with the OpenAPI operation ID. For example, the
getFileoperation generates:GetFilePathParamsGetFileQueryParamsGetFileResponse
- Request Bodies: For endpoints that expect a request body, the types are suffixed with
RequestBody(e.g.,postComments->PostCommentsRequestBody).