Computing ApiGateway URL on serverless.ts using httpApi event

With serverless definitions as TS instead of YAML, I’m trying to compute the API Gateway generated URL:

custom: {
    apiGatewayEndpoint: {
      'Fn::Join': [
          '${!Ref ApiGatewayRestApi}',

This fails with:

Cannot resolve variable at […] String value consist of variable which resolve with non-string value,

I tried using only strings in case there is a bug with the ts conversion:

custom: {
    apiGatewayId: '!Ref ApiGatewayRestApi',

But serverless print outputs this, which doesn’t look like a valid template.

  apiGatewayId: '!Ref ApiGatewayRestApi'
  apiGatewayEndpoint: https://!Ref

What am I doing wrong?
Another question: Is the ApiGatewayRestApi variable available for httpApi events too?