How to associate a lambda layer with a function in serverless.ts typescript using Ref

I use serverless framework and i use the typescript template which generates a serverless.ts file.

I am working with lambda layers and im tyring to associate a lambda layer i have created with an existing function. However im getting a typescript error.

Type ‘{ Ref: string; }’ is not assignable to type ‘AwsLambdaLayers’.
Object literal may only specify known properties, and ‘Ref’ does not exist in type ‘AwsArn’.

    functions: {
        main: {
            handler: "handler.MainHandler",
            timeout: 300,
            layers: {
                Ref: "PrismaLambdaLayer",
            },
        },
    },

  layers: {
        prisma: {
            path: ".prisma-layer",
            description: "Layer for prisma clients",
            package: {
                patterns: [
                    "!nodejs/node_modules/@prisma/engines/*",
                    "!nodejs/node_modules/.prisma/**/libquery_engine-*",
                    "nodejs/node_modules/.prisma/**/libquery_engine-rhel-openssl-1.0.x.so.node",
                    "!nodejs/prisma/**",
                    "nodejs/prisma/*.db",
                ],
            },
        },
    },

Looks like we can just do

layers: [{ Ref: "PrismaLambdaLayer" }],