Skip to content

Commit

Permalink
re-generated library after merge of #49 #47 #54 #48 #53 (modified) #41
Browse files Browse the repository at this point in the history
  • Loading branch information
didoo committed Oct 29, 2022
1 parent 56efc1e commit 74b4c58
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/api-funcs.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vector, FrameOffset } from "./ast-types";
import { Vector, FrameOffset, NodeType } from "./ast-types";
import { GetFileResult, GetFileNodesResult, GetImageResult, GetImageFillsResult, GetCommentsResult, PostCommentResult, DeleteCommentsResult, GetUserMeResult, GetVersionsResult, GetTeamProjectsResult, GetProjectFilesResult, GetTeamComponentsResult, GetFileComponentsResult, GetComponentResult, GetTeamComponentSetsResult, GetFileComponentSetsResult, GetComponentSetResult, GetTeamStylesResult, GetFileStylesResult, GetStyleResult } from "./api-types";
import { ApiRequestMethod } from "./utils";
declare type ApiClass = {
Expand All @@ -25,7 +25,7 @@ fileKey: string, opts?: {
/** Set to returns branch metadata for the requested file */
branch_data?: boolean;
}): Promise<GetFileResult>;
export declare function getFileNodesApi(this: ApiClass,
export declare function getFileNodesApi<T extends NodeType = 'DOCUMENT'>(this: ApiClass,
/**
* File to export JSON from
*
Expand Down
2 changes: 1 addition & 1 deletion lib/api-funcs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lib/api-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vector, FrameOffset, Component, Style, Node, FrameInfo, PageInfo, ContainingStateGroup, StyleType } from "./ast-types";
import { Vector, FrameOffset, Component, Style, Node, FrameInfo, PageInfo, ContainingStateGroup, StyleType, NodeType } from "./ast-types";
/** A comment or reply left by a user */
export interface Comment {
/** Unique identifier for comment */
Expand Down Expand Up @@ -153,15 +153,15 @@ export interface GetFileResult {
branches?: ProjectFile[];
}
/** The `name`, `lastModified`, `thumbnailUrl`, and `version` attributes are all metadata of the specified file. */
export interface GetFileNodesResult {
export interface GetFileNodesResult<NType extends NodeType = NodeType> {
name: string;
lastModified: string;
thumbnailUrl: string;
version: string;
err?: string;
nodes: {
[nodeId: string]: {
document: Node<'DOCUMENT'>;
document: Node<NType>;
components: {
[nodeId: string]: Component;
};
Expand Down
43 changes: 38 additions & 5 deletions lib/ast-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export declare enum StrokeJoin {
export declare enum ImageType {
JPG = "JPG",
PNG = "PNG",
SVG = "SVG"
SVG = "SVG",
PDF = "PDF"
}
/** A string enum with value, indicating the type of boolean operation applied */
export declare enum BooleanOperationType {
Expand Down Expand Up @@ -60,7 +61,8 @@ export declare enum TextDecoration {
export declare enum TextAutoResize {
NONE = "NONE",
HEIGHT = "HEIGHT",
WIDTH_AND_HEIGHT = "WIDTH_AND_HEIGHT"
WIDTH_AND_HEIGHT = "WIDTH_AND_HEIGHT",
TRUNCATE = "TRUNCATE"
}
/** The unit of the line height value specified by the user. */
export declare enum LineHeightUnit {
Expand All @@ -79,7 +81,7 @@ export declare type StylesMap = {
export declare type ExportSetting = {
/** File suffix to append to all filenames */
suffix: string;
/** Image type, string enum that supports values "JPG", "PNG", and "SVG" */
/** Image type, string enum that supports values "JPG", "PNG", "SVG" and "PDF" */
format: ImageType;
/** Constraint that determines sizing of exported asset */
constraint: Constrain;
Expand Down Expand Up @@ -447,7 +449,7 @@ export declare type TypeStyle = {
/** Text decoration applied to the node, default is `NONE` */
textDecoration?: TextDecoration;
/** Dimensions along which text will auto resize, default is that the text does not auto-resize. Default is `NONE` */
textAutoResize?: 'NONE' | 'HEIGHT' | 'WIDTH_AND_HEIGHT';
textAutoResize?: TextAutoResize;
/** Horizontal text alignment as string enum */
textAlignHorizontal: 'LEFT' | 'RIGHT' | 'CENTER' | 'JUSTIFIED';
/** Vertical text alignment as string enum */
Expand Down Expand Up @@ -512,6 +514,15 @@ export interface Component {
name: string;
/** The description of the component as entered in the editor */
description: string;
/** The ID of the component set if the component belongs to one */
componentSetId: string | null;
/** The documentation links for this component */
documentationLinks: DocumentationLinks[];
}
/** Represents a link to documentation for a component. */
export interface DocumentationLinks {
/** Should be a valid URI (e.g. https://www.figma.com). */
uri: string;
}
/** A set of properties that can be applied to nodes and published. Styles for a property can be created in the corresponding property's panel while editing a file */
export interface Style {
Expand Down Expand Up @@ -556,6 +567,13 @@ export interface FRAME {
strokes: Paint[];
/** The weight of strokes on the node */
strokeWeight: number;
/** The weight of strokes on different side of the node */
individualStrokeWeights?: {
top: number;
right: number;
left: number;
bottom: number;
};
/** Position of stroke relative to vector outline, as a string enum */
strokeAlign: StrokeAlign;
/** Radius of each corner of the frame if a single radius is set for all corners */
Expand Down Expand Up @@ -599,7 +617,7 @@ export interface FRAME {
/** Determines how the auto-layout frame’s children should be aligned in the primary axis direction. This property is only applicable for auto-layout frames. Default MIN */
primaryAxisAlignItems: 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN';
/** Determines how the auto-layout frame’s children should be aligned in the counter axis direction. This property is only applicable for auto-layout frames. Default MIN */
counterAxisAlignItems: 'MIN' | 'CENTER' | 'MAX';
counterAxisAlignItems: 'MIN' | 'CENTER' | 'MAX' | 'BASELINE';
/** default: 0. The padding between the left border of the frame and its children. This property is only applicable for auto-layout frames. */
paddingLeft: number;
/** default: 0. The padding between the right border of the frame and its children. This property is only applicable for auto-layout frames. */
Expand All @@ -614,6 +632,10 @@ export interface FRAME {
verticalPadding: number;
/** default: 0. The distance between children of the frame. This property is only applicable for auto-layout frames. */
itemSpacing: number;
/**default: false. Applicable only if layoutMode != "NONE". */
itemReverseZIndex: boolean;
/**default: false. Applicable only if layoutMode != "NONE". */
strokesIncludedInLayout: boolean;
/** Defines the scrolling behavior of the frame, if there exist contents outside of the frame boundaries. The frame can either scroll vertically, horizontally, or in both directions to the extents of the content contained within it. This behavior can be observed in a prototype. Default NONE */
overflowDirection: 'NONE' | 'HORIZONTAL_SCROLLING' | 'VERTICAL_SCROLLING' | 'HORIZONTAL_AND_VERTICAL_SCROLLING';
/** default: [] An array of layout grids attached to this node (see layout grids section for more details). GROUP nodes do not have this attribute */
Expand All @@ -624,6 +646,8 @@ export interface FRAME {
isMask: boolean;
/** default: false Does this mask ignore fill style (like gradients) and effects? */
isMaskOutline: boolean;
/** default: AUTO */
layoutPositioning: 'AUTO' | 'ABSOLUTE';
}
/** A logical grouping of nodes */
export declare type GROUP = FRAME;
Expand Down Expand Up @@ -669,6 +693,13 @@ export interface VECTOR {
strokes: Paint[];
/** The weight of strokes on the node */
strokeWeight: number;
/** The weight of strokes on different side of the node */
individualStrokeWeights?: {
top: number;
right: number;
left: number;
bottom: number;
};
/** default: NONE. A string enum with value of "NONE", "ROUND", "SQUARE", "LINE_ARROW", or "TRIANGLE_ARROW", describing the end caps of vector paths. */
strokeCap?: StrokeCap;
/** Only specified if parameter geometry=paths is used. An array of paths representing the object stroke */
Expand All @@ -686,6 +717,8 @@ export interface VECTOR {
strokeMiterAngle?: number;
/** A mapping of a StyleType to style ID (see Style) of styles present on this node. The style ID can be used to look up more information about the style in the top-level styles field. */
styles?: StylesMap;
/** default: AUTO */
layoutPositioning: 'AUTO' | 'ABSOLUTE';
}
/** A group that has a boolean operation applied to it */
export declare type BOOLEAN = VECTOR & {
Expand Down
2 changes: 2 additions & 0 deletions lib/ast-types.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74b4c58

Please sign in to comment.