@figma-export/core
Advanced tools
Comparing version 3.4.0 to 3.5.0
import * as FigmaExport from '@figma-export/types'; | ||
declare type Options = FigmaExport.BaseCommandOptions & FigmaExport.ComponentsCommandOptions; | ||
export declare const components: ({ token, fileId, onlyFromPages, transformers, outputters, concurrency, log, }: Options) => Promise<FigmaExport.PageNode[]>; | ||
export declare const components: ({ token, fileId, version, onlyFromPages, transformers, outputters, concurrency, log, }: Options) => Promise<FigmaExport.PageNode[]>; | ||
export {}; | ||
//# sourceMappingURL=export-components.d.ts.map |
@@ -14,3 +14,3 @@ "use strict"; | ||
const figma_1 = require("./figma"); | ||
const components = ({ token, fileId, onlyFromPages = [], transformers = [], outputters = [], concurrency = 30, log = (msg) => { | ||
const components = ({ token, fileId, version, onlyFromPages = [], transformers = [], outputters = [], concurrency = 30, log = (msg) => { | ||
// eslint-disable-next-line no-console | ||
@@ -21,4 +21,4 @@ console.log(msg); | ||
log('fetching document'); | ||
const { data: { document = null } = {} } = yield client.file(fileId).catch((error) => { | ||
throw new Error(`while fetching file "${fileId}": ${error.message}`); | ||
const { data: { document = null } = {} } = yield client.file(fileId, { version }).catch((error) => { | ||
throw new Error(`while fetching file "${fileId}${version ? `?version=${version}` : ''}": ${error.message}`); | ||
}); | ||
@@ -25,0 +25,0 @@ if (!document) { |
import * as FigmaExport from '@figma-export/types'; | ||
declare type Options = FigmaExport.BaseCommandOptions & FigmaExport.StylesCommandOptions; | ||
export declare const styles: ({ token, fileId, outputters, log, }: Options) => Promise<FigmaExport.Style[]>; | ||
export declare const styles: ({ token, fileId, version, outputters, log, }: Options) => Promise<FigmaExport.Style[]>; | ||
export {}; | ||
//# sourceMappingURL=export-styles.d.ts.map |
@@ -15,3 +15,3 @@ "use strict"; | ||
const figmaStyles_1 = require("./figmaStyles"); | ||
const styles = ({ token, fileId, outputters = [], log = (msg) => { | ||
const styles = ({ token, fileId, version, outputters = [], log = (msg) => { | ||
// eslint-disable-next-line no-console | ||
@@ -22,3 +22,3 @@ console.log(msg); | ||
log('fetching styles'); | ||
const styleNodes = yield (0, figmaStyles_1.fetchStyles)(client, fileId); | ||
const styleNodes = yield (0, figmaStyles_1.fetchStyles)(client, fileId, version); | ||
log('parsing styles'); | ||
@@ -25,0 +25,0 @@ const parsedStyles = (0, figmaStyles_1.parseStyles)(styleNodes); |
import * as Figma from 'figma-js'; | ||
import * as FigmaExport from '@figma-export/types'; | ||
declare const fetchStyles: (client: Figma.ClientInterface, fileId: string) => Promise<FigmaExport.StyleNode[]>; | ||
declare const fetchStyles: (client: Figma.ClientInterface, fileId: string, version?: string | undefined) => Promise<FigmaExport.StyleNode[]>; | ||
declare const parseStyles: (styleNodes: FigmaExport.StyleNode[]) => FigmaExport.Style[]; | ||
export { fetchStyles, parseStyles, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -18,5 +18,5 @@ "use strict"; | ||
// import { parse as parseGridStyle } from './gridStyle'; | ||
const fetchStyles = (client, fileId) => __awaiter(void 0, void 0, void 0, function* () { | ||
const { data: { styles = null } = {} } = yield client.file(fileId).catch((error) => { | ||
throw new Error(`while fetching file "${fileId}": ${error.message}`); | ||
const fetchStyles = (client, fileId, version) => __awaiter(void 0, void 0, void 0, function* () { | ||
const { data: { styles = null } = {} } = yield client.file(fileId, { version }).catch((error) => { | ||
throw new Error(`while fetching file "${fileId}${version ? `?version=${version}` : ''}": ${error.message}`); | ||
}); | ||
@@ -26,3 +26,3 @@ if (!styles) { | ||
} | ||
const { data: { nodes } } = yield client.fileNodes(fileId, { ids: Object.keys(styles) }).catch((error) => { | ||
const { data: { nodes } } = yield client.fileNodes(fileId, { ids: Object.keys(styles), version }).catch((error) => { | ||
throw new Error(`while fetching fileNodes: ${error.message}`); | ||
@@ -29,0 +29,0 @@ }); |
{ | ||
"name": "@figma-export/core", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "@figma-export core functionalities", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@figma-export/types": "^3.4.0", | ||
"@figma-export/types": "^3.5.0", | ||
"axios": "~0.21.4", | ||
@@ -35,3 +35,3 @@ "figma-js": "~1.14.0", | ||
}, | ||
"gitHead": "9768040983962434236b6cfc46e6af3c5a314941" | ||
"gitHead": "087b570d5b3990a9cd541df3188c3011c0108e32" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52764
Updated@figma-export/types@^3.5.0