figma-inspect-cli 0.1.0
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/README.md +156 -0
- package/dist/bin/figma-inspect.d.ts +3 -0
- package/dist/bin/figma-inspect.d.ts.map +1 -0
- package/dist/bin/figma-inspect.js +19 -0
- package/dist/bin/figma-inspect.js.map +1 -0
- package/dist/cli/errors.d.ts +3 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +3 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/export-component-set.d.ts +21 -0
- package/dist/cli/export-component-set.d.ts.map +1 -0
- package/dist/cli/export-component-set.js +173 -0
- package/dist/cli/export-component-set.js.map +1 -0
- package/dist/cli/export-contract.d.ts +20 -0
- package/dist/cli/export-contract.d.ts.map +1 -0
- package/dist/cli/export-contract.js +48 -0
- package/dist/cli/export-contract.js.map +1 -0
- package/dist/cli/export-node-contract.d.ts +17 -0
- package/dist/cli/export-node-contract.d.ts.map +1 -0
- package/dist/cli/export-node-contract.js +93 -0
- package/dist/cli/export-node-contract.js.map +1 -0
- package/dist/cli/export-result.d.ts +17 -0
- package/dist/cli/export-result.d.ts.map +1 -0
- package/dist/cli/export-result.js +22 -0
- package/dist/cli/export-result.js.map +1 -0
- package/dist/cli/export-team-index.d.ts +18 -0
- package/dist/cli/export-team-index.d.ts.map +1 -0
- package/dist/cli/export-team-index.js +121 -0
- package/dist/cli/export-team-index.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/output.d.ts +13 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +26 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/parse-args.d.ts +3 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +790 -0
- package/dist/cli/parse-args.js.map +1 -0
- package/dist/cli/run-cli.d.ts +3 -0
- package/dist/cli/run-cli.d.ts.map +1 -0
- package/dist/cli/run-cli.js +416 -0
- package/dist/cli/run-cli.js.map +1 -0
- package/dist/cli/types.d.ts +114 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/usage.d.ts +2 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +75 -0
- package/dist/cli/usage.js.map +1 -0
- package/dist/figma-api/cache/cached-request.d.ts +8 -0
- package/dist/figma-api/cache/cached-request.d.ts.map +1 -0
- package/dist/figma-api/cache/cached-request.js +100 -0
- package/dist/figma-api/cache/cached-request.js.map +1 -0
- package/dist/figma-api/cache/constants.d.ts +5 -0
- package/dist/figma-api/cache/constants.d.ts.map +1 -0
- package/dist/figma-api/cache/constants.js +5 -0
- package/dist/figma-api/cache/constants.js.map +1 -0
- package/dist/figma-api/cache/extract-metadata.d.ts +3 -0
- package/dist/figma-api/cache/extract-metadata.d.ts.map +1 -0
- package/dist/figma-api/cache/extract-metadata.js +13 -0
- package/dist/figma-api/cache/extract-metadata.js.map +1 -0
- package/dist/figma-api/cache/index.d.ts +3 -0
- package/dist/figma-api/cache/index.d.ts.map +1 -0
- package/dist/figma-api/cache/index.js +3 -0
- package/dist/figma-api/cache/index.js.map +1 -0
- package/dist/figma-api/cache/store.d.ts +10 -0
- package/dist/figma-api/cache/store.d.ts.map +1 -0
- package/dist/figma-api/cache/store.js +53 -0
- package/dist/figma-api/cache/store.js.map +1 -0
- package/dist/figma-api/cache/types.d.ts +20 -0
- package/dist/figma-api/cache/types.d.ts.map +1 -0
- package/dist/figma-api/cache/types.js +2 -0
- package/dist/figma-api/cache/types.js.map +1 -0
- package/dist/figma-api/cache/url.d.ts +5 -0
- package/dist/figma-api/cache/url.d.ts.map +1 -0
- package/dist/figma-api/cache/url.js +20 -0
- package/dist/figma-api/cache/url.js.map +1 -0
- package/dist/figma-api/constants.d.ts +2 -0
- package/dist/figma-api/constants.d.ts.map +1 -0
- package/dist/figma-api/constants.js +2 -0
- package/dist/figma-api/constants.js.map +1 -0
- package/dist/figma-api/fetch-with-retry.d.ts +2 -0
- package/dist/figma-api/fetch-with-retry.d.ts.map +1 -0
- package/dist/figma-api/fetch-with-retry.js +48 -0
- package/dist/figma-api/fetch-with-retry.js.map +1 -0
- package/dist/figma-api/figma-api-error.d.ts +4 -0
- package/dist/figma-api/figma-api-error.d.ts.map +1 -0
- package/dist/figma-api/figma-api-error.js +7 -0
- package/dist/figma-api/figma-api-error.js.map +1 -0
- package/dist/figma-api/figma-request.d.ts +2 -0
- package/dist/figma-api/figma-request.d.ts.map +1 -0
- package/dist/figma-api/figma-request.js +21 -0
- package/dist/figma-api/figma-request.js.map +1 -0
- package/dist/figma-api/format-figma-error.d.ts +2 -0
- package/dist/figma-api/format-figma-error.d.ts.map +1 -0
- package/dist/figma-api/format-figma-error.js +24 -0
- package/dist/figma-api/format-figma-error.js.map +1 -0
- package/dist/figma-api/get-component-set.d.ts +4 -0
- package/dist/figma-api/get-component-set.d.ts.map +1 -0
- package/dist/figma-api/get-component-set.js +8 -0
- package/dist/figma-api/get-component-set.js.map +1 -0
- package/dist/figma-api/get-file-images.d.ts +4 -0
- package/dist/figma-api/get-file-images.d.ts.map +1 -0
- package/dist/figma-api/get-file-images.js +45 -0
- package/dist/figma-api/get-file-images.js.map +1 -0
- package/dist/figma-api/get-file-node.d.ts +3 -0
- package/dist/figma-api/get-file-node.d.ts.map +1 -0
- package/dist/figma-api/get-file-node.js +8 -0
- package/dist/figma-api/get-file-node.js.map +1 -0
- package/dist/figma-api/get-file.d.ts +3 -0
- package/dist/figma-api/get-file.d.ts.map +1 -0
- package/dist/figma-api/get-file.js +6 -0
- package/dist/figma-api/get-file.js.map +1 -0
- package/dist/figma-api/index.d.ts +11 -0
- package/dist/figma-api/index.d.ts.map +1 -0
- package/dist/figma-api/index.js +11 -0
- package/dist/figma-api/index.js.map +1 -0
- package/dist/figma-api/list-file-component-sets.d.ts +4 -0
- package/dist/figma-api/list-file-component-sets.d.ts.map +1 -0
- package/dist/figma-api/list-file-component-sets.js +8 -0
- package/dist/figma-api/list-file-component-sets.js.map +1 -0
- package/dist/figma-api/list-file-components.d.ts +5 -0
- package/dist/figma-api/list-file-components.d.ts.map +1 -0
- package/dist/figma-api/list-file-components.js +13 -0
- package/dist/figma-api/list-file-components.js.map +1 -0
- package/dist/figma-api/list-file-pages.d.ts +4 -0
- package/dist/figma-api/list-file-pages.d.ts.map +1 -0
- package/dist/figma-api/list-file-pages.js +10 -0
- package/dist/figma-api/list-file-pages.js.map +1 -0
- package/dist/figma-api/list-project-files.d.ts +4 -0
- package/dist/figma-api/list-project-files.d.ts.map +1 -0
- package/dist/figma-api/list-project-files.js +8 -0
- package/dist/figma-api/list-project-files.js.map +1 -0
- package/dist/figma-api/list-team-component-sets.d.ts +4 -0
- package/dist/figma-api/list-team-component-sets.d.ts.map +1 -0
- package/dist/figma-api/list-team-component-sets.js +19 -0
- package/dist/figma-api/list-team-component-sets.js.map +1 -0
- package/dist/figma-api/list-team-project-files.d.ts +4 -0
- package/dist/figma-api/list-team-project-files.d.ts.map +1 -0
- package/dist/figma-api/list-team-project-files.js +19 -0
- package/dist/figma-api/list-team-project-files.js.map +1 -0
- package/dist/figma-api/list-team-projects.d.ts +4 -0
- package/dist/figma-api/list-team-projects.d.ts.map +1 -0
- package/dist/figma-api/list-team-projects.js +8 -0
- package/dist/figma-api/list-team-projects.js.map +1 -0
- package/dist/figma-api/schemas.d.ts +95 -0
- package/dist/figma-api/schemas.d.ts.map +1 -0
- package/dist/figma-api/schemas.js +154 -0
- package/dist/figma-api/schemas.js.map +1 -0
- package/dist/figma-api/types.d.ts +60 -0
- package/dist/figma-api/types.d.ts.map +1 -0
- package/dist/figma-api/types.js +2 -0
- package/dist/figma-api/types.js.map +1 -0
- package/dist/inspect/component-set-context.d.ts +11 -0
- package/dist/inspect/component-set-context.d.ts.map +1 -0
- package/dist/inspect/component-set-context.js +71 -0
- package/dist/inspect/component-set-context.js.map +1 -0
- package/dist/inspect/component-set-lookup.d.ts +6 -0
- package/dist/inspect/component-set-lookup.d.ts.map +1 -0
- package/dist/inspect/component-set-lookup.js +40 -0
- package/dist/inspect/component-set-lookup.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts +3 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.js +34 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.d.ts +9 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.js +4 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts +17 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.js +67 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts +24 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.js +83 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/index.d.ts +2 -0
- package/dist/inspect/component-set-pseudocode/index.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/index.js +2 -0
- package/dist/inspect/component-set-pseudocode/index.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/infer.d.ts +4 -0
- package/dist/inspect/component-set-pseudocode/infer.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/infer.js +426 -0
- package/dist/inspect/component-set-pseudocode/infer.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.d.ts +27 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.js +136 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts +14 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.js +28 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.d.ts +71 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.js +281 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts +3 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.js +170 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/types.d.ts +44 -0
- package/dist/inspect/component-set-pseudocode/types.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/types.js +2 -0
- package/dist/inspect/component-set-pseudocode/types.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/universal.d.ts +14 -0
- package/dist/inspect/component-set-pseudocode/universal.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/universal.js +393 -0
- package/dist/inspect/component-set-pseudocode/universal.js.map +1 -0
- package/dist/inspect/component-set-spec/bound-variables.d.ts +14 -0
- package/dist/inspect/component-set-spec/bound-variables.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/bound-variables.js +53 -0
- package/dist/inspect/component-set-spec/bound-variables.js.map +1 -0
- package/dist/inspect/component-set-spec/build-spec.d.ts +9 -0
- package/dist/inspect/component-set-spec/build-spec.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/build-spec.js +102 -0
- package/dist/inspect/component-set-spec/build-spec.js.map +1 -0
- package/dist/inspect/component-set-spec/compact-spec.d.ts +3 -0
- package/dist/inspect/component-set-spec/compact-spec.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/compact-spec.js +357 -0
- package/dist/inspect/component-set-spec/compact-spec.js.map +1 -0
- package/dist/inspect/component-set-spec/extract-slots.d.ts +5 -0
- package/dist/inspect/component-set-spec/extract-slots.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/extract-slots.js +57 -0
- package/dist/inspect/component-set-spec/extract-slots.js.map +1 -0
- package/dist/inspect/component-set-spec/figma-node.d.ts +9 -0
- package/dist/inspect/component-set-spec/figma-node.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/figma-node.js +31 -0
- package/dist/inspect/component-set-spec/figma-node.js.map +1 -0
- package/dist/inspect/component-set-spec/index.d.ts +2 -0
- package/dist/inspect/component-set-spec/index.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/index.js +2 -0
- package/dist/inspect/component-set-spec/index.js.map +1 -0
- package/dist/inspect/component-set-spec/parse-props.d.ts +9 -0
- package/dist/inspect/component-set-spec/parse-props.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/parse-props.js +96 -0
- package/dist/inspect/component-set-spec/parse-props.js.map +1 -0
- package/dist/inspect/component-set-spec/prop-name.d.ts +5 -0
- package/dist/inspect/component-set-spec/prop-name.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/prop-name.js +26 -0
- package/dist/inspect/component-set-spec/prop-name.js.map +1 -0
- package/dist/inspect/component-set-spec/resolve-tokens.d.ts +4 -0
- package/dist/inspect/component-set-spec/resolve-tokens.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/resolve-tokens.js +42 -0
- package/dist/inspect/component-set-spec/resolve-tokens.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-context.d.ts +6 -0
- package/dist/inspect/component-set-spec/slim-context.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-context.js +2 -0
- package/dist/inspect/component-set-spec/slim-context.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-node.d.ts +5 -0
- package/dist/inspect/component-set-spec/slim-node.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-node.js +393 -0
- package/dist/inspect/component-set-spec/slim-node.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-text-export.d.ts +8 -0
- package/dist/inspect/component-set-spec/slim-text-export.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-text-export.js +74 -0
- package/dist/inspect/component-set-spec/slim-text-export.js.map +1 -0
- package/dist/inspect/component-set-spec/team-component-registry.d.ts +19 -0
- package/dist/inspect/component-set-spec/team-component-registry.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/team-component-registry.js +96 -0
- package/dist/inspect/component-set-spec/team-component-registry.js.map +1 -0
- package/dist/inspect/component-set-spec/types.d.ts +127 -0
- package/dist/inspect/component-set-spec/types.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/types.js +2 -0
- package/dist/inspect/component-set-spec/types.js.map +1 -0
- package/dist/inspect/component-set-spec/variable-registry.d.ts +8 -0
- package/dist/inspect/component-set-spec/variable-registry.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/variable-registry.js +74 -0
- package/dist/inspect/component-set-spec/variable-registry.js.map +1 -0
- package/dist/inspect/component-set-spec/variant-axes.d.ts +2 -0
- package/dist/inspect/component-set-spec/variant-axes.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/variant-axes.js +14 -0
- package/dist/inspect/component-set-spec/variant-axes.js.map +1 -0
- package/dist/inspect/contract/contract-format.d.ts +5 -0
- package/dist/inspect/contract/contract-format.d.ts.map +1 -0
- package/dist/inspect/contract/contract-format.js +26 -0
- package/dist/inspect/contract/contract-format.js.map +1 -0
- package/dist/inspect/contract/contract-lock.d.ts +75 -0
- package/dist/inspect/contract/contract-lock.d.ts.map +1 -0
- package/dist/inspect/contract/contract-lock.js +326 -0
- package/dist/inspect/contract/contract-lock.js.map +1 -0
- package/dist/inspect/contract/contract-schema.d.ts +51 -0
- package/dist/inspect/contract/contract-schema.d.ts.map +1 -0
- package/dist/inspect/contract/contract-schema.js +130 -0
- package/dist/inspect/contract/contract-schema.js.map +1 -0
- package/dist/inspect/contract/fingerprint.d.ts +9 -0
- package/dist/inspect/contract/fingerprint.d.ts.map +1 -0
- package/dist/inspect/contract/fingerprint.js +301 -0
- package/dist/inspect/contract/fingerprint.js.map +1 -0
- package/dist/inspect/contract/lock-metadata.d.ts +30 -0
- package/dist/inspect/contract/lock-metadata.d.ts.map +1 -0
- package/dist/inspect/contract/lock-metadata.js +101 -0
- package/dist/inspect/contract/lock-metadata.js.map +1 -0
- package/dist/inspect/contract/stable-stringify.d.ts +2 -0
- package/dist/inspect/contract/stable-stringify.d.ts.map +1 -0
- package/dist/inspect/contract/stable-stringify.js +14 -0
- package/dist/inspect/contract/stable-stringify.js.map +1 -0
- package/dist/inspect/contract/verify-component-contract.d.ts +19 -0
- package/dist/inspect/contract/verify-component-contract.d.ts.map +1 -0
- package/dist/inspect/contract/verify-component-contract.js +126 -0
- package/dist/inspect/contract/verify-component-contract.js.map +1 -0
- package/dist/inspect/errors.d.ts +4 -0
- package/dist/inspect/errors.d.ts.map +1 -0
- package/dist/inspect/errors.js +7 -0
- package/dist/inspect/errors.js.map +1 -0
- package/dist/inspect/export/assert-asset-exportable.d.ts +3 -0
- package/dist/inspect/export/assert-asset-exportable.d.ts.map +1 -0
- package/dist/inspect/export/assert-asset-exportable.js +45 -0
- package/dist/inspect/export/assert-asset-exportable.js.map +1 -0
- package/dist/inspect/export/export-nested-assets.d.ts +94 -0
- package/dist/inspect/export/export-nested-assets.d.ts.map +1 -0
- package/dist/inspect/export/export-nested-assets.js +333 -0
- package/dist/inspect/export/export-nested-assets.js.map +1 -0
- package/dist/inspect/export/export-node-preview.d.ts +24 -0
- package/dist/inspect/export/export-node-preview.d.ts.map +1 -0
- package/dist/inspect/export/export-node-preview.js +34 -0
- package/dist/inspect/export/export-node-preview.js.map +1 -0
- package/dist/inspect/export/export-variant-assets.d.ts +18 -0
- package/dist/inspect/export/export-variant-assets.d.ts.map +1 -0
- package/dist/inspect/export/export-variant-assets.js +127 -0
- package/dist/inspect/export/export-variant-assets.js.map +1 -0
- package/dist/inspect/export/normalize-exported-svg.d.ts +2 -0
- package/dist/inspect/export/normalize-exported-svg.d.ts.map +1 -0
- package/dist/inspect/export/normalize-exported-svg.js +15 -0
- package/dist/inspect/export/normalize-exported-svg.js.map +1 -0
- package/dist/inspect/export/rendered-image-bytes.d.ts +4 -0
- package/dist/inspect/export/rendered-image-bytes.d.ts.map +1 -0
- package/dist/inspect/export/rendered-image-bytes.js +24 -0
- package/dist/inspect/export/rendered-image-bytes.js.map +1 -0
- package/dist/inspect/export-contract-target.d.ts +7 -0
- package/dist/inspect/export-contract-target.d.ts.map +1 -0
- package/dist/inspect/export-contract-target.js +33 -0
- package/dist/inspect/export-contract-target.js.map +1 -0
- package/dist/inspect/fetch-file-entry.d.ts +4 -0
- package/dist/inspect/fetch-file-entry.d.ts.map +1 -0
- package/dist/inspect/fetch-file-entry.js +7 -0
- package/dist/inspect/fetch-file-entry.js.map +1 -0
- package/dist/inspect/fetch-file-node-entry.d.ts +4 -0
- package/dist/inspect/fetch-file-node-entry.d.ts.map +1 -0
- package/dist/inspect/fetch-file-node-entry.js +7 -0
- package/dist/inspect/fetch-file-node-entry.js.map +1 -0
- package/dist/inspect/figma-node-url.d.ts +3 -0
- package/dist/inspect/figma-node-url.d.ts.map +1 -0
- package/dist/inspect/figma-node-url.js +30 -0
- package/dist/inspect/figma-node-url.js.map +1 -0
- package/dist/inspect/get-node-component-set.d.ts +5 -0
- package/dist/inspect/get-node-component-set.d.ts.map +1 -0
- package/dist/inspect/get-node-component-set.js +10 -0
- package/dist/inspect/get-node-component-set.js.map +1 -0
- package/dist/inspect/index.d.ts +17 -0
- package/dist/inspect/index.d.ts.map +1 -0
- package/dist/inspect/index.js +17 -0
- package/dist/inspect/index.js.map +1 -0
- package/dist/inspect/list-all-component-sets.d.ts +3 -0
- package/dist/inspect/list-all-component-sets.d.ts.map +1 -0
- package/dist/inspect/list-all-component-sets.js +27 -0
- package/dist/inspect/list-all-component-sets.js.map +1 -0
- package/dist/inspect/list-component-set-properties.d.ts +4 -0
- package/dist/inspect/list-component-set-properties.d.ts.map +1 -0
- package/dist/inspect/list-component-set-properties.js +73 -0
- package/dist/inspect/list-component-set-properties.js.map +1 -0
- package/dist/inspect/node-contract/build-node-contract.d.ts +12 -0
- package/dist/inspect/node-contract/build-node-contract.d.ts.map +1 -0
- package/dist/inspect/node-contract/build-node-contract.js +212 -0
- package/dist/inspect/node-contract/build-node-contract.js.map +1 -0
- package/dist/inspect/node-contract/dependencies.d.ts +5 -0
- package/dist/inspect/node-contract/dependencies.d.ts.map +1 -0
- package/dist/inspect/node-contract/dependencies.js +84 -0
- package/dist/inspect/node-contract/dependencies.js.map +1 -0
- package/dist/inspect/node-contract/index.d.ts +6 -0
- package/dist/inspect/node-contract/index.d.ts.map +1 -0
- package/dist/inspect/node-contract/index.js +6 -0
- package/dist/inspect/node-contract/index.js.map +1 -0
- package/dist/inspect/node-contract/node-kind.d.ts +9 -0
- package/dist/inspect/node-contract/node-kind.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-kind.js +31 -0
- package/dist/inspect/node-contract/node-kind.js.map +1 -0
- package/dist/inspect/node-contract/node-lock.d.ts +6 -0
- package/dist/inspect/node-contract/node-lock.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-lock.js +181 -0
- package/dist/inspect/node-contract/node-lock.js.map +1 -0
- package/dist/inspect/node-contract/node-schema.d.ts +14 -0
- package/dist/inspect/node-contract/node-schema.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-schema.js +137 -0
- package/dist/inspect/node-contract/node-schema.js.map +1 -0
- package/dist/inspect/node-contract/paths.d.ts +10 -0
- package/dist/inspect/node-contract/paths.d.ts.map +1 -0
- package/dist/inspect/node-contract/paths.js +29 -0
- package/dist/inspect/node-contract/paths.js.map +1 -0
- package/dist/inspect/node-contract/tokens.d.ts +4 -0
- package/dist/inspect/node-contract/tokens.d.ts.map +1 -0
- package/dist/inspect/node-contract/tokens.js +30 -0
- package/dist/inspect/node-contract/tokens.js.map +1 -0
- package/dist/inspect/node-contract/types.d.ts +84 -0
- package/dist/inspect/node-contract/types.d.ts.map +1 -0
- package/dist/inspect/node-contract/types.js +2 -0
- package/dist/inspect/node-contract/types.js.map +1 -0
- package/dist/inspect/node-contract/verify-node-contract.d.ts +20 -0
- package/dist/inspect/node-contract/verify-node-contract.d.ts.map +1 -0
- package/dist/inspect/node-contract/verify-node-contract.js +131 -0
- package/dist/inspect/node-contract/verify-node-contract.js.map +1 -0
- package/dist/inspect/resolve-team-component-set.d.ts +14 -0
- package/dist/inspect/resolve-team-component-set.d.ts.map +1 -0
- package/dist/inspect/resolve-team-component-set.js +77 -0
- package/dist/inspect/resolve-team-component-set.js.map +1 -0
- package/dist/inspect/schemas.d.ts +37 -0
- package/dist/inspect/schemas.d.ts.map +1 -0
- package/dist/inspect/schemas.js +79 -0
- package/dist/inspect/schemas.js.map +1 -0
- package/dist/inspect/team-index.d.ts +76 -0
- package/dist/inspect/team-index.d.ts.map +1 -0
- package/dist/inspect/team-index.js +361 -0
- package/dist/inspect/team-index.js.map +1 -0
- package/dist/inspect/types.d.ts +46 -0
- package/dist/inspect/types.d.ts.map +1 -0
- package/dist/inspect/types.js +2 -0
- package/dist/inspect/types.js.map +1 -0
- package/dist/test/fixtures.d.ts +3 -0
- package/dist/test/fixtures.d.ts.map +1 -0
- package/dist/test/fixtures.js +6 -0
- package/dist/test/fixtures.js.map +1 -0
- package/dist/zod/parse-valid-entries.d.ts +4 -0
- package/dist/zod/parse-valid-entries.d.ts.map +1 -0
- package/dist/zod/parse-valid-entries.js +20 -0
- package/dist/zod/parse-valid-entries.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { parseValidEntries } from "../zod/parse-valid-entries.js";
|
|
3
|
+
import { FigmaApiError } from "./figma-api-error.js";
|
|
4
|
+
function parseFigmaResponse(schema, payload, message) {
|
|
5
|
+
const result = schema.safeParse(payload);
|
|
6
|
+
if (!result.success) {
|
|
7
|
+
throw new FigmaApiError(message);
|
|
8
|
+
}
|
|
9
|
+
return result.data;
|
|
10
|
+
}
|
|
11
|
+
const figmaProjectSchema = z.object({
|
|
12
|
+
id: z.union([z.string(), z.number()]).transform(String),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
file_count: z.number().optional(),
|
|
15
|
+
});
|
|
16
|
+
const figmaFileSchema = z.object({
|
|
17
|
+
key: z.string(),
|
|
18
|
+
name: z.string(),
|
|
19
|
+
last_modified: z.string(),
|
|
20
|
+
});
|
|
21
|
+
const figmaPageSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
type: z.literal("CANVAS"),
|
|
24
|
+
id: z.string(),
|
|
25
|
+
name: z.string(),
|
|
26
|
+
})
|
|
27
|
+
.transform(({ id, name }) => ({ id, name }));
|
|
28
|
+
const publishedComponentSetSchema = z.object({
|
|
29
|
+
key: z.string(),
|
|
30
|
+
file_key: z.string(),
|
|
31
|
+
node_id: z.string(),
|
|
32
|
+
name: z.string(),
|
|
33
|
+
updated_at: z.string().optional(),
|
|
34
|
+
created_at: z.string().optional(),
|
|
35
|
+
});
|
|
36
|
+
const componentSetMetadataSchema = z.object({
|
|
37
|
+
key: z.string(),
|
|
38
|
+
file_key: z.string(),
|
|
39
|
+
node_id: z.string(),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
updated_at: z.string(),
|
|
42
|
+
created_at: z.string().optional(),
|
|
43
|
+
});
|
|
44
|
+
const componentSetMetadataResponseSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
meta: componentSetMetadataSchema,
|
|
47
|
+
})
|
|
48
|
+
.transform(({ meta }) => meta);
|
|
49
|
+
const fileComponentSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
key: z.string(),
|
|
52
|
+
file_key: z.string(),
|
|
53
|
+
node_id: z.string(),
|
|
54
|
+
name: z.string(),
|
|
55
|
+
updated_at: z.string(),
|
|
56
|
+
containing_frame: z
|
|
57
|
+
.object({
|
|
58
|
+
containingComponentSet: z
|
|
59
|
+
.object({
|
|
60
|
+
nodeId: z.string(),
|
|
61
|
+
})
|
|
62
|
+
.optional(),
|
|
63
|
+
})
|
|
64
|
+
.optional(),
|
|
65
|
+
})
|
|
66
|
+
.transform((component) => ({
|
|
67
|
+
key: component.key,
|
|
68
|
+
file_key: component.file_key,
|
|
69
|
+
node_id: component.node_id,
|
|
70
|
+
name: component.name,
|
|
71
|
+
updated_at: component.updated_at,
|
|
72
|
+
containing_component_set_node_id: component.containing_frame?.containingComponentSet?.nodeId,
|
|
73
|
+
}));
|
|
74
|
+
const fileComponentsResponseSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
meta: z.object({
|
|
77
|
+
components: z.array(z.unknown()),
|
|
78
|
+
}),
|
|
79
|
+
})
|
|
80
|
+
.transform(({ meta }) => parseValidEntries(fileComponentSchema, meta.components));
|
|
81
|
+
const teamProjectsResponseSchema = z
|
|
82
|
+
.object({
|
|
83
|
+
projects: z.array(z.unknown()),
|
|
84
|
+
})
|
|
85
|
+
.transform(({ projects }) => parseValidEntries(figmaProjectSchema, projects));
|
|
86
|
+
const projectFilesResponseSchema = z
|
|
87
|
+
.object({
|
|
88
|
+
files: z.array(z.unknown()),
|
|
89
|
+
})
|
|
90
|
+
.transform(({ files }) => parseValidEntries(figmaFileSchema, files));
|
|
91
|
+
const filePagesResponseSchema = z
|
|
92
|
+
.object({
|
|
93
|
+
document: z.object({
|
|
94
|
+
children: z.array(z.unknown()),
|
|
95
|
+
}),
|
|
96
|
+
})
|
|
97
|
+
.transform(({ document }) => parseValidEntries(figmaPageSchema, document.children));
|
|
98
|
+
const teamComponentSetsResponseSchema = z
|
|
99
|
+
.object({
|
|
100
|
+
meta: z.object({
|
|
101
|
+
component_sets: z.array(z.unknown()),
|
|
102
|
+
cursor: z
|
|
103
|
+
.object({
|
|
104
|
+
after: z.union([z.string(), z.number()]).optional(),
|
|
105
|
+
})
|
|
106
|
+
.optional(),
|
|
107
|
+
}),
|
|
108
|
+
})
|
|
109
|
+
.transform(({ meta }) => ({
|
|
110
|
+
componentSets: parseValidEntries(publishedComponentSetSchema, meta.component_sets),
|
|
111
|
+
cursorAfter: meta.cursor?.after === undefined ? undefined : String(meta.cursor.after),
|
|
112
|
+
}));
|
|
113
|
+
export function parseTeamProjectsResponse(payload) {
|
|
114
|
+
return parseFigmaResponse(teamProjectsResponseSchema, payload, "Invalid Figma team projects response.");
|
|
115
|
+
}
|
|
116
|
+
export function parseProjectFilesResponse(payload) {
|
|
117
|
+
return parseFigmaResponse(projectFilesResponseSchema, payload, "Invalid Figma project files response.");
|
|
118
|
+
}
|
|
119
|
+
export function parseFilePagesResponse(payload) {
|
|
120
|
+
return parseFigmaResponse(filePagesResponseSchema, payload, "Invalid Figma file response.");
|
|
121
|
+
}
|
|
122
|
+
export function parseTeamComponentSetsResponse(payload) {
|
|
123
|
+
return parseFigmaResponse(teamComponentSetsResponseSchema, payload, "Invalid Figma team component sets response.");
|
|
124
|
+
}
|
|
125
|
+
export function parseFileComponentSetsResponse(payload) {
|
|
126
|
+
return parseTeamComponentSetsResponse(payload).componentSets;
|
|
127
|
+
}
|
|
128
|
+
const fileImagesResponseSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
images: z.record(z.string(), z.string().nullable()),
|
|
131
|
+
err: z.union([z.string(), z.null()]).optional(),
|
|
132
|
+
})
|
|
133
|
+
.transform(({ images, err }) => {
|
|
134
|
+
const normalized = {};
|
|
135
|
+
for (const [nodeId, imageUrl] of Object.entries(images)) {
|
|
136
|
+
if (imageUrl) {
|
|
137
|
+
normalized[nodeId] = imageUrl;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
images: normalized,
|
|
142
|
+
...(err ? { err } : {}),
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
export function parseFileImagesResponse(payload) {
|
|
146
|
+
return parseFigmaResponse(fileImagesResponseSchema, payload, "Invalid Figma file images response.");
|
|
147
|
+
}
|
|
148
|
+
export function parseComponentSetMetadataResponse(payload) {
|
|
149
|
+
return parseFigmaResponse(componentSetMetadataResponseSchema, payload, "Invalid Figma component set response.");
|
|
150
|
+
}
|
|
151
|
+
export function parseFileComponentsResponse(payload) {
|
|
152
|
+
return parseFigmaResponse(fileComponentsResponseSchema, payload, "Invalid Figma file components response.");
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/figma-api/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,SAAS,kBAAkB,CACzB,MAAoB,EACpB,OAAgB,EAChB,OAAe;IAEf,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,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,CAAC,QAAQ,EAAE;CAChD,CAAC;KACD,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;IAC7B,MAAM,UAAU,GAA2B,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,IAAI,QAAQ,EAAE,CAAC;YACb,UAAU,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACxB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IAItD,OAAO,kBAAkB,CACvB,wBAAwB,EACxB,OAAO,EACP,qCAAqC,CACtC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAAgB;IAEhB,OAAO,kBAAkB,CACvB,kCAAkC,EAClC,OAAO,EACP,uCAAuC,CACxC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,OAAgB;IAEhB,OAAO,kBAAkB,CACvB,4BAA4B,EAC5B,OAAO,EACP,yCAAyC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface ListTeamProjectsOptions {
|
|
2
|
+
token: string;
|
|
3
|
+
teamId: string;
|
|
4
|
+
fetchImpl?: typeof fetch;
|
|
5
|
+
}
|
|
6
|
+
export interface ListTeamProjectFilesOptions {
|
|
7
|
+
token: string;
|
|
8
|
+
teamId: string;
|
|
9
|
+
fetchImpl?: typeof fetch;
|
|
10
|
+
}
|
|
11
|
+
export interface ListTeamComponentSetsOptions {
|
|
12
|
+
token: string;
|
|
13
|
+
teamId: string;
|
|
14
|
+
fetchImpl?: typeof fetch;
|
|
15
|
+
}
|
|
16
|
+
export interface ListProjectFilesOptions {
|
|
17
|
+
token: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
fetchImpl?: typeof fetch;
|
|
20
|
+
}
|
|
21
|
+
export interface ListFileComponentSetsOptions {
|
|
22
|
+
token: string;
|
|
23
|
+
fileKey: string;
|
|
24
|
+
fetchImpl?: typeof fetch;
|
|
25
|
+
}
|
|
26
|
+
export interface ListFilePagesOptions {
|
|
27
|
+
token: string;
|
|
28
|
+
fileKey: string;
|
|
29
|
+
fetchImpl?: typeof fetch;
|
|
30
|
+
}
|
|
31
|
+
export interface GetFileNodeOptions {
|
|
32
|
+
token: string;
|
|
33
|
+
fileKey: string;
|
|
34
|
+
nodeId: string;
|
|
35
|
+
fetchImpl?: typeof fetch;
|
|
36
|
+
}
|
|
37
|
+
export interface GetFileOptions {
|
|
38
|
+
token: string;
|
|
39
|
+
fileKey: string;
|
|
40
|
+
fetchImpl?: typeof fetch;
|
|
41
|
+
}
|
|
42
|
+
export interface GetFileImagesOptions {
|
|
43
|
+
token: string;
|
|
44
|
+
fileKey: string;
|
|
45
|
+
nodeIds: string[];
|
|
46
|
+
format: "svg" | "png";
|
|
47
|
+
scale?: number;
|
|
48
|
+
fetchImpl?: typeof fetch;
|
|
49
|
+
}
|
|
50
|
+
export interface GetComponentSetOptions {
|
|
51
|
+
token: string;
|
|
52
|
+
componentSetKey: string;
|
|
53
|
+
fetchImpl?: typeof fetch;
|
|
54
|
+
}
|
|
55
|
+
export interface ListFileComponentsOptions {
|
|
56
|
+
token: string;
|
|
57
|
+
fileKey: string;
|
|
58
|
+
fetchImpl?: typeof fetch;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/figma-api/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE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C,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/figma-api/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentEntry, DocumentNode, FigmaComponentSet } from "./schemas.js";
|
|
2
|
+
import type { ComponentSetNodeRefOptions, ComponentSetScopeOptions } from "./types.js";
|
|
3
|
+
export interface ComponentSetContext {
|
|
4
|
+
tree: DocumentNode;
|
|
5
|
+
componentSets: Record<string, FigmaComponentSet>;
|
|
6
|
+
components: Record<string, ComponentEntry>;
|
|
7
|
+
nameIndex: Map<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function loadComponentSetContext({ token, fileKey, nodeId, componentSet, fetchImpl, }: ComponentSetScopeOptions): Promise<ComponentSetContext>;
|
|
10
|
+
export declare function loadComponentSetContextByNodeRef({ token, fileKey, nodeId, fetchImpl, }: ComponentSetNodeRefOptions): Promise<ComponentSetContext>;
|
|
11
|
+
//# sourceMappingURL=component-set-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-set-context.d.ts","sourceRoot":"","sources":["../../src/inspect/component-set-context.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACjD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC3C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAyDD,wBAAsB,uBAAuB,CAAC,EAC5C,KAAK,EACL,OAAO,EACP,MAAM,EACN,YAAY,EACZ,SAAS,GACV,EAAE,wBAAwB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqCzD;AAED,wBAAsB,gCAAgC,CAAC,EACrD,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,GACV,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU3D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { buildLenientNameIndex, resolveComponentSetId, } from "./component-set-lookup.js";
|
|
2
|
+
import { FigmaInspectError } from "./errors.js";
|
|
3
|
+
import { fetchFileNodeEntry } from "./fetch-file-node-entry.js";
|
|
4
|
+
function findDocumentNode(root, targetId, targetType) {
|
|
5
|
+
if (!root) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (root.id === targetId && root.type === targetType) {
|
|
9
|
+
return root;
|
|
10
|
+
}
|
|
11
|
+
if (!root.children) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
for (const child of root.children) {
|
|
15
|
+
const found = findDocumentNode(child, targetId, targetType);
|
|
16
|
+
if (found) {
|
|
17
|
+
return found;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
function assertComponentSetNode(node, nodeId) {
|
|
23
|
+
if (node?.type !== "COMPONENT_SET") {
|
|
24
|
+
const type = node?.type ?? "UNKNOWN";
|
|
25
|
+
throw new FigmaInspectError(`Figma node ${nodeId} is ${type}; expected COMPONENT_SET.`);
|
|
26
|
+
}
|
|
27
|
+
return node;
|
|
28
|
+
}
|
|
29
|
+
function componentSetContextFromNodeEntry(nodeEntry, componentSetNode) {
|
|
30
|
+
const nameIndex = buildLenientNameIndex(nodeEntry.componentSets);
|
|
31
|
+
return {
|
|
32
|
+
tree: componentSetNode,
|
|
33
|
+
componentSets: nodeEntry.componentSets,
|
|
34
|
+
components: nodeEntry.components,
|
|
35
|
+
nameIndex,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export async function loadComponentSetContext({ token, fileKey, nodeId, componentSet, fetchImpl, }) {
|
|
39
|
+
const nodeEntry = await fetchFileNodeEntry({
|
|
40
|
+
token,
|
|
41
|
+
fileKey,
|
|
42
|
+
nodeId,
|
|
43
|
+
fetchImpl,
|
|
44
|
+
});
|
|
45
|
+
if (Object.keys(nodeEntry.componentSets).length === 0) {
|
|
46
|
+
throw new FigmaInspectError(`No component sets found for node ${nodeId}.`);
|
|
47
|
+
}
|
|
48
|
+
const nameIndex = buildLenientNameIndex(nodeEntry.componentSets);
|
|
49
|
+
const componentSetId = resolveComponentSetId(nodeEntry.componentSets, componentSet, nodeId);
|
|
50
|
+
const documentNode = findDocumentNode(nodeEntry.document, componentSetId, "COMPONENT_SET");
|
|
51
|
+
if (!documentNode) {
|
|
52
|
+
throw new FigmaInspectError(`Component set ${componentSetId} not found in document tree for node ${nodeId}.`);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
tree: documentNode,
|
|
56
|
+
componentSets: nodeEntry.componentSets,
|
|
57
|
+
components: nodeEntry.components,
|
|
58
|
+
nameIndex,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export async function loadComponentSetContextByNodeRef({ token, fileKey, nodeId, fetchImpl, }) {
|
|
62
|
+
const nodeEntry = await fetchFileNodeEntry({
|
|
63
|
+
token,
|
|
64
|
+
fileKey,
|
|
65
|
+
nodeId,
|
|
66
|
+
fetchImpl,
|
|
67
|
+
});
|
|
68
|
+
const componentSetNode = assertComponentSetNode(nodeEntry.document, nodeId);
|
|
69
|
+
return componentSetContextFromNodeEntry(nodeEntry, componentSetNode);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=component-set-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-set-context.js","sourceRoot":"","sources":["../../src/inspect/component-set-context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAkBhE,SAAS,gBAAgB,CACvB,IAA8B,EAC9B,QAAgB,EAChB,UAAkB;IAElB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC5D,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,sBAAsB,CAC7B,IAA8B,EAC9B,MAAc;IAEd,IAAI,IAAI,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC;QACrC,MAAM,IAAI,iBAAiB,CACz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ChC,SAAS;KACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gCAAgC,CAAC,EACrD,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,GACkB;IAC3B,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC;QACzC,KAAK;QACL,OAAO;QACP,MAAM;QACN,SAAS;KACV,CAAC,CAAC;IACH,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE5E,OAAO,gCAAgC,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FigmaComponentSet } from "./schemas.js";
|
|
2
|
+
import type { ComponentSetLookup } from "./types.js";
|
|
3
|
+
export declare function buildLenientNameIndex(componentSets: Record<string, FigmaComponentSet>): Map<string, string>;
|
|
4
|
+
export declare function indexComponentSetsByName(componentSets: Record<string, FigmaComponentSet>): Map<string, string>;
|
|
5
|
+
export declare function resolveComponentSetId(componentSets: Record<string, FigmaComponentSet>, lookup: ComponentSetLookup, nodeId: string): string;
|
|
6
|
+
//# sourceMappingURL=component-set-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-set-lookup.d.ts","sourceRoot":"","sources":["../../src/inspect/component-set-lookup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC/C,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAUrB;AAED,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC/C,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAerB;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAChD,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,MAAM,GACb,MAAM,CA8BR"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FigmaInspectError } from "./errors.js";
|
|
2
|
+
export function buildLenientNameIndex(componentSets) {
|
|
3
|
+
const index = new Map();
|
|
4
|
+
for (const [id, entry] of Object.entries(componentSets)) {
|
|
5
|
+
if (!index.has(entry.name)) {
|
|
6
|
+
index.set(entry.name, id);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return index;
|
|
10
|
+
}
|
|
11
|
+
export function indexComponentSetsByName(componentSets) {
|
|
12
|
+
const index = new Map();
|
|
13
|
+
for (const [id, entry] of Object.entries(componentSets)) {
|
|
14
|
+
const existingId = index.get(entry.name);
|
|
15
|
+
if (existingId !== undefined) {
|
|
16
|
+
throw new FigmaInspectError(`Multiple component sets named "${entry.name}" found: ${existingId}, ${id}. Use --component-set-key instead.`);
|
|
17
|
+
}
|
|
18
|
+
index.set(entry.name, id);
|
|
19
|
+
}
|
|
20
|
+
return index;
|
|
21
|
+
}
|
|
22
|
+
export function resolveComponentSetId(componentSets, lookup, nodeId) {
|
|
23
|
+
if (lookup.kind === "key") {
|
|
24
|
+
for (const [id, entry] of Object.entries(componentSets)) {
|
|
25
|
+
if (entry.key === lookup.value) {
|
|
26
|
+
return id;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
throw new FigmaInspectError(`No component set with key ${lookup.value} found in node ${nodeId}.`);
|
|
30
|
+
}
|
|
31
|
+
const matches = Object.entries(componentSets).filter(([, entry]) => entry.name === lookup.value);
|
|
32
|
+
if (matches.length === 0) {
|
|
33
|
+
throw new FigmaInspectError(`No component set with name "${lookup.value}" found in node ${nodeId}.`);
|
|
34
|
+
}
|
|
35
|
+
if (matches.length > 1) {
|
|
36
|
+
throw new FigmaInspectError(`Multiple component sets named "${lookup.value}" found: ${matches.map(([id]) => id).join(", ")}. Use --component-set-key instead.`);
|
|
37
|
+
}
|
|
38
|
+
return matches[0][0];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=component-set-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-set-lookup.js","sourceRoot":"","sources":["../../src/inspect/component-set-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,UAAU,qBAAqB,CACnC,aAAgD;IAEhD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACxD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,aAAgD;IAEhD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,KAAK,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACxD,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,iBAAiB,CACzB,kCAAkC,KAAK,CAAC,IAAI,YAAY,UAAU,KAAK,EAAE,oCAAoC,CAC9G,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IA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ources":["../../../src/inspect/component-set-pseudocode/asset-backed-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAgCvE,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,gBAAgB,GACrB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAczB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isRecord } from "../component-set-spec/figma-node.js";
|
|
2
|
+
import { extractGeometryFromNode } from "./universal.js";
|
|
3
|
+
function setNestedValue(root, axes, when, value) {
|
|
4
|
+
if (axes.length === 0) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const [axis, ...rest] = axes;
|
|
8
|
+
const axisValue = when[axis ?? ""];
|
|
9
|
+
if (!axisValue) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (rest.length === 0) {
|
|
13
|
+
root[axisValue] = value;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const current = root[axisValue];
|
|
17
|
+
if (!isRecord(current)) {
|
|
18
|
+
root[axisValue] = {};
|
|
19
|
+
}
|
|
20
|
+
setNestedValue(root[axisValue], rest, when, value);
|
|
21
|
+
}
|
|
22
|
+
export function buildAssetBackedLayoutBundle(spec) {
|
|
23
|
+
const axes = Object.keys(spec.variantAxes);
|
|
24
|
+
const root = {};
|
|
25
|
+
for (const variant of spec.variants) {
|
|
26
|
+
const geometry = extractGeometryFromNode(variant.layout);
|
|
27
|
+
if (Object.keys(geometry).length === 0) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
setNestedValue(root, axes, variant.when, { root: geometry });
|
|
31
|
+
}
|
|
32
|
+
return root;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=asset-backed-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-backed-contract.js","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/asset-backed-contract.ts"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ACvC,SAAS;QACX,CAAC;QAED,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface AssetContractEntry {
|
|
2
|
+
path: string;
|
|
3
|
+
format: "svg";
|
|
4
|
+
}
|
|
5
|
+
export interface AssetContractMap {
|
|
6
|
+
[axisValue: string]: AssetContractEntry | AssetContractMap;
|
|
7
|
+
}
|
|
8
|
+
export declare function hasAssetContractMap(assets: AssetContractMap | undefined): assets is AssetContractMap;
|
|
9
|
+
//# sourceMappingURL=assets-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets-contract.d.ts","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/assets-contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;CAC5D;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,MAAM,IAAI,gBAAgB,CAE5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets-contract.js","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/assets-contract.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,mBAAmB,CACjC,MAAoC;IAEpC,OAAO,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentSetSpec } from "../component-set-spec/types.js";
|
|
2
|
+
import type { PseudocodeModel } from "./types.js";
|
|
3
|
+
export declare function buildBaselineContracts(spec: ComponentSetSpec, model: PseudocodeModel): {
|
|
4
|
+
visuals: Record<string, unknown>;
|
|
5
|
+
geometry: Record<string, unknown>;
|
|
6
|
+
};
|
|
7
|
+
export declare function mergeBaselineWithVariantContracts(baseline: {
|
|
8
|
+
visuals: Record<string, unknown>;
|
|
9
|
+
geometry: Record<string, unknown>;
|
|
10
|
+
}, variant: {
|
|
11
|
+
visuals: Record<string, unknown>;
|
|
12
|
+
geometry: Record<string, unknown>;
|
|
13
|
+
}, axesDepth: number): {
|
|
14
|
+
visuals: Record<string, unknown>;
|
|
15
|
+
geometry: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=baseline-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-contract.d.ts","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/baseline-contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2DlD,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,eAAe,GACrB;IACD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CA6BA;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE;IACR,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,EACD,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,EACD,SAAS,EAAE,MAAM,GAChB;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAezE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { isNode, isRef, isVar, nodeKey } from "./slim-node-guards.js";
|
|
2
|
+
import { extractGeometryFromNode, extractVisualsFromNode, mergeNestedContracts, mergeNodeBundle, orderedAxes, setNestedBundle, } from "./universal.js";
|
|
3
|
+
function unwrapRoot(node) {
|
|
4
|
+
if (node.type === "component") {
|
|
5
|
+
return {
|
|
6
|
+
...node,
|
|
7
|
+
type: "frame",
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return node;
|
|
11
|
+
}
|
|
12
|
+
function collectDefinitions(model) {
|
|
13
|
+
return {
|
|
14
|
+
...model.definitions,
|
|
15
|
+
...Object.fromEntries(model.definitionTemplates.map((template) => [
|
|
16
|
+
template.name,
|
|
17
|
+
template.node,
|
|
18
|
+
])),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function walkSlimNode(node, definitions, options, visit) {
|
|
22
|
+
visit(nodeKey(node, options), node);
|
|
23
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
24
|
+
for (const child of children) {
|
|
25
|
+
if (isRef(child)) {
|
|
26
|
+
const definition = definitions[child.$ref];
|
|
27
|
+
if (definition) {
|
|
28
|
+
walkSlimNode(definition, definitions, {}, visit);
|
|
29
|
+
}
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (isVar(child)) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (isNode(child)) {
|
|
36
|
+
walkSlimNode(child, definitions, {}, visit);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function buildBaselineContracts(spec, model) {
|
|
41
|
+
const axes = orderedAxes(model);
|
|
42
|
+
const definitions = collectDefinitions(model);
|
|
43
|
+
const visualsRoot = {};
|
|
44
|
+
const geometryRoot = {};
|
|
45
|
+
for (const variant of spec.variants) {
|
|
46
|
+
const visualBundle = {};
|
|
47
|
+
const geometryBundle = {};
|
|
48
|
+
walkSlimNode(unwrapRoot(variant.layout), definitions, { root: true }, (key, node) => {
|
|
49
|
+
mergeNodeBundle(visualBundle, key, extractVisualsFromNode(node), {});
|
|
50
|
+
mergeNodeBundle(geometryBundle, key, {}, extractGeometryFromNode(node));
|
|
51
|
+
});
|
|
52
|
+
if (Object.keys(visualBundle).length > 0) {
|
|
53
|
+
setNestedBundle(visualsRoot, axes, variant.when, visualBundle);
|
|
54
|
+
}
|
|
55
|
+
if (Object.keys(geometryBundle).length > 0) {
|
|
56
|
+
setNestedBundle(geometryRoot, axes, variant.when, geometryBundle);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return { visuals: visualsRoot, geometry: geometryRoot };
|
|
60
|
+
}
|
|
61
|
+
export function mergeBaselineWithVariantContracts(baseline, variant, axesDepth) {
|
|
62
|
+
return {
|
|
63
|
+
visuals: mergeNestedContracts(baseline.visuals, variant.visuals, 0, axesDepth),
|
|
64
|
+
geometry: mergeNestedContracts(baseline.geometry, variant.geometry, 0, axesDepth),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=baseline-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseline-contract.js","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/baseline-contract.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEtE,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EAEf,WAAW,EACX,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,SAAS,UAAU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AU,iCAAiC,CAC/C,QAGC,EACD,OAGC,EACD,SAAiB;IAEjB,OAAO;QACL,OAAO,EAAE,oBAAoB,CAC3B,QAAQ,CAAC,OAAO,EAChB,OAAO,CAAC,OAAO,EACf,CAAC,EACD,SAAS,CACV;QACD,QAAQ,EAAE,oBAAoB,CAC5B,QAAQ,CAAC,QAAQ,EACjB,OAAO,CAAC,QAAQ,EAChB,CAAC,EACD,SAAS,CACV;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type BuildComponentSetSpecOptions } from "../component-set-spec/build-spec.js";
|
|
2
|
+
import { type ContractFormat } from "../contract/contract-format.js";
|
|
3
|
+
import { type AssetContractMap } from "./assets-contract.js";
|
|
4
|
+
import { type MetaContract, type MetaContractContext } from "./meta-contract.js";
|
|
5
|
+
export interface BuildComponentSetPseudocodeOptions extends BuildComponentSetSpecOptions {
|
|
6
|
+
assetBacked?: boolean;
|
|
7
|
+
assets?: AssetContractMap;
|
|
8
|
+
metaContext?: MetaContractContext;
|
|
9
|
+
format?: ContractFormat;
|
|
10
|
+
}
|
|
11
|
+
export interface ComponentSetContractResult {
|
|
12
|
+
componentName: string;
|
|
13
|
+
visuals: Record<string, unknown>;
|
|
14
|
+
geometry: Record<string, unknown>;
|
|
15
|
+
meta: MetaContract;
|
|
16
|
+
structureDsl: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveVisualsContractPath(directory: string, componentName: string, format?: ContractFormat): string;
|
|
19
|
+
export declare function resolveGeometryContractPath(directory: string, componentName: string, format?: ContractFormat): string;
|
|
20
|
+
export declare function resolveStructureDslPath(directory: string, componentName: string): string;
|
|
21
|
+
export declare function resolveMetaContractPath(directory: string, componentName: string, format?: ContractFormat): string;
|
|
22
|
+
export declare function buildComponentSetPseudocodeFromFile(inputPath: string, options?: BuildComponentSetPseudocodeOptions): Promise<ComponentSetContractResult>;
|
|
23
|
+
export declare function buildComponentSetPseudocodeFromRaw(componentSet: Record<string, unknown>, options?: BuildComponentSetPseudocodeOptions): Promise<ComponentSetContractResult>;
|
|
24
|
+
//# sourceMappingURL=build-pseudocode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-pseudocode.d.ts","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/build-pseudocode.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,4BAA4B,EAGlC,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,WAAW,kCACf,SAAQ,4BAA4B;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,cAAuB,GAC9B,MAAM,CAKR;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,cAAuB,GAC9B,MAAM,CAKR;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,MAAM,CAER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