diff --git a/bun.lockb b/bun.lockb index f82b66c..d25f5b0 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 771d65d..65eb026 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@biomejs/biome": "^1.5.3", "@figma/plugin-typings": "^1.93.0", "@types/bun": "^1.0.5", - "esbuild": "^0.23.0", + "esbuild": "^0.24.0", "json-schema-to-typescript": "^15.0.0", "knip": "^5.0.1", "prettier": "^3.2.5", diff --git a/src/types.d.ts b/src/types.d.ts index 7bf3825..c4f0257 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -99,8 +99,9 @@ export type SpatialPoint2DKey = SpatialPoint2DKeyV1 export type SpatialPoint2D = [number, number, number, number, number, number] export type CurveStyle = CurveStyleV1 export type Name = string -export type ExportPreset = ExportPresetV1 +export type ExportPreset = ExportPresetV1 | ExportPresetV2 /** + * [DEPRECATED] Use RenderScaleComponent instead. In the next version we are supporting any render scales (eg using numbers). * Used to determine exporting file scaling factor */ export type RenderScaleType = @@ -128,6 +129,11 @@ export type RenderType = * Define custom suffix for rendered file */ export type RenderSuffix = string +/** + * Used to determine exporting file scaling factor + */ +export type RenderScale = number +export type Version = number export type Ellipse = EllipseV1 export type StartAngle = number export type EndAngle = number @@ -319,7 +325,6 @@ export type HangingList = boolean * Whether updating the characters in the text node should update the name of the node. If this is set to true, name will be auto-derived from characters. */ export type AutoRename = boolean -export type Version = number export type Vector = VectorV1 export type ColorStop = ColorStopV1 export type Progress = number @@ -718,6 +723,29 @@ export interface ExportPresetV1 { } [k: string]: unknown } +export interface ExportPresetV2 { + /** + * Unique entity identifier + */ + id: string + /** + * Type of the entity + */ + tag: 'exportPreset' + /** + * Current schema version of the entity + */ + schemaVersion: 2 + components: { + entityType: EntityType + renderScale: RenderScale + renderType: RenderType + renderSuffix: RenderSuffix + version: Version + [k: string]: unknown + } + [k: string]: unknown +} export interface EllipseV1 { /** * Unique entity identifier