How to use the tsIndexSignature function from @babel/types

Find comprehensive JavaScript @babel/types.tsIndexSignature code examples handpicked from public code repositorys.

27
28
29
30
31
32
33
34
35
36

  const stringKey = t.identifier('key');
  stringKey.typeAnnotation = t.tsTypeAnnotation(t.tsStringKeyword());

  properties.push(
    t.tsIndexSignature([stringKey], t.tsTypeAnnotation(index)),
  );
}

return t.tsTypeLiteral(properties);
fork icon2
star icon14
watch icon2

+ 23 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)