firebase-functions icon indicating copy to clipboard operation
firebase-functions copied to clipboard

fix(params): exporting additional type information

Open vajahath opened this issue 2 years ago • 2 comments

Description

As per this doc, I've been using the defineSecret function. The return type SecretParam was not available for direct use.

import { SecretParam } from 'firebase-functions/params'; // fails
import { SecretParam } from 'firebase-functions/params/types.d'; // fails

This PR fixes it.

Code sample

With this PR we can do the following:

import { SecretParam } from 'firebase-functions/params'

vajahath avatar Feb 15 '23 20:02 vajahath

Current solution without this PR:

type SecretParameter = ReturnType<typeof defineSecret>;

vajahath avatar Feb 15 '23 20:02 vajahath

Was about to make the same PR. This would be really nice to have. Any chance this could be merged?

YannicEl avatar Apr 15 '23 08:04 YannicEl

Closing this PR based on https://github.com/firebase/firebase-functions/issues/1549#issuecomment-2054135491

exaby73 avatar Apr 18 '24 08:04 exaby73