Skip to main content
Question

How to import other class(sample.d.ts) in code.ts

  • December 4, 2022
  • 1 reply
  • 459 views

Anand_Kumar

Recently started to learn Figma Plugin where I could not figure not how to import a sample.d.ts file in code.ts

example: I had created a file called sample.d.ts which contains a function

function testing() { console.log('Hello') } export {}
Adding the following code in code.ts

///

import {sample} from ‘./sample’

sample.testing()

I see following error in the console
figma_app.min.js.br:5 Syntax error on line 13: Unexpected token
import { testing } from “./Sample”;

This topic has been closed for comments

1 reply

  • 0 replies
  • January 3, 2023

This topic was automatically closed after 30 days. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings