0

I'm declaring this:

export interface Interface {
    func: string[][] => string[][];
}

And I'm getting this:

error TS1005: ';' expected.

func: string[][] => string[][];
                 ~~

error TS1131: Property or signature expected.

func: string[][] => string[][];
                    ~~~~~~

error TS1011: An element access expression should take an argument.

func: string[][] => string[][];

error TS1011: An element access expression should take an argument.

func: string[][] => string[][];

error TS1128: Declaration or statement expected.

}
~

What is the correct syntax here?

1
  • You need to define an argument name, eg (arg: string[][]) Commented Apr 17, 2020 at 7:19

1 Answer 1

2

The arrow function '=>' creates an expression. An interface on another hand is a definition, so you would do it like so:

export interface Interface {
  func(arg: string[][]): string[][];
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.