@seed-design/figma 0.0.27 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as FigmaRestSpec from '@figma/rest-api-spec';
2
2
  import { LocalVariable, LocalVariableCollection, VariableResolvedDataType, VariableAlias, Style as Style$1, StyleType as StyleType$1, VariableScope } from '@figma/rest-api-spec';
3
3
  export { VariableScope } from '@figma/rest-api-spec';
4
+ import { ComponentPropertyDefinition } from './codegen/index.js';
4
5
  export * from './codegen/index.js';
5
6
 
6
7
  type NormalizedIsLayerTrait = Pick<FigmaRestSpec.IsLayerTrait, "type" | "id" | "name" | "boundVariables">;
@@ -80,6 +81,12 @@ declare function createRestNormalizer(ctx: RestNormalizerContext): (node: FigmaR
80
81
 
81
82
  declare function createPluginNormalizer(): (node: SceneNode) => Promise<NormalizedSceneNode>;
82
83
 
84
+ interface ComponentMetadata {
85
+ name: string;
86
+ key: string;
87
+ componentPropertyDefinitions: Record<string, ComponentPropertyDefinition>;
88
+ }
89
+
83
90
  interface IconData {
84
91
  name: string;
85
92
  type: "monochrome" | "multicolor";
@@ -151,14 +158,24 @@ interface VariableServiceDeps {
151
158
  }
152
159
  declare function createVariableService({ variableRepository, inferCompareFunction, }: VariableServiceDeps): VariableService;
153
160
 
161
+ interface ComponentRepository {
162
+ getOne(key: string): ComponentMetadata | undefined;
163
+ }
164
+ declare function createStaticComponentRepository(data: Record<string, ComponentMetadata>): {
165
+ getOne: (key: string) => ComponentMetadata;
166
+ };
167
+
154
168
  declare const styleRepository: StyleRepository;
155
169
  declare const variableRepository: VariableRepository;
156
170
  declare const iconRepository: {
157
171
  getOne: (key: string) => IconData;
158
172
  };
173
+ declare const componentRepository: {
174
+ getOne: (key: string) => ComponentMetadata;
175
+ };
159
176
  declare function getFigmaVariableKey(name: string): string | undefined;
160
177
  declare function getFigmaStyleKey(name: string): string | undefined;
161
178
  declare function getFigmaColorVariableNames(scopes: Array<"fg" | "bg" | "stroke" | "palette">): string[];
162
179
 
163
- export { createIconService, createPluginNormalizer, createRestNormalizer, createStaticIconRepository, createStaticStyleRepository, createStaticVariableRepository, createStyleService, createVariableService, getFigmaColorVariableNames, getFigmaStyleKey, getFigmaVariableKey, iconRepository, styleRepository, variableRepository };
164
- export type { IconData, IconRepository, IconService, NormalizedBooleanOperationNode, NormalizedComponentNode, NormalizedCornerTrait, NormalizedDefaultShapeTrait, NormalizedFrameNode, NormalizedFrameTrait, NormalizedHasChildrenTrait, NormalizedHasFramePropertiesTrait, NormalizedHasGeometryTrait, NormalizedHasLayoutTrait, NormalizedInstanceNode, NormalizedIsLayerTrait, NormalizedRectangleNode, NormalizedSceneNode, NormalizedTextNode, NormalizedTextSegment, NormalizedTypePropertiesTrait, NormalizedUnhandledNode, NormalizedVectorNode, Style, StyleRepository, StyleService, StyleType, Variable, VariableCollection, VariableRepository, VariableService, VariableServiceDeps, VariableType, VariableValue, VariableValueResolved };
180
+ export { componentRepository, createIconService, createPluginNormalizer, createRestNormalizer, createStaticComponentRepository, createStaticIconRepository, createStaticStyleRepository, createStaticVariableRepository, createStyleService, createVariableService, getFigmaColorVariableNames, getFigmaStyleKey, getFigmaVariableKey, iconRepository, styleRepository, variableRepository };
181
+ export type { ComponentMetadata, ComponentRepository, IconData, IconRepository, IconService, NormalizedBooleanOperationNode, NormalizedComponentNode, NormalizedCornerTrait, NormalizedDefaultShapeTrait, NormalizedFrameNode, NormalizedFrameTrait, NormalizedHasChildrenTrait, NormalizedHasFramePropertiesTrait, NormalizedHasGeometryTrait, NormalizedHasLayoutTrait, NormalizedInstanceNode, NormalizedIsLayerTrait, NormalizedRectangleNode, NormalizedSceneNode, NormalizedTextNode, NormalizedTextSegment, NormalizedTypePropertiesTrait, NormalizedUnhandledNode, NormalizedVectorNode, Style, StyleRepository, StyleService, StyleType, Variable, VariableCollection, VariableRepository, VariableService, VariableServiceDeps, VariableType, VariableValue, VariableValueResolved };