Skip to content

Library

Style

typescript
type StyleType = "PAINT" | "TEXT" | "EFFECT" | "GRID";

interface LibraryStyle {
  readonly name: string;
  readonly key: string;
  readonly thumbnailUrl: string;
  readonly description: string;
  readonly type: StyleType;
}

Component

typescript
interface LibraryComponent {
  readonly name: string;
  readonly key: string;
  readonly thumbnailUrl: string;
  readonly description: string;
  readonly pageName: string;
  readonly containerName: string;
  readonly categories: string[];
  readonly type: "COMPONENT";
}

interface LocalComponent extends LibraryComponent {
  generateThumbnail: () => Uint8Array;
}

ComponentSet

typescript
interface LibraryComponentSet {
  readonly name: string;
  readonly key: string;
  readonly thumbnailUrl: string;
  readonly description: string;
  readonly pageName: string;
  readonly containerName: string;
  readonly categories: string[];
  readonly type: "COMPONENT_SET";
}

interface LibraryComponentSetWithVariants extends LibraryComponentSet {
  readonly variants: LibraryComponent[];
}

interface LocalComponentSet extends LibraryComponentSet {
  generateThumbnail: () => Uint8Array;
}

LibraryItem

typescript
interface LibraryItem {
  readonly name: string;
  readonly key: string;
  readonly type: "ENT" | "TEAM";
  readonly teamName: string;
  readonly teamID: number;
  readonly subscribed: boolean;
}

LibraryAssets

typescript
interface LibraryAssets {
  readonly name: string;
  readonly key: string; // fileKey
  readonly subscribed: boolean;
  readonly componentList: (
    | LibraryComponent
    | LibraryComponentSetWithVariants
  )[];
  readonly style: {
    paints: ReadonlyArray<LibraryStyle>;
    effects: ReadonlyArray<LibraryStyle>;
    texts: ReadonlyArray<LibraryStyle>;
    grids: ReadonlyArray<LibraryStyle>;
  };
}